1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-18 04:08:58 +00:00
kickc/src/test/ref/chargen.asm

62 lines
799 B
NASM
Raw Normal View History

2017-11-05 08:44:00 +00:00
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label PROCPORT = 1
.label CHARGEN = $d000
.label SCREEN = $400
2017-11-05 08:44:00 +00:00
main: {
.label CHAR_A = CHARGEN+8
2017-11-05 08:44:00 +00:00
.label bits = 3
.label sc = 4
.label y = 2
sei
lda #$32
sta PROCPORT
lda #<SCREEN
sta.z sc
2017-11-05 08:44:00 +00:00
lda #>SCREEN
sta.z sc+1
2017-11-05 08:44:00 +00:00
lda #0
sta.z y
2017-11-05 08:44:00 +00:00
b1:
ldy.z y
lda CHAR_A,y
sta.z bits
2017-11-05 08:44:00 +00:00
ldx #0
b2:
lda #$80
and.z bits
2017-11-05 08:44:00 +00:00
cmp #0
beq b4
2017-11-05 08:44:00 +00:00
lda #'*'
jmp b3
b4:
2017-11-05 08:44:00 +00:00
lda #'.'
b3:
ldy #0
sta (sc),y
inc.z sc
2017-11-05 08:44:00 +00:00
bne !+
inc.z sc+1
2017-11-05 08:44:00 +00:00
!:
asl.z bits
2017-11-05 08:44:00 +00:00
inx
cpx #8
bne b2
2019-03-18 01:23:29 +00:00
lda #$20
2017-11-05 08:44:00 +00:00
clc
adc.z sc
sta.z sc
2017-11-05 08:44:00 +00:00
bcc !+
inc.z sc+1
2017-11-05 08:44:00 +00:00
!:
inc.z y
lda #8
cmp.z y
2017-11-05 08:44:00 +00:00
bne b1
lda #$37
sta PROCPORT
cli
rts
}