Debian Codegraph @

examples/misc/primm.a

raw
1 ;ACME 0.97
2
3 ; zp variables
4 !addr ptr = $fb
5
6 ; kernal
7 !addr k_chrout = $ffd2
8
9 ; print immediate - prints zero-terminated string located directly
10 ; after calling JSR. returns to opcode following the terminator.
11 primm pla ; get low byte of return address - 1
12 tay ; into Y
13 pla ; get high byte of return address - 1
14 sta ptr + 1 ; to ptr high
15 lda #0 ; and zero ptr low, so "(ptr), y" points before text
16 sta ptr
17 beq @entry
18 ;;;
19 --- jsr k_chrout
20 @entry iny
21 bne +
22 ; fix high byte
23 inc ptr + 1
24 + lda (ptr), y
25 bne ---
26 ; push updated address onto stack
27 lda ptr + 1
28 pha
29 tya
30 pha
31 rts ; return to caller (after zero-terminated text)