a2audit/audit/audit.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

58 lines
817 B
NASM

;;; Apple II audit routines
;;; Copyright © 2016 Zellyn Hunter <zellyn@gmail.com>
!convtab <apple ii/convtab.bin>
!to "audit.o", plain
* = $6000
HOME = $FC58
COUT = $FDED
PRBYTE = $FDDA
STRINGS = $7000
!set LASTSTRING = $7000
;; Printing and error macros.
!src "macros.asm"
main:
jsr HOME
+print
!text "APPLE II AUDIT",$8D,$8D
+printed
;; Detection and reporting of model and memory.
!src "detect.asm"
;; Language card tests.
!src "langcard.asm"
end: jmp *
print
lda $C081
lda $C081
pla
sta getch+1
pla
sta getch+2
- inc getch+1
bne getch
inc getch+2
getch lda $FEED ; FEED gets modified
beq +
jsr COUT
jmp -
+ rts
!src "technote2.asm"
; !if * != STRINGS {
; !error "Expected STRINGS to be ", *
; }
!if * > STRINGS {
!error "End of compilation passed STRINGS:", *
}