Do:
SYS828
Then to see pointers move:
10 A=1
RUN
SYS828
I know it wouldn't be any use if you had to load from tape.
My question is in the "print pointer address" section. Is this self-modifying code the way to go? I feel like I might be missing the obvious. Other comments also appreciated.
Code: Select all
; print BASIC pointers
; after this LOADs, SOV points within cassette buffer.
; NEW command will fix.
PROCESSOR 6502
ORG $033c ; SYS828 (cassette buffer)
CHROUT EQU $ffd2
CR EQU $0d
ZPALO EQU $fb
ZPAHI EQU $fc
PTRCNT EQU $6
PRTPTRS SUBROUTINE
lda #<BASICPTRS
sta ZPALO
lda #>BASICPTRS
sta ZPAHI
ldx #0 ; array row
.1 ldy #0 ; array column
; print pointer name
.2 lda (ZPALO),y
jsr CHROUT
iny
cpy #3
bcc .2
lda #":"
jsr CHROUT
lda #"$"
jsr CHROUT
; print pointer address
.3 lda (ZPALO),y
sta .+4
lda $0
jsr PRTBYTE
iny
cpy #5
bcc .3
lda #CR
jsr CHROUT
clc
lda ZPALO
adc #5
sta ZPALO
lda ZPAHI
adc #0
sta ZPAHI
inx
cpx #PTRCNT
bcc .1
rts
PRTBYTE SUBROUTINE
pha
lsr
lsr
lsr
lsr
jsr PRTHEX
pla
and #$0f
jmp PRTHEX
PRTHEX SUBROUTINE
cmp #$0a
bcc .1
adc #$06
.1 adc #$30
jmp CHROUT
BASICPTRS
BYTE "SOB", $2c, $2b
BYTE "SOV", $2e, $2d
BYTE "SOA", $30, $2f
BYTE "EOA", $32, $31
BYTE "BOS", $34, $33
BYTE "TOM", $38, $37