one-pass
A program of Temporaries and Liveness.
main.ngp
modules { "scan.asm" }
scan.asm
.section
input
.byte 3, 1, 4, 1, 5
.ends
.section zeropage
largest
.res 1
.ends
.section zeropage
above
.res 1
.ends
; tag body
.proc entry
best .ztemp 1
tally .ztemp 1
lda #0
sta best
sta tally
ldx #4
@scan lda input,x
cmp best
jcc @kept
sta best
@kept lda input,x
cmp #3
jcc @next
inc tally
@next dex
bpl @scan
lda best
sta largest
lda tally
sta above
rts
.endp
; end body
Memory map
- phase04 zero page, 43 bytes
| Address | Bytes | Section | Module | Kind | Phases | Waits |
|---|---|---|---|---|---|---|
| $0080–$0080 | 1 | entry.tally | scan | temporary | 0 | |
| $0081–$0081 | 1 | entry.best | scan | temporary | 0 | |
| $0082–$0082 | 1 | above | scan | section | 0 | |
| $0083–$0083 | 1 | largest | scan | section | 0 | |
| $2000–$2004 | 5 | input | scan | section | 0 | |
| $2005–$202A | 38 | entry | scan | proc | 0 |