Zilog Z08470 Bedienungsanleitung Seite 299

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 326
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 298
UM008007-0715 Z80 Instruction Description
Z80 CPU
User Manual
287
RETN
Operation
Return from nonmaskable interrupt
Op Code
RETN
Operands
None.
Description
This instruction is used at the end of a nonmaskable interrupts service routine to restore
the contents of the Program Counter (analogous to the RET instruction). The state of IFF2
is copied back to IFF1 so that maskable interrupts are enabled immediately following the
RETN if they were enabled before the nonmaskable interrupt.
Condition Bits Affected
None.
Example
If the Stack Pointer contains 1000h and the Program Counter contains 1A45h when a
Nonmaskable Interrupt (NMI) signal is received, the CPU ignores the next instruction and
instead restarts, returning to memory address
0066h. The current Program Counter con-
tains
1A45h, which is pushed onto the external stack address of 0FFFh and 0FFEh, high-
order byte first, and
0066h is loaded onto the Program Counter. That address begins an
interrupt service routine that ends with a RETN instruction.
Upon the execution of a RETN instruction, the contents of the former Program Counter
are popped off the external memory stack, low-order first, resulting in the Stack Pointer
again containing
1000h. The program flow continues where it left off with an op code
fetch to address
1A45h, order-byte first, and 0066h is loaded onto the Program Counter.
M Cycles T States 4 MHz E.T.
4 14 (4, 4, 3, 3) 3.50
11 0 01111
ED
01 0 01100
45
Seitenansicht 298
1 2 ... 294 295 296 297 298 299 300 301 302 303 304 ... 325 326

Kommentare zu diesen Handbüchern

Keine Kommentare