a2audit/audit/macros.asm
Zellyn Hunter c65d7b9ee2 audit: combine two print mechanisms: smaller code
The first old way was to JSR and get the value from the stack, with
string directly following. The second old way was to put strings in
their own area, and explicitly load the address of each string. The
new way combines the two: put the strings in their own area, and JSR
to a three-byte prefix of each string that just JSR's to the print
routine. The print routine pulls the string address from the stack,
and pushes nothing back, so the final JSR returns to the code that
wanted to print.
2016-12-15 22:20:54 -05:00

24 lines
302 B
NASM

;;; Apple II audit routine macros.
;;; Copyright © 2016 Zellyn Hunter <zellyn@gmail.com>
!macro print {
jsr LASTSTRING
!set TEMP = *
* = LASTSTRING
jsr print
}
!macro printed {
!byte 0
!set LASTSTRING=*
* = TEMP
}
!macro prerr NUM {
+print
}
!macro prerred {
!byte $8D
+printed
}