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.
SaveRegs
◄Example► ◄Back► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
;* SaveRegs - Macro to generate a push instruction for each register in
;* argument list. Saves each register name in the string equate REGPUSHED.
;* See also the RestoreRegs and the LoadPtr macros for examples of other
;* macro directives.
;*
;* Shows: Directives - CATSTR IRP IFNB
;*
;* Params: r1 to r9 - registers to be pushed
regpushed EQU <> ;; Initialize to the null string
SaveRegs MACRO r1, r2, r3, r4, r5, r6, r7, r8, r9
regpushed CATSTR <#>, regpushed ;; Mark a new group of registers
IRP reg, <r1, r2, r3, r4, r5, r6, r7, r8, r9>
IFNB <reg> ;; Push and record the register
push reg
regpushed CATSTR <reg>, <,>, <regpushed>
ELSE
EXITM ;; Quit if blank argument
ENDIF
ENDM ;; Terminator for IRP
ENDM ;; Terminator for MACRO
-♦-