Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
run $2000
org $2000
ldx #0
loop inx
stx $bc40
jmp loop
clc
lda #0
loop adc #1
cmp #10
sta $bc40
bne loop
end
scrad equ $58 ;.w
adr equ $80 ;.w
ldx scrad
ldy scrad+1
stx adr
sty adr+1
ldx #0
ldy #0
loop:
iny
tya
ora #$10
sta (adr,x)
lda #40
adc adr
sta adr
bcc *+4
inc adr+1
cpy #10+1
bcc loop
rts
scrad equ $58 ;.w - begin of screen
adr equ $80 ;.w - my work register with address of screen row
dec equ $82 ;.b - counter in bcd
ldx scrad ;move first screen row address
ldy scrad+1 ;to work row address
stx adr
sty adr+1
ldx #1 ;for i=1
@loop:
txa ;convert binary number to bcd
jsr bin2dec
pha
lsr @
lsr @
lsr @
lsr @
ora #$10 ;'0' internal code
ldy #0 ;column #0
sta (adr),y ;print dec
pla
and #$f
ora #$10 ;'0' internal code
iny ;column #1
sta (adr),y ;print units
clc ;calculate next screen row address
lda #40 ;screen width
adc adr
sta adr
bcc @pass
inc adr+1
@pass:
inx ;next i
cpx #10+1 ;...to 10
bcc @loop
rts
;bin to bcd conversion
bin2dec:
ldy #0 ;clear work register
sty dec
ldy #8 ;count of bits in byte
sed ;bcd mode on
@loop:
asl @ ;bit shift work only as binary operator (multiplies by 2 in binary)
lda dec ;multiplies by 2 in bcd mode
adc dec ;and shift in C from binary number
sta dec
dey
bne @loop
cld ;bcd mode off
lda dec ;dec has bcd value of A on input
rts
w1k:
then o mod it:clc
lda #0
loop adc #1
cmp #10
sta $bc40
bne loop
end
Od 1 do 13 z 13