Virtual Worlds #01
31 декабря 1999
  Железо  

Iron - Interrupts: Something strange about the interruptions of the second kind.

<b>Iron</b> - Interrupts: Something strange about the interruptions of the second kind.
           INTERRUPTS



               (C) Time Keeper



  I recently discovered one of the old technical books
information that I have a very
intrigued. What I found there
I say a little later, and remember to start the theory.


  Thus, the Z80 processor has two
types of interrupts: maskable
(Int), and Non-maskable (nmi).
After the arrival of the interrupt signal
processor executes the loop
acknowledgment of receipt of interruption during which the bus
Data needed to apply the vector
interrupts. He may have one
of three forms, depending on the
three modes of treatment interruptions, defined by software.


  In mode 0, the vector is perceived as a single-byte object
command code, which must be
executed after the interrupt acknowledge cycle. Logic 
confirmation interrupt mode 1 believes that after the next

interrupt confirmation command is a command to restart on
address # 0056. If you are using
Mode 1, the interrupt vector is not
needed at all. In some prints indicated that the ZX
Spectrum Mode 0 is similar to mode 1. Generally speaking, it is 
not exactly. Ideally, the data bus

Computer tightened to plus "
ie, when reading the interrupt vector data bus contains the 
number of # Ff - a native is the team RST # 0056. But this is 
only Ideally, in practice it is often

there are computers in which
tire "hangs in the air", ie,
reading vector data bus provides a completely random numbers, 
so the replacement regime 1 in mode 0 completely unacceptable! 
In mode 2 interrupt vector is interpreted as a junior Byte 
Address Table processing interrupts. Significant byte contained 
in register I. Together they form the address in the table on 
which are taken two bytes of address interrupt handler. Consider

details how to use the second mode preryvavany programs. 
Suppose we need "Hang" for interrupting music playback:



        ORG # 6101

        CALL MUSIC; Initializing music.

        DI

        LD HL, # 6000; Building a table in memory processing

        LD DE, # 6001; interruptions of 256 bytes

        LD BC, # 0100, ie taking into account the fact that not 
