From fbdf2fcf02316c08662d70c5f17e72c6afab9d07 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sat, 1 Jan 2022 13:06:45 +0000 Subject: [PATCH] Add some more Z80 documentation --- .../Interrupt Behaviour of the Z80 CPU.html | 133 ++++++++++++++++++ .../zlogo1.gif | Bin 0 -> 7585 bytes 2 files changed, 133 insertions(+) create mode 100644 Z80/documentation/Interrupt Behaviour of the Z80 CPU.html create mode 100644 Z80/documentation/Interrupt Behaviour of the Z80 CPU_files/zlogo1.gif diff --git a/Z80/documentation/Interrupt Behaviour of the Z80 CPU.html b/Z80/documentation/Interrupt Behaviour of the Z80 CPU.html new file mode 100644 index 0000000..fd6b9e1 --- /dev/null +++ b/Z80/documentation/Interrupt Behaviour of the Z80 CPU.html @@ -0,0 +1,133 @@ + + + +Interrupt Behaviour of the Z80 CPU + + + + + + + +Z80 Home + + + +

Interrupt Behaviour of the Z80 CPU

+

by Achim Flammenkamp

+ +

Interrupt timing

+Only at the end of an instruction execution, except a NOP in case HALT, a LDD in case LDDR, a OUTI in case OTIR, etc., the CPU checks for an interrupt request. +Thus the INT-pin should be active for at least 23 clock ticks because some IX +resp. IY instruction last so long. +Now an interrupt is accepted if INT-pin is low(active) and the interrupt flip flop +IFF1 is set or the NMI-pin is respectively was active during the just performed instruction. +If this is the case, the following happens:
+ +Immediately IFF1 is reset to 0 and if INT-pin is low also IFF2 is reset to 0. +Then the behavior depends whether it is a non maskable interrupt (NMI) or a +maskable interrupt (INT). In the later case the interrupt mode (IM) of the CPU is +also decisive: + +Some remarks: +
    +
  1. "acknowledge interrupt" means pin IORQ gets together with M1-pin +active/low. Furthermore the CPU adds 2 wait states to the normal machine cycle. +
  2. Quoted remark: +
      +
    • If a LD A,I or LD A,R (which copy IFF2 +to the P/V flag) is interrupted, then the P/V flag is reset, even if +interrupts were enabled beforehand. +
    • If interrupts are disabled when a EI instruction is +interrupted, then the interrupt will not occur until after the +instruction following the EI, as when IFF1 is sampled +during the one and only machine-cycle of the EI, it will be reset. +
    +
    + +
  3. An INT will let the INT-pin low(active) until it is indirectly +reseted by an RETI or other external hardware. In contrast a signal +at the NMI-pin will be recognized when its state going from high to low! +Thus it is not a level trigger signal, but a pulse which is stored internally +by the CPU until the next M1 cycle. +
+

+

Reset Timing

+One can consider a reset (RESET-pin gets low) as a very special interrupt. +If this occurs, the following happens in one machine cycle:
+ +

+

Thanks for contribution goes to:

+
+

+
+Back to main page. +
+ + + + + + \ No newline at end of file diff --git a/Z80/documentation/Interrupt Behaviour of the Z80 CPU_files/zlogo1.gif b/Z80/documentation/Interrupt Behaviour of the Z80 CPU_files/zlogo1.gif new file mode 100644 index 0000000000000000000000000000000000000000..e78abb936c1662970137e1559bdf5da4f11a6f17 GIT binary patch literal 7585 zcmWlYcRbXO6BUPT>$48F$&E&faxqW}Urt_Le<>eU+MqORq#fukj-MV${ z+O>xdA1*8`Ox(Ivkda|VrD~B#ePv}A3knLt!f;sZ#pvj0GqW-VVqf+~*)Q4262M$+9B8A~_893Z6dHDq#ZWo8^L!+Oe(Lc~=GysqQfC>P90FVIy zbpX%@01E)H3jm+YsAgt1HZ~p}48Nr4q-ekBFpn?~8xIE6rYxf%DJ(kL#v|IpFUiIu zjB4gV(gFZL{udks03@LCzYYAq6M)>MrL(LwgoGzrqwatTtUV#g}zv`si%hR82akYvf9BW}&~;g&j}r`IYRB`_6ypcZ@r z_+JE62H%AdxI1|lNj|dT2Eb633c5L?Zg`mDy$*BM6z&Zw4I=1tT9!mQvf;dM-Q5tD3NQvo?}w{@1U89$BW@GaW3aa-m=5Vg+g?c`@8EN$Oeg&~n5b#`A(ffCy|SmKF@B@MWOCC?Ldl;uf-D_XI*=4Q zQ@Kl!hW9U) z-4oh;y3>TMZ9|$1+FGVcNLfozxEN)AQ>m0Ri`;V{zhY{8N$fZtJz%aM*$pOtv3ug6nsVW?f67$#I zT7zPLdoxumTInw_^`=xro*8j8-wABwj`FK^TViXJ-4DPnM99%-UCr95yRRHerYp@O z;`w%n8H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