Instruction Set
4-185
PUSHA
PUSHA
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 PUSHA, 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 components from the stack into the 16-bit general registers
POPA
Push a component onto the stack
PUSH
Push the Processor Status Flags register onto the stack
PUSHF
; 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
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...