Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
PushAll
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* @PushAll and @PopAll - Macros to push and pop all general purpose
;* registers. Registers are pushed in the following order:
;*    AX, CX, DX, BX, SP, BP, SI, DI
;* They are popped in the reverse order. Uses most efficient method
;* available at assembly time (not at run time).
;*
;* Shows:   Instruction - pusha     popa
;*          Operator    - AND
;*
;* Params:  None
 
@PushAll MACRO
    IF @Cpu AND 00000010y       ;; If assembling on 80186/286/386,
        pusha                   ;;  use efficient PUSHA
    ELSE                        ;; Otherwise push individually
        push ax
        push cx
        push dx
        push bx
        push sp
        push bp
        push si
        push di
    ENDIF
ENDM
 
@PopAll MACRO
    IF @Cpu AND 00000010y       ;; If assembling on 80186/286/386,
        popa                    ;;  use efficient POPA
    ELSE                        ;; Otherwise pop individually
        pop di
        pop si
        pop bp
        pop sp
        pop bx
        pop dx
        pop cx
        pop ax
    ENDIF
ENDM
                                    -♦-