Code: Alles auswählen
.zero
a .byte 0
b .byte 0
c .byte 0
.text
.word $1000
*=$1000
lda #1 ; a = 1
sta a
outer_loop
ldx #1 ; b = 1
stx b
dex ; c = 0
stx c
lda #13 ; print newline before block
jsr $ffd2
inner_loop
clc ; c += a
lda c
adc a
sta c
ldx b ; print b
jsr print_byte
lda #'*' ; print "*"
jsr $ffd2
ldx a ; print a
jsr print_byte
lda #'=' ; print "="
jsr $ffd2
ldx c ; print c
jsr print_byte
lda #13 ; print newline
jsr $ffd2
inc b ; b += 1
lda #11 ; if b != 11 then repeat loop
cmp b
bne inner_loop
inc a ; a += 1
cmp a ; if b != 11 then repeat loop
bne outer_loop
rts ; bye...
;---------------------------------
; Print byte value in X register.
print_byte
lda #0
jmp $bdcd