1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-29 03:56:15 +00:00
kickc/src/test/ref/liverange-6.asm

32 lines
586 B
NASM
Raw Normal View History

// Test effective live range and register allocation
2020-03-23 06:26:26 +00:00
// out::c should be a hardware register, main::i should be a hardware register, global idx should be a hardware register
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label SCREEN = $400
main: {
ldx #0
ldy #0
__b1:
// out(msg[i])
lda msg,y
jsr out
// for( byte i: 0..11)
iny
cpy #$c
bne __b1
// }
rts
}
// out(byte register(A) c)
out: {
// SCREEN[idx++] = c
sta SCREEN,x
// SCREEN[idx++] = c;
inx
// }
rts
}
msg: .text "hello world!"
.byte 0