dispatch
A program of Instructions.
main.ngp
target { region $0080 .. $00FF ram region $2000 .. $BFFF ram }
modules { "state.asm" }
container raw
state.asm
.section
state
.res 1
.ends
.section
speed
.res 1
.ends
; tag step
; Four positions of this Proc, chosen by what is in `A`. The clamp is the
; writer's: the statement indexes a table and does not check, exactly as any
; other index does not.
.proc step
lda state
cmp #3
jcc @ok
lda #3
@ok .dispatch @idle, @walk, @run, @stop
@idle lda #0
jmp @set
@walk lda #1
jmp @set
@run lda #4
jmp @set
@stop lda #0
@set sta speed
rts
.endp
; end step
Memory map
- phase00 zero page, 50 bytes
| Address | Bytes | Section | Module | Kind | Phases | Waits |
|---|---|---|---|---|---|---|
| $2000–$2000 | 1 | state | state | section | 0 | |
| $2001–$2001 | 1 | speed | state | section | 0 | |
| $2002–$2031 | 48 | step | state | proc | 0 |