1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-20 02:32:36 +00:00
kickc/src/test/ref/overlap-allocation.asm

34 lines
596 B
NASM
Raw Normal View History

2019-02-17 23:12:29 +00:00
// Allocates ZP to j/k-variables even though all of i, j, k could be allocates to x and be more efficient.
// Reason: Pass4RegisterUpliftCombinations.isAllocationOverlapping() believes i/j/k variables overlaps insode plot()
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label SCREEN = $400
main: {
ldx #0
__b1:
jsr plot
inx
cpx #$b
bne __b1
ldx #0
__b2:
jsr plot
inx
cpx #$b
bne __b2
ldx #0
__b3:
jsr plot
inx
cpx #$b
bne __b3
rts
}
// plot(byte register(X) x)
plot: {
lda #'*'
sta SCREEN,x
rts
}