1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-10-21 02:24:34 +00:00
kickc/src/test/ref/inline-function-print.asm
jespergravgaard dacd25ac5f Added constant loop-head detection to a switchable optimization option -Oloophead. #246
Implemented for()-loop condition checking before body. Closes #183
2019-08-07 11:27:56 +02:00

37 lines
584 B
NASM

// TEst inlining a slightly complex print function (containing a loop)
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label screen = $400
main: {
.label print2_at = screen+2*$28
ldx #0
ldy #0
print1_b1:
lda #'@'
cmp hello,y
bne print1_b2
ldx #0
ldy #0
print2_b1:
lda #'@'
cmp hello,y
bne print2_b2
rts
print2_b2:
lda hello,y
sta print2_at,x
inx
inx
iny
jmp print2_b1
print1_b2:
lda hello,y
sta screen,x
inx
inx
iny
jmp print1_b1
hello: .text "hello world!@"
}