2017-11-05 08:44:00 +00:00
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(main)
|
|
|
|
.pc = $80d "Program"
|
2018-01-31 20:27:22 +00:00
|
|
|
.label PROCPORT = 1
|
|
|
|
.label CHARGEN = $d000
|
|
|
|
.label SCREEN = $400
|
2017-11-05 08:44:00 +00:00
|
|
|
main: {
|
2018-01-31 20:27:22 +00:00
|
|
|
.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
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z sc
|
2017-11-05 08:44:00 +00:00
|
|
|
lda #>SCREEN
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z sc+1
|
2017-11-05 08:44:00 +00:00
|
|
|
lda #0
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z y
|
2017-11-05 08:44:00 +00:00
|
|
|
b1:
|
2019-08-07 19:00:19 +00:00
|
|
|
ldy.z y
|
2018-01-01 14:09:47 +00:00
|
|
|
lda CHAR_A,y
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z bits
|
2017-11-05 08:44:00 +00:00
|
|
|
ldx #0
|
|
|
|
b2:
|
2018-01-21 10:14:20 +00:00
|
|
|
lda #$80
|
2019-08-07 19:00:19 +00:00
|
|
|
and.z bits
|
2017-11-05 08:44:00 +00:00
|
|
|
cmp #0
|
2017-12-03 14:12:20 +00:00
|
|
|
beq b4
|
2017-11-05 08:44:00 +00:00
|
|
|
lda #'*'
|
|
|
|
jmp b3
|
2017-12-03 14:12:20 +00:00
|
|
|
b4:
|
2017-11-05 08:44:00 +00:00
|
|
|
lda #'.'
|
|
|
|
b3:
|
|
|
|
ldy #0
|
|
|
|
sta (sc),y
|
2019-08-07 19:00:19 +00:00
|
|
|
inc.z sc
|
2017-11-05 08:44:00 +00:00
|
|
|
bne !+
|
2019-08-07 19:00:19 +00:00
|
|
|
inc.z sc+1
|
2017-11-05 08:44:00 +00:00
|
|
|
!:
|
2019-08-07 19:00:19 +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
|
2019-08-07 19:00:19 +00:00
|
|
|
adc.z sc
|
|
|
|
sta.z sc
|
2017-11-05 08:44:00 +00:00
|
|
|
bcc !+
|
2019-08-07 19:00:19 +00:00
|
|
|
inc.z sc+1
|
2017-11-05 08:44:00 +00:00
|
|
|
!:
|
2019-08-07 19:00:19 +00:00
|
|
|
inc.z y
|
2019-03-26 22:49:44 +00:00
|
|
|
lda #8
|
2019-08-07 19:00:19 +00:00
|
|
|
cmp.z y
|
2017-11-05 08:44:00 +00:00
|
|
|
bne b1
|
|
|
|
lda #$37
|
|
|
|
sta PROCPORT
|
|
|
|
cli
|
|
|
|
rts
|
|
|
|
}
|