Interrupt Controller (8259A)
When the V20 receives an interrupt vector byte from the 8259A, it
multiplies its value by four to acquire the address of the interrupt type.
For example, if the interrupt vector byte specifies a type of 128 (80h),
the vectored address in V20 memory is 4 x 80h, which equals 200h.
Program execution is then vectored to the service routine whose
address is specified by the code segment and the instruction pointer
values within type 128 located at 200h.
When entering an interrupt service routine, those registers that are
used by the main program and the service routine should be saved.
The best way to do this is to push each register used onto the stack
immediately. The service routine can then pop each register off the
stack in the reverse order when it is completed.
Once the service routine is completed, the main program may be re-
entered by using an IRET (Interrupt Return) instruction. The IRET
instruction pops the pre-interrupt instruction pointer, code segment,
and flags off the stack. Thus, the main program resumes where it was
interrupted with the same flag status regardless of changes in the
service routine. Note especially that this includes the state of the IF
flag. Thus, interrupts are re-enabled automatically when returning
from the service routine.
In addition to external interrupt generation from the INTR pin, the
V20 is also able to invoke interrupts by software. Three interrupt
instructions are provided: INT, INT (Type 3), and INTO. INT is a
two-byte instruction; the second byte selects the interrupt type. INT
(Type 3) is a one-byte instruction that selects interrupt Type 3. INTO
is a conditional one-byte interrupt instruction that selects interrupt
Type 4 if the OF flag (trap on overflow) is set. Like the hardware
interrupts, all of the software interrupts vector program execution.
For further details on interrupt controller operation, see the subsection
entitled "Operation of the Interrupt Controller" on page 12-24.
12-6