But I have absolutely no clue what I am doing.
This is what my code is doing:
Code: Select all
dir_test:
bra @start
@char_in: .byte 0
@start:
lda #8
jsr LISTEN ; ($ffb1)
lda #15
jsr SECOND ; ($ff93)
lda #'$'
jsr CIOUT ; ($ffa8)
lda #'='
jsr CIOUT ; ($ffa8)
lda #'C'
jsr CIOUT ; ($ffa8)
lda #$0d
jsr CIOUT ; ($ffa8)
jsr UNLSN ; ($ffae)
lda #8
jsr TALK; ($ffb4)
lda #15
jsr TKSA ; ($ff96)
ldx #100
@loop:
jsr ACPTR; ($ffa5)
sta @char_in
jsr XSH_ADD_CHAR
lda @char_in
dex
bne @loop
jsr UNTALK ; ($ffab)
rts
The call to XSH_ADD_CHAR is a hook back to the terminal that inserts the characters. (Printable ones display, $0d goes to the next line.)
This is what happens: