home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
coreaids
/
popall.asm
< prev
next >
Wrap
Assembly Source File
|
1987-06-25
|
1KB
|
57 lines
; DESC: Pop all registers (SI,DI,BP,ES,DS,DX,CX,BX,AX) V1.00
; SAMPLE: POPALL
; ##################################################################
PSH_POPS Segment Para Common 'DATA'
DW 180 DUP(0)
PSH_POPS Ends
POPALLC Segment
Assume CS:POPALLC,DS:NOTHING,ES:PSH_POPS
Public POPALL
;notice.
DB 'POPALL - V1.00, Copyright 1987, CoreTechs ',0DH,0AH
POPALL Proc Near
Pop AX ;save return address.
Push AX ;store mutliple returns.
Push AX
Mov CS:WORD PTR[0],SP ;move to temporary stack
Mov CS:WORD PTR[2],SS ;where last pushall occurred.
Mov SP,PSH_POPS
Mov SS,SP
Mov SP,CS:WORD PTR[6] ;recover top of stack pointer.
Pop SI ;recover register values.
Pop DI
Pop BP
Pop ES
Pop DS
Pop DX
Pop CX
Pop BX
Pop AX
Pop CS:WORD PTR[4] ;recover main return address.
Mov CS:WORD PTR[6],SP ;update top of stack pointer.
Mov SP,CS:WORD PTR[0] ;return to old stack.
Mov SS,CS:WORD PTR[2]
Pop CS:WORD PTR[8] ;unload junk from stack.
Pop CS:WORD PTR[8]
Push CS:WORD PTR[4] ;return to caller and then
Push CS:WORD PTR[8] ;to main routine.
Ret
POPALL Endp
POPALLC Ends
End