mirror of
https://github.com/zellyn/a2audit.git
synced 2024-11-22 13:33:35 +00:00
c65d7b9ee2
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.
24 lines
302 B
NASM
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
|
|
}
|