2019-02-17 23:12:29 +00:00
|
|
|
// TEst inlining a slightly complex print function (containing a loop)
|
2018-05-01 20:08:23 +00:00
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(main)
|
|
|
|
.pc = $80d "Program"
|
|
|
|
.label screen = $400
|
|
|
|
main: {
|
|
|
|
.label print2_at = screen+2*$28
|
|
|
|
ldx #0
|
|
|
|
ldy #0
|
|
|
|
print1_b1:
|
2019-08-07 17:48:56 +00:00
|
|
|
lda #0
|
2019-03-26 22:49:44 +00:00
|
|
|
cmp hello,y
|
2019-08-07 09:27:55 +00:00
|
|
|
bne print1_b2
|
2019-08-07 17:48:56 +00:00
|
|
|
tax
|
|
|
|
tay
|
2018-05-01 20:08:23 +00:00
|
|
|
print2_b1:
|
2019-08-07 17:48:56 +00:00
|
|
|
lda #0
|
2019-08-07 09:27:55 +00:00
|
|
|
cmp hello,y
|
|
|
|
bne print2_b2
|
|
|
|
rts
|
|
|
|
print2_b2:
|
2019-03-22 18:50:20 +00:00
|
|
|
lda hello,y
|
2018-05-01 20:08:23 +00:00
|
|
|
sta print2_at,x
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
iny
|
2019-08-07 09:27:55 +00:00
|
|
|
jmp print2_b1
|
|
|
|
print1_b2:
|
|
|
|
lda hello,y
|
|
|
|
sta screen,x
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
iny
|
|
|
|
jmp print1_b1
|
2019-08-07 17:36:19 +00:00
|
|
|
hello: .text "hello world!"
|
|
|
|
.byte 0
|
2018-05-01 20:08:23 +00:00
|
|
|
}
|