(Updated November 18, 2024)
Printing.asm
define CHROUT $ffd2
ldx #0 ; set index to zero
print:
lda words,x ; load a letter from words
beq done ; if it's the zero, we're done
jsr CHROUT ; print the character
inx ; increment the index
bne print ; keep printing
done:
brk ; end!
; data below this line
words:
txt "The quick brown\nfox jumps over\n"
txt "the lazy dog.\n"
dcb 0
Adding.asm
*= $4000 ; start at address $4000
define linprt $bdcd
define chrout $ffd2
ldx num1
lda num1+1
jsr printxa
ldx num2
lda num2+1
jsr printxa
adding: clc
lda num2
adc num1
sta sum
lda num2+1
adc num1+1
sta sum+1
; this is printing the sum
prtsum: ldx sum
lda sum+1
printxa: jsr linprt
lda #13
jmp chrout ; rts from call
rts
num1: dcw 3650
num2: dcw 1217
sum: dcw 0