
Instruction Set
4-179
POPA
POPA
Examples
This example of an interrupt-service routine enables interrupts so that interrupt nesting can
occur, resets a device, disables interrupts until the interrupted procedure is resumed, and
then clears the in-service bits in the In-Service (INSERV) register by writing to the End-Of-
Interrupt (EOI) register.
Tips
Before you use POPA, use MOV to copy the stack segment to SS and the stack offset to SP.
To prevent a called procedure from destroying register values that are necessary for the
successful execution of the calling procedure, use PUSHA at the beginning of each
procedure, and then use POPA at the end. If you want to pass a parameter to the calling
procedure using a general register, copy the parameter to the register after POPA.
Related Instructions
If you want to
See
Pop a component from the stack
POP
Pop a component from the stack into the Processor Status Flags register
POPF
Push the 16-bit general registers onto the stack
PUSHA
; the microcontroller pushes the flags onto
; the stack before executing this routine
; enable interrupt nesting during routine
ISR1
PROC
FAR
PUSHA
; save general registers
STI
; enable unmasked maskable interrupts
mRESET_DEVICE1
; perform operation (macro)
CLI
; disable maskable interrupts until IRET
; reset in-service bits by writing to EOI register
MOV
DX,INT_EOI_ADDR
; address of EOI register
MOV
AX,8000h
; nonspecific EOI
OUT
DX,AX
; write to EOI register
POPA
; restore general registers
IRET
ISR1
ENDP
; the microcontroller pops the flags from the stack
; before returning to the interrupted procedure
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...