@@ -2626,18 +2626,17 @@ Z80_API zusize z80_run(Z80 *self, zusize cycles)
26262626 FLAGS = F & ~(zuint8 )PF ;
26272627# endif
26282628
2629- /*---------------------------------------------------------------------.
2630- | The INT acknowledge cycle (INTA) indicates that the interrupting I/O |
2631- | device can write to the data bus. 2 wait T-states are automatically |
2632- | added to this M-cycle, allowing sufficient time to identify which |
2633- | device must insert the interrupt response data (IRD). The first and |
2634- | possibly sole byte of the IRD is read from the data bus during this |
2635- | special M1 cycle. |
2636- | |
2637- | The value FFh is assumed when the `Z80::inta` callback is not used. |
2638- | This is the most convenient default IRD, since an `rst 38h` will be |
2639- | executed if the interrupt mode is 0. |
2640- '=====================================================================*/
2629+ /*-----------------------------------------------------------------------.
2630+ | The INT acknowledge M-cycle (INTA) indicates that the interrupting I/O |
2631+ | device can write to the data bus. The CPU adds 2 wait T-states to this |
2632+ | M-cycle, allowing sufficient time to identify which device must insert |
2633+ | the interrupt response data (IRD). The first and possibly sole byte of |
2634+ | the IRD is read from the data bus during this special M1 cycle. |
2635+ | |
2636+ | The value FFh is assumed when the `Z80::inta` callback is not used. |
2637+ | This is the most convenient default IRD, since an `rst 38h` will be |
2638+ | executed if the interrupt mode is 0. |
2639+ '=======================================================================*/
26412640 R ++ ;
26422641 ird = (self -> inta != Z_NULL ) ? self -> inta (CONTEXT , PC ) : 0xFF ;
26432642
@@ -2651,15 +2650,15 @@ Z80_API zusize z80_run(Z80 *self, zusize cycles)
26512650 | Interrupt Mode 0: Execute Instruction | T-states: 2*n + instruction |
26522651 |--------------------------------------------------------------------------|
26532652 | An instruction supplied via the data bus is executed. Its first byte is |
2654- | read during the INT acknowledge cycle (INTA). If it is an opcode prefix, |
2655- | additional M-cycles of this kind are produced until the final opcode of |
2656- | the instruction is fetched [1]. Each INTA M-cycle takes as many T-states |
2657- | as its normal M1 counterpart (the opcode fetch M-cycle) plus the 2 wait |
2658- | T-states mentioned above [1]. Subsequent bytes of the instruction are |
2659- | fetched by using normal memory read M-cycles [1, 2], during which the |
2660- | interrupting I/O device must still supply the data [2]. The PC register, |
2661- | however, remains at its pre-interrupt state, not being incremented as a |
2662- | result of the instruction fetch [1, 2]. |
2653+ | read during the INTA M- cycle and, if it is an opcode prefix, additional |
2654+ | M-cycles of this kind are produced until the final opcode of the |
2655+ | instruction is fetched [1]. Each INTA M-cycle takes as many T-states as |
2656+ | its normal M1 counterpart (the opcode fetch M-cycle) plus the 2 wait |
2657+ | T-states mentioned in the previous comment [1]. Subsequent bytes of the |
2658+ | instruction are fetched by using normal memory read M-cycles [1, 2], |
2659+ | during which the interrupting I/O device must still supply the data [2]. |
2660+ | The PC register, however, remains at its pre-interrupt state, not being |
2661+ | incremented as a result of the instruction fetch [1, 2]. |
26632662 | |
26642663 | References: |
26652664 | 1. Checked with "Visual Z80 Remix". |
@@ -2901,9 +2900,9 @@ Z80_API zusize z80_run(Z80 *self, zusize cycles)
29012900 | of the interrupt response vector "must be a zero", since the address |
29022901 | formed "is used to get two adjacent bytes to form a complete 16-bit |
29032902 | service routine starting address and the addresses must always start |
2904- | in even locations" [1]. However, Sean Young's experiments confirmed |
2905- | that there is no such limitation [2]; any vector works regardless of |
2906- | whether it is even or odd. |
2903+ | in even locations" [1]. However, Sean Young's confirmed that there |
2904+ | is no such limitation [2]; the CPU fetches the ISR pointer from the |
2905+ | specified location regardless of the value of bit 0 of the IRD. |
29072906 | |
29082907 | References: |
29092908 | 1. Zilog (2005-03). "Z80 CPU User Manual" rev. 5, pp. 25-26. |
0 commit comments