all 

        LD (HL), # BF; computers have pulled up to "+"

        LDIR; data bus.

        LD A, # C3; at the address shown in the table

        LD (# BFBF), A; ie # BFBF put the command transfer
        LD HL, INT_EXE; of the JP INT_EXE.

        LD (# BFC0), HL

        LD A, # 60; Put I register at the top of the table.

        LD I, A

        IM 2; includes a second mode, and

        EI; allow interrupts.

        ...
INT_EXE PUSH IX, IY, HL, DE, BC, AF; Actually the program itself

        EXX; interrupt handling.

        EX AF, AF '

        PUSH HL, DE, BC, AF

        CALL MUSIC +6

        POP AF, BC, DE, HL

        EXX

        EX AF, AF '

        POP AF, BC, HL, DE, IY, IX

        EI

        RET



  In the book, VF Queen "Microprocessor Zilog Z * 80" (from the 
series "to assist the developer of microprocessor technology," 
1992. ed. Argus-Master) said

the following:

------------- Cut. ------------

  When an interrupt is confirmed in mode 2, the external circuit
should be placed on the data bus
vector interrupt acknowledgment.
Processor unify content
I register with the vector interrupt acknowledgment, creating 16
bit address, which will indicate
corresponding vector addresses
Table interrupt handling.
Since 16-bit addresses can be in memory only in words with even 
addresses only Seven of the eight-bit vector

interrupt acknowledgment processor used to generate addresses 
in a table, Jr. address bits set to 0.


Thus:

The contents of the vector I with double-byte bus
(As senior + data (as a junior = address table

  bytes). bytes with zero processing addresses the Young

                      PWM bit). interrupts.


------------- Cut. ------------

  After reading this book I
was a bit confused.
All written anywhere that is needed to break a plate indicating
at the address in memory, which
Junior and Senior bytes must
match. From reading in the
this book is, generally speaking, that is not so! In the 
example above, the plate contains a number # BF, and if you 
believe book, address the program interrupt service will be 
equal # BFBE. We have the same program is located at # BFBF. 
After seeing the contents of the memory cell to I found this at 
0. Hence, getting the address # BFBE, processor performs the 
first team NOP, and then the program itself, the interrupt 
handler. And if at # BFBE will be located, for example, a team 
of RST # 00; it will lead to a crash. Topics

at least in this case it runnable.


  To make sure I typed program, test for
a scheme formed by address
transition in the parish of interruption:
taking into account the zero bits or without.


  Try it on all processors, which were at hand, I got the same 
result: the address was formed taking into account the zero 
bits. Despite on these results, doubts remain. It says in the 
book on the corporate Z-80 (zilog), and among the trusted me 
Processors this was not, so for me this remains an open 
question, and who knows what other secrets may hold a little 
gray box with labeled Z-80 ...








Other articles:

From the Editor - the story of creating a magazine.

Guide - the detailed contents of rooms.

Description shells - a description of the shell and methods for its proper operation.

Authors - the authors.

Assembler - Z80 Flags: undocumented command processor Z80.

Assembler - Overlays for JC: Description of methods for creating utilities running Jemmini_Commander 4.0T.

Assembler - Secrets of the TR-DOS: the methods of distribution presence drives.

Assembler - Circles on the water: The algorithms simulate the effect of a well-known on other platforms, called "ripples."

Assembler - search path. Solution to the problem of "static" find the shortest route between two points.

Spending - The mechanical effect. This story is about what happens using condoms dubious origin.

Iron - Bugs keyboard: why in the game for two players, when playing together, the computer does not listen to your management, and information on how to avoid it.

Iron - Interrupts: Something strange about the interruptions of the second kind.

Technical assistance - the thought aloud. It is interesting letter from fido7.zx.spectrum conference on the theme "On the question of standardization."

Technical assistance - File FAQ. A complete analysis of file formats, most often vstechayuschihsya the Internet, and not only, as well as methods for their conversion into a "normal" form.

Technical assistance - Dos Review: material on the format of the disk operating system IS-DOS.

Technical assistance - Dos Review 2: The material on the format of disk operating systems, PC "Agat", Radio-86RK, SP-DOS, BK-0011M.

Technical assistance - Dos Review 3: The material on the format of the disk operating system CP / M, ASC SOUND MASTER, RT11, SM computers RAFOS.

Technical assistance - Dos Review 4: The material on the format of the disk operating system from an unknown author.

DI: HALT: 99 - An analysis of DH: 99. Finally, the whole truth about the past summer, in Dzerzhinsk party, from the organizers themselves.

DI: HALT: 99 - Hidden Parts. Dzerzhinsky life (not only) in the period spektrumistov of DI: HALT: 99.

DI: HALT: 99 - The results. Having walked DH: 99, almost every other newspaper, considered it their duty to come up with a new version of the results. This article is the direction on the fact that finally put the record straight "I".

Programs - Alien: description and walkthrough of the film "Alien."

Programs - description of the Universal AntiProtector 0.01 (a program for automatically splitting a number of popular defense systems).

Programs - Editor-game screens, "White Spot".

Programs - Exhumator: a program to "drive the exhumation."

Programs - chankovy graphics editor: Hard Core ver 3.01

Programs - Eye of crying: the files of allowing to watch pictures, sprites, while listening to etommuzyku.

Spending - Verse of Sysop'e. Poetry, but ...

Spending - Sex and Fido. Humorous raskaz about What about actually making love inveterate fidoshniki.

Spending - Anecdotes. A selection of jokes with a computer theme.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Iron - reset circuit in the "Gluk Reset Service".
Schedule - schedule BBS.
Technology sprites - Part 3: Format of sprites.
Humor - anecdotes.

В этот день...   29 April