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.
PushC
 Map                                       Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
;* pushc - Macro that pushes a constant using the most efficient
;* method for the current processor. The 80286 version pushes
;* directly. Since this is illegal on the 8086, this version pushes
;* through AX.
;*
;* Shows:   Operator    - OPATTR
;*          Text macro  - @Cpu
 
IF  @Cpu AND 00000010y
    pushc  MACRO op             ;; 80186 or higher
        push op
    ENDM
ELSE
    pushc  MACRO op             ;; 8088/8086
        IFE (OPATTR (adr)) AND 00000100y
            mov  ax, op         ;; If it's really a constant
            push ax             ;;   push through register
        ELSE
            push op             ;; If not constant, push normal
        ENDIF
    ENDM
ENDIF
                                    -♦-