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

34 lines
596 B
NASM

// 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
}