mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-05 07:40:39 +00:00
Fixed error where global variable live ranges where ignored by ZP coalesce.
This commit is contained in:
parent
e64659025e
commit
966773ed2b
@ -0,0 +1,8 @@
|
||||
clc
|
||||
lda {c1},x
|
||||
adc {c2}
|
||||
sta {z1}
|
||||
lda {c1}+1,x
|
||||
adc {c2}+1
|
||||
sta {z1}+1
|
||||
|
@ -0,0 +1,12 @@
|
||||
clc
|
||||
ldy #0
|
||||
lda {c1},x
|
||||
adc ({z1}),y
|
||||
pha
|
||||
iny
|
||||
lda {c1}+1,x
|
||||
adc ({z1}),y
|
||||
sta {z1}+1
|
||||
pla
|
||||
sta {z1}
|
||||
|
@ -0,0 +1,10 @@
|
||||
clc
|
||||
ldy #0
|
||||
lda {c1},x
|
||||
adc ({z2}),y
|
||||
sta {z1}
|
||||
iny
|
||||
lda {c1}+1,x
|
||||
adc ({z2}),y
|
||||
sta {z1}+1
|
||||
|
@ -0,0 +1,8 @@
|
||||
clc
|
||||
lda {c1},y
|
||||
adc {c2}
|
||||
sta {z1}
|
||||
lda {c1}+1,y
|
||||
adc {c2}+1
|
||||
sta {z1}+1
|
||||
|
@ -167,6 +167,11 @@ public class CompileLog {
|
||||
this.verboseLiveRanges = verboseLiveRanges;
|
||||
}
|
||||
|
||||
public CompileLog verboseLiveRanges() {
|
||||
setVerboseLiveRanges(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isVerboseFragmentLog() {
|
||||
return verboseFragmentLog;
|
||||
}
|
||||
|
@ -105,6 +105,13 @@ public class LiveRangeVariablesEffective {
|
||||
referencedInProcedure = referenceInfo.getReferencedVars(procedure.getRef().getLabelRef());
|
||||
} else {
|
||||
callPaths = new CallPaths(ROOT_PROCEDURE);
|
||||
// Interrupt is called outside procedure scope - create initial call-path.
|
||||
ArrayList<CallGraph.CallBlock.Call> rootPath = new ArrayList<>();
|
||||
ArrayList<VariableRef> rootAlive = new ArrayList<>();
|
||||
// Initialize with global cross-scope aliases (assumed empty)
|
||||
Pass2AliasElimination.Aliases rootAliases = new Pass2AliasElimination.Aliases();
|
||||
LiveRangeVariablesEffective.CallPath rootCallPath = new LiveRangeVariablesEffective.CallPath(rootPath, rootAlive, rootAliases, rootAliases);
|
||||
callPaths.add(rootCallPath);
|
||||
referencedInProcedure = new ArrayList<>();
|
||||
}
|
||||
Pass2AliasElimination.Aliases callAliases = null;
|
||||
@ -169,7 +176,7 @@ public class LiveRangeVariablesEffective {
|
||||
|
||||
/**
|
||||
* All variables alive in a specific procedure at a specific call-path.
|
||||
* The call-path is th path from the main()-procedure to the procedure in question.
|
||||
* The call-path is the path from the main()-procedure to the procedure in question.
|
||||
*/
|
||||
public static class CallPath {
|
||||
|
||||
|
@ -112,9 +112,7 @@ public class SymbolTypeInference {
|
||||
Variable structMember = structDefinition.getVariable(structMemberRef.getMemberName());
|
||||
return structMember.getType();
|
||||
} else {
|
||||
AsmFragmentInstanceSpec asmFragmentInstanceSpec = null;
|
||||
Program program = asmFragmentInstanceSpec.getProgram();
|
||||
throw new CompileError("Dot applied to non-struct "+ structMemberRef.getStruct().toString(program));
|
||||
throw new CompileError("Dot applied to non-struct "+ structMemberRef.getStruct().toString());
|
||||
}
|
||||
} else if(rValue instanceof StructZero) {
|
||||
return ((StructZero)rValue).getTypeStruct();
|
||||
|
@ -35,6 +35,16 @@ public class TestPrograms {
|
||||
public TestPrograms() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNesArray() throws IOException, URISyntaxException {
|
||||
compileAndCompare("nes-array");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLiverangeProblem0() throws IOException, URISyntaxException {
|
||||
compileAndCompare("liverange-problem-0");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCiaTimerCyclecount() throws IOException, URISyntaxException {
|
||||
compileAndCompare("cia-timer-cyclecount");
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Clears start screen throwing around the letters (by turning them into sprites)
|
||||
import "stdlib"
|
||||
import "sqr"
|
||||
import "atan2"
|
||||
import "multiply"
|
||||
import "c64"
|
||||
|
||||
@ -76,7 +77,7 @@ struct ProcessingSprite[NUM_PROCESSING] PROCESSING;
|
||||
|
||||
void main() {
|
||||
// Initialize the screen containing distance to the center
|
||||
init_dist_screen(SCREEN_DIST);
|
||||
init_angle_screen(SCREEN_DIST);
|
||||
// Copy screen to screen copy
|
||||
for( byte* src=SCREEN, dst=SCREEN_COPY; src!=SCREEN+1000; src++, dst++) *dst = *src;
|
||||
// Init processing array
|
||||
@ -248,6 +249,27 @@ void init_dist_screen(byte* screen) {
|
||||
}
|
||||
}
|
||||
|
||||
// Populates 1000 bytes (a screen) with values representing the angle to the center.
|
||||
// Utilizes symmetry around the center
|
||||
void init_angle_screen(byte* screen) {
|
||||
byte* screen_topline = screen+40*12;
|
||||
byte *screen_bottomline = screen+40*12;
|
||||
for(byte y: 0..12) {
|
||||
for( byte x=0,xb=39; x<=19; x++, xb--) {
|
||||
signed word xw = (signed word)(word){ 39-x*2, 0 };
|
||||
signed word yw = (signed word)(word){ y*2, 0 };
|
||||
word angle_w = atan2_16(xw, yw);
|
||||
byte ang_w = >(angle_w+0x0080);
|
||||
screen_bottomline[xb] = ang_w;
|
||||
screen_topline[xb] = -ang_w;
|
||||
screen_topline[x] = 0x80+ang_w;
|
||||
screen_bottomline[x] = 0x80-ang_w;
|
||||
}
|
||||
screen_topline -= 40;
|
||||
screen_bottomline += 40;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize sprites
|
||||
void initSprites() {
|
||||
// Clear sprite data
|
||||
|
18
src/test/kc/liverange-problem-0.kc
Normal file
18
src/test/kc/liverange-problem-0.kc
Normal file
@ -0,0 +1,18 @@
|
||||
// Error where the compiler is reusing the same ZP for two byte* variables.
|
||||
// SCREEN_1 and SCREEN_2 are both allocated to ZP: 4
|
||||
// Problem is that outside main() scope statements have zero call-paths and then isStatementAllocationOverlapping() never checks liveranges
|
||||
// CallPath code must be rewritten to use @begin as the outermost call instead of main()
|
||||
|
||||
byte* MEM = 0x0400;
|
||||
byte* malloc() {
|
||||
return ++MEM;
|
||||
}
|
||||
|
||||
byte* SCREEN_1 = malloc();
|
||||
byte* SCREEN_2 = malloc();
|
||||
|
||||
void main() {
|
||||
*SCREEN_1 = 0;
|
||||
*SCREEN_2 = 0;
|
||||
}
|
||||
|
15
src/test/kc/malloc-problem-0.kc
Normal file
15
src/test/kc/malloc-problem-0.kc
Normal file
@ -0,0 +1,15 @@
|
||||
// Error where the compiler is reusing the same ZP for two byte* variables.
|
||||
|
||||
byte* MEM = 0x0400;
|
||||
byte* malloc() {
|
||||
return ++MEM;
|
||||
}
|
||||
|
||||
byte* SCREEN_1 = malloc();
|
||||
byte* SCREEN_2 = malloc();
|
||||
|
||||
void main() {
|
||||
*SCREEN_1 = 0;
|
||||
*SCREEN_2 = 0;
|
||||
}
|
||||
|
17
src/test/kc/nes-array.kc
Normal file
17
src/test/kc/nes-array.kc
Normal file
@ -0,0 +1,17 @@
|
||||
// Test a bit of array code from the NES forum
|
||||
// https://forums.nesdev.com/viewtopic.php?f=2&t=18735
|
||||
|
||||
int[4] wow = { 0xCAFE, 0xBABE, 0x1234, 0x5678};
|
||||
|
||||
int foo(unsigned char x, int *y) {
|
||||
return wow[x] + *y;
|
||||
}
|
||||
|
||||
void main() {
|
||||
int* SCREEN = 0x400;
|
||||
int y1 = 0x1234;
|
||||
int y2 = 0x1234;
|
||||
*SCREEN++ = foo(1, &y1);
|
||||
*SCREEN++ = foo(2, &y2);
|
||||
|
||||
}
|
@ -485,7 +485,7 @@ setv: {
|
||||
//SEG40 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) val#0 ← (byte) 0 [ val#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) val#0 ← (byte) 0 [ val#0 ] ( [ val#0 ] ) always clobbers reg byte a
|
||||
Statement [4] *((const byte*) main::SCREEN1#0) ← (byte) val#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((const byte*) main::SCREEN2#0) ← (byte) '.' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] (byte) val#1 ← (byte) 1 [ val#1 ] ( main:2 [ val#1 ] ) always clobbers reg byte a
|
||||
|
@ -2383,7 +2383,7 @@ irq: {
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Equivalence Class zp ZP_BYTE:34 [ bitmap_init::$4 ] has ALU potential.
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [14] (word) bitmap_plot::x#0 ← (word) main::x#2 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ( main:3 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ) always clobbers reg byte a
|
||||
@ -2425,7 +2425,7 @@ Statement [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 [ frame_cnt#0 ] (
|
||||
Statement [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [85] return [ ] ( [ ] ) always clobbers reg byte a reg byte x reg byte y
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [14] (word) bitmap_plot::x#0 ← (word) main::x#2 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ( main:3 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ) always clobbers reg byte a
|
||||
|
@ -5867,7 +5867,7 @@ REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Equivalence Class zp ZP_WORD:86 [ main::$10 ] has ALU potential.
|
||||
Equivalence Class zp ZP_WORD:108 [ main::$15 ] has ALU potential.
|
||||
Equivalence Class zp ZP_BYTE:142 [ bitmap_init::$4 ] has ALU potential.
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [16] (word~) main::$24 ← (word) main::idx_x#3 << (byte) 1 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 main::$24 ] ( main:3 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 main::$24 ] ) always clobbers reg byte a
|
||||
@ -5996,7 +5996,7 @@ Statement [224] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 [ frame_cnt#0 ] (
|
||||
Statement [227] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [228] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [229] return [ ] ( [ ] ) always clobbers reg byte a reg byte x reg byte y
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [16] (word~) main::$24 ← (word) main::idx_x#3 << (byte) 1 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 main::$24 ] ( main:3 [ frame_cnt#0 main::idx_x#3 main::idx_y#3 main::$24 ] ) always clobbers reg byte a
|
||||
|
@ -6159,7 +6159,7 @@ irq: {
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Equivalence Class zp ZP_BYTE:141 [ bitmap_init::$4 ] has ALU potential.
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [16] (word~) main::$32 ← (word) main::idx_x#11 << (byte) 1 [ frame_cnt#0 main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 main::$32 ] ( main:3 [ frame_cnt#0 main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 main::$32 ] ) always clobbers reg byte a
|
||||
@ -6301,7 +6301,7 @@ Statement [233] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 [ frame_cnt#0 ] (
|
||||
Statement [236] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [237] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [238] return [ ] ( [ ] ) always clobbers reg byte a reg byte x reg byte y
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a
|
||||
Statement [16] (word~) main::$32 ← (word) main::idx_x#11 << (byte) 1 [ frame_cnt#0 main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 main::$32 ] ( main:3 [ frame_cnt#0 main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 main::$32 ] ) always clobbers reg byte a
|
||||
|
@ -349,7 +349,7 @@ irq: {
|
||||
//SEG31 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte) irq_raster_next#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) irq_raster_next#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Statement [7] *((const byte*) BORDERCOL#0) ← (const byte) DARK_GREY#0 [ irq_raster_next#0 ] ( [ irq_raster_next#0 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [ irq_raster_next#1 ] ( [ irq_raster_next#1 ] ) always clobbers reg byte a reg byte x
|
||||
|
@ -2,7 +2,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
.const SIZEOF_WORD = 2
|
||||
.const STATUS_FREE = 0
|
||||
.const STATUS_NEW = 1
|
||||
.const STATUS_PROCESSING = 2
|
||||
@ -16,6 +15,8 @@
|
||||
.const OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR = $c
|
||||
// Start of the heap used by malloc()
|
||||
.label HEAP_START = $c000
|
||||
// The number of iterations performed during 16-bit CORDIC atan2 calculation
|
||||
.const CORDIC_ITERATIONS_16 = $f
|
||||
// Processor port data direction register
|
||||
.label PROCPORT_DDR = 0
|
||||
// Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written
|
||||
@ -68,22 +69,16 @@
|
||||
.const NUM_PROCESSING = 8
|
||||
// Distance value meaning not found
|
||||
.const NOT_FOUND = $ff
|
||||
.const NUM_SQUARES = $30
|
||||
.const RASTER_IRQ_TOP = $30
|
||||
.const RASTER_IRQ_MIDDLE = $ff
|
||||
.const XPOS_RIGHTMOST = BORDER_XPOS_RIGHT<<4
|
||||
.const YPOS_BOTTOMMOST = BORDER_YPOS_BOTTOM<<4
|
||||
.const XPOS_LEFTMOST = BORDER_XPOS_LEFT-8<<4
|
||||
.const YPOS_TOPMOST = BORDER_YPOS_TOP-8<<4
|
||||
.label heap_head = $23
|
||||
.label SQUARES = $49
|
||||
.label SCREEN_COPY = $29
|
||||
.label SCREEN_DIST = $2b
|
||||
.label heap_head = $27
|
||||
.label SCREEN_COPY = $2b
|
||||
.label SCREEN_DIST = $2d
|
||||
bbegin:
|
||||
lda #<$3e8
|
||||
sta malloc.size
|
||||
lda #>$3e8
|
||||
sta malloc.size+1
|
||||
lda #<HEAP_START
|
||||
sta heap_head
|
||||
lda #>HEAP_START
|
||||
@ -93,27 +88,19 @@ bbegin:
|
||||
sta SCREEN_COPY
|
||||
lda malloc.mem+1
|
||||
sta SCREEN_COPY+1
|
||||
lda #<$3e8
|
||||
sta malloc.size
|
||||
lda #>$3e8
|
||||
sta malloc.size+1
|
||||
jsr malloc
|
||||
lda malloc.mem
|
||||
sta SCREEN_DIST
|
||||
lda malloc.mem+1
|
||||
sta SCREEN_DIST+1
|
||||
jsr main
|
||||
rts
|
||||
main: {
|
||||
.label dst = 4
|
||||
.label src = 2
|
||||
.label i = 6
|
||||
.label center_y = $2d
|
||||
.label center_y = $2f
|
||||
lda SCREEN_DIST
|
||||
sta init_dist_screen.screen
|
||||
sta init_angle_screen.screen
|
||||
lda SCREEN_DIST+1
|
||||
sta init_dist_screen.screen+1
|
||||
jsr init_dist_screen
|
||||
sta init_angle_screen.screen+1
|
||||
jsr init_angle_screen
|
||||
lda SCREEN_COPY
|
||||
sta dst
|
||||
lda SCREEN_COPY+1
|
||||
@ -197,36 +184,36 @@ main: {
|
||||
jmp b3
|
||||
}
|
||||
// Start processing a char - by inserting it into the PROCESSING array
|
||||
// startProcessing(byte zeropage($2e) center_x, byte zeropage($2d) center_y)
|
||||
// startProcessing(byte zeropage($30) center_x, byte zeropage($2f) center_y)
|
||||
startProcessing: {
|
||||
.label _0 = $2f
|
||||
.label _1 = $2f
|
||||
.label _0 = $31
|
||||
.label _1 = $31
|
||||
.label _5 = $a
|
||||
.label _6 = $a
|
||||
.label _8 = 8
|
||||
.label _9 = 8
|
||||
.label _11 = $36
|
||||
.label _12 = $36
|
||||
.label _13 = $36
|
||||
.label _15 = $38
|
||||
.label _16 = $38
|
||||
.label _17 = $38
|
||||
.label _23 = $3b
|
||||
.label center_x = $2e
|
||||
.label center_y = $2d
|
||||
.label _11 = $38
|
||||
.label _12 = $38
|
||||
.label _13 = $38
|
||||
.label _15 = $3a
|
||||
.label _16 = $3a
|
||||
.label _17 = $3a
|
||||
.label _23 = $3d
|
||||
.label center_x = $30
|
||||
.label center_y = $2f
|
||||
.label i = 7
|
||||
.label offset = $2f
|
||||
.label colPtr = $33
|
||||
.label spriteCol = $35
|
||||
.label screenPtr = $2f
|
||||
.label offset = $31
|
||||
.label colPtr = $35
|
||||
.label spriteCol = $37
|
||||
.label screenPtr = $31
|
||||
.label spriteData = $a
|
||||
.label chargenData = 8
|
||||
.label spriteX = $36
|
||||
.label spriteY = $38
|
||||
.label spritePtr = $3a
|
||||
.label spriteX = $38
|
||||
.label spriteY = $3a
|
||||
.label spritePtr = $3c
|
||||
.label freeIdx = 7
|
||||
.label _47 = $31
|
||||
.label _48 = $2f
|
||||
.label _47 = $33
|
||||
.label _48 = $31
|
||||
ldx #$ff
|
||||
b1:
|
||||
lda #0
|
||||
@ -480,9 +467,9 @@ startProcessing: {
|
||||
// Find the non-space char closest to the center of the screen
|
||||
// If no non-space char is found the distance will be 0xffff
|
||||
getCharToProcess: {
|
||||
.label _8 = $3d
|
||||
.label _9 = $3d
|
||||
.label _10 = $3d
|
||||
.label _8 = $3f
|
||||
.label _9 = $3f
|
||||
.label _10 = $3f
|
||||
.label screen_line = $c
|
||||
.label dist_line = $e
|
||||
.label y = $10
|
||||
@ -491,8 +478,8 @@ getCharToProcess: {
|
||||
.label closest_dist = $11
|
||||
.label closest_x = $12
|
||||
.label closest_y = $13
|
||||
.label _12 = $3f
|
||||
.label _13 = $3d
|
||||
.label _12 = $41
|
||||
.label _13 = $3f
|
||||
lda SCREEN_COPY
|
||||
sta screen_line
|
||||
lda SCREEN_COPY+1
|
||||
@ -663,292 +650,308 @@ initSprites: {
|
||||
sta SPRITES_EXPAND_Y
|
||||
rts
|
||||
}
|
||||
// Populates 1000 bytes (a screen) with values representing the distance to the center.
|
||||
// The actual value stored is distance*2 to increase precision
|
||||
// init_dist_screen(byte* zeropage($17) screen)
|
||||
init_dist_screen: {
|
||||
// Populates 1000 bytes (a screen) with values representing the angle to the center.
|
||||
// Utilizes symmetry around the center
|
||||
// init_angle_screen(byte* zeropage($17) screen)
|
||||
init_angle_screen: {
|
||||
.label _10 = $21
|
||||
.label screen = $17
|
||||
.label screen_bottomline = $19
|
||||
.label yds = $41
|
||||
.label xds = $43
|
||||
.label ds = $43
|
||||
.label screen_topline = $19
|
||||
.label screen_bottomline = $17
|
||||
.label xw = $43
|
||||
.label yw = $45
|
||||
.label angle_w = $21
|
||||
.label ang_w = $47
|
||||
.label x = $1b
|
||||
.label xb = $1c
|
||||
.label screen_topline = $17
|
||||
.label y = $16
|
||||
jsr init_squares
|
||||
lda screen
|
||||
clc
|
||||
adc #<$28*$18
|
||||
sta screen_bottomline
|
||||
adc #<$28*$c
|
||||
sta screen_topline
|
||||
lda screen+1
|
||||
adc #>$28*$18
|
||||
adc #>$28*$c
|
||||
sta screen_topline+1
|
||||
clc
|
||||
lda screen_bottomline
|
||||
adc #<$28*$c
|
||||
sta screen_bottomline
|
||||
lda screen_bottomline+1
|
||||
adc #>$28*$c
|
||||
sta screen_bottomline+1
|
||||
lda #0
|
||||
sta y
|
||||
b1:
|
||||
lda y
|
||||
asl
|
||||
cmp #$18
|
||||
bcs b2
|
||||
eor #$ff
|
||||
clc
|
||||
adc #$18+1
|
||||
b4:
|
||||
jsr sqr
|
||||
lda sqr.return
|
||||
sta sqr.return_2
|
||||
lda sqr.return+1
|
||||
sta sqr.return_2+1
|
||||
lda #$27
|
||||
sta xb
|
||||
lda #0
|
||||
sta x
|
||||
b5:
|
||||
b2:
|
||||
lda x
|
||||
asl
|
||||
cmp #$27
|
||||
bcs b6
|
||||
eor #$ff
|
||||
clc
|
||||
adc #$27+1
|
||||
b8:
|
||||
jsr sqr
|
||||
lda ds
|
||||
ldy #0
|
||||
sta xw+1
|
||||
sty xw
|
||||
lda y
|
||||
asl
|
||||
sta yw+1
|
||||
sty yw
|
||||
jsr atan2_16
|
||||
lda #$80
|
||||
clc
|
||||
adc yds
|
||||
sta ds
|
||||
lda ds+1
|
||||
adc yds+1
|
||||
sta ds+1
|
||||
jsr sqrt
|
||||
adc _10
|
||||
sta _10
|
||||
bcc !+
|
||||
inc _10+1
|
||||
!:
|
||||
lda _10+1
|
||||
sta ang_w
|
||||
ldy xb
|
||||
sta (screen_bottomline),y
|
||||
eor #$ff
|
||||
clc
|
||||
adc #1
|
||||
sta (screen_topline),y
|
||||
lda #$80
|
||||
clc
|
||||
adc ang_w
|
||||
ldy x
|
||||
sta (screen_topline),y
|
||||
sta (screen_bottomline),y
|
||||
ldy xb
|
||||
sta (screen_topline),y
|
||||
lda #$80
|
||||
sec
|
||||
sbc ang_w
|
||||
sta (screen_bottomline),y
|
||||
inc x
|
||||
dec xb
|
||||
lda x
|
||||
cmp #$13+1
|
||||
bcc b5
|
||||
lda #$28
|
||||
clc
|
||||
adc screen_topline
|
||||
sta screen_topline
|
||||
bcc !+
|
||||
inc screen_topline+1
|
||||
!:
|
||||
lda screen_bottomline
|
||||
bcc b2
|
||||
lda screen_topline
|
||||
sec
|
||||
sbc #<$28
|
||||
sta screen_bottomline
|
||||
lda screen_bottomline+1
|
||||
sta screen_topline
|
||||
lda screen_topline+1
|
||||
sbc #>$28
|
||||
sta screen_bottomline+1
|
||||
sta screen_topline+1
|
||||
lda #$28
|
||||
clc
|
||||
adc screen_bottomline
|
||||
sta screen_bottomline
|
||||
bcc !+
|
||||
inc screen_bottomline+1
|
||||
!:
|
||||
inc y
|
||||
lda #$d
|
||||
cmp y
|
||||
bne b1
|
||||
rts
|
||||
b6:
|
||||
sec
|
||||
sbc #$27
|
||||
jmp b8
|
||||
b2:
|
||||
sec
|
||||
sbc #$18
|
||||
jmp b4
|
||||
}
|
||||
// Find the (integer) square root of a word value
|
||||
// If the square is not an integer then it returns the largest integer N where N*N <= val
|
||||
// Uses a table of squares that must be initialized by calling init_squares()
|
||||
// sqrt(word zeropage($43) val)
|
||||
sqrt: {
|
||||
.label _1 = $1d
|
||||
.label _3 = $1d
|
||||
.label found = $1d
|
||||
.label val = $43
|
||||
lda SQUARES
|
||||
sta bsearch16u.items
|
||||
lda SQUARES+1
|
||||
sta bsearch16u.items+1
|
||||
jsr bsearch16u
|
||||
lda _3
|
||||
sec
|
||||
sbc SQUARES
|
||||
sta _3
|
||||
lda _3+1
|
||||
sbc SQUARES+1
|
||||
sta _3+1
|
||||
lsr _1+1
|
||||
ror _1
|
||||
lda _1
|
||||
rts
|
||||
}
|
||||
// Searches an array of nitems unsigned words, the initial member of which is pointed to by base, for a member that matches the value key.
|
||||
// - key - The value to look for
|
||||
// - items - Pointer to the start of the array to search in
|
||||
// - num - The number of items in the array
|
||||
// Returns pointer to an entry in the array that matches the search key
|
||||
// bsearch16u(word zeropage($43) key, word* zeropage($1d) items, byte register(X) num)
|
||||
bsearch16u: {
|
||||
// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
|
||||
// Finding the angle requires a binary search using CORDIC_ITERATIONS_16
|
||||
// Returns the angle in hex-degrees (0=0, 0x8000=PI, 0x10000=2*PI)
|
||||
// atan2_16(signed word zeropage($43) x, signed word zeropage($45) y)
|
||||
atan2_16: {
|
||||
.label _2 = $1d
|
||||
.label pivot = $45
|
||||
.label result = $47
|
||||
.label return = $1d
|
||||
.label items = $1d
|
||||
.label key = $43
|
||||
ldx #NUM_SQUARES
|
||||
b3:
|
||||
cpx #0
|
||||
bne b4
|
||||
ldy #1
|
||||
lda (items),y
|
||||
cmp key+1
|
||||
bne !+
|
||||
dey
|
||||
lda (items),y
|
||||
cmp key
|
||||
beq b2
|
||||
!:
|
||||
bcc b2
|
||||
lda _2
|
||||
.label _7 = $1f
|
||||
.label yi = $1d
|
||||
.label xi = $1f
|
||||
.label angle = $21
|
||||
.label xd = $25
|
||||
.label yd = $23
|
||||
.label return = $21
|
||||
.label x = $43
|
||||
.label y = $45
|
||||
lda y+1
|
||||
bmi !b1+
|
||||
jmp b1
|
||||
!b1:
|
||||
sec
|
||||
sbc #<1*SIZEOF_WORD
|
||||
lda #0
|
||||
sbc y
|
||||
sta _2
|
||||
lda _2+1
|
||||
sbc #>1*SIZEOF_WORD
|
||||
lda #0
|
||||
sbc y+1
|
||||
sta _2+1
|
||||
b2:
|
||||
rts
|
||||
b4:
|
||||
txa
|
||||
lsr
|
||||
asl
|
||||
clc
|
||||
adc items
|
||||
sta pivot
|
||||
lda #0
|
||||
adc items+1
|
||||
sta pivot+1
|
||||
b3:
|
||||
lda x+1
|
||||
bmi !b4+
|
||||
jmp b4
|
||||
!b4:
|
||||
sec
|
||||
lda key
|
||||
ldy #0
|
||||
sbc (pivot),y
|
||||
sta result
|
||||
lda key+1
|
||||
iny
|
||||
sbc (pivot),y
|
||||
sta result+1
|
||||
bne b6
|
||||
lda result
|
||||
bne b6
|
||||
lda pivot
|
||||
sta return
|
||||
lda pivot+1
|
||||
sta return+1
|
||||
rts
|
||||
b6:
|
||||
lda result+1
|
||||
bmi b7
|
||||
bne !+
|
||||
lda result
|
||||
beq b7
|
||||
!:
|
||||
lda #1*SIZEOF_WORD
|
||||
clc
|
||||
adc pivot
|
||||
sta items
|
||||
lda #0
|
||||
adc pivot+1
|
||||
sta items+1
|
||||
dex
|
||||
b7:
|
||||
txa
|
||||
lsr
|
||||
sbc x
|
||||
sta _7
|
||||
lda #0
|
||||
sbc x+1
|
||||
sta _7+1
|
||||
b6:
|
||||
lda #0
|
||||
sta angle
|
||||
sta angle+1
|
||||
tax
|
||||
jmp b3
|
||||
}
|
||||
// Find the square of a byte value
|
||||
// Uses a table of squares that must be initialized by calling init_squares()
|
||||
// sqr(byte register(A) val)
|
||||
sqr: {
|
||||
.label return = $43
|
||||
.label return_2 = $41
|
||||
b10:
|
||||
lda yi+1
|
||||
bne b11
|
||||
lda yi
|
||||
bne b11
|
||||
b12:
|
||||
lsr angle+1
|
||||
ror angle
|
||||
lda x+1
|
||||
bpl b7
|
||||
sec
|
||||
lda #<$8000
|
||||
sbc angle
|
||||
sta angle
|
||||
lda #>$8000
|
||||
sbc angle+1
|
||||
sta angle+1
|
||||
b7:
|
||||
lda y+1
|
||||
bpl b8
|
||||
sec
|
||||
lda #0
|
||||
sbc angle
|
||||
sta angle
|
||||
lda #0
|
||||
sbc angle+1
|
||||
sta angle+1
|
||||
b8:
|
||||
rts
|
||||
b11:
|
||||
txa
|
||||
tay
|
||||
lda xi
|
||||
sta xd
|
||||
lda xi+1
|
||||
sta xd+1
|
||||
lda yi
|
||||
sta yd
|
||||
lda yi+1
|
||||
sta yd+1
|
||||
b13:
|
||||
cpy #2
|
||||
bcs b14
|
||||
cpy #0
|
||||
beq b17
|
||||
lda xd+1
|
||||
cmp #$80
|
||||
ror xd+1
|
||||
ror xd
|
||||
lda yd+1
|
||||
cmp #$80
|
||||
ror yd+1
|
||||
ror yd
|
||||
b17:
|
||||
lda yi+1
|
||||
bpl b18
|
||||
lda xi
|
||||
sec
|
||||
sbc yd
|
||||
sta xi
|
||||
lda xi+1
|
||||
sbc yd+1
|
||||
sta xi+1
|
||||
lda yi
|
||||
clc
|
||||
adc xd
|
||||
sta yi
|
||||
lda yi+1
|
||||
adc xd+1
|
||||
sta yi+1
|
||||
txa
|
||||
asl
|
||||
tay
|
||||
lda (SQUARES),y
|
||||
sta return
|
||||
iny
|
||||
lda (SQUARES),y
|
||||
sta return+1
|
||||
rts
|
||||
}
|
||||
// Initialize squares table
|
||||
// Uses iterative formula (x+1)^2 = x^2 + 2*x + 1
|
||||
init_squares: {
|
||||
.label squares = $21
|
||||
.label sqr = $1f
|
||||
lda #NUM_SQUARES*SIZEOF_WORD
|
||||
sta malloc.size
|
||||
lda #0
|
||||
sta malloc.size+1
|
||||
jsr malloc
|
||||
lda SQUARES
|
||||
sta squares
|
||||
lda SQUARES+1
|
||||
sta squares+1
|
||||
ldx #0
|
||||
txa
|
||||
sta sqr
|
||||
sta sqr+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda sqr
|
||||
sta (squares),y
|
||||
iny
|
||||
lda sqr+1
|
||||
sta (squares),y
|
||||
lda #SIZEOF_WORD
|
||||
sec
|
||||
lda angle
|
||||
sbc CORDIC_ATAN2_ANGLES_16,y
|
||||
sta angle
|
||||
lda angle+1
|
||||
sbc CORDIC_ATAN2_ANGLES_16+1,y
|
||||
sta angle+1
|
||||
b19:
|
||||
inx
|
||||
cpx #CORDIC_ITERATIONS_16-1+1
|
||||
bne !b12+
|
||||
jmp b12
|
||||
!b12:
|
||||
jmp b10
|
||||
b18:
|
||||
lda xi
|
||||
clc
|
||||
adc squares
|
||||
sta squares
|
||||
bcc !+
|
||||
inc squares+1
|
||||
!:
|
||||
adc yd
|
||||
sta xi
|
||||
lda xi+1
|
||||
adc yd+1
|
||||
sta xi+1
|
||||
lda yi
|
||||
sec
|
||||
sbc xd
|
||||
sta yi
|
||||
lda yi+1
|
||||
sbc xd+1
|
||||
sta yi+1
|
||||
txa
|
||||
asl
|
||||
tay
|
||||
clc
|
||||
adc #1
|
||||
clc
|
||||
adc sqr
|
||||
sta sqr
|
||||
bcc !+
|
||||
inc sqr+1
|
||||
!:
|
||||
inx
|
||||
cpx #NUM_SQUARES-1+1
|
||||
bne b1
|
||||
rts
|
||||
lda angle
|
||||
adc CORDIC_ATAN2_ANGLES_16,y
|
||||
sta angle
|
||||
lda angle+1
|
||||
adc CORDIC_ATAN2_ANGLES_16+1,y
|
||||
sta angle+1
|
||||
jmp b19
|
||||
b14:
|
||||
lda xd+1
|
||||
cmp #$80
|
||||
ror xd+1
|
||||
ror xd
|
||||
lda xd+1
|
||||
cmp #$80
|
||||
ror xd+1
|
||||
ror xd
|
||||
lda yd+1
|
||||
cmp #$80
|
||||
ror yd+1
|
||||
ror yd
|
||||
lda yd+1
|
||||
cmp #$80
|
||||
ror yd+1
|
||||
ror yd
|
||||
dey
|
||||
dey
|
||||
jmp b13
|
||||
b4:
|
||||
lda x
|
||||
sta xi
|
||||
lda x+1
|
||||
sta xi+1
|
||||
jmp b6
|
||||
b1:
|
||||
lda y
|
||||
sta yi
|
||||
lda y+1
|
||||
sta yi+1
|
||||
jmp b3
|
||||
}
|
||||
// Allocates a block of size bytes of memory, returning a pointer to the beginning of the block.
|
||||
// The content of the newly allocated block of memory is not initialized, remaining with indeterminate values.
|
||||
// malloc(word zeropage($25) size)
|
||||
malloc: {
|
||||
.label mem = $49
|
||||
.label size = $25
|
||||
.label mem = $2d
|
||||
lda heap_head
|
||||
sta mem
|
||||
lda heap_head+1
|
||||
sta mem+1
|
||||
lda heap_head
|
||||
clc
|
||||
adc size
|
||||
lda heap_head
|
||||
adc #<$3e8
|
||||
sta heap_head
|
||||
lda heap_head+1
|
||||
adc size+1
|
||||
adc #>$3e8
|
||||
sta heap_head+1
|
||||
rts
|
||||
}
|
||||
@ -978,14 +981,14 @@ irqBottom: {
|
||||
}
|
||||
// Process any chars in the PROCESSING array
|
||||
processChars: {
|
||||
.label _15 = $50
|
||||
.label _25 = $4e
|
||||
.label processing = $4b
|
||||
.label bitmask = $4d
|
||||
.label i = $27
|
||||
.label xpos = $4e
|
||||
.label ypos = $52
|
||||
.label numActive = $28
|
||||
.label _15 = $4d
|
||||
.label _25 = $4b
|
||||
.label processing = $48
|
||||
.label bitmask = $4a
|
||||
.label i = $29
|
||||
.label xpos = $4b
|
||||
.label ypos = $4f
|
||||
.label numActive = $2a
|
||||
lda #0
|
||||
sta numActive
|
||||
sta i
|
||||
@ -1278,6 +1281,11 @@ irqTop: {
|
||||
ldy #00
|
||||
rti
|
||||
}
|
||||
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
|
||||
CORDIC_ATAN2_ANGLES_16:
|
||||
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
|
||||
.word 256*2*256*atan(1/pow(2,i))/PI/2
|
||||
|
||||
// Values added to VX
|
||||
VXSIN:
|
||||
.for(var i=0; i<40; i++) {
|
||||
|
@ -19,8 +19,8 @@
|
||||
@end: scope:[] from @2
|
||||
[8] phi()
|
||||
main: scope:[main] from @2
|
||||
[9] (byte*) init_dist_screen::screen#0 ← (byte*)(void*) SCREEN_DIST#0
|
||||
[10] call init_dist_screen
|
||||
[9] (byte*) init_angle_screen::screen#0 ← (byte*)(void*) SCREEN_DIST#0
|
||||
[10] call init_angle_screen
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main
|
||||
[11] (byte*) main::dst#0 ← (byte*)(void*) SCREEN_COPY#0
|
||||
@ -281,284 +281,264 @@ initSprites::@3: scope:[initSprites] from initSprites::@2
|
||||
initSprites::@return: scope:[initSprites] from initSprites::@3
|
||||
[168] return
|
||||
to:@return
|
||||
init_dist_screen: scope:[init_dist_screen] from main
|
||||
[169] phi()
|
||||
[170] call init_squares
|
||||
to:init_dist_screen::@10
|
||||
init_dist_screen::@10: scope:[init_dist_screen] from init_dist_screen
|
||||
[171] (byte*) init_dist_screen::screen_bottomline#0 ← (byte*) init_dist_screen::screen#0 + (word)(number) $28*(number) $18
|
||||
to:init_dist_screen::@1
|
||||
init_dist_screen::@1: scope:[init_dist_screen] from init_dist_screen::@10 init_dist_screen::@9
|
||||
[172] (byte*) init_dist_screen::screen_bottomline#10 ← phi( init_dist_screen::@9/(byte*) init_dist_screen::screen_bottomline#1 init_dist_screen::@10/(byte*) init_dist_screen::screen_bottomline#0 )
|
||||
[172] (byte*) init_dist_screen::screen_topline#10 ← phi( init_dist_screen::@9/(byte*) init_dist_screen::screen_topline#1 init_dist_screen::@10/(byte*) init_dist_screen::screen#0 )
|
||||
[172] (byte) init_dist_screen::y#10 ← phi( init_dist_screen::@9/(byte) init_dist_screen::y#1 init_dist_screen::@10/(byte) 0 )
|
||||
[173] (byte) init_dist_screen::y2#0 ← (byte) init_dist_screen::y#10 << (byte) 1
|
||||
[174] if((byte) init_dist_screen::y2#0>=(byte) $18) goto init_dist_screen::@2
|
||||
to:init_dist_screen::@3
|
||||
init_dist_screen::@3: scope:[init_dist_screen] from init_dist_screen::@1
|
||||
[175] (byte~) init_dist_screen::$5 ← (byte) $18 - (byte) init_dist_screen::y2#0
|
||||
to:init_dist_screen::@4
|
||||
init_dist_screen::@4: scope:[init_dist_screen] from init_dist_screen::@2 init_dist_screen::@3
|
||||
[176] (byte) init_dist_screen::yd#0 ← phi( init_dist_screen::@2/(byte~) init_dist_screen::$7 init_dist_screen::@3/(byte~) init_dist_screen::$5 )
|
||||
[177] (byte) sqr::val#0 ← (byte) init_dist_screen::yd#0
|
||||
[178] call sqr
|
||||
[179] (word) sqr::return#2 ← (word) sqr::return#0
|
||||
to:init_dist_screen::@11
|
||||
init_dist_screen::@11: scope:[init_dist_screen] from init_dist_screen::@4
|
||||
[180] (word) init_dist_screen::yds#0 ← (word) sqr::return#2
|
||||
to:init_dist_screen::@5
|
||||
init_dist_screen::@5: scope:[init_dist_screen] from init_dist_screen::@11 init_dist_screen::@13
|
||||
[181] (byte) init_dist_screen::xb#2 ← phi( init_dist_screen::@11/(byte) $27 init_dist_screen::@13/(byte) init_dist_screen::xb#1 )
|
||||
[181] (byte) init_dist_screen::x#2 ← phi( init_dist_screen::@11/(byte) 0 init_dist_screen::@13/(byte) init_dist_screen::x#1 )
|
||||
[182] (byte) init_dist_screen::x2#0 ← (byte) init_dist_screen::x#2 << (byte) 1
|
||||
[183] if((byte) init_dist_screen::x2#0>=(byte) $27) goto init_dist_screen::@6
|
||||
to:init_dist_screen::@7
|
||||
init_dist_screen::@7: scope:[init_dist_screen] from init_dist_screen::@5
|
||||
[184] (byte~) init_dist_screen::$13 ← (byte) $27 - (byte) init_dist_screen::x2#0
|
||||
to:init_dist_screen::@8
|
||||
init_dist_screen::@8: scope:[init_dist_screen] from init_dist_screen::@6 init_dist_screen::@7
|
||||
[185] (byte) init_dist_screen::xd#0 ← phi( init_dist_screen::@6/(byte~) init_dist_screen::$15 init_dist_screen::@7/(byte~) init_dist_screen::$13 )
|
||||
[186] (byte) sqr::val#1 ← (byte) init_dist_screen::xd#0
|
||||
[187] call sqr
|
||||
[188] (word) sqr::return#3 ← (word) sqr::return#0
|
||||
to:init_dist_screen::@12
|
||||
init_dist_screen::@12: scope:[init_dist_screen] from init_dist_screen::@8
|
||||
[189] (word) init_dist_screen::xds#0 ← (word) sqr::return#3
|
||||
[190] (word) init_dist_screen::ds#0 ← (word) init_dist_screen::xds#0 + (word) init_dist_screen::yds#0
|
||||
[191] (word) sqrt::val#0 ← (word) init_dist_screen::ds#0
|
||||
[192] call sqrt
|
||||
[193] (byte) sqrt::return#2 ← (byte) sqrt::return#0
|
||||
to:init_dist_screen::@13
|
||||
init_dist_screen::@13: scope:[init_dist_screen] from init_dist_screen::@12
|
||||
[194] (byte) init_dist_screen::d#0 ← (byte) sqrt::return#2
|
||||
[195] *((byte*) init_dist_screen::screen_topline#10 + (byte) init_dist_screen::x#2) ← (byte) init_dist_screen::d#0
|
||||
[196] *((byte*) init_dist_screen::screen_bottomline#10 + (byte) init_dist_screen::x#2) ← (byte) init_dist_screen::d#0
|
||||
[197] *((byte*) init_dist_screen::screen_topline#10 + (byte) init_dist_screen::xb#2) ← (byte) init_dist_screen::d#0
|
||||
[198] *((byte*) init_dist_screen::screen_bottomline#10 + (byte) init_dist_screen::xb#2) ← (byte) init_dist_screen::d#0
|
||||
[199] (byte) init_dist_screen::x#1 ← ++ (byte) init_dist_screen::x#2
|
||||
[200] (byte) init_dist_screen::xb#1 ← -- (byte) init_dist_screen::xb#2
|
||||
[201] if((byte) init_dist_screen::x#1<(byte) $13+(byte) 1) goto init_dist_screen::@5
|
||||
to:init_dist_screen::@9
|
||||
init_dist_screen::@9: scope:[init_dist_screen] from init_dist_screen::@13
|
||||
[202] (byte*) init_dist_screen::screen_topline#1 ← (byte*) init_dist_screen::screen_topline#10 + (byte) $28
|
||||
[203] (byte*) init_dist_screen::screen_bottomline#1 ← (byte*) init_dist_screen::screen_bottomline#10 - (byte) $28
|
||||
[204] (byte) init_dist_screen::y#1 ← ++ (byte) init_dist_screen::y#10
|
||||
[205] if((byte) init_dist_screen::y#1!=(byte) $d) goto init_dist_screen::@1
|
||||
to:init_dist_screen::@return
|
||||
init_dist_screen::@return: scope:[init_dist_screen] from init_dist_screen::@9
|
||||
[206] return
|
||||
init_angle_screen: scope:[init_angle_screen] from main
|
||||
[169] (byte*) init_angle_screen::screen_topline#0 ← (byte*) init_angle_screen::screen#0 + (word)(number) $28*(number) $c
|
||||
[170] (byte*) init_angle_screen::screen_bottomline#0 ← (byte*) init_angle_screen::screen#0 + (word)(number) $28*(number) $c
|
||||
to:init_angle_screen::@1
|
||||
init_angle_screen::@1: scope:[init_angle_screen] from init_angle_screen init_angle_screen::@3
|
||||
[171] (byte*) init_angle_screen::screen_topline#5 ← phi( init_angle_screen/(byte*) init_angle_screen::screen_topline#0 init_angle_screen::@3/(byte*) init_angle_screen::screen_topline#1 )
|
||||
[171] (byte*) init_angle_screen::screen_bottomline#5 ← phi( init_angle_screen/(byte*) init_angle_screen::screen_bottomline#0 init_angle_screen::@3/(byte*) init_angle_screen::screen_bottomline#1 )
|
||||
[171] (byte) init_angle_screen::y#4 ← phi( init_angle_screen/(byte) 0 init_angle_screen::@3/(byte) init_angle_screen::y#1 )
|
||||
to:init_angle_screen::@2
|
||||
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@4
|
||||
[172] (byte) init_angle_screen::xb#2 ← phi( init_angle_screen::@1/(byte) $27 init_angle_screen::@4/(byte) init_angle_screen::xb#1 )
|
||||
[172] (byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(byte) 0 init_angle_screen::@4/(byte) init_angle_screen::x#1 )
|
||||
[173] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1
|
||||
[174] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2
|
||||
[175] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0
|
||||
[176] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1
|
||||
[177] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0
|
||||
[178] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
|
||||
[179] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
|
||||
[180] call atan2_16
|
||||
[181] (word) atan2_16::return#2 ← (word) atan2_16::return#0
|
||||
to:init_angle_screen::@4
|
||||
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
|
||||
[182] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
|
||||
[183] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80
|
||||
[184] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10
|
||||
[185] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0
|
||||
[186] (byte~) init_angle_screen::$12 ← - (byte) init_angle_screen::ang_w#0
|
||||
[187] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$12
|
||||
[188] (byte~) init_angle_screen::$13 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
|
||||
[189] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13
|
||||
[190] (byte~) init_angle_screen::$14 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
|
||||
[191] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$14
|
||||
[192] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2
|
||||
[193] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2
|
||||
[194] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@2
|
||||
to:init_angle_screen::@3
|
||||
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@4
|
||||
[195] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28
|
||||
[196] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28
|
||||
[197] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#4
|
||||
[198] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
|
||||
to:init_angle_screen::@return
|
||||
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@3
|
||||
[199] return
|
||||
to:@return
|
||||
init_dist_screen::@6: scope:[init_dist_screen] from init_dist_screen::@5
|
||||
[207] (byte~) init_dist_screen::$15 ← (byte) init_dist_screen::x2#0 - (byte) $27
|
||||
to:init_dist_screen::@8
|
||||
init_dist_screen::@2: scope:[init_dist_screen] from init_dist_screen::@1
|
||||
[208] (byte~) init_dist_screen::$7 ← (byte) init_dist_screen::y2#0 - (byte) $18
|
||||
to:init_dist_screen::@4
|
||||
sqrt: scope:[sqrt] from init_dist_screen::@12
|
||||
[209] (word) bsearch16u::key#0 ← (word) sqrt::val#0
|
||||
[210] (word*) bsearch16u::items#1 ← (word*)(void*) SQUARES#1
|
||||
[211] call bsearch16u
|
||||
[212] (word*) bsearch16u::return#3 ← (word*) bsearch16u::return#1
|
||||
to:sqrt::@1
|
||||
sqrt::@1: scope:[sqrt] from sqrt
|
||||
[213] (word*) sqrt::found#0 ← (word*) bsearch16u::return#3
|
||||
[214] (word~) sqrt::$3 ← (word*) sqrt::found#0 - (word*)(void*) SQUARES#1
|
||||
[215] (word~) sqrt::$1 ← (word~) sqrt::$3 >> (byte) 1
|
||||
[216] (byte) sqrt::return#0 ← (byte)(word~) sqrt::$1
|
||||
to:sqrt::@return
|
||||
sqrt::@return: scope:[sqrt] from sqrt::@1
|
||||
[217] return
|
||||
atan2_16: scope:[atan2_16] from init_angle_screen::@2
|
||||
[200] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1
|
||||
to:atan2_16::@2
|
||||
atan2_16::@2: scope:[atan2_16] from atan2_16
|
||||
[201] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
|
||||
to:atan2_16::@3
|
||||
atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2
|
||||
[202] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#16 atan2_16::@2/(signed word~) atan2_16::$2 )
|
||||
[203] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4
|
||||
to:atan2_16::@5
|
||||
atan2_16::@5: scope:[atan2_16] from atan2_16::@3
|
||||
[204] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
|
||||
to:atan2_16::@6
|
||||
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
|
||||
[205] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#13 atan2_16::@5/(signed word~) atan2_16::$7 )
|
||||
to:atan2_16::@10
|
||||
atan2_16::@10: scope:[atan2_16] from atan2_16::@19 atan2_16::@6
|
||||
[206] (word) atan2_16::angle#12 ← phi( atan2_16::@19/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
|
||||
[206] (byte) atan2_16::i#2 ← phi( atan2_16::@19/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
|
||||
[206] (signed word) atan2_16::xi#3 ← phi( atan2_16::@19/(signed word) atan2_16::xi#8 atan2_16::@6/(signed word) atan2_16::xi#0 )
|
||||
[206] (signed word) atan2_16::yi#3 ← phi( atan2_16::@19/(signed word) atan2_16::yi#8 atan2_16::@6/(signed word) atan2_16::yi#0 )
|
||||
[207] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
|
||||
to:atan2_16::@12
|
||||
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@19
|
||||
[208] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@19/(word) atan2_16::angle#13 )
|
||||
[209] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
|
||||
[210] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
|
||||
to:atan2_16::@21
|
||||
atan2_16::@21: scope:[atan2_16] from atan2_16::@12
|
||||
[211] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
|
||||
to:atan2_16::@7
|
||||
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@21
|
||||
[212] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@21/(word) atan2_16::angle#4 )
|
||||
[213] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
|
||||
to:atan2_16::@9
|
||||
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
|
||||
[214] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
|
||||
to:atan2_16::@8
|
||||
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
|
||||
[215] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
|
||||
to:atan2_16::@return
|
||||
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
|
||||
[216] return
|
||||
to:@return
|
||||
bsearch16u: scope:[bsearch16u] from sqrt
|
||||
[218] phi()
|
||||
to:bsearch16u::@3
|
||||
bsearch16u::@3: scope:[bsearch16u] from bsearch16u bsearch16u::@7
|
||||
[219] (word*) bsearch16u::items#2 ← phi( bsearch16u/(word*) bsearch16u::items#1 bsearch16u::@7/(word*) bsearch16u::items#8 )
|
||||
[219] (byte) bsearch16u::num#3 ← phi( bsearch16u/(const byte) NUM_SQUARES#3 bsearch16u::@7/(byte) bsearch16u::num#0 )
|
||||
[220] if((byte) bsearch16u::num#3>(byte) 0) goto bsearch16u::@4
|
||||
to:bsearch16u::@5
|
||||
bsearch16u::@5: scope:[bsearch16u] from bsearch16u::@3
|
||||
[221] if(*((word*) bsearch16u::items#2)<=(word) bsearch16u::key#0) goto bsearch16u::@2
|
||||
to:bsearch16u::@1
|
||||
bsearch16u::@1: scope:[bsearch16u] from bsearch16u::@5
|
||||
[222] (word*~) bsearch16u::$2 ← (word*) bsearch16u::items#2 - (byte) 1*(const byte) SIZEOF_WORD
|
||||
to:bsearch16u::@2
|
||||
bsearch16u::@2: scope:[bsearch16u] from bsearch16u::@1 bsearch16u::@5
|
||||
[223] (word*) bsearch16u::return#2 ← phi( bsearch16u::@5/(word*) bsearch16u::items#2 bsearch16u::@1/(word*~) bsearch16u::$2 )
|
||||
to:bsearch16u::@return
|
||||
bsearch16u::@return: scope:[bsearch16u] from bsearch16u::@2 bsearch16u::@8
|
||||
[224] (word*) bsearch16u::return#1 ← phi( bsearch16u::@8/(word*~) bsearch16u::return#6 bsearch16u::@2/(word*) bsearch16u::return#2 )
|
||||
[225] return
|
||||
to:@return
|
||||
bsearch16u::@4: scope:[bsearch16u] from bsearch16u::@3
|
||||
[226] (byte~) bsearch16u::$6 ← (byte) bsearch16u::num#3 >> (byte) 1
|
||||
[227] (byte~) bsearch16u::$16 ← (byte~) bsearch16u::$6 << (byte) 1
|
||||
[228] (word*) bsearch16u::pivot#0 ← (word*) bsearch16u::items#2 + (byte~) bsearch16u::$16
|
||||
[229] (signed word) bsearch16u::result#0 ← (signed word)(word) bsearch16u::key#0 - (signed word)*((word*) bsearch16u::pivot#0)
|
||||
[230] if((signed word) bsearch16u::result#0!=(signed byte) 0) goto bsearch16u::@6
|
||||
to:bsearch16u::@8
|
||||
bsearch16u::@8: scope:[bsearch16u] from bsearch16u::@4
|
||||
[231] (word*~) bsearch16u::return#6 ← (word*) bsearch16u::pivot#0
|
||||
to:bsearch16u::@return
|
||||
bsearch16u::@6: scope:[bsearch16u] from bsearch16u::@4
|
||||
[232] if((signed word) bsearch16u::result#0<=(signed byte) 0) goto bsearch16u::@7
|
||||
to:bsearch16u::@9
|
||||
bsearch16u::@9: scope:[bsearch16u] from bsearch16u::@6
|
||||
[233] (word*) bsearch16u::items#0 ← (word*) bsearch16u::pivot#0 + (byte) 1*(const byte) SIZEOF_WORD
|
||||
[234] (byte) bsearch16u::num#1 ← -- (byte) bsearch16u::num#3
|
||||
to:bsearch16u::@7
|
||||
bsearch16u::@7: scope:[bsearch16u] from bsearch16u::@6 bsearch16u::@9
|
||||
[235] (word*) bsearch16u::items#8 ← phi( bsearch16u::@9/(word*) bsearch16u::items#0 bsearch16u::@6/(word*) bsearch16u::items#2 )
|
||||
[235] (byte) bsearch16u::num#5 ← phi( bsearch16u::@9/(byte) bsearch16u::num#1 bsearch16u::@6/(byte) bsearch16u::num#3 )
|
||||
[236] (byte) bsearch16u::num#0 ← (byte) bsearch16u::num#5 >> (byte) 1
|
||||
to:bsearch16u::@3
|
||||
sqr: scope:[sqr] from init_dist_screen::@4 init_dist_screen::@8
|
||||
[237] (byte) sqr::val#2 ← phi( init_dist_screen::@4/(byte) sqr::val#0 init_dist_screen::@8/(byte) sqr::val#1 )
|
||||
[238] (byte~) sqr::$0 ← (byte) sqr::val#2 << (byte) 1
|
||||
[239] (word) sqr::return#0 ← *((word*)(void*) SQUARES#1 + (byte~) sqr::$0)
|
||||
to:sqr::@return
|
||||
sqr::@return: scope:[sqr] from sqr
|
||||
[240] return
|
||||
to:@return
|
||||
init_squares: scope:[init_squares] from init_dist_screen
|
||||
[241] phi()
|
||||
[242] call malloc
|
||||
to:init_squares::@2
|
||||
init_squares::@2: scope:[init_squares] from init_squares
|
||||
[243] (void*) SQUARES#1 ← (void*)(byte*) malloc::mem#0
|
||||
[244] (word*) init_squares::squares#0 ← (word*)(void*) SQUARES#1
|
||||
to:init_squares::@1
|
||||
init_squares::@1: scope:[init_squares] from init_squares::@1 init_squares::@2
|
||||
[245] (byte) init_squares::i#2 ← phi( init_squares::@1/(byte) init_squares::i#1 init_squares::@2/(byte) 0 )
|
||||
[245] (word*) init_squares::squares#2 ← phi( init_squares::@1/(word*) init_squares::squares#1 init_squares::@2/(word*) init_squares::squares#0 )
|
||||
[245] (word) init_squares::sqr#2 ← phi( init_squares::@1/(word) init_squares::sqr#1 init_squares::@2/(byte) 0 )
|
||||
[246] *((word*) init_squares::squares#2) ← (word) init_squares::sqr#2
|
||||
[247] (word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD
|
||||
[248] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1
|
||||
[249] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1
|
||||
[250] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4
|
||||
[251] (byte) init_squares::i#1 ← ++ (byte) init_squares::i#2
|
||||
[252] if((byte) init_squares::i#1!=(const byte) NUM_SQUARES#3-(byte) 1+(byte) 1) goto init_squares::@1
|
||||
to:init_squares::@return
|
||||
init_squares::@return: scope:[init_squares] from init_squares::@1
|
||||
[253] return
|
||||
to:@return
|
||||
malloc: scope:[malloc] from @1 @3 init_squares
|
||||
[254] (word) malloc::size#3 ← phi( @1/(word) $3e8 @3/(word) $3e8 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD )
|
||||
[254] (byte*) heap_head#12 ← phi( @1/(const byte*) HEAP_START#0 @3/(byte*) heap_head#1 init_squares/(byte*) heap_head#1 )
|
||||
[255] (byte*) malloc::mem#0 ← (byte*) heap_head#12
|
||||
[256] (byte*) heap_head#1 ← (byte*) heap_head#12 + (word) malloc::size#3
|
||||
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
|
||||
[217] (byte~) atan2_16::shift#5 ← (byte) atan2_16::i#2
|
||||
[218] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3
|
||||
[219] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3
|
||||
to:atan2_16::@13
|
||||
atan2_16::@13: scope:[atan2_16] from atan2_16::@11 atan2_16::@14
|
||||
[220] (signed word) atan2_16::yd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::yd#10 atan2_16::@14/(signed word) atan2_16::yd#1 )
|
||||
[220] (signed word) atan2_16::xd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::xd#10 atan2_16::@14/(signed word) atan2_16::xd#1 )
|
||||
[220] (byte) atan2_16::shift#2 ← phi( atan2_16::@11/(byte~) atan2_16::shift#5 atan2_16::@14/(byte) atan2_16::shift#1 )
|
||||
[221] if((byte) atan2_16::shift#2>=(byte) 2) goto atan2_16::@14
|
||||
to:atan2_16::@15
|
||||
atan2_16::@15: scope:[atan2_16] from atan2_16::@13
|
||||
[222] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@17
|
||||
to:atan2_16::@16
|
||||
atan2_16::@16: scope:[atan2_16] from atan2_16::@15
|
||||
[223] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1
|
||||
[224] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1
|
||||
to:atan2_16::@17
|
||||
atan2_16::@17: scope:[atan2_16] from atan2_16::@15 atan2_16::@16
|
||||
[225] (signed word) atan2_16::xd#5 ← phi( atan2_16::@15/(signed word) atan2_16::xd#3 atan2_16::@16/(signed word) atan2_16::xd#2 )
|
||||
[225] (signed word) atan2_16::yd#5 ← phi( atan2_16::@15/(signed word) atan2_16::yd#3 atan2_16::@16/(signed word) atan2_16::yd#2 )
|
||||
[226] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18
|
||||
to:atan2_16::@20
|
||||
atan2_16::@20: scope:[atan2_16] from atan2_16::@17
|
||||
[227] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5
|
||||
[228] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5
|
||||
[229] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
|
||||
[230] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
|
||||
to:atan2_16::@19
|
||||
atan2_16::@19: scope:[atan2_16] from atan2_16::@18 atan2_16::@20
|
||||
[231] (signed word) atan2_16::xi#8 ← phi( atan2_16::@18/(signed word) atan2_16::xi#1 atan2_16::@20/(signed word) atan2_16::xi#2 )
|
||||
[231] (word) atan2_16::angle#13 ← phi( atan2_16::@18/(word) atan2_16::angle#2 atan2_16::@20/(word) atan2_16::angle#3 )
|
||||
[231] (signed word) atan2_16::yi#8 ← phi( atan2_16::@18/(signed word) atan2_16::yi#1 atan2_16::@20/(signed word) atan2_16::yi#2 )
|
||||
[232] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
|
||||
[233] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
|
||||
to:atan2_16::@10
|
||||
atan2_16::@18: scope:[atan2_16] from atan2_16::@17
|
||||
[234] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5
|
||||
[235] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5
|
||||
[236] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
|
||||
[237] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
|
||||
to:atan2_16::@19
|
||||
atan2_16::@14: scope:[atan2_16] from atan2_16::@13
|
||||
[238] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2
|
||||
[239] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2
|
||||
[240] (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#2 - (byte) 2
|
||||
to:atan2_16::@13
|
||||
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
|
||||
[241] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0
|
||||
to:atan2_16::@6
|
||||
atan2_16::@1: scope:[atan2_16] from atan2_16
|
||||
[242] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0
|
||||
to:atan2_16::@3
|
||||
malloc: scope:[malloc] from @1 @3
|
||||
[243] (byte*) heap_head#5 ← phi( @1/(const byte*) HEAP_START#0 @3/(byte*) heap_head#1 )
|
||||
[244] (byte*) malloc::mem#0 ← (byte*) heap_head#5
|
||||
[245] (byte*) heap_head#1 ← (byte*) heap_head#5 + (word) $3e8
|
||||
to:malloc::@return
|
||||
malloc::@return: scope:[malloc] from malloc
|
||||
[257] return
|
||||
[246] return
|
||||
to:@return
|
||||
irqBottom: scope:[irqBottom] from
|
||||
[258] phi()
|
||||
[247] phi()
|
||||
to:irqBottom::@1
|
||||
irqBottom::@1: scope:[irqBottom] from irqBottom
|
||||
[259] phi()
|
||||
[260] call processChars
|
||||
[248] phi()
|
||||
[249] call processChars
|
||||
to:irqBottom::@2
|
||||
irqBottom::@2: scope:[irqBottom] from irqBottom::@1
|
||||
[261] *((const byte*) RASTER#0) ← (const byte) RASTER_IRQ_TOP#0
|
||||
[262] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
[263] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
[250] *((const byte*) RASTER#0) ← (const byte) RASTER_IRQ_TOP#0
|
||||
[251] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
[252] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
to:irqBottom::@return
|
||||
irqBottom::@return: scope:[irqBottom] from irqBottom::@2
|
||||
[264] return
|
||||
[253] return
|
||||
to:@return
|
||||
processChars: scope:[processChars] from irqBottom::@1
|
||||
[265] phi()
|
||||
[254] phi()
|
||||
to:processChars::@1
|
||||
processChars::@1: scope:[processChars] from processChars processChars::@2
|
||||
[266] (byte) processChars::numActive#10 ← phi( processChars/(byte) 0 processChars::@2/(byte) processChars::numActive#3 )
|
||||
[266] (byte) processChars::i#10 ← phi( processChars/(byte) 0 processChars::@2/(byte) processChars::i#1 )
|
||||
[267] (byte) processChars::$67 ← (byte) processChars::i#10 << (byte) 1
|
||||
[268] (byte) processChars::$68 ← (byte) processChars::$67 + (byte) processChars::i#10
|
||||
[269] (byte) processChars::$69 ← (byte) processChars::$68 << (byte) 1
|
||||
[270] (byte) processChars::$70 ← (byte) processChars::$69 + (byte) processChars::i#10
|
||||
[271] (byte~) processChars::$37 ← (byte) processChars::$70 << (byte) 1
|
||||
[272] (struct ProcessingSprite*) processChars::processing#0 ← (const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0 + (byte~) processChars::$37
|
||||
[273] (byte) processChars::bitmask#0 ← (byte) 1 << *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID)
|
||||
[274] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)==(const byte) STATUS_FREE) goto processChars::@2
|
||||
[255] (byte) processChars::numActive#10 ← phi( processChars/(byte) 0 processChars::@2/(byte) processChars::numActive#3 )
|
||||
[255] (byte) processChars::i#10 ← phi( processChars/(byte) 0 processChars::@2/(byte) processChars::i#1 )
|
||||
[256] (byte) processChars::$67 ← (byte) processChars::i#10 << (byte) 1
|
||||
[257] (byte) processChars::$68 ← (byte) processChars::$67 + (byte) processChars::i#10
|
||||
[258] (byte) processChars::$69 ← (byte) processChars::$68 << (byte) 1
|
||||
[259] (byte) processChars::$70 ← (byte) processChars::$69 + (byte) processChars::i#10
|
||||
[260] (byte~) processChars::$37 ← (byte) processChars::$70 << (byte) 1
|
||||
[261] (struct ProcessingSprite*) processChars::processing#0 ← (const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0 + (byte~) processChars::$37
|
||||
[262] (byte) processChars::bitmask#0 ← (byte) 1 << *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID)
|
||||
[263] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)==(const byte) STATUS_FREE) goto processChars::@2
|
||||
to:processChars::@10
|
||||
processChars::@10: scope:[processChars] from processChars::@1
|
||||
[275] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)!=(const byte) STATUS_NEW) goto processChars::@3
|
||||
[264] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)!=(const byte) STATUS_NEW) goto processChars::@3
|
||||
to:processChars::@11
|
||||
processChars::@11: scope:[processChars] from processChars::@10
|
||||
[276] *(*((byte**)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR)) ← (byte) ' '
|
||||
[277] *((const byte*) SPRITES_ENABLE#0) ← *((const byte*) SPRITES_ENABLE#0) | (byte) processChars::bitmask#0
|
||||
[278] *((const byte*) SPRITES_COLS#0 + *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID)) ← *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL)
|
||||
[279] *((const byte*) SCREEN#0+(const word) SPRITE_PTRS#0 + *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID)) ← *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR)
|
||||
[280] *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS) ← (const byte) STATUS_PROCESSING
|
||||
[265] *(*((byte**)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR)) ← (byte) ' '
|
||||
[266] *((const byte*) SPRITES_ENABLE#0) ← *((const byte*) SPRITES_ENABLE#0) | (byte) processChars::bitmask#0
|
||||
[267] *((const byte*) SPRITES_COLS#0 + *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID)) ← *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL)
|
||||
[268] *((const byte*) SCREEN#0+(const word) SPRITE_PTRS#0 + *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID)) ← *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR)
|
||||
[269] *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS) ← (const byte) STATUS_PROCESSING
|
||||
to:processChars::@3
|
||||
processChars::@3: scope:[processChars] from processChars::@10 processChars::@11
|
||||
[281] (word) processChars::xpos#0 ← *((word*)(struct ProcessingSprite*) processChars::processing#0) >> (byte) 4
|
||||
[282] (byte~) processChars::$11 ← > (word) processChars::xpos#0
|
||||
[283] if((byte) 0!=(byte~) processChars::$11) goto processChars::@4
|
||||
[270] (word) processChars::xpos#0 ← *((word*)(struct ProcessingSprite*) processChars::processing#0) >> (byte) 4
|
||||
[271] (byte~) processChars::$11 ← > (word) processChars::xpos#0
|
||||
[272] if((byte) 0!=(byte~) processChars::$11) goto processChars::@4
|
||||
to:processChars::@8
|
||||
processChars::@8: scope:[processChars] from processChars::@3
|
||||
[284] (byte~) processChars::$12 ← (byte) $ff ^ (byte) processChars::bitmask#0
|
||||
[285] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) processChars::$12
|
||||
[273] (byte~) processChars::$12 ← (byte) $ff ^ (byte) processChars::bitmask#0
|
||||
[274] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte~) processChars::$12
|
||||
to:processChars::@5
|
||||
processChars::@5: scope:[processChars] from processChars::@4 processChars::@8
|
||||
[286] (byte~) processChars::$17 ← (byte) processChars::i#10 << (byte) 1
|
||||
[287] (byte~) processChars::$14 ← (byte)(word) processChars::xpos#0
|
||||
[288] *((const byte*) SPRITES_XPOS#0 + (byte~) processChars::$17) ← (byte~) processChars::$14
|
||||
[289] (word~) processChars::$15 ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) >> (byte) 4
|
||||
[290] (byte) processChars::ypos#0 ← (byte)(word~) processChars::$15
|
||||
[291] *((const byte*) SPRITES_YPOS#0 + (byte~) processChars::$17) ← (byte) processChars::ypos#0
|
||||
[292] if(*((word*)(struct ProcessingSprite*) processChars::processing#0)<(const word) XPOS_LEFTMOST#0) goto processChars::@6
|
||||
[275] (byte~) processChars::$17 ← (byte) processChars::i#10 << (byte) 1
|
||||
[276] (byte~) processChars::$14 ← (byte)(word) processChars::xpos#0
|
||||
[277] *((const byte*) SPRITES_XPOS#0 + (byte~) processChars::$17) ← (byte~) processChars::$14
|
||||
[278] (word~) processChars::$15 ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) >> (byte) 4
|
||||
[279] (byte) processChars::ypos#0 ← (byte)(word~) processChars::$15
|
||||
[280] *((const byte*) SPRITES_YPOS#0 + (byte~) processChars::$17) ← (byte) processChars::ypos#0
|
||||
[281] if(*((word*)(struct ProcessingSprite*) processChars::processing#0)<(const word) XPOS_LEFTMOST#0) goto processChars::@6
|
||||
to:processChars::@14
|
||||
processChars::@14: scope:[processChars] from processChars::@5
|
||||
[293] if(*((word*)(struct ProcessingSprite*) processChars::processing#0)>(const word) XPOS_RIGHTMOST#0) goto processChars::@6
|
||||
[282] if(*((word*)(struct ProcessingSprite*) processChars::processing#0)>(const word) XPOS_RIGHTMOST#0) goto processChars::@6
|
||||
to:processChars::@13
|
||||
processChars::@13: scope:[processChars] from processChars::@14
|
||||
[294] if(*((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y)<(const word) YPOS_TOPMOST#0) goto processChars::@6
|
||||
[283] if(*((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y)<(const word) YPOS_TOPMOST#0) goto processChars::@6
|
||||
to:processChars::@12
|
||||
processChars::@12: scope:[processChars] from processChars::@13
|
||||
[295] if(*((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y)>(const word) YPOS_BOTTOMMOST#0) goto processChars::@6
|
||||
[284] if(*((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y)>(const word) YPOS_BOTTOMMOST#0) goto processChars::@6
|
||||
to:processChars::@9
|
||||
processChars::@9: scope:[processChars] from processChars::@12
|
||||
[296] (word~) processChars::$25 ← (word) processChars::xpos#0 >> (byte) 3
|
||||
[297] (byte~) processChars::$26 ← (byte)(word~) processChars::$25
|
||||
[298] (byte) processChars::xchar#0 ← (byte~) processChars::$26 - (const byte) BORDER_XPOS_LEFT#0/(byte) 8
|
||||
[299] (byte~) processChars::$38 ← (byte) processChars::xchar#0 << (byte) 1
|
||||
[300] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX) ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX) + *((const word[$28]) VXSIN#0 + (byte~) processChars::$38)
|
||||
[301] *((word*)(struct ProcessingSprite*) processChars::processing#0) ← *((word*)(struct ProcessingSprite*) processChars::processing#0) + *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX)
|
||||
[302] (byte~) processChars::$30 ← (byte) processChars::ypos#0 >> (byte) 3
|
||||
[303] (byte) processChars::ychar#0 ← (byte~) processChars::$30 - (const byte) BORDER_YPOS_TOP#0/(byte) 8
|
||||
[304] (byte~) processChars::$39 ← (byte) processChars::ychar#0 << (byte) 1
|
||||
[305] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY) ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY) + *((const word[$19]) VYSIN#0 + (byte~) processChars::$39)
|
||||
[306] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) + *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY)
|
||||
[285] (word~) processChars::$25 ← (word) processChars::xpos#0 >> (byte) 3
|
||||
[286] (byte~) processChars::$26 ← (byte)(word~) processChars::$25
|
||||
[287] (byte) processChars::xchar#0 ← (byte~) processChars::$26 - (const byte) BORDER_XPOS_LEFT#0/(byte) 8
|
||||
[288] (byte~) processChars::$38 ← (byte) processChars::xchar#0 << (byte) 1
|
||||
[289] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX) ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX) + *((const word[$28]) VXSIN#0 + (byte~) processChars::$38)
|
||||
[290] *((word*)(struct ProcessingSprite*) processChars::processing#0) ← *((word*)(struct ProcessingSprite*) processChars::processing#0) + *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX)
|
||||
[291] (byte~) processChars::$30 ← (byte) processChars::ypos#0 >> (byte) 3
|
||||
[292] (byte) processChars::ychar#0 ← (byte~) processChars::$30 - (const byte) BORDER_YPOS_TOP#0/(byte) 8
|
||||
[293] (byte~) processChars::$39 ← (byte) processChars::ychar#0 << (byte) 1
|
||||
[294] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY) ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY) + *((const word[$19]) VYSIN#0 + (byte~) processChars::$39)
|
||||
[295] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) + *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY)
|
||||
to:processChars::@7
|
||||
processChars::@7: scope:[processChars] from processChars::@6 processChars::@9
|
||||
[307] (byte) processChars::numActive#1 ← ++ (byte) processChars::numActive#10
|
||||
[296] (byte) processChars::numActive#1 ← ++ (byte) processChars::numActive#10
|
||||
to:processChars::@2
|
||||
processChars::@2: scope:[processChars] from processChars::@1 processChars::@7
|
||||
[308] (byte) processChars::numActive#3 ← phi( processChars::@1/(byte) processChars::numActive#10 processChars::@7/(byte) processChars::numActive#1 )
|
||||
[309] (byte) processChars::i#1 ← ++ (byte) processChars::i#10
|
||||
[310] if((byte) processChars::i#1!=(const byte) NUM_PROCESSING#0-(byte) 1+(byte) 1) goto processChars::@1
|
||||
[297] (byte) processChars::numActive#3 ← phi( processChars::@1/(byte) processChars::numActive#10 processChars::@7/(byte) processChars::numActive#1 )
|
||||
[298] (byte) processChars::i#1 ← ++ (byte) processChars::i#10
|
||||
[299] if((byte) processChars::i#1!=(const byte) NUM_PROCESSING#0-(byte) 1+(byte) 1) goto processChars::@1
|
||||
to:processChars::@return
|
||||
processChars::@return: scope:[processChars] from processChars::@2
|
||||
[311] return
|
||||
[300] return
|
||||
to:@return
|
||||
processChars::@6: scope:[processChars] from processChars::@12 processChars::@13 processChars::@14 processChars::@5
|
||||
[312] *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS) ← (const byte) STATUS_FREE
|
||||
[313] (byte~) processChars::$33 ← (byte) $ff ^ (byte) processChars::bitmask#0
|
||||
[314] *((const byte*) SPRITES_ENABLE#0) ← *((const byte*) SPRITES_ENABLE#0) & (byte~) processChars::$33
|
||||
[301] *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS) ← (const byte) STATUS_FREE
|
||||
[302] (byte~) processChars::$33 ← (byte) $ff ^ (byte) processChars::bitmask#0
|
||||
[303] *((const byte*) SPRITES_ENABLE#0) ← *((const byte*) SPRITES_ENABLE#0) & (byte~) processChars::$33
|
||||
to:processChars::@7
|
||||
processChars::@4: scope:[processChars] from processChars::@3
|
||||
[315] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) processChars::bitmask#0
|
||||
[304] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) processChars::bitmask#0
|
||||
to:processChars::@5
|
||||
irqTop: scope:[irqTop] from
|
||||
[316] phi()
|
||||
[305] phi()
|
||||
to:irqTop::@1
|
||||
irqTop::@1: scope:[irqTop] from irqTop
|
||||
[317] *((const byte*) RASTER#0) ← (const byte) RASTER_IRQ_MIDDLE#0
|
||||
[318] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_ALL)(void()) irqBottom()
|
||||
[319] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
[306] *((const byte*) RASTER#0) ← (const byte) RASTER_IRQ_MIDDLE#0
|
||||
[307] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_ALL)(void()) irqBottom()
|
||||
[308] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
to:irqTop::@return
|
||||
irqTop::@return: scope:[irqTop] from irqTop::@1
|
||||
[320] return
|
||||
[309] return
|
||||
to:@return
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -23,6 +23,12 @@
|
||||
(const byte) CIA_INTERRUPT_CLEAR#0 CIA_INTERRUPT_CLEAR = (byte) $7f
|
||||
(byte*) COLS
|
||||
(const byte*) COLS#0 COLS = (byte*) 55296
|
||||
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
|
||||
(const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
|
||||
.word 256*2*256*atan(1/pow(2,i))/PI/2
|
||||
}}
|
||||
(byte) CORDIC_ITERATIONS_16
|
||||
(const byte) CORDIC_ITERATIONS_16#0 CORDIC_ITERATIONS_16 = (byte) $f
|
||||
(bool) DEBUG
|
||||
(void()**) HARDWARE_IRQ
|
||||
(const void()**) HARDWARE_IRQ#0 HARDWARE_IRQ = (void()**) 65534
|
||||
@ -40,8 +46,6 @@
|
||||
(const byte) NOT_FOUND#0 NOT_FOUND = (byte) $ff
|
||||
(byte) NUM_PROCESSING
|
||||
(const byte) NUM_PROCESSING#0 NUM_PROCESSING = (byte) 8
|
||||
(byte) NUM_SQUARES
|
||||
(const byte) NUM_SQUARES#3 NUM_SQUARES = (byte) $30
|
||||
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL OFFSET_STRUCT_PROCESSINGSPRITE_COL = (byte) $a
|
||||
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID OFFSET_STRUCT_PROCESSINGSPRITE_ID = (byte) 8
|
||||
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR OFFSET_STRUCT_PROCESSINGSPRITE_PTR = (byte) 9
|
||||
@ -83,10 +87,9 @@
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(byte*) SCREEN_COPY
|
||||
(void*) SCREEN_COPY#0 SCREEN_COPY zp ZP_WORD:41 0.0273972602739726
|
||||
(void*) SCREEN_COPY#0 SCREEN_COPY zp ZP_WORD:43 0.0273972602739726
|
||||
(byte*) SCREEN_DIST
|
||||
(void*) SCREEN_DIST#0 SCREEN_DIST zp ZP_WORD:43 0.028169014084507043
|
||||
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte) 2
|
||||
(void*) SCREEN_DIST#0 SCREEN_DIST zp ZP_WORD:45 0.028169014084507043
|
||||
(byte*) SPRITES_COLS
|
||||
(const byte*) SPRITES_COLS#0 SPRITES_COLS = (byte*) 53287
|
||||
(byte*) SPRITES_ENABLE
|
||||
@ -107,8 +110,6 @@
|
||||
(const byte*) SPRITE_DATA#0 SPRITE_DATA = (byte*) 8192
|
||||
(word) SPRITE_PTRS
|
||||
(const word) SPRITE_PTRS#0 SPRITE_PTRS = (word) $3f8
|
||||
(word*) SQUARES
|
||||
(void*) SQUARES#1 SQUARES zp ZP_WORD:73 0.03225806451612903
|
||||
(const byte) STATUS_FREE STATUS_FREE = (byte) 0
|
||||
(const byte) STATUS_NEW STATUS_NEW = (byte) 1
|
||||
(const byte) STATUS_PROCESSING STATUS_PROCESSING = (byte) 2
|
||||
@ -133,47 +134,89 @@
|
||||
(const word) YPOS_BOTTOMMOST#0 YPOS_BOTTOMMOST = (word)(const byte) BORDER_YPOS_BOTTOM#0<<(byte) 4
|
||||
(word) YPOS_TOPMOST
|
||||
(const word) YPOS_TOPMOST#0 YPOS_TOPMOST = (word)(const byte) BORDER_YPOS_TOP#0-(byte) 8<<(byte) 4
|
||||
(word*()) bsearch16u((word) bsearch16u::key , (word*) bsearch16u::items , (byte) bsearch16u::num)
|
||||
(byte~) bsearch16u::$16 reg byte a 2002.0
|
||||
(word*~) bsearch16u::$2 $2 zp ZP_WORD:29 4.0
|
||||
(byte~) bsearch16u::$6 reg byte a 2002.0
|
||||
(label) bsearch16u::@1
|
||||
(label) bsearch16u::@2
|
||||
(label) bsearch16u::@3
|
||||
(label) bsearch16u::@4
|
||||
(label) bsearch16u::@5
|
||||
(label) bsearch16u::@6
|
||||
(label) bsearch16u::@7
|
||||
(label) bsearch16u::@8
|
||||
(label) bsearch16u::@9
|
||||
(label) bsearch16u::@return
|
||||
(word*) bsearch16u::items
|
||||
(word*) bsearch16u::items#0 items zp ZP_WORD:29 1001.0
|
||||
(word*) bsearch16u::items#1 items zp ZP_WORD:29 2.0
|
||||
(word*) bsearch16u::items#2 items zp ZP_WORD:29 334.5555555555556
|
||||
(word*) bsearch16u::items#8 items zp ZP_WORD:29 1501.5
|
||||
(word) bsearch16u::key
|
||||
(word) bsearch16u::key#0 key zp ZP_WORD:67 0.26666666666666666
|
||||
(byte) bsearch16u::num
|
||||
(byte) bsearch16u::num#0 reg byte x 2002.0
|
||||
(byte) bsearch16u::num#1 reg byte x 2002.0
|
||||
(byte) bsearch16u::num#3 reg byte x 556.1111111111111
|
||||
(byte) bsearch16u::num#5 reg byte x 3003.0
|
||||
(word*) bsearch16u::pivot
|
||||
(word*) bsearch16u::pivot#0 pivot zp ZP_WORD:69 501.0
|
||||
(signed word) bsearch16u::result
|
||||
(signed word) bsearch16u::result#0 result zp ZP_WORD:71 1501.5
|
||||
(word*) bsearch16u::return
|
||||
(word*) bsearch16u::return#1 return zp ZP_WORD:29 2.0
|
||||
(word*) bsearch16u::return#2 return zp ZP_WORD:29 6.0
|
||||
(word*) bsearch16u::return#3 return zp ZP_WORD:29 4.0
|
||||
(word*~) bsearch16u::return#6 return zp ZP_WORD:29 4.0
|
||||
(word()) atan2_16((signed word) atan2_16::x , (signed word) atan2_16::y)
|
||||
(signed word~) atan2_16::$2 $2 zp ZP_WORD:29 4.0
|
||||
(byte~) atan2_16::$23 reg byte a 2002.0
|
||||
(byte~) atan2_16::$24 reg byte a 2002.0
|
||||
(signed word~) atan2_16::$7 $7 zp ZP_WORD:31 4.0
|
||||
(label) atan2_16::@1
|
||||
(label) atan2_16::@10
|
||||
(label) atan2_16::@11
|
||||
(label) atan2_16::@12
|
||||
(label) atan2_16::@13
|
||||
(label) atan2_16::@14
|
||||
(label) atan2_16::@15
|
||||
(label) atan2_16::@16
|
||||
(label) atan2_16::@17
|
||||
(label) atan2_16::@18
|
||||
(label) atan2_16::@19
|
||||
(label) atan2_16::@2
|
||||
(label) atan2_16::@20
|
||||
(label) atan2_16::@21
|
||||
(label) atan2_16::@3
|
||||
(label) atan2_16::@4
|
||||
(label) atan2_16::@5
|
||||
(label) atan2_16::@6
|
||||
(label) atan2_16::@7
|
||||
(label) atan2_16::@8
|
||||
(label) atan2_16::@9
|
||||
(label) atan2_16::@return
|
||||
(word) atan2_16::angle
|
||||
(word) atan2_16::angle#1 angle zp ZP_WORD:33 3.0
|
||||
(word) atan2_16::angle#11 angle zp ZP_WORD:33 4.0
|
||||
(word) atan2_16::angle#12 angle zp ZP_WORD:33 190.66666666666666
|
||||
(word) atan2_16::angle#13 angle zp ZP_WORD:33 1334.6666666666667
|
||||
(word) atan2_16::angle#2 angle zp ZP_WORD:33 2002.0
|
||||
(word) atan2_16::angle#3 angle zp ZP_WORD:33 2002.0
|
||||
(word) atan2_16::angle#4 angle zp ZP_WORD:33 4.0
|
||||
(word) atan2_16::angle#5 angle zp ZP_WORD:33 4.0
|
||||
(word) atan2_16::angle#6 angle zp ZP_WORD:33 2004.0
|
||||
(byte) atan2_16::i
|
||||
(byte) atan2_16::i#1 reg byte x 1501.5
|
||||
(byte) atan2_16::i#2 reg byte x 208.54166666666669
|
||||
(word) atan2_16::return
|
||||
(word) atan2_16::return#0 return zp ZP_WORD:33 34.99999999999999
|
||||
(word) atan2_16::return#2 return zp ZP_WORD:33 202.0
|
||||
(byte) atan2_16::shift
|
||||
(byte) atan2_16::shift#1 reg byte y 20002.0
|
||||
(byte) atan2_16::shift#2 reg byte y 8001.25
|
||||
(byte~) atan2_16::shift#5 reg byte y 667.3333333333334
|
||||
(signed word) atan2_16::x
|
||||
(signed word) atan2_16::x#0 x zp ZP_WORD:67 2.8684210526315796
|
||||
(signed word) atan2_16::xd
|
||||
(signed word) atan2_16::xd#1 xd zp ZP_WORD:37 6667.333333333333
|
||||
(signed word~) atan2_16::xd#10 xd zp ZP_WORD:37 1001.0
|
||||
(signed word) atan2_16::xd#2 xd zp ZP_WORD:37 1001.0
|
||||
(signed word) atan2_16::xd#3 xd zp ZP_WORD:37 7668.333333333332
|
||||
(signed word) atan2_16::xd#5 xd zp ZP_WORD:37 1001.0
|
||||
(signed word) atan2_16::xi
|
||||
(signed word) atan2_16::xi#0 xi zp ZP_WORD:31 6.0
|
||||
(signed word) atan2_16::xi#1 xi zp ZP_WORD:31 500.5
|
||||
(signed word~) atan2_16::xi#13 xi zp ZP_WORD:31 4.0
|
||||
(signed word) atan2_16::xi#2 xi zp ZP_WORD:31 500.5
|
||||
(signed word) atan2_16::xi#3 xi zp ZP_WORD:31 267.0666666666667
|
||||
(signed word) atan2_16::xi#8 xi zp ZP_WORD:31 1001.0
|
||||
(signed word) atan2_16::y
|
||||
(signed word) atan2_16::y#0 y zp ZP_WORD:69 2.724999999999999
|
||||
(signed word) atan2_16::yd
|
||||
(signed word) atan2_16::yd#1 yd zp ZP_WORD:35 10001.0
|
||||
(signed word~) atan2_16::yd#10 yd zp ZP_WORD:35 2002.0
|
||||
(signed word) atan2_16::yd#2 yd zp ZP_WORD:35 2002.0
|
||||
(signed word) atan2_16::yd#3 yd zp ZP_WORD:35 4601.0
|
||||
(signed word) atan2_16::yd#5 yd zp ZP_WORD:35 2002.0
|
||||
(signed word) atan2_16::yi
|
||||
(signed word) atan2_16::yi#0 yi zp ZP_WORD:29 1.2000000000000002
|
||||
(signed word) atan2_16::yi#1 yi zp ZP_WORD:29 667.3333333333334
|
||||
(signed word~) atan2_16::yi#16 yi zp ZP_WORD:29 4.0
|
||||
(signed word) atan2_16::yi#2 yi zp ZP_WORD:29 667.3333333333334
|
||||
(signed word) atan2_16::yi#3 yi zp ZP_WORD:29 353.4117647058823
|
||||
(signed word) atan2_16::yi#8 yi zp ZP_WORD:29 1001.0
|
||||
(struct ProcessingChar()) getCharToProcess()
|
||||
(byte*~) getCharToProcess::$10 $10 zp ZP_WORD:61 4.0
|
||||
(word) getCharToProcess::$12 $12 zp ZP_WORD:63 4.0
|
||||
(word) getCharToProcess::$13 $13 zp ZP_WORD:61 4.0
|
||||
(word~) getCharToProcess::$8 $8 zp ZP_WORD:61 3.0
|
||||
(word~) getCharToProcess::$9 $9 zp ZP_WORD:61 4.0
|
||||
(byte*~) getCharToProcess::$10 $10 zp ZP_WORD:63 4.0
|
||||
(word) getCharToProcess::$12 $12 zp ZP_WORD:65 4.0
|
||||
(word) getCharToProcess::$13 $13 zp ZP_WORD:63 4.0
|
||||
(word~) getCharToProcess::$8 $8 zp ZP_WORD:63 3.0
|
||||
(word~) getCharToProcess::$9 $9 zp ZP_WORD:63 4.0
|
||||
(label) getCharToProcess::@1
|
||||
(label) getCharToProcess::@10
|
||||
(label) getCharToProcess::@11
|
||||
@ -229,8 +272,8 @@
|
||||
(byte) getCharToProcess::y#1 y zp ZP_BYTE:16 101.0
|
||||
(byte) getCharToProcess::y#7 y zp ZP_BYTE:16 80.2
|
||||
(byte*) heap_head
|
||||
(byte*) heap_head#1 heap_head zp ZP_WORD:35 0.6000000000000001
|
||||
(byte*) heap_head#12 heap_head zp ZP_WORD:35 4.0
|
||||
(byte*) heap_head#1 heap_head zp ZP_WORD:39 1.0
|
||||
(byte*) heap_head#5 heap_head zp ZP_WORD:39 3.0
|
||||
(void()) initSprites()
|
||||
(label) initSprites::@1
|
||||
(label) initSprites::@2
|
||||
@ -242,75 +285,46 @@
|
||||
(byte*) initSprites::sp
|
||||
(byte*) initSprites::sp#1 sp zp ZP_WORD:20 16.5
|
||||
(byte*) initSprites::sp#2 sp zp ZP_WORD:20 16.5
|
||||
(void()) init_dist_screen((byte*) init_dist_screen::screen)
|
||||
(byte~) init_dist_screen::$13 reg byte a 202.0
|
||||
(byte~) init_dist_screen::$15 reg byte a 202.0
|
||||
(byte~) init_dist_screen::$5 reg byte a 22.0
|
||||
(byte~) init_dist_screen::$7 reg byte a 22.0
|
||||
(label) init_dist_screen::@1
|
||||
(label) init_dist_screen::@10
|
||||
(label) init_dist_screen::@11
|
||||
(label) init_dist_screen::@12
|
||||
(label) init_dist_screen::@13
|
||||
(label) init_dist_screen::@2
|
||||
(label) init_dist_screen::@3
|
||||
(label) init_dist_screen::@4
|
||||
(label) init_dist_screen::@5
|
||||
(label) init_dist_screen::@6
|
||||
(label) init_dist_screen::@7
|
||||
(label) init_dist_screen::@8
|
||||
(label) init_dist_screen::@9
|
||||
(label) init_dist_screen::@return
|
||||
(byte) init_dist_screen::d
|
||||
(byte) init_dist_screen::d#0 reg byte a 126.25
|
||||
(word) init_dist_screen::ds
|
||||
(word) init_dist_screen::ds#0 ds zp ZP_WORD:67 202.0
|
||||
(byte*) init_dist_screen::screen
|
||||
(byte*) init_dist_screen::screen#0 screen zp ZP_WORD:23 1.5
|
||||
(byte*) init_dist_screen::screen_bottomline
|
||||
(byte*) init_dist_screen::screen_bottomline#0 screen_bottomline zp ZP_WORD:25 4.0
|
||||
(byte*) init_dist_screen::screen_bottomline#1 screen_bottomline zp ZP_WORD:25 7.333333333333333
|
||||
(byte*) init_dist_screen::screen_bottomline#10 screen_bottomline zp ZP_WORD:25 6.848484848484849
|
||||
(byte*) init_dist_screen::screen_topline
|
||||
(byte*) init_dist_screen::screen_topline#1 screen_topline zp ZP_WORD:23 5.5
|
||||
(byte*) init_dist_screen::screen_topline#10 screen_topline zp ZP_WORD:23 7.0625
|
||||
(byte) init_dist_screen::x
|
||||
(byte) init_dist_screen::x#1 x zp ZP_BYTE:27 101.0
|
||||
(byte) init_dist_screen::x#2 x zp ZP_BYTE:27 26.578947368421055
|
||||
(byte) init_dist_screen::x2
|
||||
(byte) init_dist_screen::x2#0 reg byte a 202.0
|
||||
(byte) init_dist_screen::xb
|
||||
(byte) init_dist_screen::xb#1 xb zp ZP_BYTE:28 101.0
|
||||
(byte) init_dist_screen::xb#2 xb zp ZP_BYTE:28 20.2
|
||||
(byte) init_dist_screen::xd
|
||||
(byte) init_dist_screen::xd#0 reg byte a 303.0
|
||||
(word) init_dist_screen::xds
|
||||
(word) init_dist_screen::xds#0 xds zp ZP_WORD:67 202.0
|
||||
(byte) init_dist_screen::y
|
||||
(byte) init_dist_screen::y#1 y zp ZP_BYTE:22 16.5
|
||||
(byte) init_dist_screen::y#10 y zp ZP_BYTE:22 0.9705882352941178
|
||||
(byte) init_dist_screen::y2
|
||||
(byte) init_dist_screen::y2#0 reg byte a 22.0
|
||||
(byte) init_dist_screen::yd
|
||||
(byte) init_dist_screen::yd#0 reg byte a 33.0
|
||||
(word) init_dist_screen::yds
|
||||
(word) init_dist_screen::yds#0 yds zp ZP_WORD:65 4.869565217391305
|
||||
(void()) init_squares()
|
||||
(byte~) init_squares::$3 reg byte a 22.0
|
||||
(byte~) init_squares::$4 reg byte a 22.0
|
||||
(label) init_squares::@1
|
||||
(label) init_squares::@2
|
||||
(label) init_squares::@return
|
||||
(byte) init_squares::i
|
||||
(byte) init_squares::i#1 reg byte x 16.5
|
||||
(byte) init_squares::i#2 reg byte x 5.5
|
||||
(word) init_squares::sqr
|
||||
(word) init_squares::sqr#1 sqr zp ZP_WORD:31 7.333333333333333
|
||||
(word) init_squares::sqr#2 sqr zp ZP_WORD:31 6.6000000000000005
|
||||
(word*) init_squares::squares
|
||||
(word*) init_squares::squares#0 squares zp ZP_WORD:33 4.0
|
||||
(word*) init_squares::squares#1 squares zp ZP_WORD:33 3.6666666666666665
|
||||
(word*) init_squares::squares#2 squares zp ZP_WORD:33 17.5
|
||||
(void()) init_angle_screen((byte*) init_angle_screen::screen)
|
||||
(word~) init_angle_screen::$10 $10 zp ZP_WORD:33 202.0
|
||||
(byte~) init_angle_screen::$12 reg byte a 202.0
|
||||
(byte~) init_angle_screen::$13 reg byte a 202.0
|
||||
(byte~) init_angle_screen::$14 reg byte a 202.0
|
||||
(byte~) init_angle_screen::$2 reg byte a 202.0
|
||||
(byte~) init_angle_screen::$3 reg byte a 202.0
|
||||
(byte~) init_angle_screen::$6 reg byte a 202.0
|
||||
(label) init_angle_screen::@1
|
||||
(label) init_angle_screen::@2
|
||||
(label) init_angle_screen::@3
|
||||
(label) init_angle_screen::@4
|
||||
(label) init_angle_screen::@return
|
||||
(byte) init_angle_screen::ang_w
|
||||
(byte) init_angle_screen::ang_w#0 ang_w zp ZP_BYTE:71 84.16666666666666
|
||||
(word) init_angle_screen::angle_w
|
||||
(word) init_angle_screen::angle_w#0 angle_w zp ZP_WORD:33 202.0
|
||||
(byte*) init_angle_screen::screen
|
||||
(byte*) init_angle_screen::screen#0 screen zp ZP_WORD:23 3.0
|
||||
(byte*) init_angle_screen::screen_bottomline
|
||||
(byte*) init_angle_screen::screen_bottomline#0 screen_bottomline zp ZP_WORD:23 4.0
|
||||
(byte*) init_angle_screen::screen_bottomline#1 screen_bottomline zp ZP_WORD:23 7.333333333333333
|
||||
(byte*) init_angle_screen::screen_bottomline#5 screen_bottomline zp ZP_WORD:23 9.040000000000001
|
||||
(byte*) init_angle_screen::screen_topline
|
||||
(byte*) init_angle_screen::screen_topline#0 screen_topline zp ZP_WORD:25 2.0
|
||||
(byte*) init_angle_screen::screen_topline#1 screen_topline zp ZP_WORD:25 5.5
|
||||
(byte*) init_angle_screen::screen_topline#5 screen_topline zp ZP_WORD:25 9.416666666666666
|
||||
(byte) init_angle_screen::x
|
||||
(byte) init_angle_screen::x#1 x zp ZP_BYTE:27 101.0
|
||||
(byte) init_angle_screen::x#2 x zp ZP_BYTE:27 25.25
|
||||
(byte) init_angle_screen::xb
|
||||
(byte) init_angle_screen::xb#1 xb zp ZP_BYTE:28 101.0
|
||||
(byte) init_angle_screen::xb#2 xb zp ZP_BYTE:28 19.238095238095237
|
||||
(signed word) init_angle_screen::xw
|
||||
(word) init_angle_screen::xw#0 xw zp ZP_WORD:67 33.666666666666664
|
||||
(byte) init_angle_screen::y
|
||||
(byte) init_angle_screen::y#1 y zp ZP_BYTE:22 16.5
|
||||
(byte) init_angle_screen::y#4 y zp ZP_BYTE:22 4.730769230769231
|
||||
(signed word) init_angle_screen::yw
|
||||
(word) init_angle_screen::yw#0 yw zp ZP_WORD:69 50.5
|
||||
interrupt(HARDWARE_ALL)(void()) irqBottom()
|
||||
(label) irqBottom::@1
|
||||
(label) irqBottom::@2
|
||||
@ -343,7 +357,7 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(byte) main::center_x
|
||||
(byte) main::center_x#0 reg byte y 5.5
|
||||
(byte) main::center_y
|
||||
(byte) main::center_y#0 center_y zp ZP_BYTE:45 5.5
|
||||
(byte) main::center_y#0 center_y zp ZP_BYTE:47 5.5
|
||||
(byte*) main::dst
|
||||
(byte*) main::dst#0 dst zp ZP_WORD:4 4.0
|
||||
(byte*) main::dst#1 dst zp ZP_WORD:4 11.0
|
||||
@ -357,17 +371,16 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(void*()) malloc((word) malloc::size)
|
||||
(label) malloc::@return
|
||||
(byte*) malloc::mem
|
||||
(byte*) malloc::mem#0 mem zp ZP_WORD:73 0.3333333333333333
|
||||
(byte*) malloc::mem#0 mem zp ZP_WORD:45 0.4
|
||||
(void*) malloc::return
|
||||
(word) malloc::size
|
||||
(word) malloc::size#3 size zp ZP_WORD:37 1.0
|
||||
(void()) processChars()
|
||||
(byte~) processChars::$11 reg byte a 22.0
|
||||
(byte~) processChars::$12 reg byte a 22.0
|
||||
(byte~) processChars::$14 reg byte a 22.0
|
||||
(word~) processChars::$15 $15 zp ZP_WORD:80 11.0
|
||||
(word~) processChars::$15 $15 zp ZP_WORD:77 11.0
|
||||
(byte~) processChars::$17 reg byte x 6.6000000000000005
|
||||
(word~) processChars::$25 $25 zp ZP_WORD:78 11.0
|
||||
(word~) processChars::$25 $25 zp ZP_WORD:75 11.0
|
||||
(byte~) processChars::$26 reg byte a 22.0
|
||||
(byte~) processChars::$30 reg byte a 22.0
|
||||
(byte~) processChars::$33 reg byte a 22.0
|
||||
@ -394,24 +407,24 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(label) processChars::@9
|
||||
(label) processChars::@return
|
||||
(byte) processChars::bitmask
|
||||
(byte) processChars::bitmask#0 bitmask zp ZP_BYTE:77 2.2
|
||||
(byte) processChars::bitmask#0 bitmask zp ZP_BYTE:74 2.2
|
||||
(byte) processChars::i
|
||||
(byte) processChars::i#1 i zp ZP_BYTE:39 16.5
|
||||
(byte) processChars::i#10 i zp ZP_BYTE:39 1.4042553191489362
|
||||
(byte) processChars::i#1 i zp ZP_BYTE:41 16.5
|
||||
(byte) processChars::i#10 i zp ZP_BYTE:41 1.4042553191489362
|
||||
(byte) processChars::numActive
|
||||
(byte) processChars::numActive#1 numActive zp ZP_BYTE:40 22.0
|
||||
(byte) processChars::numActive#10 numActive zp ZP_BYTE:40 0.7333333333333333
|
||||
(byte) processChars::numActive#3 numActive zp ZP_BYTE:40 11.0
|
||||
(byte) processChars::numActive#1 numActive zp ZP_BYTE:42 22.0
|
||||
(byte) processChars::numActive#10 numActive zp ZP_BYTE:42 0.7333333333333333
|
||||
(byte) processChars::numActive#3 numActive zp ZP_BYTE:42 11.0
|
||||
(struct ProcessingSprite*) processChars::processing
|
||||
(struct ProcessingSprite*) processChars::processing#0 processing zp ZP_WORD:75 0.3142857142857143
|
||||
(struct ProcessingSprite*) processChars::processing#0 processing zp ZP_WORD:72 0.3142857142857143
|
||||
(byte) processChars::xchar
|
||||
(byte) processChars::xchar#0 reg byte a 22.0
|
||||
(word) processChars::xpos
|
||||
(word) processChars::xpos#0 xpos zp ZP_WORD:78 2.0625
|
||||
(word) processChars::xpos#0 xpos zp ZP_WORD:75 2.0625
|
||||
(byte) processChars::ychar
|
||||
(byte) processChars::ychar#0 reg byte a 22.0
|
||||
(byte) processChars::ypos
|
||||
(byte) processChars::ypos#0 ypos zp ZP_BYTE:82 2.75
|
||||
(byte) processChars::ypos#0 ypos zp ZP_BYTE:79 2.75
|
||||
(void()) setupRasterIrq((word) setupRasterIrq::raster , (void()*) setupRasterIrq::irqRoutine)
|
||||
(label) setupRasterIrq::@1
|
||||
(label) setupRasterIrq::@2
|
||||
@ -419,49 +432,25 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(void()*) setupRasterIrq::irqRoutine
|
||||
(const void()*) setupRasterIrq::irqRoutine#0 irqRoutine = &interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(word) setupRasterIrq::raster
|
||||
(word()) sqr((byte) sqr::val)
|
||||
(byte~) sqr::$0 reg byte a 4.0
|
||||
(label) sqr::@return
|
||||
(word) sqr::return
|
||||
(word) sqr::return#0 return zp ZP_WORD:67 28.5
|
||||
(word) sqr::return#2 return#2 zp ZP_WORD:65 22.0
|
||||
(word) sqr::return#3 return zp ZP_WORD:67 202.0
|
||||
(byte) sqr::val
|
||||
(byte) sqr::val#0 reg byte a 22.0
|
||||
(byte) sqr::val#1 reg byte a 202.0
|
||||
(byte) sqr::val#2 reg byte a 114.0
|
||||
(byte()) sqrt((word) sqrt::val)
|
||||
(word~) sqrt::$1 $1 zp ZP_WORD:29 2.0
|
||||
(word~) sqrt::$3 $3 zp ZP_WORD:29 4.0
|
||||
(label) sqrt::@1
|
||||
(label) sqrt::@return
|
||||
(word*) sqrt::found
|
||||
(word*) sqrt::found#0 found zp ZP_WORD:29 4.0
|
||||
(byte) sqrt::return
|
||||
(byte) sqrt::return#0 reg byte a 34.33333333333333
|
||||
(byte) sqrt::return#2 reg byte a 202.0
|
||||
(byte) sqrt::sq
|
||||
(word) sqrt::val
|
||||
(word) sqrt::val#0 val zp ZP_WORD:67 103.0
|
||||
(void()) startProcessing((byte) startProcessing::center_x , (byte) startProcessing::center_y , (byte) startProcessing::center_dist)
|
||||
(word~) startProcessing::$0 $0 zp ZP_WORD:47 3.0
|
||||
(word~) startProcessing::$1 $1 zp ZP_WORD:47 4.0
|
||||
(word~) startProcessing::$11 $11 zp ZP_WORD:54 4.0
|
||||
(word~) startProcessing::$12 $12 zp ZP_WORD:54 4.0
|
||||
(word~) startProcessing::$13 $13 zp ZP_WORD:54 4.0
|
||||
(word~) startProcessing::$15 $15 zp ZP_WORD:56 4.0
|
||||
(word~) startProcessing::$16 $16 zp ZP_WORD:56 4.0
|
||||
(word~) startProcessing::$17 $17 zp ZP_WORD:56 4.0
|
||||
(word~) startProcessing::$0 $0 zp ZP_WORD:49 3.0
|
||||
(word~) startProcessing::$1 $1 zp ZP_WORD:49 4.0
|
||||
(word~) startProcessing::$11 $11 zp ZP_WORD:56 4.0
|
||||
(word~) startProcessing::$12 $12 zp ZP_WORD:56 4.0
|
||||
(word~) startProcessing::$13 $13 zp ZP_WORD:56 4.0
|
||||
(word~) startProcessing::$15 $15 zp ZP_WORD:58 4.0
|
||||
(word~) startProcessing::$16 $16 zp ZP_WORD:58 4.0
|
||||
(word~) startProcessing::$17 $17 zp ZP_WORD:58 4.0
|
||||
(byte~) startProcessing::$22 reg byte a 2.0
|
||||
(word~) startProcessing::$23 $23 zp ZP_WORD:59 0.5
|
||||
(word~) startProcessing::$23 $23 zp ZP_WORD:61 0.5
|
||||
(byte~) startProcessing::$30 reg byte a 2002.0
|
||||
(byte~) startProcessing::$31 reg byte x 2.2222222222222228
|
||||
(byte) startProcessing::$42 reg byte a 2002.0
|
||||
(byte) startProcessing::$43 reg byte a 2002.0
|
||||
(byte) startProcessing::$44 reg byte a 2002.0
|
||||
(byte) startProcessing::$45 reg byte a 2002.0
|
||||
(word) startProcessing::$47 $47 zp ZP_WORD:49 4.0
|
||||
(word) startProcessing::$48 $48 zp ZP_WORD:47 4.0
|
||||
(word) startProcessing::$47 $47 zp ZP_WORD:51 4.0
|
||||
(word) startProcessing::$48 $48 zp ZP_WORD:49 4.0
|
||||
(word~) startProcessing::$5 $5 zp ZP_WORD:10 4.0
|
||||
(byte) startProcessing::$50 reg byte a 4.0
|
||||
(byte) startProcessing::$51 reg byte a 4.0
|
||||
@ -483,9 +472,9 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(struct ProcessingChar) startProcessing::center
|
||||
(byte) startProcessing::center_dist
|
||||
(byte) startProcessing::center_x
|
||||
(byte) startProcessing::center_x#0 center_x zp ZP_BYTE:46 0.30952380952380953
|
||||
(byte) startProcessing::center_x#0 center_x zp ZP_BYTE:48 0.30952380952380953
|
||||
(byte) startProcessing::center_y
|
||||
(byte) startProcessing::center_y#0 center_y zp ZP_BYTE:45 0.24444444444444444
|
||||
(byte) startProcessing::center_y#0 center_y zp ZP_BYTE:47 0.24444444444444444
|
||||
(byte) startProcessing::ch
|
||||
(byte) startProcessing::ch#0 reg byte a 2.0
|
||||
(byte*) startProcessing::chargenData
|
||||
@ -493,7 +482,7 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(byte*) startProcessing::chargenData#1 chargenData zp ZP_WORD:8 67.33333333333333
|
||||
(byte*) startProcessing::chargenData#2 chargenData zp ZP_WORD:8 101.66666666666666
|
||||
(byte*) startProcessing::colPtr
|
||||
(byte*) startProcessing::colPtr#0 colPtr zp ZP_WORD:51 4.0
|
||||
(byte*) startProcessing::colPtr#0 colPtr zp ZP_WORD:53 4.0
|
||||
(byte) startProcessing::freeIdx
|
||||
(byte) startProcessing::freeIdx#2 freeIdx zp ZP_BYTE:7 28.0
|
||||
(byte) startProcessing::freeIdx#6 reg byte x 20.2
|
||||
@ -506,22 +495,22 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(byte) startProcessing::i1#1 reg byte x 151.5
|
||||
(byte) startProcessing::i1#2 reg byte x 50.5
|
||||
(word) startProcessing::offset
|
||||
(word) startProcessing::offset#0 offset zp ZP_WORD:47 2.0
|
||||
(word) startProcessing::offset#0 offset zp ZP_WORD:49 2.0
|
||||
(byte*) startProcessing::screenPtr
|
||||
(byte*) startProcessing::screenPtr#0 screenPtr zp ZP_WORD:47 0.14285714285714285
|
||||
(byte*) startProcessing::screenPtr#0 screenPtr zp ZP_WORD:49 0.14285714285714285
|
||||
(byte) startProcessing::spriteCol
|
||||
(byte) startProcessing::spriteCol#0 spriteCol zp ZP_BYTE:53 0.0975609756097561
|
||||
(byte) startProcessing::spriteCol#0 spriteCol zp ZP_BYTE:55 0.0975609756097561
|
||||
(byte*) startProcessing::spriteData
|
||||
(byte*) startProcessing::spriteData#0 spriteData zp ZP_WORD:10 0.5714285714285714
|
||||
(byte*) startProcessing::spriteData#1 spriteData zp ZP_WORD:10 50.5
|
||||
(byte*) startProcessing::spriteData#2 spriteData zp ZP_WORD:10 152.5
|
||||
(byte) startProcessing::spriteIdx
|
||||
(byte) startProcessing::spritePtr
|
||||
(byte) startProcessing::spritePtr#0 spritePtr zp ZP_BYTE:58 0.3076923076923077
|
||||
(byte) startProcessing::spritePtr#0 spritePtr zp ZP_BYTE:60 0.3076923076923077
|
||||
(word) startProcessing::spriteX
|
||||
(word) startProcessing::spriteX#0 spriteX zp ZP_WORD:54 0.3076923076923077
|
||||
(word) startProcessing::spriteX#0 spriteX zp ZP_WORD:56 0.3076923076923077
|
||||
(word) startProcessing::spriteY
|
||||
(word) startProcessing::spriteY#0 spriteY zp ZP_WORD:56 0.4
|
||||
(word) startProcessing::spriteY#0 spriteY zp ZP_WORD:58 0.4
|
||||
|
||||
zp ZP_WORD:2 [ main::src#2 main::src#1 ]
|
||||
zp ZP_WORD:4 [ main::dst#2 main::dst#1 main::dst#0 ]
|
||||
@ -541,25 +530,23 @@ zp ZP_BYTE:19 [ getCharToProcess::closest_y#7 getCharToProcess::closest_y#9 getC
|
||||
reg byte x [ getCharToProcess::return_dist#1 getCharToProcess::return_dist#5 getCharToProcess::return_dist#6 getCharToProcess::dist#0 ]
|
||||
zp ZP_WORD:20 [ initSprites::sp#2 initSprites::sp#1 ]
|
||||
reg byte x [ initSprites::i#2 initSprites::i#1 ]
|
||||
zp ZP_BYTE:22 [ init_dist_screen::y#10 init_dist_screen::y#1 ]
|
||||
zp ZP_WORD:23 [ init_dist_screen::screen_topline#10 init_dist_screen::screen_topline#1 init_dist_screen::screen#0 ]
|
||||
zp ZP_WORD:25 [ init_dist_screen::screen_bottomline#10 init_dist_screen::screen_bottomline#1 init_dist_screen::screen_bottomline#0 ]
|
||||
reg byte a [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ]
|
||||
zp ZP_BYTE:27 [ init_dist_screen::x#2 init_dist_screen::x#1 ]
|
||||
zp ZP_BYTE:28 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ]
|
||||
reg byte a [ init_dist_screen::xd#0 init_dist_screen::$15 init_dist_screen::$13 ]
|
||||
zp ZP_WORD:29 [ bsearch16u::return#1 bsearch16u::return#6 bsearch16u::return#2 bsearch16u::items#2 bsearch16u::items#1 bsearch16u::items#8 bsearch16u::$2 bsearch16u::items#0 bsearch16u::return#3 sqrt::found#0 sqrt::$3 sqrt::$1 ]
|
||||
reg byte x [ bsearch16u::num#5 bsearch16u::num#1 bsearch16u::num#3 bsearch16u::num#0 ]
|
||||
reg byte a [ sqr::val#2 sqr::val#0 sqr::val#1 ]
|
||||
zp ZP_WORD:31 [ init_squares::sqr#2 init_squares::sqr#1 ]
|
||||
zp ZP_WORD:33 [ init_squares::squares#2 init_squares::squares#1 init_squares::squares#0 ]
|
||||
reg byte x [ init_squares::i#2 init_squares::i#1 ]
|
||||
zp ZP_WORD:35 [ heap_head#12 heap_head#1 ]
|
||||
zp ZP_WORD:37 [ malloc::size#3 ]
|
||||
zp ZP_BYTE:39 [ processChars::i#10 processChars::i#1 ]
|
||||
zp ZP_BYTE:40 [ processChars::numActive#10 processChars::numActive#3 processChars::numActive#1 ]
|
||||
zp ZP_WORD:41 [ SCREEN_COPY#0 ]
|
||||
zp ZP_WORD:43 [ SCREEN_DIST#0 ]
|
||||
zp ZP_BYTE:22 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
|
||||
zp ZP_WORD:23 [ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 init_angle_screen::screen#0 ]
|
||||
zp ZP_WORD:25 [ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#0 init_angle_screen::screen_topline#1 ]
|
||||
zp ZP_BYTE:27 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
|
||||
zp ZP_BYTE:28 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
|
||||
zp ZP_WORD:29 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
|
||||
zp ZP_WORD:31 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
|
||||
reg byte x [ atan2_16::i#2 atan2_16::i#1 ]
|
||||
zp ZP_WORD:33 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$10 ]
|
||||
reg byte y [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ]
|
||||
zp ZP_WORD:35 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ]
|
||||
zp ZP_WORD:37 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
|
||||
zp ZP_WORD:39 [ heap_head#5 heap_head#1 ]
|
||||
zp ZP_BYTE:41 [ processChars::i#10 processChars::i#1 ]
|
||||
zp ZP_BYTE:42 [ processChars::numActive#10 processChars::numActive#3 processChars::numActive#1 ]
|
||||
zp ZP_WORD:43 [ SCREEN_COPY#0 ]
|
||||
zp ZP_WORD:45 [ SCREEN_DIST#0 malloc::mem#0 ]
|
||||
reg byte a [ main::$26 ]
|
||||
reg byte a [ main::$27 ]
|
||||
reg byte a [ main::$28 ]
|
||||
@ -569,60 +556,56 @@ reg byte y [ getCharToProcess::return_x#0 ]
|
||||
reg byte a [ getCharToProcess::return_y#0 ]
|
||||
reg byte x [ getCharToProcess::return_dist#0 ]
|
||||
reg byte y [ main::center_x#0 ]
|
||||
zp ZP_BYTE:45 [ main::center_y#0 startProcessing::center_y#0 ]
|
||||
zp ZP_BYTE:47 [ main::center_y#0 startProcessing::center_y#0 ]
|
||||
reg byte a [ main::center_dist#0 ]
|
||||
zp ZP_BYTE:46 [ startProcessing::center_x#0 ]
|
||||
zp ZP_BYTE:48 [ startProcessing::center_x#0 ]
|
||||
reg byte a [ startProcessing::$42 ]
|
||||
reg byte a [ startProcessing::$43 ]
|
||||
reg byte a [ startProcessing::$44 ]
|
||||
reg byte a [ startProcessing::$45 ]
|
||||
reg byte a [ startProcessing::$30 ]
|
||||
zp ZP_WORD:47 [ startProcessing::$0 startProcessing::$48 startProcessing::$1 startProcessing::offset#0 startProcessing::screenPtr#0 ]
|
||||
zp ZP_WORD:49 [ startProcessing::$47 ]
|
||||
zp ZP_WORD:51 [ startProcessing::colPtr#0 ]
|
||||
zp ZP_BYTE:53 [ startProcessing::spriteCol#0 ]
|
||||
zp ZP_WORD:49 [ startProcessing::$0 startProcessing::$48 startProcessing::$1 startProcessing::offset#0 startProcessing::screenPtr#0 ]
|
||||
zp ZP_WORD:51 [ startProcessing::$47 ]
|
||||
zp ZP_WORD:53 [ startProcessing::colPtr#0 ]
|
||||
zp ZP_BYTE:55 [ startProcessing::spriteCol#0 ]
|
||||
reg byte a [ startProcessing::ch#0 ]
|
||||
zp ZP_WORD:54 [ startProcessing::$11 startProcessing::$12 startProcessing::$13 startProcessing::spriteX#0 ]
|
||||
zp ZP_WORD:56 [ startProcessing::$15 startProcessing::$16 startProcessing::$17 startProcessing::spriteY#0 ]
|
||||
zp ZP_BYTE:58 [ startProcessing::spritePtr#0 ]
|
||||
zp ZP_WORD:56 [ startProcessing::$11 startProcessing::$12 startProcessing::$13 startProcessing::spriteX#0 ]
|
||||
zp ZP_WORD:58 [ startProcessing::$15 startProcessing::$16 startProcessing::$17 startProcessing::spriteY#0 ]
|
||||
zp ZP_BYTE:60 [ startProcessing::spritePtr#0 ]
|
||||
reg byte a [ startProcessing::$22 ]
|
||||
zp ZP_WORD:59 [ startProcessing::$23 ]
|
||||
zp ZP_WORD:61 [ startProcessing::$23 ]
|
||||
reg byte a [ startProcessing::$50 ]
|
||||
reg byte a [ startProcessing::$51 ]
|
||||
reg byte a [ startProcessing::$52 ]
|
||||
reg byte a [ startProcessing::$53 ]
|
||||
reg byte x [ startProcessing::$31 ]
|
||||
zp ZP_WORD:61 [ getCharToProcess::$8 getCharToProcess::$13 getCharToProcess::$9 getCharToProcess::$10 ]
|
||||
zp ZP_WORD:63 [ getCharToProcess::$12 ]
|
||||
reg byte a [ init_dist_screen::y2#0 ]
|
||||
zp ZP_WORD:65 [ sqr::return#2 init_dist_screen::yds#0 ]
|
||||
reg byte a [ init_dist_screen::x2#0 ]
|
||||
zp ZP_WORD:67 [ sqr::return#3 init_dist_screen::xds#0 sqr::return#0 init_dist_screen::ds#0 sqrt::val#0 bsearch16u::key#0 ]
|
||||
reg byte a [ sqrt::return#2 ]
|
||||
reg byte a [ init_dist_screen::d#0 ]
|
||||
reg byte a [ sqrt::return#0 ]
|
||||
reg byte a [ bsearch16u::$6 ]
|
||||
reg byte a [ bsearch16u::$16 ]
|
||||
zp ZP_WORD:69 [ bsearch16u::pivot#0 ]
|
||||
zp ZP_WORD:71 [ bsearch16u::result#0 ]
|
||||
reg byte a [ sqr::$0 ]
|
||||
zp ZP_WORD:73 [ SQUARES#1 malloc::mem#0 ]
|
||||
reg byte a [ init_squares::$3 ]
|
||||
reg byte a [ init_squares::$4 ]
|
||||
zp ZP_WORD:63 [ getCharToProcess::$8 getCharToProcess::$13 getCharToProcess::$9 getCharToProcess::$10 ]
|
||||
zp ZP_WORD:65 [ getCharToProcess::$12 ]
|
||||
reg byte a [ init_angle_screen::$2 ]
|
||||
reg byte a [ init_angle_screen::$3 ]
|
||||
zp ZP_WORD:67 [ init_angle_screen::xw#0 atan2_16::x#0 ]
|
||||
reg byte a [ init_angle_screen::$6 ]
|
||||
zp ZP_WORD:69 [ init_angle_screen::yw#0 atan2_16::y#0 ]
|
||||
zp ZP_BYTE:71 [ init_angle_screen::ang_w#0 ]
|
||||
reg byte a [ init_angle_screen::$12 ]
|
||||
reg byte a [ init_angle_screen::$13 ]
|
||||
reg byte a [ init_angle_screen::$14 ]
|
||||
reg byte a [ atan2_16::$24 ]
|
||||
reg byte a [ atan2_16::$23 ]
|
||||
reg byte a [ processChars::$67 ]
|
||||
reg byte a [ processChars::$68 ]
|
||||
reg byte a [ processChars::$69 ]
|
||||
reg byte a [ processChars::$70 ]
|
||||
reg byte a [ processChars::$37 ]
|
||||
zp ZP_WORD:75 [ processChars::processing#0 ]
|
||||
zp ZP_BYTE:77 [ processChars::bitmask#0 ]
|
||||
zp ZP_WORD:78 [ processChars::xpos#0 processChars::$25 ]
|
||||
zp ZP_WORD:72 [ processChars::processing#0 ]
|
||||
zp ZP_BYTE:74 [ processChars::bitmask#0 ]
|
||||
zp ZP_WORD:75 [ processChars::xpos#0 processChars::$25 ]
|
||||
reg byte a [ processChars::$11 ]
|
||||
reg byte a [ processChars::$12 ]
|
||||
reg byte x [ processChars::$17 ]
|
||||
reg byte a [ processChars::$14 ]
|
||||
zp ZP_WORD:80 [ processChars::$15 ]
|
||||
zp ZP_BYTE:82 [ processChars::ypos#0 ]
|
||||
zp ZP_WORD:77 [ processChars::$15 ]
|
||||
zp ZP_BYTE:79 [ processChars::ypos#0 ]
|
||||
reg byte a [ processChars::$26 ]
|
||||
reg byte a [ processChars::xchar#0 ]
|
||||
reg byte a [ processChars::$38 ]
|
||||
|
@ -2819,11 +2819,11 @@ SIN:
|
||||
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [3] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [4] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ ] ( ) always clobbers reg byte a
|
||||
Statement [6] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ ] ( ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_cnt#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [3] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [4] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [6] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_cnt#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte) 3 [ ] ( main:10 [ ] ) always clobbers reg byte a
|
||||
Statement [15] *((const byte*) CIA2_PORT_A#0) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a
|
||||
@ -2883,11 +2883,11 @@ Statement [102] (byte) irq_sprite_ptr#2 ← (byte) irq_sprite_ptr#0 + (byte) 3 [
|
||||
Statement [103] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [ irq_cnt#1 irq_raster_next#1 ] ( [ irq_cnt#1 irq_raster_next#1 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [104] (byte) irq_sprite_ypos#1 ← (const byte) SPRITES_FIRST_YPOS#0 [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 ] ( [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 ] ) always clobbers reg byte a
|
||||
Statement [106] (byte) irq_sprite_ptr#1 ← (const byte) sprites_irq::toSpritePtr2_return#0 [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 irq_sprite_ptr#1 ] ( [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 irq_sprite_ptr#1 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [3] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [4] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ ] ( ) always clobbers reg byte a
|
||||
Statement [6] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ ] ( ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_cnt#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [3] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [4] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [6] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_cnt#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte) 3 [ ] ( main:10 [ ] ) always clobbers reg byte a
|
||||
Statement [15] *((const byte*) CIA2_PORT_A#0) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:10 [ ] ) always clobbers reg byte a
|
||||
|
@ -17913,12 +17913,12 @@ sprites_irq: {
|
||||
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ render_screen_showing#0 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (dword) score_bcd#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [8] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [10] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [11] (byte) irq_cnt#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ render_screen_showing#0 ] ( [ render_screen_showing#0 ] ) always clobbers reg byte a
|
||||
Statement [2] (dword) score_bcd#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [10] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [11] (byte) irq_cnt#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [33] (byte*~) current_piece_gfx#112 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7) [ render_screen_showing#0 score_bcd#0 current_ypos#98 current_ypos#6 current_xpos#119 current_xpos#100 current_piece_gfx#112 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_movedown_slow#1 game_over#52 ] ( main:13 [ render_screen_showing#0 score_bcd#0 current_ypos#98 current_ypos#6 current_xpos#119 current_xpos#100 current_piece_gfx#112 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_movedown_slow#1 game_over#52 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:24 [ current_ypos#13 current_ypos#98 current_ypos#99 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:56 [ current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 ]
|
||||
@ -18185,12 +18185,12 @@ Statement [581] (byte) irq_sprite_ptr#2 ← (byte) irq_sprite_ptr#0 + (byte) 3 [
|
||||
Statement [582] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [ irq_cnt#1 irq_raster_next#1 ] ( [ irq_cnt#1 irq_raster_next#1 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [583] (byte) irq_sprite_ypos#1 ← (const byte) SPRITES_FIRST_YPOS#0 [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 ] ( [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 ] ) always clobbers reg byte a
|
||||
Statement [585] (byte) irq_sprite_ptr#1 ← (const byte) sprites_irq::toSpritePtr2_return#0 [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 irq_sprite_ptr#1 ] ( [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 irq_sprite_ptr#1 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ render_screen_showing#0 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (dword) score_bcd#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [8] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [10] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [11] (byte) irq_cnt#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ render_screen_showing#0 ] ( [ render_screen_showing#0 ] ) always clobbers reg byte a
|
||||
Statement [2] (dword) score_bcd#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [10] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [11] (byte) irq_cnt#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [33] (byte*~) current_piece_gfx#112 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7) [ render_screen_showing#0 score_bcd#0 current_ypos#98 current_ypos#6 current_xpos#119 current_xpos#100 current_piece_gfx#112 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_movedown_slow#1 game_over#52 ] ( main:13 [ render_screen_showing#0 score_bcd#0 current_ypos#98 current_ypos#6 current_xpos#119 current_xpos#100 current_piece_gfx#112 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_movedown_slow#1 game_over#52 ] ) always clobbers reg byte a
|
||||
Statement [38] (byte*~) current_piece#102 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7) [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_movedown_slow#1 game_over#52 ] ( main:13 [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_movedown_slow#1 game_over#52 ] ) always clobbers reg byte a
|
||||
Statement [39] (byte*~) current_piece_gfx#124 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7) [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_piece_gfx#124 current_movedown_slow#1 game_over#52 ] ( main:13 [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_piece_gfx#124 current_movedown_slow#1 game_over#52 ] ) always clobbers reg byte a
|
||||
@ -18364,12 +18364,12 @@ Statement [581] (byte) irq_sprite_ptr#2 ← (byte) irq_sprite_ptr#0 + (byte) 3 [
|
||||
Statement [582] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15 [ irq_cnt#1 irq_raster_next#1 ] ( [ irq_cnt#1 irq_raster_next#1 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [583] (byte) irq_sprite_ypos#1 ← (const byte) SPRITES_FIRST_YPOS#0 [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 ] ( [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 ] ) always clobbers reg byte a
|
||||
Statement [585] (byte) irq_sprite_ptr#1 ← (const byte) sprites_irq::toSpritePtr2_return#0 [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 irq_sprite_ptr#1 ] ( [ irq_cnt#1 irq_raster_next#1 irq_sprite_ypos#1 irq_sprite_ptr#1 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ render_screen_showing#0 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (dword) score_bcd#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [8] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [10] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [11] (byte) irq_cnt#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) render_screen_showing#0 ← (byte) 0 [ render_screen_showing#0 ] ( [ render_screen_showing#0 ] ) always clobbers reg byte a
|
||||
Statement [2] (dword) score_bcd#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) irq_raster_next#0 ← (const byte) IRQ_RASTER_FIRST#0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte) irq_sprite_ypos#0 ← (const byte) SPRITES_FIRST_YPOS#0+(byte) $15 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [10] (byte) irq_sprite_ptr#0 ← (const byte) toSpritePtr1_return#0+(byte) 3 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [11] (byte) irq_cnt#0 ← (byte) 0 [ render_screen_showing#0 score_bcd#0 ] ( [ render_screen_showing#0 score_bcd#0 ] ) always clobbers reg byte a
|
||||
Statement [33] (byte*~) current_piece_gfx#112 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7) [ render_screen_showing#0 score_bcd#0 current_ypos#98 current_ypos#6 current_xpos#119 current_xpos#100 current_piece_gfx#112 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_movedown_slow#1 game_over#52 ] ( main:13 [ render_screen_showing#0 score_bcd#0 current_ypos#98 current_ypos#6 current_xpos#119 current_xpos#100 current_piece_gfx#112 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_movedown_slow#1 game_over#52 ] ) always clobbers reg byte a
|
||||
Statement [38] (byte*~) current_piece#102 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7) [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_movedown_slow#1 game_over#52 ] ( main:13 [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 play_spawn_current::$7 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_movedown_slow#1 game_over#52 ] ) always clobbers reg byte a
|
||||
Statement [39] (byte*~) current_piece_gfx#124 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7) [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_piece_gfx#124 current_movedown_slow#1 game_over#52 ] ( main:13 [ render_screen_showing#0 score_bcd#0 current_ypos#6 current_xpos#100 current_piece_char#5 play_spawn_current::piece_idx#2 current_piece#102 current_piece_gfx#124 current_movedown_slow#1 game_over#52 ] ) always clobbers reg byte a
|
||||
|
@ -255,7 +255,7 @@ sub: {
|
||||
//SEG23 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) A#0 ← (byte) 'a' [ A#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) A#0 ← (byte) 'a' [ A#0 ] ( [ A#0 ] ) always clobbers reg byte a
|
||||
Statement [4] *((const byte*) SCREEN#0) ← (byte) A#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a
|
||||
Statement [5] *((const byte*) SCREEN#0+(byte) 1) ← (const byte) main::B#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) SCREEN#0+(byte) 2) ← *((const byte*) main::addrA#0) [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a
|
||||
|
@ -555,7 +555,7 @@ hello: {
|
||||
//SEG60 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte) idx#16 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) idx#16 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [12] call *((void()*) do10::fn#3) [ do10::fn#3 do10::i#2 ] ( main:3::do10:6 [ do10::fn#3 do10::i#2 ] main:3::do10:8 [ do10::fn#3 do10::i#2 ] ) always clobbers reg byte a reg byte x reg byte y
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ do10::i#2 do10::i#1 ]
|
||||
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ do10::i#2 do10::i#1 ]
|
||||
@ -565,7 +565,7 @@ Statement [21] *((const byte*) SCREEN#0 + (byte) idx#11) ← *((byte*) print::ms
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ print::i#2 print::i#1 ]
|
||||
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:7 [ print::i#2 print::i#1 ]
|
||||
Statement [24] if(*((byte*) print::msg#3 + (byte) print::i#1)!=(byte) '@') goto print::@1 [ print::msg#3 print::i#1 idx#12 ] ( print:17 [ print::msg#3 print::i#1 idx#12 ] print:27 [ print::msg#3 print::i#1 idx#12 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) idx#16 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) idx#16 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [12] call *((void()*) do10::fn#3) [ do10::fn#3 do10::i#2 ] ( main:3::do10:6 [ do10::fn#3 do10::i#2 ] main:3::do10:8 [ do10::fn#3 do10::i#2 ] ) always clobbers reg byte a reg byte x reg byte y
|
||||
Statement [14] if((byte) do10::i#1!=(byte) $a) goto do10::@1 [ do10::fn#3 do10::i#1 ] ( main:3::do10:6 [ do10::fn#3 do10::i#1 ] main:3::do10:8 [ do10::fn#3 do10::i#1 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte*) SCREEN#0 + (byte) idx#11) ← *((byte*) print::msg#3 + (byte) print::i#2) [ print::msg#3 print::i#2 idx#11 ] ( print:17 [ print::msg#3 print::i#2 idx#11 ] print:27 [ print::msg#3 print::i#2 idx#11 ] ) always clobbers reg byte a reg byte x
|
||||
|
@ -394,14 +394,14 @@ hello: {
|
||||
msg: .text "hello @"
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte) idx#0 ← (byte) 0 [ idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) idx#0 ← (byte) 0 [ idx#0 ] ( [ idx#0 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) SCREEN#0 + (byte) idx#3) ← *((const byte[]) msg#0 + (byte) hello::i#2) [ idx#0 hello::i#2 idx#3 ] ( main:3::do10:6::hello:10 [ do10::i#2 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ do10::i#2 do10::i#1 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ do10::i#2 do10::i#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ hello::i#2 hello::i#1 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ hello::i#2 hello::i#1 ]
|
||||
Statement [19] if(*((const byte[]) msg#0 + (byte) hello::i#1)!=(byte) '@') goto hello::@1 [ idx#0 hello::i#1 idx#1 ] ( main:3::do10:6::hello:10 [ do10::i#2 idx#0 hello::i#1 idx#1 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) idx#0 ← (byte) 0 [ idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) idx#0 ← (byte) 0 [ idx#0 ] ( [ idx#0 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) SCREEN#0 + (byte) idx#3) ← *((const byte[]) msg#0 + (byte) hello::i#2) [ idx#0 hello::i#2 idx#3 ] ( main:3::do10:6::hello:10 [ do10::i#2 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [19] if(*((const byte[]) msg#0 + (byte) hello::i#1)!=(byte) '@') goto hello::@1 [ idx#0 hello::i#1 idx#1 ] ( main:3::do10:6::hello:10 [ do10::i#2 idx#0 hello::i#1 idx#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ do10::i#2 do10::i#1 ] : zp ZP_BYTE:2 , reg byte x ,
|
||||
|
@ -480,8 +480,8 @@ hello: {
|
||||
msg2: .text "world @"
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte*) msg#10 ← (byte*) 0 [ msg#10 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#10 idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte*) msg#10 ← (byte*) 0 [ msg#10 ] ( [ msg#10 ] ) always clobbers reg byte a
|
||||
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#10 idx#0 ] ( [ msg#10 idx#0 ] ) always clobbers reg byte a
|
||||
Statement [6] (byte*) msg#0 ← (const byte[]) msg1#0 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte*) msg#1 ← (const byte[]) msg2#0 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
|
||||
Statement [19] *((const byte*) SCREEN#0 + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2) [ msg#10 idx#0 hello::i#2 idx#3 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] main:4::do10:9::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte x
|
||||
@ -490,8 +490,8 @@ Removing always clobbered register reg byte x as potential for zp ZP_BYTE:2 [ do
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ hello::i#2 hello::i#1 ]
|
||||
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:3 [ hello::i#2 hello::i#1 ]
|
||||
Statement [22] if(*((byte*) msg#10 + (byte) hello::i#1)!=(byte) '@') goto hello::@1 [ msg#10 idx#0 hello::i#1 idx#1 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#1 idx#1 ] main:4::do10:9::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#1 idx#1 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte*) msg#10 ← (byte*) 0 [ msg#10 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#10 idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte*) msg#10 ← (byte*) 0 [ msg#10 ] ( [ msg#10 ] ) always clobbers reg byte a
|
||||
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#10 idx#0 ] ( [ msg#10 idx#0 ] ) always clobbers reg byte a
|
||||
Statement [6] (byte*) msg#0 ← (const byte[]) msg1#0 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte*) msg#1 ← (const byte[]) msg2#0 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
|
||||
Statement [19] *((const byte*) SCREEN#0 + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2) [ msg#10 idx#0 hello::i#2 idx#3 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] main:4::do10:9::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte x
|
||||
|
@ -206,7 +206,7 @@ fn1: {
|
||||
//SEG22 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) idx#0 ← (byte) 0 [ idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) idx#0 ← (byte) 0 [ idx#0 ] ( [ idx#0 ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) SCREEN#0 + (byte) idx#0) ← (byte) 'a' [ idx#0 ] ( main:2 [ idx#0 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [8] *((const byte*) SCREEN#0 + (byte) idx#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
|
||||
Potential registers zp ZP_BYTE:2 [ idx#0 idx#1 ] : zp ZP_BYTE:2 ,
|
||||
|
@ -197,7 +197,7 @@ main: {
|
||||
//SEG21 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) x#0 ← (byte) $c [ x#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) x#0 ← (byte) $c [ x#0 ] ( [ x#0 ] ) always clobbers reg byte a
|
||||
Statement [7] if((byte) x#1<(byte) $32) goto main::@1 [ x#1 ] ( main:2 [ x#1 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte) x#2 ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ x#5 x#0 x#1 x#2 ] : zp ZP_BYTE:2 ,
|
||||
|
@ -238,8 +238,8 @@ irq: {
|
||||
//SEG23 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) col2#0 ← (byte) 8 [ ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) col2#0 ← (byte) 8 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Statement [7] *((const byte*) SCREEN#0+(byte) $28) ← (byte) col1#0 [ col1#0 col2#0 ] ( [ col1#0 col2#0 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) SCREEN#0+(byte) $29) ← (byte) col2#0 [ col2#0 ] ( [ col2#0 ] ) always clobbers reg byte a
|
||||
|
@ -472,7 +472,7 @@ irq: {
|
||||
//SEG47 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [4] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [8] (byte~) main::$1 ← (byte) main::a#2 + (byte) main::y#4 [ main::x#6 main::y#4 main::a#2 main::$1 ] ( main:2 [ main::x#6 main::y#4 main::a#2 main::$1 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::x#6 main::x#1 ]
|
||||
@ -481,7 +481,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ ma
|
||||
Statement [17] *((const byte*) IRQ_STATUS#0) ← (byte) 1 [ col1#0 ] ( [ col1#0 ] ) always clobbers reg byte a
|
||||
Statement asm { lda$dc0d } always clobbers reg byte a
|
||||
Statement [19] *((const byte*) SCREEN#0+(byte) $28) ← (byte) col1#0 [ col1#0 ] ( [ col1#0 ] ) always clobbers reg byte a
|
||||
Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [4] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [8] (byte~) main::$1 ← (byte) main::a#2 + (byte) main::y#4 [ main::x#6 main::y#4 main::a#2 main::$1 ] ( main:2 [ main::x#6 main::y#4 main::a#2 main::$1 ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) IRQ_STATUS#0) ← (byte) 1 [ col1#0 ] ( [ col1#0 ] ) always clobbers reg byte a
|
||||
|
@ -631,7 +631,7 @@ table_driven_irq: {
|
||||
IRQ_CHANGE_IDX: .byte $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte) irq_idx#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) irq_idx#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Statement [7] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte) $7f [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Statement [8] *((const byte*) RASTER#0) ← (byte) $60 [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
@ -646,7 +646,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ ta
|
||||
Statement [24] (byte) irq_idx#2 ← (byte) 0 [ irq_idx#2 ] ( [ irq_idx#2 ] ) always clobbers reg byte a
|
||||
Statement [27] *((const byte*) SCREEN#0+-(const byte) VIC_SIZE#0+(word) $3f8 + (byte) table_driven_irq::idx#0) ← (byte) table_driven_irq::val#0 [ irq_idx#1 ] ( [ irq_idx#1 ] ) always clobbers reg byte a
|
||||
Statement [28] *((const byte*) VIC_BASE#0 + (byte) table_driven_irq::idx#0) ← (byte) table_driven_irq::val#0 [ irq_idx#1 ] ( [ irq_idx#1 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) irq_idx#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) irq_idx#0 ← (byte) 0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Statement [7] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte) $7f [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
Statement [8] *((const byte*) RASTER#0) ← (byte) $60 [ ] ( main:3 [ ] ) always clobbers reg byte a
|
||||
|
@ -441,7 +441,7 @@ irq: {
|
||||
//SEG40 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (bool) framedone#11 ← false [ framedone#11 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (bool) framedone#11 ← false [ framedone#11 ] ( [ framedone#11 ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ framedone#11 ] ( main:3 [ framedone#11 ] ) always clobbers reg byte a
|
||||
Statement [7] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte) $7f [ framedone#11 ] ( main:3 [ framedone#11 ] ) always clobbers reg byte a
|
||||
Statement [8] *((const byte*) RASTER#0) ← (byte) $fd [ framedone#11 ] ( main:3 [ framedone#11 ] ) always clobbers reg byte a
|
||||
|
43
src/test/ref/liverange-problem-0.asm
Normal file
43
src/test/ref/liverange-problem-0.asm
Normal file
@ -0,0 +1,43 @@
|
||||
// Error where the compiler is reusing the same ZP for two byte* variables.
|
||||
// SCREEN_1 and SCREEN_2 are both allocated to ZP: 4
|
||||
// Problem is that outside main() scope statements have zero call-paths and then isStatementAllocationOverlapping() never checks liveranges
|
||||
// CallPath code must be rewritten to use @begin as the outermost call instead of main()
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
.label MEM = 2
|
||||
.label SCREEN_1 = 4
|
||||
.label SCREEN_2 = 6
|
||||
bbegin:
|
||||
lda #<$400
|
||||
sta MEM
|
||||
lda #>$400
|
||||
sta MEM+1
|
||||
jsr malloc
|
||||
lda malloc.return
|
||||
sta malloc.return_2
|
||||
lda malloc.return+1
|
||||
sta malloc.return_2+1
|
||||
jsr malloc
|
||||
jsr main
|
||||
rts
|
||||
main: {
|
||||
lda #0
|
||||
tay
|
||||
sta (SCREEN_1),y
|
||||
sta (SCREEN_2),y
|
||||
rts
|
||||
}
|
||||
malloc: {
|
||||
.label return = 6
|
||||
.label return_2 = 4
|
||||
inc MEM
|
||||
bne !+
|
||||
inc MEM+1
|
||||
!:
|
||||
lda MEM
|
||||
sta return
|
||||
lda MEM+1
|
||||
sta return+1
|
||||
rts
|
||||
}
|
37
src/test/ref/liverange-problem-0.cfg
Normal file
37
src/test/ref/liverange-problem-0.cfg
Normal file
@ -0,0 +1,37 @@
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call malloc
|
||||
[3] (byte*) malloc::return#2 ← (byte*) malloc::return#0
|
||||
to:@3
|
||||
@3: scope:[] from @1
|
||||
[4] (byte*) SCREEN_1#0 ← (byte*) malloc::return#2
|
||||
[5] call malloc
|
||||
[6] (byte*) malloc::return#3 ← (byte*) malloc::return#0
|
||||
to:@4
|
||||
@4: scope:[] from @3
|
||||
[7] (byte*) SCREEN_2#0 ← (byte*) malloc::return#3
|
||||
to:@2
|
||||
@2: scope:[] from @4
|
||||
[8] phi()
|
||||
[9] call main
|
||||
to:@end
|
||||
@end: scope:[] from @2
|
||||
[10] phi()
|
||||
main: scope:[main] from @2
|
||||
[11] *((byte*) SCREEN_1#0) ← (byte) 0
|
||||
[12] *((byte*) SCREEN_2#0) ← (byte) 0
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[13] return
|
||||
to:@return
|
||||
malloc: scope:[malloc] from @1 @3
|
||||
[14] (byte*) MEM#5 ← phi( @1/(byte*) 1024 @3/(byte*) MEM#1 )
|
||||
[15] (byte*) MEM#1 ← ++ (byte*) MEM#5
|
||||
[16] (byte*) malloc::return#0 ← (byte*) MEM#1
|
||||
to:malloc::@return
|
||||
malloc::@return: scope:[malloc] from malloc
|
||||
[17] return
|
||||
to:@return
|
606
src/test/ref/liverange-problem-0.log
Normal file
606
src/test/ref/liverange-problem-0.log
Normal file
@ -0,0 +1,606 @@
|
||||
Culled Empty Block (label) malloc::@1
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(byte*) MEM#0 ← ((byte*)) (number) $400
|
||||
to:@1
|
||||
malloc: scope:[malloc] from @1 @3
|
||||
(byte*) MEM#5 ← phi( @1/(byte*) MEM#9 @3/(byte*) MEM#3 )
|
||||
(byte*) MEM#1 ← ++ (byte*) MEM#5
|
||||
(byte*) malloc::return#0 ← (byte*) MEM#1
|
||||
to:malloc::@return
|
||||
malloc::@return: scope:[malloc] from malloc
|
||||
(byte*) MEM#6 ← phi( malloc/(byte*) MEM#1 )
|
||||
(byte*) malloc::return#4 ← phi( malloc/(byte*) malloc::return#0 )
|
||||
(byte*) malloc::return#1 ← (byte*) malloc::return#4
|
||||
(byte*) MEM#2 ← (byte*) MEM#6
|
||||
return
|
||||
to:@return
|
||||
@1: scope:[] from @begin
|
||||
(byte*) MEM#9 ← phi( @begin/(byte*) MEM#0 )
|
||||
call malloc
|
||||
(byte*) malloc::return#2 ← (byte*) malloc::return#1
|
||||
to:@3
|
||||
@3: scope:[] from @1
|
||||
(byte*) MEM#7 ← phi( @1/(byte*) MEM#2 )
|
||||
(byte*) malloc::return#5 ← phi( @1/(byte*) malloc::return#2 )
|
||||
(byte*~) $0 ← (byte*) malloc::return#5
|
||||
(byte*) MEM#3 ← (byte*) MEM#7
|
||||
(byte*) SCREEN_1#0 ← (byte*~) $0
|
||||
call malloc
|
||||
(byte*) malloc::return#3 ← (byte*) malloc::return#1
|
||||
to:@4
|
||||
@4: scope:[] from @3
|
||||
(byte*) SCREEN_1#3 ← phi( @3/(byte*) SCREEN_1#0 )
|
||||
(byte*) MEM#8 ← phi( @3/(byte*) MEM#2 )
|
||||
(byte*) malloc::return#6 ← phi( @3/(byte*) malloc::return#3 )
|
||||
(byte*~) $1 ← (byte*) malloc::return#6
|
||||
(byte*) MEM#4 ← (byte*) MEM#8
|
||||
(byte*) SCREEN_2#0 ← (byte*~) $1
|
||||
to:@2
|
||||
main: scope:[main] from @2
|
||||
(byte*) SCREEN_2#1 ← phi( @2/(byte*) SCREEN_2#2 )
|
||||
(byte*) SCREEN_1#1 ← phi( @2/(byte*) SCREEN_1#2 )
|
||||
*((byte*) SCREEN_1#1) ← (number) 0
|
||||
*((byte*) SCREEN_2#1) ← (number) 0
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
to:@return
|
||||
@2: scope:[] from @4
|
||||
(byte*) SCREEN_2#2 ← phi( @4/(byte*) SCREEN_2#0 )
|
||||
(byte*) SCREEN_1#2 ← phi( @4/(byte*) SCREEN_1#3 )
|
||||
call main
|
||||
to:@5
|
||||
@5: scope:[] from @2
|
||||
to:@end
|
||||
@end: scope:[] from @5
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(byte*~) $0
|
||||
(byte*~) $1
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @3
|
||||
(label) @4
|
||||
(label) @5
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte*) MEM
|
||||
(byte*) MEM#0
|
||||
(byte*) MEM#1
|
||||
(byte*) MEM#2
|
||||
(byte*) MEM#3
|
||||
(byte*) MEM#4
|
||||
(byte*) MEM#5
|
||||
(byte*) MEM#6
|
||||
(byte*) MEM#7
|
||||
(byte*) MEM#8
|
||||
(byte*) MEM#9
|
||||
(byte*) SCREEN_1
|
||||
(byte*) SCREEN_1#0
|
||||
(byte*) SCREEN_1#1
|
||||
(byte*) SCREEN_1#2
|
||||
(byte*) SCREEN_1#3
|
||||
(byte*) SCREEN_2
|
||||
(byte*) SCREEN_2#0
|
||||
(byte*) SCREEN_2#1
|
||||
(byte*) SCREEN_2#2
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(byte*()) malloc()
|
||||
(label) malloc::@return
|
||||
(byte*) malloc::return
|
||||
(byte*) malloc::return#0
|
||||
(byte*) malloc::return#1
|
||||
(byte*) malloc::return#2
|
||||
(byte*) malloc::return#3
|
||||
(byte*) malloc::return#4
|
||||
(byte*) malloc::return#5
|
||||
(byte*) malloc::return#6
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN_1#1) ← (number) 0
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN_2#1) ← (number) 0
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast (byte*) MEM#0 ← (byte*)(number) $400
|
||||
Inlining cast *((byte*) SCREEN_1#1) ← (unumber)(number) 0
|
||||
Inlining cast *((byte*) SCREEN_2#1) ← (unumber)(number) 0
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias (byte*) malloc::return#0 = (byte*) malloc::return#4 (byte*) malloc::return#1
|
||||
Alias (byte*) MEM#1 = (byte*) MEM#6 (byte*) MEM#2
|
||||
Alias (byte*) MEM#0 = (byte*) MEM#9
|
||||
Alias (byte*) malloc::return#2 = (byte*) malloc::return#5
|
||||
Alias (byte*) MEM#3 = (byte*) MEM#7
|
||||
Alias (byte*) SCREEN_1#0 = (byte*~) $0 (byte*) SCREEN_1#3 (byte*) SCREEN_1#2
|
||||
Alias (byte*) malloc::return#3 = (byte*) malloc::return#6
|
||||
Alias (byte*) MEM#4 = (byte*) MEM#8
|
||||
Alias (byte*) SCREEN_2#0 = (byte*~) $1 (byte*) SCREEN_2#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte*) MEM#3 (byte*) MEM#1
|
||||
Identical Phi Values (byte*) MEM#4 (byte*) MEM#1
|
||||
Identical Phi Values (byte*) SCREEN_1#1 (byte*) SCREEN_1#0
|
||||
Identical Phi Values (byte*) SCREEN_2#1 (byte*) SCREEN_2#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Constant (const byte*) MEM#0 = (byte*) 1024
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings (const byte*) MEM#0
|
||||
Constant inlined MEM#0 = (byte*) 1024
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @5
|
||||
Adding NOP phi() at start of @end
|
||||
CALL GRAPH
|
||||
Calls in [] to malloc:2 malloc:6 main:10
|
||||
|
||||
Created 1 initial phi equivalence classes
|
||||
Coalesced [5] MEM#10 ← MEM#1
|
||||
Coalesced down to 1 phi equivalence classes
|
||||
Culled Empty Block (label) @5
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call malloc
|
||||
[3] (byte*) malloc::return#2 ← (byte*) malloc::return#0
|
||||
to:@3
|
||||
@3: scope:[] from @1
|
||||
[4] (byte*) SCREEN_1#0 ← (byte*) malloc::return#2
|
||||
[5] call malloc
|
||||
[6] (byte*) malloc::return#3 ← (byte*) malloc::return#0
|
||||
to:@4
|
||||
@4: scope:[] from @3
|
||||
[7] (byte*) SCREEN_2#0 ← (byte*) malloc::return#3
|
||||
to:@2
|
||||
@2: scope:[] from @4
|
||||
[8] phi()
|
||||
[9] call main
|
||||
to:@end
|
||||
@end: scope:[] from @2
|
||||
[10] phi()
|
||||
main: scope:[main] from @2
|
||||
[11] *((byte*) SCREEN_1#0) ← (byte) 0
|
||||
[12] *((byte*) SCREEN_2#0) ← (byte) 0
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[13] return
|
||||
to:@return
|
||||
malloc: scope:[malloc] from @1 @3
|
||||
[14] (byte*) MEM#5 ← phi( @1/(byte*) 1024 @3/(byte*) MEM#1 )
|
||||
[15] (byte*) MEM#1 ← ++ (byte*) MEM#5
|
||||
[16] (byte*) malloc::return#0 ← (byte*) MEM#1
|
||||
to:malloc::@return
|
||||
malloc::@return: scope:[malloc] from malloc
|
||||
[17] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte*) MEM
|
||||
(byte*) MEM#1 1.0
|
||||
(byte*) MEM#5 4.0
|
||||
(byte*) SCREEN_1
|
||||
(byte*) SCREEN_1#0 0.8
|
||||
(byte*) SCREEN_2
|
||||
(byte*) SCREEN_2#0 1.3333333333333333
|
||||
(void()) main()
|
||||
(byte*()) malloc()
|
||||
(byte*) malloc::return
|
||||
(byte*) malloc::return#0 1.5
|
||||
(byte*) malloc::return#2 4.0
|
||||
(byte*) malloc::return#3 4.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ MEM#5 MEM#1 ]
|
||||
Added variable malloc::return#2 to zero page equivalence class [ malloc::return#2 ]
|
||||
Added variable SCREEN_1#0 to zero page equivalence class [ SCREEN_1#0 ]
|
||||
Added variable malloc::return#3 to zero page equivalence class [ malloc::return#3 ]
|
||||
Added variable SCREEN_2#0 to zero page equivalence class [ SCREEN_2#0 ]
|
||||
Added variable malloc::return#0 to zero page equivalence class [ malloc::return#0 ]
|
||||
Complete equivalence classes
|
||||
[ MEM#5 MEM#1 ]
|
||||
[ malloc::return#2 ]
|
||||
[ SCREEN_1#0 ]
|
||||
[ malloc::return#3 ]
|
||||
[ SCREEN_2#0 ]
|
||||
[ malloc::return#0 ]
|
||||
Allocated zp ZP_WORD:2 [ MEM#5 MEM#1 ]
|
||||
Allocated zp ZP_WORD:4 [ malloc::return#2 ]
|
||||
Allocated zp ZP_WORD:6 [ SCREEN_1#0 ]
|
||||
Allocated zp ZP_WORD:8 [ malloc::return#3 ]
|
||||
Allocated zp ZP_WORD:10 [ SCREEN_2#0 ]
|
||||
Allocated zp ZP_WORD:12 [ malloc::return#0 ]
|
||||
|
||||
INITIAL ASM
|
||||
//SEG0 File Comments
|
||||
// Error where the compiler is reusing the same ZP for two byte* variables.
|
||||
// SCREEN_1 and SCREEN_2 are both allocated to ZP: 4
|
||||
// Problem is that outside main() scope statements have zero call-paths and then isStatementAllocationOverlapping() never checks liveranges
|
||||
// CallPath code must be rewritten to use @begin as the outermost call instead of main()
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.label MEM = 2
|
||||
.label SCREEN_1 = 6
|
||||
.label SCREEN_2 = $a
|
||||
//SEG3 @begin
|
||||
bbegin:
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
b1_from_bbegin:
|
||||
jmp b1
|
||||
//SEG5 @1
|
||||
b1:
|
||||
//SEG6 [2] call malloc
|
||||
//SEG7 [14] phi from @1 to malloc [phi:@1->malloc]
|
||||
malloc_from_b1:
|
||||
//SEG8 [14] phi (byte*) MEM#5 = (byte*) 1024 [phi:@1->malloc#0] -- pbuz1=pbuc1
|
||||
lda #<$400
|
||||
sta MEM
|
||||
lda #>$400
|
||||
sta MEM+1
|
||||
jsr malloc
|
||||
//SEG9 [3] (byte*) malloc::return#2 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
|
||||
lda malloc.return
|
||||
sta malloc.return_2
|
||||
lda malloc.return+1
|
||||
sta malloc.return_2+1
|
||||
jmp b3
|
||||
//SEG10 @3
|
||||
b3:
|
||||
//SEG11 [4] (byte*) SCREEN_1#0 ← (byte*) malloc::return#2 -- pbuz1=pbuz2
|
||||
lda malloc.return_2
|
||||
sta SCREEN_1
|
||||
lda malloc.return_2+1
|
||||
sta SCREEN_1+1
|
||||
//SEG12 [5] call malloc
|
||||
//SEG13 [14] phi from @3 to malloc [phi:@3->malloc]
|
||||
malloc_from_b3:
|
||||
//SEG14 [14] phi (byte*) MEM#5 = (byte*) MEM#1 [phi:@3->malloc#0] -- register_copy
|
||||
jsr malloc
|
||||
//SEG15 [6] (byte*) malloc::return#3 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
|
||||
lda malloc.return
|
||||
sta malloc.return_3
|
||||
lda malloc.return+1
|
||||
sta malloc.return_3+1
|
||||
jmp b4
|
||||
//SEG16 @4
|
||||
b4:
|
||||
//SEG17 [7] (byte*) SCREEN_2#0 ← (byte*) malloc::return#3 -- pbuz1=pbuz2
|
||||
lda malloc.return_3
|
||||
sta SCREEN_2
|
||||
lda malloc.return_3+1
|
||||
sta SCREEN_2+1
|
||||
//SEG18 [8] phi from @4 to @2 [phi:@4->@2]
|
||||
b2_from_b4:
|
||||
jmp b2
|
||||
//SEG19 @2
|
||||
b2:
|
||||
//SEG20 [9] call main
|
||||
jsr main
|
||||
//SEG21 [10] phi from @2 to @end [phi:@2->@end]
|
||||
bend_from_b2:
|
||||
jmp bend
|
||||
//SEG22 @end
|
||||
bend:
|
||||
//SEG23 main
|
||||
main: {
|
||||
//SEG24 [11] *((byte*) SCREEN_1#0) ← (byte) 0 -- _deref_pbuz1=vbuc1
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (SCREEN_1),y
|
||||
//SEG25 [12] *((byte*) SCREEN_2#0) ← (byte) 0 -- _deref_pbuz1=vbuc1
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (SCREEN_2),y
|
||||
jmp breturn
|
||||
//SEG26 main::@return
|
||||
breturn:
|
||||
//SEG27 [13] return
|
||||
rts
|
||||
}
|
||||
//SEG28 malloc
|
||||
malloc: {
|
||||
.label return = $c
|
||||
.label return_2 = 4
|
||||
.label return_3 = 8
|
||||
//SEG29 [15] (byte*) MEM#1 ← ++ (byte*) MEM#5 -- pbuz1=_inc_pbuz1
|
||||
inc MEM
|
||||
bne !+
|
||||
inc MEM+1
|
||||
!:
|
||||
//SEG30 [16] (byte*) malloc::return#0 ← (byte*) MEM#1 -- pbuz1=pbuz2
|
||||
lda MEM
|
||||
sta return
|
||||
lda MEM+1
|
||||
sta return+1
|
||||
jmp breturn
|
||||
//SEG31 malloc::@return
|
||||
breturn:
|
||||
//SEG32 [17] return
|
||||
rts
|
||||
}
|
||||
//SEG33 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [3] (byte*) malloc::return#2 ← (byte*) malloc::return#0 [ malloc::return#2 MEM#1 ] ( [ malloc::return#2 MEM#1 ] ) always clobbers reg byte a
|
||||
Statement [4] (byte*) SCREEN_1#0 ← (byte*) malloc::return#2 [ SCREEN_1#0 MEM#1 ] ( [ SCREEN_1#0 MEM#1 ] ) always clobbers reg byte a
|
||||
Statement [6] (byte*) malloc::return#3 ← (byte*) malloc::return#0 [ SCREEN_1#0 malloc::return#3 ] ( [ SCREEN_1#0 malloc::return#3 ] ) always clobbers reg byte a
|
||||
Statement [7] (byte*) SCREEN_2#0 ← (byte*) malloc::return#3 [ SCREEN_1#0 SCREEN_2#0 ] ( [ SCREEN_1#0 SCREEN_2#0 ] ) always clobbers reg byte a
|
||||
Statement [11] *((byte*) SCREEN_1#0) ← (byte) 0 [ SCREEN_2#0 ] ( main:9 [ SCREEN_2#0 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [12] *((byte*) SCREEN_2#0) ← (byte) 0 [ ] ( main:9 [ ] ) always clobbers reg byte a reg byte y
|
||||
Statement [16] (byte*) malloc::return#0 ← (byte*) MEM#1 [ malloc::return#0 MEM#1 ] ( malloc:2 [ malloc::return#0 MEM#1 ] malloc:5 [ malloc::return#0 MEM#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ MEM#5 MEM#1 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_WORD:4 [ malloc::return#2 ] : zp ZP_WORD:4 ,
|
||||
Potential registers zp ZP_WORD:6 [ SCREEN_1#0 ] : zp ZP_WORD:6 ,
|
||||
Potential registers zp ZP_WORD:8 [ malloc::return#3 ] : zp ZP_WORD:8 ,
|
||||
Potential registers zp ZP_WORD:10 [ SCREEN_2#0 ] : zp ZP_WORD:10 ,
|
||||
Potential registers zp ZP_WORD:12 [ malloc::return#0 ] : zp ZP_WORD:12 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [malloc] 4: zp ZP_WORD:4 [ malloc::return#2 ] 4: zp ZP_WORD:8 [ malloc::return#3 ] 1.5: zp ZP_WORD:12 [ malloc::return#0 ]
|
||||
Uplift Scope [] 5: zp ZP_WORD:2 [ MEM#5 MEM#1 ] 1.33: zp ZP_WORD:10 [ SCREEN_2#0 ] 0.8: zp ZP_WORD:6 [ SCREEN_1#0 ]
|
||||
Uplift Scope [main]
|
||||
|
||||
Uplifting [malloc] best 153 combination zp ZP_WORD:4 [ malloc::return#2 ] zp ZP_WORD:8 [ malloc::return#3 ] zp ZP_WORD:12 [ malloc::return#0 ]
|
||||
Uplifting [] best 153 combination zp ZP_WORD:2 [ MEM#5 MEM#1 ] zp ZP_WORD:10 [ SCREEN_2#0 ] zp ZP_WORD:6 [ SCREEN_1#0 ]
|
||||
Uplifting [main] best 153 combination
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:4 [ malloc::return#2 ] ] with [ zp ZP_WORD:6 [ SCREEN_1#0 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ malloc::return#3 ] ] with [ zp ZP_WORD:10 [ SCREEN_2#0 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ malloc::return#3 SCREEN_2#0 ] ] with [ zp ZP_WORD:12 [ malloc::return#0 ] ] - score: 1
|
||||
Allocated (was zp ZP_WORD:8) zp ZP_WORD:6 [ malloc::return#3 SCREEN_2#0 malloc::return#0 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
//SEG0 File Comments
|
||||
// Error where the compiler is reusing the same ZP for two byte* variables.
|
||||
// SCREEN_1 and SCREEN_2 are both allocated to ZP: 4
|
||||
// Problem is that outside main() scope statements have zero call-paths and then isStatementAllocationOverlapping() never checks liveranges
|
||||
// CallPath code must be rewritten to use @begin as the outermost call instead of main()
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.label MEM = 2
|
||||
.label SCREEN_1 = 4
|
||||
.label SCREEN_2 = 6
|
||||
//SEG3 @begin
|
||||
bbegin:
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
b1_from_bbegin:
|
||||
jmp b1
|
||||
//SEG5 @1
|
||||
b1:
|
||||
//SEG6 [2] call malloc
|
||||
//SEG7 [14] phi from @1 to malloc [phi:@1->malloc]
|
||||
malloc_from_b1:
|
||||
//SEG8 [14] phi (byte*) MEM#5 = (byte*) 1024 [phi:@1->malloc#0] -- pbuz1=pbuc1
|
||||
lda #<$400
|
||||
sta MEM
|
||||
lda #>$400
|
||||
sta MEM+1
|
||||
jsr malloc
|
||||
//SEG9 [3] (byte*) malloc::return#2 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
|
||||
lda malloc.return
|
||||
sta malloc.return_2
|
||||
lda malloc.return+1
|
||||
sta malloc.return_2+1
|
||||
jmp b3
|
||||
//SEG10 @3
|
||||
b3:
|
||||
//SEG11 [4] (byte*) SCREEN_1#0 ← (byte*) malloc::return#2
|
||||
//SEG12 [5] call malloc
|
||||
//SEG13 [14] phi from @3 to malloc [phi:@3->malloc]
|
||||
malloc_from_b3:
|
||||
//SEG14 [14] phi (byte*) MEM#5 = (byte*) MEM#1 [phi:@3->malloc#0] -- register_copy
|
||||
jsr malloc
|
||||
//SEG15 [6] (byte*) malloc::return#3 ← (byte*) malloc::return#0
|
||||
jmp b4
|
||||
//SEG16 @4
|
||||
b4:
|
||||
//SEG17 [7] (byte*) SCREEN_2#0 ← (byte*) malloc::return#3
|
||||
//SEG18 [8] phi from @4 to @2 [phi:@4->@2]
|
||||
b2_from_b4:
|
||||
jmp b2
|
||||
//SEG19 @2
|
||||
b2:
|
||||
//SEG20 [9] call main
|
||||
jsr main
|
||||
//SEG21 [10] phi from @2 to @end [phi:@2->@end]
|
||||
bend_from_b2:
|
||||
jmp bend
|
||||
//SEG22 @end
|
||||
bend:
|
||||
//SEG23 main
|
||||
main: {
|
||||
//SEG24 [11] *((byte*) SCREEN_1#0) ← (byte) 0 -- _deref_pbuz1=vbuc1
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (SCREEN_1),y
|
||||
//SEG25 [12] *((byte*) SCREEN_2#0) ← (byte) 0 -- _deref_pbuz1=vbuc1
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (SCREEN_2),y
|
||||
jmp breturn
|
||||
//SEG26 main::@return
|
||||
breturn:
|
||||
//SEG27 [13] return
|
||||
rts
|
||||
}
|
||||
//SEG28 malloc
|
||||
malloc: {
|
||||
.label return = 6
|
||||
.label return_2 = 4
|
||||
//SEG29 [15] (byte*) MEM#1 ← ++ (byte*) MEM#5 -- pbuz1=_inc_pbuz1
|
||||
inc MEM
|
||||
bne !+
|
||||
inc MEM+1
|
||||
!:
|
||||
//SEG30 [16] (byte*) malloc::return#0 ← (byte*) MEM#1 -- pbuz1=pbuz2
|
||||
lda MEM
|
||||
sta return
|
||||
lda MEM+1
|
||||
sta return+1
|
||||
jmp breturn
|
||||
//SEG31 malloc::@return
|
||||
breturn:
|
||||
//SEG32 [17] return
|
||||
rts
|
||||
}
|
||||
//SEG33 File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b4
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing instruction ldy #0 with TAY
|
||||
Removing instruction lda #0
|
||||
Removing instruction ldy #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction malloc_from_b1:
|
||||
Removing instruction malloc_from_b3:
|
||||
Removing instruction b4:
|
||||
Removing instruction b2_from_b4:
|
||||
Removing instruction bend_from_b2:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction b3:
|
||||
Removing instruction b2:
|
||||
Removing instruction bend:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Adding RTS to root block
|
||||
Succesful ASM optimization Pass5AddMainRts
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @3
|
||||
(label) @4
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte*) MEM
|
||||
(byte*) MEM#1 MEM zp ZP_WORD:2 1.0
|
||||
(byte*) MEM#5 MEM zp ZP_WORD:2 4.0
|
||||
(byte*) SCREEN_1
|
||||
(byte*) SCREEN_1#0 SCREEN_1 zp ZP_WORD:4 0.8
|
||||
(byte*) SCREEN_2
|
||||
(byte*) SCREEN_2#0 SCREEN_2 zp ZP_WORD:6 1.3333333333333333
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(byte*()) malloc()
|
||||
(label) malloc::@return
|
||||
(byte*) malloc::return
|
||||
(byte*) malloc::return#0 return zp ZP_WORD:6 1.5
|
||||
(byte*) malloc::return#2 return#2 zp ZP_WORD:4 4.0
|
||||
(byte*) malloc::return#3 return zp ZP_WORD:6 4.0
|
||||
|
||||
zp ZP_WORD:2 [ MEM#5 MEM#1 ]
|
||||
zp ZP_WORD:4 [ malloc::return#2 SCREEN_1#0 ]
|
||||
zp ZP_WORD:6 [ malloc::return#3 SCREEN_2#0 malloc::return#0 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 98
|
||||
|
||||
//SEG0 File Comments
|
||||
// Error where the compiler is reusing the same ZP for two byte* variables.
|
||||
// SCREEN_1 and SCREEN_2 are both allocated to ZP: 4
|
||||
// Problem is that outside main() scope statements have zero call-paths and then isStatementAllocationOverlapping() never checks liveranges
|
||||
// CallPath code must be rewritten to use @begin as the outermost call instead of main()
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.label MEM = 2
|
||||
.label SCREEN_1 = 4
|
||||
.label SCREEN_2 = 6
|
||||
//SEG3 @begin
|
||||
bbegin:
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
//SEG5 @1
|
||||
//SEG6 [2] call malloc
|
||||
//SEG7 [14] phi from @1 to malloc [phi:@1->malloc]
|
||||
//SEG8 [14] phi (byte*) MEM#5 = (byte*) 1024 [phi:@1->malloc#0] -- pbuz1=pbuc1
|
||||
lda #<$400
|
||||
sta MEM
|
||||
lda #>$400
|
||||
sta MEM+1
|
||||
jsr malloc
|
||||
//SEG9 [3] (byte*) malloc::return#2 ← (byte*) malloc::return#0 -- pbuz1=pbuz2
|
||||
lda malloc.return
|
||||
sta malloc.return_2
|
||||
lda malloc.return+1
|
||||
sta malloc.return_2+1
|
||||
//SEG10 @3
|
||||
//SEG11 [4] (byte*) SCREEN_1#0 ← (byte*) malloc::return#2
|
||||
//SEG12 [5] call malloc
|
||||
//SEG13 [14] phi from @3 to malloc [phi:@3->malloc]
|
||||
//SEG14 [14] phi (byte*) MEM#5 = (byte*) MEM#1 [phi:@3->malloc#0] -- register_copy
|
||||
jsr malloc
|
||||
//SEG15 [6] (byte*) malloc::return#3 ← (byte*) malloc::return#0
|
||||
//SEG16 @4
|
||||
//SEG17 [7] (byte*) SCREEN_2#0 ← (byte*) malloc::return#3
|
||||
//SEG18 [8] phi from @4 to @2 [phi:@4->@2]
|
||||
//SEG19 @2
|
||||
//SEG20 [9] call main
|
||||
jsr main
|
||||
rts
|
||||
//SEG21 [10] phi from @2 to @end [phi:@2->@end]
|
||||
//SEG22 @end
|
||||
//SEG23 main
|
||||
main: {
|
||||
//SEG24 [11] *((byte*) SCREEN_1#0) ← (byte) 0 -- _deref_pbuz1=vbuc1
|
||||
lda #0
|
||||
tay
|
||||
sta (SCREEN_1),y
|
||||
//SEG25 [12] *((byte*) SCREEN_2#0) ← (byte) 0 -- _deref_pbuz1=vbuc1
|
||||
sta (SCREEN_2),y
|
||||
//SEG26 main::@return
|
||||
//SEG27 [13] return
|
||||
rts
|
||||
}
|
||||
//SEG28 malloc
|
||||
malloc: {
|
||||
.label return = 6
|
||||
.label return_2 = 4
|
||||
//SEG29 [15] (byte*) MEM#1 ← ++ (byte*) MEM#5 -- pbuz1=_inc_pbuz1
|
||||
inc MEM
|
||||
bne !+
|
||||
inc MEM+1
|
||||
!:
|
||||
//SEG30 [16] (byte*) malloc::return#0 ← (byte*) MEM#1 -- pbuz1=pbuz2
|
||||
lda MEM
|
||||
sta return
|
||||
lda MEM+1
|
||||
sta return+1
|
||||
//SEG31 malloc::@return
|
||||
//SEG32 [17] return
|
||||
rts
|
||||
}
|
||||
//SEG33 File Data
|
||||
|
25
src/test/ref/liverange-problem-0.sym
Normal file
25
src/test/ref/liverange-problem-0.sym
Normal file
@ -0,0 +1,25 @@
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @3
|
||||
(label) @4
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte*) MEM
|
||||
(byte*) MEM#1 MEM zp ZP_WORD:2 1.0
|
||||
(byte*) MEM#5 MEM zp ZP_WORD:2 4.0
|
||||
(byte*) SCREEN_1
|
||||
(byte*) SCREEN_1#0 SCREEN_1 zp ZP_WORD:4 0.8
|
||||
(byte*) SCREEN_2
|
||||
(byte*) SCREEN_2#0 SCREEN_2 zp ZP_WORD:6 1.3333333333333333
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(byte*()) malloc()
|
||||
(label) malloc::@return
|
||||
(byte*) malloc::return
|
||||
(byte*) malloc::return#0 return zp ZP_WORD:6 1.5
|
||||
(byte*) malloc::return#2 return#2 zp ZP_WORD:4 4.0
|
||||
(byte*) malloc::return#3 return zp ZP_WORD:6 4.0
|
||||
|
||||
zp ZP_WORD:2 [ MEM#5 MEM#1 ]
|
||||
zp ZP_WORD:4 [ malloc::return#2 SCREEN_1#0 ]
|
||||
zp ZP_WORD:6 [ malloc::return#3 SCREEN_2#0 malloc::return#0 ]
|
@ -328,7 +328,7 @@ irq: {
|
||||
//SEG31 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( [ col#0 ] ) always clobbers reg byte a
|
||||
Statement [4] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ col#0 ] ( main:2 [ col#0 ] ) always clobbers reg byte a
|
||||
Statement [6] if((byte) col#12<(byte) $a+(byte) 1) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) col#1 ← (byte) 0 [ col#1 ] ( main:2 [ col#1 ] ) always clobbers reg byte a
|
||||
|
@ -3180,11 +3180,11 @@ YSIN:
|
||||
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] (byte) plex_show_idx#0 ← (byte) 0 [ plex_show_idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (byte) plex_sprite_idx#0 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [3] (byte) plex_sprite_msb#0 ← (byte) 1 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ( ) always clobbers reg byte a
|
||||
Statement [4] (byte) plex_free_next#31 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ( ) always clobbers reg byte a
|
||||
Statement [6] (bool) framedone#17 ← true [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) plex_show_idx#0 ← (byte) 0 [ plex_show_idx#0 ] ( [ plex_show_idx#0 ] ) always clobbers reg byte a
|
||||
Statement [2] (byte) plex_sprite_idx#0 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 ] ( [ plex_show_idx#0 plex_sprite_idx#0 ] ) always clobbers reg byte a
|
||||
Statement [3] (byte) plex_sprite_msb#0 ← (byte) 1 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ) always clobbers reg byte a
|
||||
Statement [4] (byte) plex_free_next#31 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ) always clobbers reg byte a
|
||||
Statement [6] (bool) framedone#17 ← true [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ) always clobbers reg byte a
|
||||
Statement [17] if((bool) framedone#12) goto loop::@3 [ framedone#12 loop::sin_idx#6 ] ( main:8::loop:13 [ framedone#12 loop::sin_idx#6 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ]
|
||||
Statement [18] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 [ loop::sin_idx#6 ] ( main:8::loop:13 [ loop::sin_idx#6 ] ) always clobbers reg byte a
|
||||
@ -3252,11 +3252,11 @@ Statement [116] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byt
|
||||
Statement [119] if((byte) plex_sprite_msb#3!=(byte) 0) goto plexShowSprite::@return [ plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#3 ] ( plexShowSprite:87 [ framedone#17 plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#3 ] ) always clobbers reg byte a
|
||||
Statement [120] (byte) plex_sprite_msb#4 ← (byte) 1 [ plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#4 ] ( plexShowSprite:87 [ framedone#17 plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#4 ] ) always clobbers reg byte a
|
||||
Statement [123] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#28 [ plex_sprite_idx#25 plex_show_idx#27 plex_sprite_msb#28 plexShowSprite::plexFreeAdd1_$2#0 ] ( plexShowSprite:87 [ framedone#17 plex_sprite_idx#25 plex_show_idx#27 plex_sprite_msb#28 plexShowSprite::plexFreeAdd1_$2#0 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) plex_show_idx#0 ← (byte) 0 [ plex_show_idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (byte) plex_sprite_idx#0 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [3] (byte) plex_sprite_msb#0 ← (byte) 1 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ( ) always clobbers reg byte a
|
||||
Statement [4] (byte) plex_free_next#31 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ( ) always clobbers reg byte a
|
||||
Statement [6] (bool) framedone#17 ← true [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) plex_show_idx#0 ← (byte) 0 [ plex_show_idx#0 ] ( [ plex_show_idx#0 ] ) always clobbers reg byte a
|
||||
Statement [2] (byte) plex_sprite_idx#0 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 ] ( [ plex_show_idx#0 plex_sprite_idx#0 ] ) always clobbers reg byte a
|
||||
Statement [3] (byte) plex_sprite_msb#0 ← (byte) 1 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ) always clobbers reg byte a
|
||||
Statement [4] (byte) plex_free_next#31 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ) always clobbers reg byte a
|
||||
Statement [6] (bool) framedone#17 ← true [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ) always clobbers reg byte a
|
||||
Statement [17] if((bool) framedone#12) goto loop::@3 [ framedone#12 loop::sin_idx#6 ] ( main:8::loop:13 [ framedone#12 loop::sin_idx#6 ] ) always clobbers reg byte a
|
||||
Statement [18] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 [ loop::sin_idx#6 ] ( main:8::loop:13 [ loop::sin_idx#6 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte[$100]) YSIN#0 + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:8::loop:13 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ) always clobbers reg byte a
|
||||
@ -3310,11 +3310,11 @@ Statement [116] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byt
|
||||
Statement [119] if((byte) plex_sprite_msb#3!=(byte) 0) goto plexShowSprite::@return [ plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#3 ] ( plexShowSprite:87 [ framedone#17 plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#3 ] ) always clobbers reg byte a
|
||||
Statement [120] (byte) plex_sprite_msb#4 ← (byte) 1 [ plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#4 ] ( plexShowSprite:87 [ framedone#17 plexShowSprite::$6 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#4 ] ) always clobbers reg byte a
|
||||
Statement [123] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#28 [ plex_sprite_idx#25 plex_show_idx#27 plex_sprite_msb#28 plexShowSprite::plexFreeAdd1_$2#0 ] ( plexShowSprite:87 [ framedone#17 plex_sprite_idx#25 plex_show_idx#27 plex_sprite_msb#28 plexShowSprite::plexFreeAdd1_$2#0 ] ) always clobbers reg byte a
|
||||
Statement [1] (byte) plex_show_idx#0 ← (byte) 0 [ plex_show_idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [2] (byte) plex_sprite_idx#0 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 ] ( ) always clobbers reg byte a
|
||||
Statement [3] (byte) plex_sprite_msb#0 ← (byte) 1 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ( ) always clobbers reg byte a
|
||||
Statement [4] (byte) plex_free_next#31 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ( ) always clobbers reg byte a
|
||||
Statement [6] (bool) framedone#17 ← true [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ( ) always clobbers reg byte a
|
||||
Statement [1] (byte) plex_show_idx#0 ← (byte) 0 [ plex_show_idx#0 ] ( [ plex_show_idx#0 ] ) always clobbers reg byte a
|
||||
Statement [2] (byte) plex_sprite_idx#0 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 ] ( [ plex_show_idx#0 plex_sprite_idx#0 ] ) always clobbers reg byte a
|
||||
Statement [3] (byte) plex_sprite_msb#0 ← (byte) 1 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 ] ) always clobbers reg byte a
|
||||
Statement [4] (byte) plex_free_next#31 ← (byte) 0 [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 ] ) always clobbers reg byte a
|
||||
Statement [6] (bool) framedone#17 ← true [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ( [ plex_show_idx#0 plex_sprite_idx#0 plex_sprite_msb#0 plex_free_next#31 framedone#17 ] ) always clobbers reg byte a
|
||||
Statement [17] if((bool) framedone#12) goto loop::@3 [ framedone#12 loop::sin_idx#6 ] ( main:8::loop:13 [ framedone#12 loop::sin_idx#6 ] ) always clobbers reg byte a
|
||||
Statement [18] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 [ loop::sin_idx#6 ] ( main:8::loop:13 [ loop::sin_idx#6 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte[$100]) YSIN#0 + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:8::loop:13 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ) always clobbers reg byte a
|
||||
|
63
src/test/ref/nes-array.asm
Normal file
63
src/test/ref/nes-array.asm
Normal file
@ -0,0 +1,63 @@
|
||||
// Test a bit of array code from the NES forum
|
||||
// https://forums.nesdev.com/viewtopic.php?f=2&t=18735
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.const SIZEOF_SIGNED_WORD = 2
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = 2
|
||||
.label _3 = 2
|
||||
.label y1 = 4
|
||||
.label y2 = 6
|
||||
lda #<$1234
|
||||
sta y1
|
||||
lda #>$1234
|
||||
sta y1+1
|
||||
lda #<$1234
|
||||
sta y2
|
||||
lda #>$1234
|
||||
sta y2+1
|
||||
lda #<y1
|
||||
sta foo.y
|
||||
lda #>y1
|
||||
sta foo.y+1
|
||||
ldx #1
|
||||
jsr foo
|
||||
lda _1
|
||||
sta SCREEN
|
||||
lda _1+1
|
||||
sta SCREEN+1
|
||||
lda #<y2
|
||||
sta foo.y
|
||||
lda #>y2
|
||||
sta foo.y+1
|
||||
ldx #2
|
||||
jsr foo
|
||||
lda _3
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD
|
||||
lda _3+1
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD+1
|
||||
rts
|
||||
}
|
||||
// foo(byte register(X) x, signed word* zeropage(2) y)
|
||||
foo: {
|
||||
.label return = 2
|
||||
.label y = 2
|
||||
txa
|
||||
asl
|
||||
tax
|
||||
clc
|
||||
ldy #0
|
||||
lda wow,x
|
||||
adc (return),y
|
||||
pha
|
||||
iny
|
||||
lda wow+1,x
|
||||
adc (return),y
|
||||
sta return+1
|
||||
pla
|
||||
sta return
|
||||
rts
|
||||
}
|
||||
wow: .word $cafe, $babe, $1234, $5678
|
37
src/test/ref/nes-array.cfg
Normal file
37
src/test/ref/nes-array.cfg
Normal file
@ -0,0 +1,37 @@
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call main
|
||||
to:@end
|
||||
@end: scope:[] from @1
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] (signed word) main::y1#0 ← (signed word) $1234
|
||||
[5] (signed word) main::y2#0 ← (signed word) $1234
|
||||
[6] call foo
|
||||
[7] (signed word) foo::return#2 ← (signed word) foo::return#0
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main
|
||||
[8] (signed word~) main::$1 ← (signed word) foo::return#2
|
||||
[9] *((const signed word*) main::SCREEN#0) ← (signed word~) main::$1
|
||||
[10] call foo
|
||||
[11] (signed word) foo::return#3 ← (signed word) foo::return#0
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1
|
||||
[12] (signed word~) main::$3 ← (signed word) foo::return#3
|
||||
[13] *((const signed word*) main::SCREEN#0+(const byte) SIZEOF_SIGNED_WORD) ← (signed word~) main::$3
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[14] return
|
||||
to:@return
|
||||
foo: scope:[foo] from main main::@1
|
||||
[15] (signed word*) foo::y#2 ← phi( main/&(signed word) main::y1#0 main::@1/&(signed word) main::y2#0 )
|
||||
[15] (byte) foo::x#2 ← phi( main/(byte) 1 main::@1/(byte) 2 )
|
||||
[16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1
|
||||
[17] (signed word) foo::return#0 ← *((const signed word[4]) wow#0 + (byte~) foo::$1) + *((signed word*) foo::y#2)
|
||||
to:foo::@return
|
||||
foo::@return: scope:[foo] from foo
|
||||
[18] return
|
||||
to:@return
|
752
src/test/ref/nes-array.log
Normal file
752
src/test/ref/nes-array.log
Normal file
@ -0,0 +1,752 @@
|
||||
Setting inferred volatile on symbol affected by address-of (signed word*~) main::$0 ← & (signed word) main::y1
|
||||
Setting inferred volatile on symbol affected by address-of (signed word*~) main::$2 ← & (signed word) main::y2
|
||||
Fixing pointer increment (signed word*) main::SCREEN ← ++ (signed word*) main::SCREEN
|
||||
Fixing pointer increment (signed word*) main::SCREEN ← ++ (signed word*) main::SCREEN
|
||||
Fixing pointer array-indexing *((signed word[4]) wow + (byte) foo::x)
|
||||
Culled Empty Block (label) foo::@1
|
||||
Culled Empty Block (label) @1
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(signed word[4]) wow#0 ← { (number) $cafe, (number) $babe, (number) $1234, (number) $5678 }
|
||||
to:@2
|
||||
foo: scope:[foo] from main main::@1
|
||||
(signed word*) foo::y#2 ← phi( main/(signed word*) foo::y#0 main::@1/(signed word*) foo::y#1 )
|
||||
(byte) foo::x#2 ← phi( main/(byte) foo::x#0 main::@1/(byte) foo::x#1 )
|
||||
(byte~) foo::$1 ← (byte) foo::x#2 * (const byte) SIZEOF_SIGNED_WORD
|
||||
(signed word~) foo::$0 ← *((signed word[4]) wow#0 + (byte~) foo::$1) + *((signed word*) foo::y#2)
|
||||
(signed word) foo::return#0 ← (signed word~) foo::$0
|
||||
to:foo::@return
|
||||
foo::@return: scope:[foo] from foo
|
||||
(signed word) foo::return#4 ← phi( foo/(signed word) foo::return#0 )
|
||||
(signed word) foo::return#1 ← (signed word) foo::return#4
|
||||
return
|
||||
to:@return
|
||||
main: scope:[main] from @2
|
||||
(signed word*) main::SCREEN#0 ← ((signed word*)) (number) $400
|
||||
(signed word) main::y1#0 ← (number) $1234
|
||||
(signed word) main::y2#0 ← (number) $1234
|
||||
(signed word*~) main::$0 ← & (signed word) main::y1#0
|
||||
(byte) foo::x#0 ← (number) 1
|
||||
(signed word*) foo::y#0 ← (signed word*~) main::$0
|
||||
call foo
|
||||
(signed word) foo::return#2 ← (signed word) foo::return#1
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main
|
||||
(signed word) main::y2#1 ← phi( main/(signed word) main::y2#0 )
|
||||
(signed word*) main::SCREEN#3 ← phi( main/(signed word*) main::SCREEN#0 )
|
||||
(signed word) foo::return#5 ← phi( main/(signed word) foo::return#2 )
|
||||
(signed word~) main::$1 ← (signed word) foo::return#5
|
||||
*((signed word*) main::SCREEN#3) ← (signed word~) main::$1
|
||||
(signed word*) main::SCREEN#1 ← (signed word*) main::SCREEN#3 + (const byte) SIZEOF_SIGNED_WORD
|
||||
(signed word*~) main::$2 ← & (signed word) main::y2#1
|
||||
(byte) foo::x#1 ← (number) 2
|
||||
(signed word*) foo::y#1 ← (signed word*~) main::$2
|
||||
call foo
|
||||
(signed word) foo::return#3 ← (signed word) foo::return#1
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1
|
||||
(signed word*) main::SCREEN#4 ← phi( main::@1/(signed word*) main::SCREEN#1 )
|
||||
(signed word) foo::return#6 ← phi( main::@1/(signed word) foo::return#3 )
|
||||
(signed word~) main::$3 ← (signed word) foo::return#6
|
||||
*((signed word*) main::SCREEN#4) ← (signed word~) main::$3
|
||||
(signed word*) main::SCREEN#2 ← (signed word*) main::SCREEN#4 + (const byte) SIZEOF_SIGNED_WORD
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
return
|
||||
to:@return
|
||||
@2: scope:[] from @begin
|
||||
call main
|
||||
to:@3
|
||||
@3: scope:[] from @2
|
||||
to:@end
|
||||
@end: scope:[] from @3
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(label) @2
|
||||
(label) @3
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) SIZEOF_SIGNED_WORD = (byte) 2
|
||||
(signed word()) foo((byte) foo::x , (signed word*) foo::y)
|
||||
(signed word~) foo::$0
|
||||
(byte~) foo::$1
|
||||
(label) foo::@return
|
||||
(signed word) foo::return
|
||||
(signed word) foo::return#0
|
||||
(signed word) foo::return#1
|
||||
(signed word) foo::return#2
|
||||
(signed word) foo::return#3
|
||||
(signed word) foo::return#4
|
||||
(signed word) foo::return#5
|
||||
(signed word) foo::return#6
|
||||
(byte) foo::x
|
||||
(byte) foo::x#0
|
||||
(byte) foo::x#1
|
||||
(byte) foo::x#2
|
||||
(signed word*) foo::y
|
||||
(signed word*) foo::y#0
|
||||
(signed word*) foo::y#1
|
||||
(signed word*) foo::y#2
|
||||
(void()) main()
|
||||
(signed word*~) main::$0
|
||||
(signed word~) main::$1
|
||||
(signed word*~) main::$2
|
||||
(signed word~) main::$3
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(signed word*) main::SCREEN
|
||||
(signed word*) main::SCREEN#0
|
||||
(signed word*) main::SCREEN#1
|
||||
(signed word*) main::SCREEN#2
|
||||
(signed word*) main::SCREEN#3
|
||||
(signed word*) main::SCREEN#4
|
||||
(signed word) main::y1
|
||||
(signed word) main::y1#0
|
||||
(signed word) main::y2
|
||||
(signed word) main::y2#0
|
||||
(signed word) main::y2#1
|
||||
(signed word[4]) wow
|
||||
(signed word[4]) wow#0
|
||||
|
||||
Adding number conversion cast (snumber) $1234 in (signed word) main::y1#0 ← (number) $1234
|
||||
Adding number conversion cast (snumber) $1234 in (signed word) main::y2#0 ← (number) $1234
|
||||
Adding number conversion cast (unumber) 1 in (byte) foo::x#0 ← (number) 1
|
||||
Adding number conversion cast (unumber) 2 in (byte) foo::x#1 ← (number) 2
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Adding number conversion cast (signed word) to elements in (signed word[4]) wow#0 ← { (signed word)(number) $cafe, (signed word)(number) $babe, (signed word)(number) $1234, (signed word)(number) $5678 }
|
||||
Successful SSA optimization PassNAddArrayNumberTypeConversions
|
||||
Inlining cast (signed word*) main::SCREEN#0 ← (signed word*)(number) $400
|
||||
Inlining cast (signed word) main::y1#0 ← (snumber)(number) $1234
|
||||
Inlining cast (signed word) main::y2#0 ← (snumber)(number) $1234
|
||||
Inlining cast (byte) foo::x#0 ← (unumber)(number) 1
|
||||
Inlining cast (byte) foo::x#1 ← (unumber)(number) 2
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast $cafe
|
||||
Simplifying constant integer cast $babe
|
||||
Simplifying constant integer cast $1234
|
||||
Simplifying constant integer cast $5678
|
||||
Simplifying constant pointer cast (signed word*) 1024
|
||||
Simplifying constant integer cast $1234
|
||||
Simplifying constant integer cast $1234
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 2
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized signed number type (signed word) $1234
|
||||
Finalized signed number type (signed word) $1234
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 2
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias (signed word) foo::return#0 = (signed word~) foo::$0 (signed word) foo::return#4 (signed word) foo::return#1
|
||||
Alias (signed word*) foo::y#0 = (signed word*~) main::$0
|
||||
Alias (signed word) foo::return#2 = (signed word) foo::return#5
|
||||
Alias (signed word*) main::SCREEN#0 = (signed word*) main::SCREEN#3
|
||||
Alias (signed word) main::y2#0 = (signed word) main::y2#1
|
||||
Alias (signed word*) foo::y#1 = (signed word*~) main::$2
|
||||
Alias (signed word) foo::return#3 = (signed word) foo::return#6
|
||||
Alias (signed word*) main::SCREEN#1 = (signed word*) main::SCREEN#4
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Constant right-side identified [0] (signed word[4]) wow#0 ← { (signed word) $cafe, (signed word) $babe, (signed word) $1234, (signed word) $5678 }
|
||||
Constant right-side identified [11] (signed word*) foo::y#0 ← & (signed word) main::y1#0
|
||||
Constant right-side identified [20] (signed word*) foo::y#1 ← & (signed word) main::y2#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const signed word[4]) wow#0 = { $cafe, $babe, $1234, $5678 }
|
||||
Constant (const signed word*) main::SCREEN#0 = (signed word*) 1024
|
||||
Constant (const signed word*) foo::y#0 = &main::y1#0
|
||||
Constant (const byte) foo::x#0 = 1
|
||||
Constant (const signed word*) foo::y#1 = &main::y2#0
|
||||
Constant (const byte) foo::x#1 = 2
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Converting *(pointer+n) to pointer[n] [27] *((signed word*) main::SCREEN#1) ← (signed word~) main::$3 -- *(main::SCREEN#0 + SIZEOF_SIGNED_WORD)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Eliminating unused variable (signed word*) main::SCREEN#2 and assignment [15] (signed word*) main::SCREEN#2 ← (signed word*) main::SCREEN#1 + (const byte) SIZEOF_SIGNED_WORD
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Eliminating unused variable (signed word*) main::SCREEN#1 and assignment [10] (signed word*) main::SCREEN#1 ← (const signed word*) main::SCREEN#0 + (const byte) SIZEOF_SIGNED_WORD
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Rewriting multiplication to use shift [1] (byte~) foo::$1 ← (byte) foo::x#2 * (const byte) SIZEOF_SIGNED_WORD
|
||||
Successful SSA optimization Pass2MultiplyToShiftRewriting
|
||||
Inlining constant with var siblings (const signed word*) foo::y#0
|
||||
Inlining constant with var siblings (const byte) foo::x#0
|
||||
Inlining constant with var siblings (const signed word*) foo::y#1
|
||||
Inlining constant with var siblings (const byte) foo::x#1
|
||||
Constant inlined foo::y#0 = &(signed word) main::y1#0
|
||||
Constant inlined foo::x#1 = (byte) 2
|
||||
Constant inlined foo::y#1 = &(signed word) main::y2#0
|
||||
Constant inlined foo::x#0 = (byte) 1
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(main::SCREEN#0+SIZEOF_SIGNED_WORD)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @3
|
||||
Adding NOP phi() at start of @end
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
Calls in [main] to foo:7 foo:11
|
||||
|
||||
Created 2 initial phi equivalence classes
|
||||
Coalesced down to 2 phi equivalence classes
|
||||
Culled Empty Block (label) @3
|
||||
Renumbering block @2 to @1
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call main
|
||||
to:@end
|
||||
@end: scope:[] from @1
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] (signed word) main::y1#0 ← (signed word) $1234
|
||||
[5] (signed word) main::y2#0 ← (signed word) $1234
|
||||
[6] call foo
|
||||
[7] (signed word) foo::return#2 ← (signed word) foo::return#0
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main
|
||||
[8] (signed word~) main::$1 ← (signed word) foo::return#2
|
||||
[9] *((const signed word*) main::SCREEN#0) ← (signed word~) main::$1
|
||||
[10] call foo
|
||||
[11] (signed word) foo::return#3 ← (signed word) foo::return#0
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1
|
||||
[12] (signed word~) main::$3 ← (signed word) foo::return#3
|
||||
[13] *((const signed word*) main::SCREEN#0+(const byte) SIZEOF_SIGNED_WORD) ← (signed word~) main::$3
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[14] return
|
||||
to:@return
|
||||
foo: scope:[foo] from main main::@1
|
||||
[15] (signed word*) foo::y#2 ← phi( main/&(signed word) main::y1#0 main::@1/&(signed word) main::y2#0 )
|
||||
[15] (byte) foo::x#2 ← phi( main/(byte) 1 main::@1/(byte) 2 )
|
||||
[16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1
|
||||
[17] (signed word) foo::return#0 ← *((const signed word[4]) wow#0 + (byte~) foo::$1) + *((signed word*) foo::y#2)
|
||||
to:foo::@return
|
||||
foo::@return: scope:[foo] from foo
|
||||
[18] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(signed word()) foo((byte) foo::x , (signed word*) foo::y)
|
||||
(byte~) foo::$1 4.0
|
||||
(signed word) foo::return
|
||||
(signed word) foo::return#0 1.5
|
||||
(signed word) foo::return#2 4.0
|
||||
(signed word) foo::return#3 4.0
|
||||
(byte) foo::x
|
||||
(byte) foo::x#2 2.0
|
||||
(signed word*) foo::y
|
||||
(signed word*) foo::y#2 1.0
|
||||
(void()) main()
|
||||
(signed word~) main::$1 4.0
|
||||
(signed word~) main::$3 4.0
|
||||
(signed word*) main::SCREEN
|
||||
(signed word) main::y1
|
||||
(signed word) main::y1#0 20.0
|
||||
(signed word) main::y2
|
||||
(signed word) main::y2#0 20.0
|
||||
(signed word[4]) wow
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ foo::x#2 ]
|
||||
[ foo::y#2 ]
|
||||
Added variable foo::return#2 to zero page equivalence class [ foo::return#2 ]
|
||||
Added variable main::$1 to zero page equivalence class [ main::$1 ]
|
||||
Added variable foo::return#3 to zero page equivalence class [ foo::return#3 ]
|
||||
Added variable main::$3 to zero page equivalence class [ main::$3 ]
|
||||
Added variable foo::$1 to zero page equivalence class [ foo::$1 ]
|
||||
Added variable foo::return#0 to zero page equivalence class [ foo::return#0 ]
|
||||
Complete equivalence classes
|
||||
[ foo::x#2 ]
|
||||
[ foo::y#2 ]
|
||||
[ main::y1#0 ]
|
||||
[ main::y2#0 ]
|
||||
[ foo::return#2 ]
|
||||
[ main::$1 ]
|
||||
[ foo::return#3 ]
|
||||
[ main::$3 ]
|
||||
[ foo::$1 ]
|
||||
[ foo::return#0 ]
|
||||
Allocated zp ZP_BYTE:2 [ foo::x#2 ]
|
||||
Allocated zp ZP_WORD:3 [ foo::y#2 ]
|
||||
Allocated zp ZP_WORD:5 [ main::y1#0 ]
|
||||
Allocated zp ZP_WORD:7 [ main::y2#0 ]
|
||||
Allocated zp ZP_WORD:9 [ foo::return#2 ]
|
||||
Allocated zp ZP_WORD:11 [ main::$1 ]
|
||||
Allocated zp ZP_WORD:13 [ foo::return#3 ]
|
||||
Allocated zp ZP_WORD:15 [ main::$3 ]
|
||||
Allocated zp ZP_BYTE:17 [ foo::$1 ]
|
||||
Allocated zp ZP_WORD:18 [ foo::return#0 ]
|
||||
|
||||
INITIAL ASM
|
||||
//SEG0 File Comments
|
||||
// Test a bit of array code from the NES forum
|
||||
// https://forums.nesdev.com/viewtopic.php?f=2&t=18735
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.const SIZEOF_SIGNED_WORD = 2
|
||||
//SEG3 @begin
|
||||
bbegin:
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
b1_from_bbegin:
|
||||
jmp b1
|
||||
//SEG5 @1
|
||||
b1:
|
||||
//SEG6 [2] call main
|
||||
jsr main
|
||||
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
|
||||
bend_from_b1:
|
||||
jmp bend
|
||||
//SEG8 @end
|
||||
bend:
|
||||
//SEG9 main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = $b
|
||||
.label _3 = $f
|
||||
.label y1 = 5
|
||||
.label y2 = 7
|
||||
//SEG10 [4] (signed word) main::y1#0 ← (signed word) $1234 -- vwsz1=vwsc1
|
||||
lda #<$1234
|
||||
sta y1
|
||||
lda #>$1234
|
||||
sta y1+1
|
||||
//SEG11 [5] (signed word) main::y2#0 ← (signed word) $1234 -- vwsz1=vwsc1
|
||||
lda #<$1234
|
||||
sta y2
|
||||
lda #>$1234
|
||||
sta y2+1
|
||||
//SEG12 [6] call foo
|
||||
//SEG13 [15] phi from main to foo [phi:main->foo]
|
||||
foo_from_main:
|
||||
//SEG14 [15] phi (signed word*) foo::y#2 = &(signed word) main::y1#0 [phi:main->foo#0] -- pwsz1=pwsc1
|
||||
lda #<y1
|
||||
sta foo.y
|
||||
lda #>y1
|
||||
sta foo.y+1
|
||||
//SEG15 [15] phi (byte) foo::x#2 = (byte) 1 [phi:main->foo#1] -- vbuz1=vbuc1
|
||||
lda #1
|
||||
sta foo.x
|
||||
jsr foo
|
||||
//SEG16 [7] (signed word) foo::return#2 ← (signed word) foo::return#0 -- vwsz1=vwsz2
|
||||
lda foo.return
|
||||
sta foo.return_2
|
||||
lda foo.return+1
|
||||
sta foo.return_2+1
|
||||
jmp b1
|
||||
//SEG17 main::@1
|
||||
b1:
|
||||
//SEG18 [8] (signed word~) main::$1 ← (signed word) foo::return#2 -- vwsz1=vwsz2
|
||||
lda foo.return_2
|
||||
sta _1
|
||||
lda foo.return_2+1
|
||||
sta _1+1
|
||||
//SEG19 [9] *((const signed word*) main::SCREEN#0) ← (signed word~) main::$1 -- _deref_pwsc1=vwsz1
|
||||
lda _1
|
||||
sta SCREEN
|
||||
lda _1+1
|
||||
sta SCREEN+1
|
||||
//SEG20 [10] call foo
|
||||
//SEG21 [15] phi from main::@1 to foo [phi:main::@1->foo]
|
||||
foo_from_b1:
|
||||
//SEG22 [15] phi (signed word*) foo::y#2 = &(signed word) main::y2#0 [phi:main::@1->foo#0] -- pwsz1=pwsc1
|
||||
lda #<y2
|
||||
sta foo.y
|
||||
lda #>y2
|
||||
sta foo.y+1
|
||||
//SEG23 [15] phi (byte) foo::x#2 = (byte) 2 [phi:main::@1->foo#1] -- vbuz1=vbuc1
|
||||
lda #2
|
||||
sta foo.x
|
||||
jsr foo
|
||||
//SEG24 [11] (signed word) foo::return#3 ← (signed word) foo::return#0 -- vwsz1=vwsz2
|
||||
lda foo.return
|
||||
sta foo.return_3
|
||||
lda foo.return+1
|
||||
sta foo.return_3+1
|
||||
jmp b2
|
||||
//SEG25 main::@2
|
||||
b2:
|
||||
//SEG26 [12] (signed word~) main::$3 ← (signed word) foo::return#3 -- vwsz1=vwsz2
|
||||
lda foo.return_3
|
||||
sta _3
|
||||
lda foo.return_3+1
|
||||
sta _3+1
|
||||
//SEG27 [13] *((const signed word*) main::SCREEN#0+(const byte) SIZEOF_SIGNED_WORD) ← (signed word~) main::$3 -- _deref_pwsc1=vwsz1
|
||||
lda _3
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD
|
||||
lda _3+1
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD+1
|
||||
jmp breturn
|
||||
//SEG28 main::@return
|
||||
breturn:
|
||||
//SEG29 [14] return
|
||||
rts
|
||||
}
|
||||
//SEG30 foo
|
||||
// foo(byte zeropage(2) x, signed word* zeropage(3) y)
|
||||
foo: {
|
||||
.label _1 = $11
|
||||
.label return = $12
|
||||
.label return_2 = 9
|
||||
.label return_3 = $d
|
||||
.label x = 2
|
||||
.label y = 3
|
||||
//SEG31 [16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
|
||||
lda x
|
||||
asl
|
||||
sta _1
|
||||
//SEG32 [17] (signed word) foo::return#0 ← *((const signed word[4]) wow#0 + (byte~) foo::$1) + *((signed word*) foo::y#2) -- vwsz1=pwsc1_derefidx_vbuz2_plus__deref_pwsz3
|
||||
ldx _1
|
||||
clc
|
||||
ldy #0
|
||||
lda wow,x
|
||||
adc (y),y
|
||||
sta return
|
||||
iny
|
||||
lda wow+1,x
|
||||
adc (y),y
|
||||
sta return+1
|
||||
jmp breturn
|
||||
//SEG33 foo::@return
|
||||
breturn:
|
||||
//SEG34 [18] return
|
||||
rts
|
||||
}
|
||||
//SEG35 File Data
|
||||
wow: .word $cafe, $babe, $1234, $5678
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [4] (signed word) main::y1#0 ← (signed word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [5] (signed word) main::y2#0 ← (signed word) $1234 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [7] (signed word) foo::return#2 ← (signed word) foo::return#0 [ foo::return#2 ] ( main:2 [ foo::return#2 ] ) always clobbers reg byte a
|
||||
Statement [8] (signed word~) main::$1 ← (signed word) foo::return#2 [ main::$1 ] ( main:2 [ main::$1 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const signed word*) main::SCREEN#0) ← (signed word~) main::$1 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [11] (signed word) foo::return#3 ← (signed word) foo::return#0 [ foo::return#3 ] ( main:2 [ foo::return#3 ] ) always clobbers reg byte a
|
||||
Statement [12] (signed word~) main::$3 ← (signed word) foo::return#3 [ main::$3 ] ( main:2 [ main::$3 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const signed word*) main::SCREEN#0+(const byte) SIZEOF_SIGNED_WORD) ← (signed word~) main::$3 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1 [ foo::y#2 foo::$1 ] ( main:2::foo:6 [ foo::y#2 foo::$1 ] main:2::foo:10 [ foo::y#2 foo::$1 ] ) always clobbers reg byte a
|
||||
Statement [17] (signed word) foo::return#0 ← *((const signed word[4]) wow#0 + (byte~) foo::$1) + *((signed word*) foo::y#2) [ foo::return#0 ] ( main:2::foo:6 [ foo::return#0 ] main:2::foo:10 [ foo::return#0 ] ) always clobbers reg byte a reg byte y
|
||||
Potential registers zp ZP_BYTE:2 [ foo::x#2 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_WORD:3 [ foo::y#2 ] : zp ZP_WORD:3 ,
|
||||
Potential registers zp ZP_WORD:5 [ main::y1#0 ] : zp ZP_WORD:5 ,
|
||||
Potential registers zp ZP_WORD:7 [ main::y2#0 ] : zp ZP_WORD:7 ,
|
||||
Potential registers zp ZP_WORD:9 [ foo::return#2 ] : zp ZP_WORD:9 ,
|
||||
Potential registers zp ZP_WORD:11 [ main::$1 ] : zp ZP_WORD:11 ,
|
||||
Potential registers zp ZP_WORD:13 [ foo::return#3 ] : zp ZP_WORD:13 ,
|
||||
Potential registers zp ZP_WORD:15 [ main::$3 ] : zp ZP_WORD:15 ,
|
||||
Potential registers zp ZP_BYTE:17 [ foo::$1 ] : zp ZP_BYTE:17 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_WORD:18 [ foo::return#0 ] : zp ZP_WORD:18 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 20: zp ZP_WORD:5 [ main::y1#0 ] 20: zp ZP_WORD:7 [ main::y2#0 ] 4: zp ZP_WORD:11 [ main::$1 ] 4: zp ZP_WORD:15 [ main::$3 ]
|
||||
Uplift Scope [foo] 4: zp ZP_WORD:9 [ foo::return#2 ] 4: zp ZP_WORD:13 [ foo::return#3 ] 4: zp ZP_BYTE:17 [ foo::$1 ] 2: zp ZP_BYTE:2 [ foo::x#2 ] 1.5: zp ZP_WORD:18 [ foo::return#0 ] 1: zp ZP_WORD:3 [ foo::y#2 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 217 combination zp ZP_WORD:5 [ main::y1#0 ] zp ZP_WORD:7 [ main::y2#0 ] zp ZP_WORD:11 [ main::$1 ] zp ZP_WORD:15 [ main::$3 ]
|
||||
Uplifting [foo] best 206 combination zp ZP_WORD:9 [ foo::return#2 ] zp ZP_WORD:13 [ foo::return#3 ] reg byte a [ foo::$1 ] reg byte x [ foo::x#2 ] zp ZP_WORD:18 [ foo::return#0 ] zp ZP_WORD:3 [ foo::y#2 ]
|
||||
Uplifting [] best 206 combination
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ foo::y#2 ] ] with [ zp ZP_WORD:18 [ foo::return#0 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:9 [ foo::return#2 ] ] with [ zp ZP_WORD:11 [ main::$1 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:13 [ foo::return#3 ] ] with [ zp ZP_WORD:15 [ main::$3 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ foo::y#2 foo::return#0 ] ] with [ zp ZP_WORD:9 [ foo::return#2 main::$1 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ foo::y#2 foo::return#0 foo::return#2 main::$1 ] ] with [ zp ZP_WORD:13 [ foo::return#3 main::$3 ] ] - score: 1
|
||||
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ foo::y#2 foo::return#0 foo::return#2 main::$1 foo::return#3 main::$3 ]
|
||||
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ main::y1#0 ]
|
||||
Allocated (was zp ZP_WORD:7) zp ZP_WORD:6 [ main::y2#0 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
//SEG0 File Comments
|
||||
// Test a bit of array code from the NES forum
|
||||
// https://forums.nesdev.com/viewtopic.php?f=2&t=18735
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.const SIZEOF_SIGNED_WORD = 2
|
||||
//SEG3 @begin
|
||||
bbegin:
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
b1_from_bbegin:
|
||||
jmp b1
|
||||
//SEG5 @1
|
||||
b1:
|
||||
//SEG6 [2] call main
|
||||
jsr main
|
||||
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
|
||||
bend_from_b1:
|
||||
jmp bend
|
||||
//SEG8 @end
|
||||
bend:
|
||||
//SEG9 main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = 2
|
||||
.label _3 = 2
|
||||
.label y1 = 4
|
||||
.label y2 = 6
|
||||
//SEG10 [4] (signed word) main::y1#0 ← (signed word) $1234 -- vwsz1=vwsc1
|
||||
lda #<$1234
|
||||
sta y1
|
||||
lda #>$1234
|
||||
sta y1+1
|
||||
//SEG11 [5] (signed word) main::y2#0 ← (signed word) $1234 -- vwsz1=vwsc1
|
||||
lda #<$1234
|
||||
sta y2
|
||||
lda #>$1234
|
||||
sta y2+1
|
||||
//SEG12 [6] call foo
|
||||
//SEG13 [15] phi from main to foo [phi:main->foo]
|
||||
foo_from_main:
|
||||
//SEG14 [15] phi (signed word*) foo::y#2 = &(signed word) main::y1#0 [phi:main->foo#0] -- pwsz1=pwsc1
|
||||
lda #<y1
|
||||
sta foo.y
|
||||
lda #>y1
|
||||
sta foo.y+1
|
||||
//SEG15 [15] phi (byte) foo::x#2 = (byte) 1 [phi:main->foo#1] -- vbuxx=vbuc1
|
||||
ldx #1
|
||||
jsr foo
|
||||
//SEG16 [7] (signed word) foo::return#2 ← (signed word) foo::return#0
|
||||
jmp b1
|
||||
//SEG17 main::@1
|
||||
b1:
|
||||
//SEG18 [8] (signed word~) main::$1 ← (signed word) foo::return#2
|
||||
//SEG19 [9] *((const signed word*) main::SCREEN#0) ← (signed word~) main::$1 -- _deref_pwsc1=vwsz1
|
||||
lda _1
|
||||
sta SCREEN
|
||||
lda _1+1
|
||||
sta SCREEN+1
|
||||
//SEG20 [10] call foo
|
||||
//SEG21 [15] phi from main::@1 to foo [phi:main::@1->foo]
|
||||
foo_from_b1:
|
||||
//SEG22 [15] phi (signed word*) foo::y#2 = &(signed word) main::y2#0 [phi:main::@1->foo#0] -- pwsz1=pwsc1
|
||||
lda #<y2
|
||||
sta foo.y
|
||||
lda #>y2
|
||||
sta foo.y+1
|
||||
//SEG23 [15] phi (byte) foo::x#2 = (byte) 2 [phi:main::@1->foo#1] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
jsr foo
|
||||
//SEG24 [11] (signed word) foo::return#3 ← (signed word) foo::return#0
|
||||
jmp b2
|
||||
//SEG25 main::@2
|
||||
b2:
|
||||
//SEG26 [12] (signed word~) main::$3 ← (signed word) foo::return#3
|
||||
//SEG27 [13] *((const signed word*) main::SCREEN#0+(const byte) SIZEOF_SIGNED_WORD) ← (signed word~) main::$3 -- _deref_pwsc1=vwsz1
|
||||
lda _3
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD
|
||||
lda _3+1
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD+1
|
||||
jmp breturn
|
||||
//SEG28 main::@return
|
||||
breturn:
|
||||
//SEG29 [14] return
|
||||
rts
|
||||
}
|
||||
//SEG30 foo
|
||||
// foo(byte register(X) x, signed word* zeropage(2) y)
|
||||
foo: {
|
||||
.label return = 2
|
||||
.label y = 2
|
||||
//SEG31 [16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
|
||||
txa
|
||||
asl
|
||||
//SEG32 [17] (signed word) foo::return#0 ← *((const signed word[4]) wow#0 + (byte~) foo::$1) + *((signed word*) foo::y#2) -- vwsz1=pwsc1_derefidx_vbuaa_plus__deref_pwsz1
|
||||
tax
|
||||
clc
|
||||
ldy #0
|
||||
lda wow,x
|
||||
adc (return),y
|
||||
pha
|
||||
iny
|
||||
lda wow+1,x
|
||||
adc (return),y
|
||||
sta return+1
|
||||
pla
|
||||
sta return
|
||||
jmp breturn
|
||||
//SEG33 foo::@return
|
||||
breturn:
|
||||
//SEG34 [18] return
|
||||
rts
|
||||
}
|
||||
//SEG35 File Data
|
||||
wow: .word $cafe, $babe, $1234, $5678
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction foo_from_main:
|
||||
Removing instruction b1:
|
||||
Removing instruction foo_from_b1:
|
||||
Removing instruction b2:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2
|
||||
(signed word()) foo((byte) foo::x , (signed word*) foo::y)
|
||||
(byte~) foo::$1 reg byte a 4.0
|
||||
(label) foo::@return
|
||||
(signed word) foo::return
|
||||
(signed word) foo::return#0 return zp ZP_WORD:2 1.5
|
||||
(signed word) foo::return#2 return zp ZP_WORD:2 4.0
|
||||
(signed word) foo::return#3 return zp ZP_WORD:2 4.0
|
||||
(byte) foo::x
|
||||
(byte) foo::x#2 reg byte x 2.0
|
||||
(signed word*) foo::y
|
||||
(signed word*) foo::y#2 y zp ZP_WORD:2 1.0
|
||||
(void()) main()
|
||||
(signed word~) main::$1 $1 zp ZP_WORD:2 4.0
|
||||
(signed word~) main::$3 $3 zp ZP_WORD:2 4.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(signed word*) main::SCREEN
|
||||
(const signed word*) main::SCREEN#0 SCREEN = (signed word*) 1024
|
||||
(signed word) main::y1
|
||||
(signed word) main::y1#0 y1 zp ZP_WORD:4 20.0
|
||||
(signed word) main::y2
|
||||
(signed word) main::y2#0 y2 zp ZP_WORD:6 20.0
|
||||
(signed word[4]) wow
|
||||
(const signed word[4]) wow#0 wow = { (signed word) $cafe, (signed word) $babe, (signed word) $1234, (signed word) $5678 }
|
||||
|
||||
reg byte x [ foo::x#2 ]
|
||||
zp ZP_WORD:2 [ foo::y#2 foo::return#0 foo::return#2 main::$1 foo::return#3 main::$3 ]
|
||||
zp ZP_WORD:4 [ main::y1#0 ]
|
||||
zp ZP_WORD:6 [ main::y2#0 ]
|
||||
reg byte a [ foo::$1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 141
|
||||
|
||||
//SEG0 File Comments
|
||||
// Test a bit of array code from the NES forum
|
||||
// https://forums.nesdev.com/viewtopic.php?f=2&t=18735
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.const SIZEOF_SIGNED_WORD = 2
|
||||
//SEG3 @begin
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
//SEG5 @1
|
||||
//SEG6 [2] call main
|
||||
//SEG7 [3] phi from @1 to @end [phi:@1->@end]
|
||||
//SEG8 @end
|
||||
//SEG9 main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = 2
|
||||
.label _3 = 2
|
||||
.label y1 = 4
|
||||
.label y2 = 6
|
||||
//SEG10 [4] (signed word) main::y1#0 ← (signed word) $1234 -- vwsz1=vwsc1
|
||||
lda #<$1234
|
||||
sta y1
|
||||
lda #>$1234
|
||||
sta y1+1
|
||||
//SEG11 [5] (signed word) main::y2#0 ← (signed word) $1234 -- vwsz1=vwsc1
|
||||
lda #<$1234
|
||||
sta y2
|
||||
lda #>$1234
|
||||
sta y2+1
|
||||
//SEG12 [6] call foo
|
||||
//SEG13 [15] phi from main to foo [phi:main->foo]
|
||||
//SEG14 [15] phi (signed word*) foo::y#2 = &(signed word) main::y1#0 [phi:main->foo#0] -- pwsz1=pwsc1
|
||||
lda #<y1
|
||||
sta foo.y
|
||||
lda #>y1
|
||||
sta foo.y+1
|
||||
//SEG15 [15] phi (byte) foo::x#2 = (byte) 1 [phi:main->foo#1] -- vbuxx=vbuc1
|
||||
ldx #1
|
||||
jsr foo
|
||||
//SEG16 [7] (signed word) foo::return#2 ← (signed word) foo::return#0
|
||||
//SEG17 main::@1
|
||||
//SEG18 [8] (signed word~) main::$1 ← (signed word) foo::return#2
|
||||
//SEG19 [9] *((const signed word*) main::SCREEN#0) ← (signed word~) main::$1 -- _deref_pwsc1=vwsz1
|
||||
lda _1
|
||||
sta SCREEN
|
||||
lda _1+1
|
||||
sta SCREEN+1
|
||||
//SEG20 [10] call foo
|
||||
//SEG21 [15] phi from main::@1 to foo [phi:main::@1->foo]
|
||||
//SEG22 [15] phi (signed word*) foo::y#2 = &(signed word) main::y2#0 [phi:main::@1->foo#0] -- pwsz1=pwsc1
|
||||
lda #<y2
|
||||
sta foo.y
|
||||
lda #>y2
|
||||
sta foo.y+1
|
||||
//SEG23 [15] phi (byte) foo::x#2 = (byte) 2 [phi:main::@1->foo#1] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
jsr foo
|
||||
//SEG24 [11] (signed word) foo::return#3 ← (signed word) foo::return#0
|
||||
//SEG25 main::@2
|
||||
//SEG26 [12] (signed word~) main::$3 ← (signed word) foo::return#3
|
||||
//SEG27 [13] *((const signed word*) main::SCREEN#0+(const byte) SIZEOF_SIGNED_WORD) ← (signed word~) main::$3 -- _deref_pwsc1=vwsz1
|
||||
lda _3
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD
|
||||
lda _3+1
|
||||
sta SCREEN+SIZEOF_SIGNED_WORD+1
|
||||
//SEG28 main::@return
|
||||
//SEG29 [14] return
|
||||
rts
|
||||
}
|
||||
//SEG30 foo
|
||||
// foo(byte register(X) x, signed word* zeropage(2) y)
|
||||
foo: {
|
||||
.label return = 2
|
||||
.label y = 2
|
||||
//SEG31 [16] (byte~) foo::$1 ← (byte) foo::x#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
|
||||
txa
|
||||
asl
|
||||
//SEG32 [17] (signed word) foo::return#0 ← *((const signed word[4]) wow#0 + (byte~) foo::$1) + *((signed word*) foo::y#2) -- vwsz1=pwsc1_derefidx_vbuaa_plus__deref_pwsz1
|
||||
tax
|
||||
clc
|
||||
ldy #0
|
||||
lda wow,x
|
||||
adc (return),y
|
||||
pha
|
||||
iny
|
||||
lda wow+1,x
|
||||
adc (return),y
|
||||
sta return+1
|
||||
pla
|
||||
sta return
|
||||
//SEG33 foo::@return
|
||||
//SEG34 [18] return
|
||||
rts
|
||||
}
|
||||
//SEG35 File Data
|
||||
wow: .word $cafe, $babe, $1234, $5678
|
||||
|
35
src/test/ref/nes-array.sym
Normal file
35
src/test/ref/nes-array.sym
Normal file
@ -0,0 +1,35 @@
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte) 2
|
||||
(signed word()) foo((byte) foo::x , (signed word*) foo::y)
|
||||
(byte~) foo::$1 reg byte a 4.0
|
||||
(label) foo::@return
|
||||
(signed word) foo::return
|
||||
(signed word) foo::return#0 return zp ZP_WORD:2 1.5
|
||||
(signed word) foo::return#2 return zp ZP_WORD:2 4.0
|
||||
(signed word) foo::return#3 return zp ZP_WORD:2 4.0
|
||||
(byte) foo::x
|
||||
(byte) foo::x#2 reg byte x 2.0
|
||||
(signed word*) foo::y
|
||||
(signed word*) foo::y#2 y zp ZP_WORD:2 1.0
|
||||
(void()) main()
|
||||
(signed word~) main::$1 $1 zp ZP_WORD:2 4.0
|
||||
(signed word~) main::$3 $3 zp ZP_WORD:2 4.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(signed word*) main::SCREEN
|
||||
(const signed word*) main::SCREEN#0 SCREEN = (signed word*) 1024
|
||||
(signed word) main::y1
|
||||
(signed word) main::y1#0 y1 zp ZP_WORD:4 20.0
|
||||
(signed word) main::y2
|
||||
(signed word) main::y2#0 y2 zp ZP_WORD:6 20.0
|
||||
(signed word[4]) wow
|
||||
(const signed word[4]) wow#0 wow = { (signed word) $cafe, (signed word) $babe, (signed word) $1234, (signed word) $5678 }
|
||||
|
||||
reg byte x [ foo::x#2 ]
|
||||
zp ZP_WORD:2 [ foo::y#2 foo::return#0 foo::return#2 main::$1 foo::return#3 main::$3 ]
|
||||
zp ZP_WORD:4 [ main::y1#0 ]
|
||||
zp ZP_WORD:6 [ main::y2#0 ]
|
||||
reg byte a [ foo::$1 ]
|
@ -286,7 +286,7 @@ setscreen: {
|
||||
//SEG28 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte*) screen#0 ← (byte*) 1024 [ screen#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte*) screen#0 ← (byte*) 1024 [ screen#0 ] ( [ screen#0 ] ) always clobbers reg byte a
|
||||
Statement [6] *((byte*) screen#0) ← (byte) 'a' [ screen#0 ] ( main:2 [ screen#0 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [8] *((byte*) screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a reg byte y
|
||||
Statement [11] *(&(byte*) screen#0) ← (byte*) setscreen::val#2 [ screen#0 ] ( main:2::setscreen:5 [ screen#0 ] main:2::setscreen:7 [ screen#0 ] ) always clobbers reg byte a
|
||||
|
@ -349,7 +349,7 @@ irq: {
|
||||
//SEG33 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( [ col#0 ] ) always clobbers reg byte a
|
||||
Statement [4] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ col#0 ] ( main:2 [ col#0 ] ) always clobbers reg byte a
|
||||
Statement [6] if((byte) col#14<(byte) $a+(byte) 1) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [7] (byte) col#1 ← (byte) 0 [ col#1 ] ( main:2 [ col#1 ] ) always clobbers reg byte a
|
||||
|
@ -232,7 +232,7 @@ irq: {
|
||||
//SEG23 File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( ) always clobbers reg byte a
|
||||
Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( [ col#0 ] ) always clobbers reg byte a
|
||||
Statement [4] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ col#0 ] ( main:2 [ col#0 ] ) always clobbers reg byte a
|
||||
Statement asm { lda$dc0d } always clobbers reg byte a
|
||||
Statement [8] *((const byte*) BGCOL#0) ← (byte) col#0 [ ] ( [ ] ) always clobbers reg byte a
|
||||
|
Loading…
x
Reference in New Issue
Block a user