Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
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
                                    -♦-