From 452b9d2ae6de17fa8035e2f48b0ecd3c320c609e Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Mon, 26 Aug 2019 00:55:22 +0200 Subject: [PATCH] Fixed tests & fragment. --- src/main/fragment/pbuz1=pbuz1_plus_2.asm | 2 +- .../dk/camelot64/kickc/test/TestPrograms.java | 10 + src/test/kc/bitmap-circle.kc | 65 + src/test/ref/bitmap-circle.asm | 385 ++ src/test/ref/bitmap-circle.cfg | 135 + src/test/ref/bitmap-circle.log | 3343 +++++++++++++++++ src/test/ref/bitmap-circle.sym | 128 + src/test/ref/cia-timer-cyclecount.log | 22 +- src/test/ref/cia-timer-simple.log | 22 +- src/test/ref/examples/rotate/rotate.log | 58 +- src/test/ref/screen-center-angle.log | 52 +- src/test/ref/screen-center-distance.log | 56 +- 12 files changed, 4177 insertions(+), 101 deletions(-) create mode 100644 src/test/kc/bitmap-circle.kc create mode 100644 src/test/ref/bitmap-circle.asm create mode 100644 src/test/ref/bitmap-circle.cfg create mode 100644 src/test/ref/bitmap-circle.log create mode 100644 src/test/ref/bitmap-circle.sym diff --git a/src/main/fragment/pbuz1=pbuz1_plus_2.asm b/src/main/fragment/pbuz1=pbuz1_plus_2.asm index 0269e281b..be2f8732d 100644 --- a/src/main/fragment/pbuz1=pbuz1_plus_2.asm +++ b/src/main/fragment/pbuz1=pbuz1_plus_2.asm @@ -3,5 +3,5 @@ clc adc #2 sta {z1} bcc !+ -inc {z2}+1 +inc {z1}+1 !: \ No newline at end of file diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 8f551207f..dcbb3418e 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -36,6 +36,11 @@ public class TestPrograms { public TestPrograms() { } + @Test + public void testBitmapCircle() throws IOException, URISyntaxException { + compileAndCompare("bitmap-circle"); + } + // TODO: Optimize comparisons with values outside the range of types https://gitlab.com/camelot/kickc/issues/291 @Test public void testOptimizeUnsignedComparisons() throws IOException, URISyntaxException { @@ -1833,6 +1838,11 @@ public class TestPrograms { // compileAndCompare("complex/travis/game"); //} + //@Test + //public void testBcmod() throws IOException, URISyntaxException { + // compileAndCompare("complex/bcmod/bcmod", log()); + //} + @Test public void testTetrisSprites() throws IOException, URISyntaxException { compileAndCompare("complex/tetris/test-sprites"); diff --git a/src/test/kc/bitmap-circle.kc b/src/test/kc/bitmap-circle.kc new file mode 100644 index 000000000..7799e30b8 --- /dev/null +++ b/src/test/kc/bitmap-circle.kc @@ -0,0 +1,65 @@ +// Plots a circle on a bitmap using Bresenham's Circle algorithm +// Coded by Richard-William Loerakker +// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac + +import "c64" + +const byte* SCREEN = $400; +const byte* BITMAP = $2000; +const byte* COLORS = $d800; + +byte[] bitmask = { 128, 64, 32, 16, 8, 4, 2, 1 }; + +void main() { + fill(BITMAP,40*25*8,0); + fill(SCREEN,40*25,$16); + + *BORDERCOL = BLUE; + *D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3; + *VIC_MEMORY = (byte)((((word)SCREEN&$3fff)/$40)|(((word)BITMAP&$3fff)/$400)); + + circle(100,100,50); + + do {} while (true); +} + +void circle(int xc, int yc, int r) { + int x = 0; + int y = r; + int p = 3-(r << 1); + + for(int x = 0; x <= y; x ++) { + if(p < 0) { + p = p + (x << 2) + 6; + } else { + y=y-1; + p = p + ((x-y) << 2) + 10; + } + + plot(xc+x,yc-y); + plot(xc-x,yc-y); + plot(xc+x,yc+y); + plot(xc-x,yc+y); + plot(xc+y,yc-x); + plot(xc-y,yc-x); + plot(xc+y,yc+x); + plot(xc-y,yc+x); + } +} + +void plot(int x, int y) { + byte* location = BITMAP; + location += x & $fff8; + location += > 3) * 320); + (*location) = (*location) | bitmask[x & 7]; +} + +// Fill some memory with a value +void fill(byte* start, int size, byte val) { + byte* end = start + size; + for(byte* addr = start; addr!=end; addr++) { + *addr = val; + } +} + diff --git a/src/test/ref/bitmap-circle.asm b/src/test/ref/bitmap-circle.asm new file mode 100644 index 000000000..49e921dad --- /dev/null +++ b/src/test/ref/bitmap-circle.asm @@ -0,0 +1,385 @@ +// Plots a circle on a bitmap using Bresenham's Circle algorithm +// Coded by Richard-William Loerakker +// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + .label BORDERCOL = $d020 + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_MEMORY = $d018 + .const BLUE = 6 + .label SCREEN = $400 + .label BITMAP = $2000 +main: { + ldx #0 + lda #<$28*$19*8 + sta.z fill.size + lda #>$28*$19*8 + sta.z fill.size+1 + lda #BITMAP + sta.z fill.addr+1 + jsr fill + ldx #$16 + lda #<$28*$19 + sta.z fill.size + lda #>$28*$19 + sta.z fill.size+1 + lda #SCREEN + sta.z fill.addr+1 + jsr fill + lda #BLUE + sta BORDERCOL + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + lda #(SCREEN&$3fff)/$40|(BITMAP&$3fff)/$400 + sta VIC_MEMORY + jsr circle + b1: + jmp b1 +} +circle: { + .const xc = $64 + .const yc = $64 + .const r = $32 + .label _5 = 8 + .label _6 = 8 + .label _7 = 2 + .label _9 = $a + .label _10 = 2 + .label p = 2 + .label y = 6 + .label x1 = 4 + lda #<3-(r<<1) + sta.z p + lda #>3-(r<<1) + sta.z p+1 + lda #r + sta.z y+1 + lda #<0 + sta.z x1 + sta.z x1+1 + b1: + lda.z y + cmp.z x1 + lda.z y+1 + sbc.z x1+1 + bvc !+ + eor #$80 + !: + bpl b2 + rts + b2: + lda.z p+1 + bpl !b3+ + jmp b3 + !b3: + sec + lda.z y + sbc #1 + sta.z y + bcs !+ + dec.z y+1 + !: + lda.z x1 + sec + sbc.z y + sta.z _5 + lda.z x1+1 + sbc.z y+1 + sta.z _5+1 + asl.z _6 + rol.z _6+1 + asl.z _6 + rol.z _6+1 + lda.z _7 + clc + adc.z _6 + sta.z _7 + lda.z _7+1 + adc.z _6+1 + sta.z _7+1 + lda.z p + clc + adc #<$a + sta.z p + lda.z p+1 + adc #>$a + sta.z p+1 + b4: + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + jsr plot + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + jsr plot + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + lda.z y + clc + adc #yc + sta.z plot.y+1 + jsr plot + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + lda.z y + clc + adc #yc + sta.z plot.y+1 + jsr plot + lda.z y + clc + adc #xc + sta.z plot.x+1 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + jsr plot + lda #xc + sbc.z y+1 + sta.z plot.x+1 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + jsr plot + lda.z y + clc + adc #xc + sta.z plot.x+1 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + jsr plot + lda #xc + sbc.z y+1 + sta.z plot.x+1 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + jsr plot + inc.z x1 + bne !+ + inc.z x1+1 + !: + jmp b1 + b3: + lda.z x1 + asl + sta.z _9 + lda.z x1+1 + rol + sta.z _9+1 + asl.z _9 + rol.z _9+1 + lda.z _10 + clc + adc.z _9 + sta.z _10 + lda.z _10+1 + adc.z _9+1 + sta.z _10+1 + lda.z p + clc + adc #<6 + sta.z p + lda.z p+1 + adc #>6 + sta.z p+1 + jmp b4 +} +// plot(signed word zeropage(8) x, signed word zeropage($a) y) +plot: { + .label _0 = $c + .label _3 = $a + .label _4 = $e + .label x = 8 + .label y = $a + .label location = $c + .label _7 = $e + .label _8 = $e + lda.z x + and #<$fff8 + sta.z _0 + lda.z x+1 + and #>$fff8 + sta.z _0+1 + lda #BITMAP + adc.z location+1 + sta.z location+1 + lda.z y + and #7 + clc + adc.z location + sta.z location + bcc !+ + inc.z location+1 + !: + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3 + asl + sta.z _7 + lda.z _3+1 + rol + sta.z _7+1 + asl.z _7 + rol.z _7+1 + lda.z _8 + clc + adc.z _3 + sta.z _8 + lda.z _8+1 + adc.z _3+1 + sta.z _8+1 + lda.z _4+1 + sta.z $ff + lda.z _4 + sta.z _4+1 + lda #0 + sta.z _4 + lsr.z $ff + ror.z _4+1 + ror.z _4 + lsr.z $ff + ror.z _4+1 + ror.z _4 + lda.z location + clc + adc.z _4 + sta.z location + lda.z location+1 + adc.z _4+1 + sta.z location+1 + lda #7 + and.z x + tay + lda bitmask,y + ldy #0 + ora (location),y + sta (location),y + rts +} +// Fill some memory with a value +// fill(signed word zeropage(4) size, byte register(X) val) +fill: { + .label end = 4 + .label addr = 6 + .label size = 4 + lda.z addr + clc + adc.z end + sta.z end + lda.z addr+1 + adc.z end+1 + sta.z end+1 + b1: + lda.z addr+1 + cmp.z end+1 + bne b2 + lda.z addr + cmp.z end + bne b2 + rts + b2: + txa + ldy #0 + sta (addr),y + inc.z addr + bne !+ + inc.z addr+1 + !: + jmp b1 +} + bitmask: .byte $80, $40, $20, $10, 8, 4, 2, 1 diff --git a/src/test/ref/bitmap-circle.cfg b/src/test/ref/bitmap-circle.cfg new file mode 100644 index 000000000..c60327201 --- /dev/null +++ b/src/test/ref/bitmap-circle.cfg @@ -0,0 +1,135 @@ +@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] phi() + [5] call fill + to:main::@2 +main::@2: scope:[main] from main + [6] phi() + [7] call fill + to:main::@3 +main::@3: scope:[main] from main::@2 + [8] *((const byte*) BORDERCOL#0) ← (const byte) BLUE#0 + [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 + [10] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 + [11] call circle + to:main::@1 +main::@1: scope:[main] from main::@1 main::@3 + [12] phi() + to:main::@1 +circle: scope:[circle] from main::@3 + [13] phi() + to:circle::@1 +circle::@1: scope:[circle] from circle circle::@13 + [14] (signed word) circle::p#3 ← phi( circle/(signed byte) 3-(const signed word) circle::r#0<<(signed byte) 1 circle::@13/(signed word) circle::p#10 ) + [14] (signed word) circle::y#13 ← phi( circle/(const signed word) circle::r#0 circle::@13/(signed word) circle::y#10 ) + [14] (signed word) circle::x1#10 ← phi( circle/(signed byte) 0 circle::@13/(signed word) circle::x1#1 ) + [15] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 + to:circle::@return +circle::@return: scope:[circle] from circle::@1 + [16] return + to:@return +circle::@2: scope:[circle] from circle::@1 + [17] if((signed word) circle::p#3<(signed byte) 0) goto circle::@3 + to:circle::@5 +circle::@5: scope:[circle] from circle::@2 + [18] (signed word) circle::y#1 ← (signed word) circle::y#13 - (signed byte) 1 + [19] (signed word~) circle::$5 ← (signed word) circle::x1#10 - (signed word) circle::y#1 + [20] (signed word~) circle::$6 ← (signed word~) circle::$5 << (signed byte) 2 + [21] (signed word~) circle::$7 ← (signed word) circle::p#3 + (signed word~) circle::$6 + [22] (signed word) circle::p#2 ← (signed word~) circle::$7 + (signed byte) $a + to:circle::@4 +circle::@4: scope:[circle] from circle::@3 circle::@5 + [23] (signed word) circle::p#10 ← phi( circle::@3/(signed word) circle::p#1 circle::@5/(signed word) circle::p#2 ) + [23] (signed word) circle::y#10 ← phi( circle::@3/(signed word) circle::y#13 circle::@5/(signed word) circle::y#1 ) + [24] (signed word) plot::x#0 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 + [25] (signed word) plot::y#0 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 + [26] call plot + to:circle::@6 +circle::@6: scope:[circle] from circle::@4 + [27] (signed word) plot::x#1 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 + [28] (signed word) plot::y#1 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 + [29] call plot + to:circle::@7 +circle::@7: scope:[circle] from circle::@6 + [30] (signed word) plot::x#2 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 + [31] (signed word) plot::y#2 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 + [32] call plot + to:circle::@8 +circle::@8: scope:[circle] from circle::@7 + [33] (signed word) plot::x#3 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 + [34] (signed word) plot::y#3 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 + [35] call plot + to:circle::@9 +circle::@9: scope:[circle] from circle::@8 + [36] (signed word) plot::x#4 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 + [37] (signed word) plot::y#4 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 + [38] call plot + to:circle::@10 +circle::@10: scope:[circle] from circle::@9 + [39] (signed word) plot::x#5 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 + [40] (signed word) plot::y#5 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 + [41] call plot + to:circle::@11 +circle::@11: scope:[circle] from circle::@10 + [42] (signed word) plot::x#6 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 + [43] (signed word) plot::y#6 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 + [44] call plot + to:circle::@12 +circle::@12: scope:[circle] from circle::@11 + [45] (signed word) plot::x#7 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 + [46] (signed word) plot::y#7 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 + [47] call plot + to:circle::@13 +circle::@13: scope:[circle] from circle::@12 + [48] (signed word) circle::x1#1 ← ++ (signed word) circle::x1#10 + to:circle::@1 +circle::@3: scope:[circle] from circle::@2 + [49] (signed word~) circle::$9 ← (signed word) circle::x1#10 << (signed byte) 2 + [50] (signed word~) circle::$10 ← (signed word) circle::p#3 + (signed word~) circle::$9 + [51] (signed word) circle::p#1 ← (signed word~) circle::$10 + (signed byte) 6 + to:circle::@4 +plot: scope:[plot] from circle::@10 circle::@11 circle::@12 circle::@4 circle::@6 circle::@7 circle::@8 circle::@9 + [52] (signed word) plot::y#8 ← phi( circle::@6/(signed word) plot::y#1 circle::@7/(signed word) plot::y#2 circle::@8/(signed word) plot::y#3 circle::@9/(signed word) plot::y#4 circle::@10/(signed word) plot::y#5 circle::@11/(signed word) plot::y#6 circle::@12/(signed word) plot::y#7 circle::@4/(signed word) plot::y#0 ) + [52] (signed word) plot::x#8 ← phi( circle::@6/(signed word) plot::x#1 circle::@7/(signed word) plot::x#2 circle::@8/(signed word) plot::x#3 circle::@9/(signed word) plot::x#4 circle::@10/(signed word) plot::x#5 circle::@11/(signed word) plot::x#6 circle::@12/(signed word) plot::x#7 circle::@4/(signed word) plot::x#0 ) + [53] (signed word~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 + [54] (byte*) plot::location#1 ← (const byte*) BITMAP#0 + (signed word~) plot::$0 + [55] (byte~) plot::$1 ← < (signed word) plot::y#8 + [56] (byte~) plot::$2 ← (byte~) plot::$1 & (byte) 7 + [57] (byte*) plot::location#2 ← (byte*) plot::location#1 + (byte~) plot::$2 + [58] (signed word~) plot::$3 ← (signed word) plot::y#8 >> (signed byte) 3 + [59] (signed word) plot::$7 ← (signed word~) plot::$3 << (byte) 2 + [60] (signed word) plot::$8 ← (signed word) plot::$7 + (signed word~) plot::$3 + [61] (signed word~) plot::$4 ← (signed word) plot::$8 << (byte) 6 + [62] (byte*) plot::location#3 ← (byte*) plot::location#2 + (signed word~) plot::$4 + [63] (signed byte~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 + [64] (byte~) plot::$6 ← *((byte*) plot::location#3) | *((const byte[]) bitmask#0 + (signed byte~) plot::$5) + [65] *((byte*) plot::location#3) ← (byte~) plot::$6 + to:plot::@return +plot::@return: scope:[plot] from plot + [66] return + to:@return +fill: scope:[fill] from main main::@2 + [67] (byte) fill::val#4 ← phi( main/(byte) 0 main::@2/(byte) $16 ) + [67] (signed word) fill::size#2 ← phi( main/(signed word)(number) $28*(number) $19*(number) 8 main::@2/(signed word)(number) $28*(number) $19 ) + [67] (byte*) fill::addr#0 ← phi( main/(const byte*) BITMAP#0 main::@2/(const byte*) SCREEN#0 ) + [68] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (signed word) fill::size#2 + to:fill::@1 +fill::@1: scope:[fill] from fill fill::@2 + [69] (byte*) fill::addr#2 ← phi( fill/(byte*) fill::addr#0 fill::@2/(byte*) fill::addr#1 ) + [70] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 + to:fill::@return +fill::@return: scope:[fill] from fill::@1 + [71] return + to:@return +fill::@2: scope:[fill] from fill::@1 + [72] *((byte*) fill::addr#2) ← (byte) fill::val#4 + [73] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2 + to:fill::@1 diff --git a/src/test/ref/bitmap-circle.log b/src/test/ref/bitmap-circle.log new file mode 100644 index 000000000..9465a5fad --- /dev/null +++ b/src/test/ref/bitmap-circle.log @@ -0,0 +1,3343 @@ +Identified constant variable (signed word) circle::x +Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx +Culled Empty Block (label) @1 +Culled Empty Block (label) @2 +Culled Empty Block (label) @3 +Culled Empty Block (label) main::@2 +Culled Empty Block (label) @5 +Culled Empty Block (label) circle::@6 +Culled Empty Block (label) circle::@3 +Culled Empty Block (label) circle::@7 +Culled Empty Block (label) circle::@9 +Culled Empty Block (label) circle::@10 +Culled Empty Block (label) @6 +Culled Empty Block (label) @7 +Culled Empty Block (label) fill::@4 +Culled Empty Block (label) fill::@3 +Culled Empty Block (label) fill::@5 +Culled Empty Block (label) fill::@6 + +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + (byte*) BORDERCOL#0 ← ((byte*)) (number) $d020 + (byte*) D011#0 ← ((byte*)) (number) $d011 + (byte) VIC_BMM#0 ← (number) $20 + (byte) VIC_DEN#0 ← (number) $10 + (byte) VIC_RSEL#0 ← (number) 8 + (byte*) VIC_MEMORY#0 ← ((byte*)) (number) $d018 + (byte) BLUE#0 ← (number) 6 + to:@4 +@4: scope:[] from @begin + (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte*) BITMAP#0 ← ((byte*)) (number) $2000 + (byte[]) bitmask#0 ← { (number) $80, (number) $40, (number) $20, (number) $10, (number) 8, (number) 4, (number) 2, (number) 1 } + to:@8 +main: scope:[main] from @8 + (byte*) fill::start#0 ← (byte*) BITMAP#0 + (signed word) fill::size#0 ← (number) $28*(number) $19*(number) 8 + (byte) fill::val#0 ← (number) 0 + call fill + to:main::@3 +main::@3: scope:[main] from main + (byte*) fill::start#1 ← (byte*) SCREEN#0 + (signed word) fill::size#1 ← (number) $28*(number) $19 + (byte) fill::val#1 ← (number) $16 + call fill + to:main::@4 +main::@4: scope:[main] from main::@3 + *((byte*) BORDERCOL#0) ← (byte) BLUE#0 + (byte~) main::$2 ← (byte) VIC_BMM#0 | (byte) VIC_DEN#0 + (byte~) main::$3 ← (byte~) main::$2 | (byte) VIC_RSEL#0 + (number~) main::$4 ← (byte~) main::$3 | (number) 3 + *((byte*) D011#0) ← (number~) main::$4 + (word~) main::$5 ← ((word)) (byte*) SCREEN#0 + (number~) main::$6 ← (word~) main::$5 & (number) $3fff + (number~) main::$7 ← (number~) main::$6 / (number) $40 + (word~) main::$8 ← ((word)) (byte*) BITMAP#0 + (number~) main::$9 ← (word~) main::$8 & (number) $3fff + (number~) main::$10 ← (number~) main::$9 / (number) $400 + (number~) main::$11 ← (number~) main::$7 | (number~) main::$10 + (byte~) main::$12 ← ((byte)) (number~) main::$11 + *((byte*) VIC_MEMORY#0) ← (byte~) main::$12 + (signed word) circle::xc#0 ← (number) $64 + (signed word) circle::yc#0 ← (number) $64 + (signed word) circle::r#0 ← (number) $32 + call circle + to:main::@5 +main::@5: scope:[main] from main::@4 + to:main::@1 +main::@1: scope:[main] from main::@1 main::@5 + if(true) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@1 + return + to:@return +circle: scope:[circle] from main::@4 + (signed word) circle::yc#13 ← phi( main::@4/(signed word) circle::yc#0 ) + (signed word) circle::xc#13 ← phi( main::@4/(signed word) circle::xc#0 ) + (signed word) circle::r#1 ← phi( main::@4/(signed word) circle::r#0 ) + (signed word) circle::y#0 ← (signed word) circle::r#1 + (signed word~) circle::$0 ← (signed word) circle::r#1 << (number) 1 + (number~) circle::$1 ← (number) 3 - (signed word~) circle::$0 + (signed word) circle::p#0 ← (number~) circle::$1 + (signed word) circle::x1#0 ← (number) 0 + to:circle::@1 +circle::@1: scope:[circle] from circle circle::@18 + (signed word) circle::yc#12 ← phi( circle/(signed word) circle::yc#13 circle::@18/(signed word) circle::yc#14 ) + (signed word) circle::xc#12 ← phi( circle/(signed word) circle::xc#13 circle::@18/(signed word) circle::xc#14 ) + (signed word) circle::p#6 ← phi( circle/(signed word) circle::p#0 circle::@18/(signed word) circle::p#7 ) + (signed word) circle::y#2 ← phi( circle/(signed word) circle::y#0 circle::@18/(signed word) circle::y#12 ) + (signed word) circle::x1#2 ← phi( circle/(signed word) circle::x1#0 circle::@18/(signed word) circle::x1#1 ) + (bool~) circle::$2 ← (signed word) circle::x1#2 <= (signed word) circle::y#2 + if((bool~) circle::$2) goto circle::@2 + to:circle::@return +circle::@2: scope:[circle] from circle::@1 + (signed word) circle::yc#11 ← phi( circle::@1/(signed word) circle::yc#12 ) + (signed word) circle::xc#11 ← phi( circle::@1/(signed word) circle::xc#12 ) + (signed word) circle::y#13 ← phi( circle::@1/(signed word) circle::y#2 ) + (signed word) circle::x1#14 ← phi( circle::@1/(signed word) circle::x1#2 ) + (signed word) circle::p#3 ← phi( circle::@1/(signed word) circle::p#6 ) + (bool~) circle::$3 ← (signed word) circle::p#3 < (number) 0 + if((bool~) circle::$3) goto circle::@4 + to:circle::@8 +circle::@4: scope:[circle] from circle::@2 + (signed word) circle::y#14 ← phi( circle::@2/(signed word) circle::y#13 ) + (signed word) circle::yc#9 ← phi( circle::@2/(signed word) circle::yc#11 ) + (signed word) circle::xc#9 ← phi( circle::@2/(signed word) circle::xc#11 ) + (signed word) circle::p#4 ← phi( circle::@2/(signed word) circle::p#3 ) + (signed word) circle::x1#3 ← phi( circle::@2/(signed word) circle::x1#14 ) + (signed word~) circle::$9 ← (signed word) circle::x1#3 << (number) 2 + (signed word~) circle::$10 ← (signed word) circle::p#4 + (signed word~) circle::$9 + (number~) circle::$11 ← (signed word~) circle::$10 + (number) 6 + (signed word) circle::p#1 ← (number~) circle::$11 + to:circle::@5 +circle::@8: scope:[circle] from circle::@2 + (signed word) circle::yc#10 ← phi( circle::@2/(signed word) circle::yc#11 ) + (signed word) circle::xc#10 ← phi( circle::@2/(signed word) circle::xc#11 ) + (signed word) circle::p#5 ← phi( circle::@2/(signed word) circle::p#3 ) + (signed word) circle::x1#4 ← phi( circle::@2/(signed word) circle::x1#14 ) + (signed word) circle::y#3 ← phi( circle::@2/(signed word) circle::y#13 ) + (number~) circle::$4 ← (signed word) circle::y#3 - (number) 1 + (signed word) circle::y#1 ← (number~) circle::$4 + (signed word~) circle::$5 ← (signed word) circle::x1#4 - (signed word) circle::y#1 + (signed word~) circle::$6 ← (signed word~) circle::$5 << (number) 2 + (signed word~) circle::$7 ← (signed word) circle::p#5 + (signed word~) circle::$6 + (number~) circle::$8 ← (signed word~) circle::$7 + (number) $a + (signed word) circle::p#2 ← (number~) circle::$8 + to:circle::@5 +circle::@5: scope:[circle] from circle::@4 circle::@8 + (signed word) circle::p#15 ← phi( circle::@4/(signed word) circle::p#1 circle::@8/(signed word) circle::p#2 ) + (signed word) circle::y#4 ← phi( circle::@4/(signed word) circle::y#14 circle::@8/(signed word) circle::y#1 ) + (signed word) circle::yc#1 ← phi( circle::@4/(signed word) circle::yc#9 circle::@8/(signed word) circle::yc#10 ) + (signed word) circle::x1#5 ← phi( circle::@4/(signed word) circle::x1#3 circle::@8/(signed word) circle::x1#4 ) + (signed word) circle::xc#1 ← phi( circle::@4/(signed word) circle::xc#9 circle::@8/(signed word) circle::xc#10 ) + (signed word~) circle::$12 ← (signed word) circle::xc#1 + (signed word) circle::x1#5 + (signed word~) circle::$13 ← (signed word) circle::yc#1 - (signed word) circle::y#4 + (signed word) plot::x#0 ← (signed word~) circle::$12 + (signed word) plot::y#0 ← (signed word~) circle::$13 + call plot + to:circle::@11 +circle::@11: scope:[circle] from circle::@5 + (signed word) circle::p#14 ← phi( circle::@5/(signed word) circle::p#15 ) + (signed word) circle::y#5 ← phi( circle::@5/(signed word) circle::y#4 ) + (signed word) circle::yc#2 ← phi( circle::@5/(signed word) circle::yc#1 ) + (signed word) circle::x1#6 ← phi( circle::@5/(signed word) circle::x1#5 ) + (signed word) circle::xc#2 ← phi( circle::@5/(signed word) circle::xc#1 ) + (signed word~) circle::$15 ← (signed word) circle::xc#2 - (signed word) circle::x1#6 + (signed word~) circle::$16 ← (signed word) circle::yc#2 - (signed word) circle::y#5 + (signed word) plot::x#1 ← (signed word~) circle::$15 + (signed word) plot::y#1 ← (signed word~) circle::$16 + call plot + to:circle::@12 +circle::@12: scope:[circle] from circle::@11 + (signed word) circle::p#13 ← phi( circle::@11/(signed word) circle::p#14 ) + (signed word) circle::y#6 ← phi( circle::@11/(signed word) circle::y#5 ) + (signed word) circle::yc#3 ← phi( circle::@11/(signed word) circle::yc#2 ) + (signed word) circle::x1#7 ← phi( circle::@11/(signed word) circle::x1#6 ) + (signed word) circle::xc#3 ← phi( circle::@11/(signed word) circle::xc#2 ) + (signed word~) circle::$18 ← (signed word) circle::xc#3 + (signed word) circle::x1#7 + (signed word~) circle::$19 ← (signed word) circle::yc#3 + (signed word) circle::y#6 + (signed word) plot::x#2 ← (signed word~) circle::$18 + (signed word) plot::y#2 ← (signed word~) circle::$19 + call plot + to:circle::@13 +circle::@13: scope:[circle] from circle::@12 + (signed word) circle::p#12 ← phi( circle::@12/(signed word) circle::p#13 ) + (signed word) circle::y#7 ← phi( circle::@12/(signed word) circle::y#6 ) + (signed word) circle::yc#4 ← phi( circle::@12/(signed word) circle::yc#3 ) + (signed word) circle::x1#8 ← phi( circle::@12/(signed word) circle::x1#7 ) + (signed word) circle::xc#4 ← phi( circle::@12/(signed word) circle::xc#3 ) + (signed word~) circle::$21 ← (signed word) circle::xc#4 - (signed word) circle::x1#8 + (signed word~) circle::$22 ← (signed word) circle::yc#4 + (signed word) circle::y#7 + (signed word) plot::x#3 ← (signed word~) circle::$21 + (signed word) plot::y#3 ← (signed word~) circle::$22 + call plot + to:circle::@14 +circle::@14: scope:[circle] from circle::@13 + (signed word) circle::p#11 ← phi( circle::@13/(signed word) circle::p#12 ) + (signed word) circle::x1#9 ← phi( circle::@13/(signed word) circle::x1#8 ) + (signed word) circle::yc#5 ← phi( circle::@13/(signed word) circle::yc#4 ) + (signed word) circle::y#8 ← phi( circle::@13/(signed word) circle::y#7 ) + (signed word) circle::xc#5 ← phi( circle::@13/(signed word) circle::xc#4 ) + (signed word~) circle::$24 ← (signed word) circle::xc#5 + (signed word) circle::y#8 + (signed word~) circle::$25 ← (signed word) circle::yc#5 - (signed word) circle::x1#9 + (signed word) plot::x#4 ← (signed word~) circle::$24 + (signed word) plot::y#4 ← (signed word~) circle::$25 + call plot + to:circle::@15 +circle::@15: scope:[circle] from circle::@14 + (signed word) circle::p#10 ← phi( circle::@14/(signed word) circle::p#11 ) + (signed word) circle::x1#10 ← phi( circle::@14/(signed word) circle::x1#9 ) + (signed word) circle::yc#6 ← phi( circle::@14/(signed word) circle::yc#5 ) + (signed word) circle::y#9 ← phi( circle::@14/(signed word) circle::y#8 ) + (signed word) circle::xc#6 ← phi( circle::@14/(signed word) circle::xc#5 ) + (signed word~) circle::$27 ← (signed word) circle::xc#6 - (signed word) circle::y#9 + (signed word~) circle::$28 ← (signed word) circle::yc#6 - (signed word) circle::x1#10 + (signed word) plot::x#5 ← (signed word~) circle::$27 + (signed word) plot::y#5 ← (signed word~) circle::$28 + call plot + to:circle::@16 +circle::@16: scope:[circle] from circle::@15 + (signed word) circle::p#9 ← phi( circle::@15/(signed word) circle::p#10 ) + (signed word) circle::x1#11 ← phi( circle::@15/(signed word) circle::x1#10 ) + (signed word) circle::yc#7 ← phi( circle::@15/(signed word) circle::yc#6 ) + (signed word) circle::y#10 ← phi( circle::@15/(signed word) circle::y#9 ) + (signed word) circle::xc#7 ← phi( circle::@15/(signed word) circle::xc#6 ) + (signed word~) circle::$30 ← (signed word) circle::xc#7 + (signed word) circle::y#10 + (signed word~) circle::$31 ← (signed word) circle::yc#7 + (signed word) circle::x1#11 + (signed word) plot::x#6 ← (signed word~) circle::$30 + (signed word) plot::y#6 ← (signed word~) circle::$31 + call plot + to:circle::@17 +circle::@17: scope:[circle] from circle::@16 + (signed word) circle::p#8 ← phi( circle::@16/(signed word) circle::p#9 ) + (signed word) circle::x1#12 ← phi( circle::@16/(signed word) circle::x1#11 ) + (signed word) circle::yc#8 ← phi( circle::@16/(signed word) circle::yc#7 ) + (signed word) circle::y#11 ← phi( circle::@16/(signed word) circle::y#10 ) + (signed word) circle::xc#8 ← phi( circle::@16/(signed word) circle::xc#7 ) + (signed word~) circle::$33 ← (signed word) circle::xc#8 - (signed word) circle::y#11 + (signed word~) circle::$34 ← (signed word) circle::yc#8 + (signed word) circle::x1#12 + (signed word) plot::x#7 ← (signed word~) circle::$33 + (signed word) plot::y#7 ← (signed word~) circle::$34 + call plot + to:circle::@18 +circle::@18: scope:[circle] from circle::@17 + (signed word) circle::yc#14 ← phi( circle::@17/(signed word) circle::yc#8 ) + (signed word) circle::xc#14 ← phi( circle::@17/(signed word) circle::xc#8 ) + (signed word) circle::p#7 ← phi( circle::@17/(signed word) circle::p#8 ) + (signed word) circle::y#12 ← phi( circle::@17/(signed word) circle::y#11 ) + (signed word) circle::x1#13 ← phi( circle::@17/(signed word) circle::x1#12 ) + (signed word) circle::x1#1 ← ++ (signed word) circle::x1#13 + to:circle::@1 +circle::@return: scope:[circle] from circle::@1 + return + to:@return +plot: scope:[plot] from circle::@11 circle::@12 circle::@13 circle::@14 circle::@15 circle::@16 circle::@17 circle::@5 + (signed word) plot::y#8 ← phi( circle::@11/(signed word) plot::y#1 circle::@12/(signed word) plot::y#2 circle::@13/(signed word) plot::y#3 circle::@14/(signed word) plot::y#4 circle::@15/(signed word) plot::y#5 circle::@16/(signed word) plot::y#6 circle::@17/(signed word) plot::y#7 circle::@5/(signed word) plot::y#0 ) + (signed word) plot::x#8 ← phi( circle::@11/(signed word) plot::x#1 circle::@12/(signed word) plot::x#2 circle::@13/(signed word) plot::x#3 circle::@14/(signed word) plot::x#4 circle::@15/(signed word) plot::x#5 circle::@16/(signed word) plot::x#6 circle::@17/(signed word) plot::x#7 circle::@5/(signed word) plot::x#0 ) + (byte*) plot::location#0 ← (byte*) BITMAP#0 + (number~) plot::$0 ← (signed word) plot::x#8 & (number) $fff8 + (byte*) plot::location#1 ← (byte*) plot::location#0 + (number~) plot::$0 + (byte~) plot::$1 ← < (signed word) plot::y#8 + (number~) plot::$2 ← (byte~) plot::$1 & (number) 7 + (byte*) plot::location#2 ← (byte*) plot::location#1 + (number~) plot::$2 + (signed word~) plot::$3 ← (signed word) plot::y#8 >> (number) 3 + (number~) plot::$4 ← (signed word~) plot::$3 * (number) $140 + (byte*) plot::location#3 ← (byte*) plot::location#2 + (number~) plot::$4 + (number~) plot::$5 ← (signed word) plot::x#8 & (number) 7 + (byte~) plot::$6 ← *((byte*) plot::location#3) | *((byte[]) bitmask#0 + (number~) plot::$5) + *((byte*) plot::location#3) ← (byte~) plot::$6 + to:plot::@return +plot::@return: scope:[plot] from plot + return + to:@return +fill: scope:[fill] from main main::@3 + (byte) fill::val#4 ← phi( main/(byte) fill::val#0 main::@3/(byte) fill::val#1 ) + (signed word) fill::size#2 ← phi( main/(signed word) fill::size#0 main::@3/(signed word) fill::size#1 ) + (byte*) fill::start#2 ← phi( main/(byte*) fill::start#0 main::@3/(byte*) fill::start#1 ) + (byte*~) fill::$0 ← (byte*) fill::start#2 + (signed word) fill::size#2 + (byte*) fill::end#0 ← (byte*~) fill::$0 + (byte*) fill::addr#0 ← (byte*) fill::start#2 + to:fill::@1 +fill::@1: scope:[fill] from fill fill::@2 + (byte) fill::val#3 ← phi( fill/(byte) fill::val#4 fill::@2/(byte) fill::val#2 ) + (byte*) fill::end#1 ← phi( fill/(byte*) fill::end#0 fill::@2/(byte*) fill::end#2 ) + (byte*) fill::addr#2 ← phi( fill/(byte*) fill::addr#0 fill::@2/(byte*) fill::addr#1 ) + (bool~) fill::$1 ← (byte*) fill::addr#2 != (byte*) fill::end#1 + if((bool~) fill::$1) goto fill::@2 + to:fill::@return +fill::@2: scope:[fill] from fill::@1 + (byte*) fill::end#2 ← phi( fill::@1/(byte*) fill::end#1 ) + (byte*) fill::addr#3 ← phi( fill::@1/(byte*) fill::addr#2 ) + (byte) fill::val#2 ← phi( fill::@1/(byte) fill::val#3 ) + *((byte*) fill::addr#3) ← (byte) fill::val#2 + (byte*) fill::addr#1 ← ++ (byte*) fill::addr#3 + to:fill::@1 +fill::@return: scope:[fill] from fill::@1 + return + to:@return +@8: scope:[] from @4 + call main + to:@9 +@9: scope:[] from @8 + to:@end +@end: scope:[] from @9 + +SYMBOL TABLE SSA +(label) @4 +(label) @8 +(label) @9 +(label) @begin +(label) @end +(byte*) BITMAP +(byte*) BITMAP#0 +(byte) BLUE +(byte) BLUE#0 +(byte*) BORDERCOL +(byte*) BORDERCOL#0 +(byte*) D011 +(byte*) D011#0 +(byte*) SCREEN +(byte*) SCREEN#0 +(byte) VIC_BMM +(byte) VIC_BMM#0 +(byte) VIC_DEN +(byte) VIC_DEN#0 +(byte*) VIC_MEMORY +(byte*) VIC_MEMORY#0 +(byte) VIC_RSEL +(byte) VIC_RSEL#0 +(byte[]) bitmask +(byte[]) bitmask#0 +(void()) circle((signed word) circle::xc , (signed word) circle::yc , (signed word) circle::r) +(signed word~) circle::$0 +(number~) circle::$1 +(signed word~) circle::$10 +(number~) circle::$11 +(signed word~) circle::$12 +(signed word~) circle::$13 +(signed word~) circle::$15 +(signed word~) circle::$16 +(signed word~) circle::$18 +(signed word~) circle::$19 +(bool~) circle::$2 +(signed word~) circle::$21 +(signed word~) circle::$22 +(signed word~) circle::$24 +(signed word~) circle::$25 +(signed word~) circle::$27 +(signed word~) circle::$28 +(bool~) circle::$3 +(signed word~) circle::$30 +(signed word~) circle::$31 +(signed word~) circle::$33 +(signed word~) circle::$34 +(number~) circle::$4 +(signed word~) circle::$5 +(signed word~) circle::$6 +(signed word~) circle::$7 +(number~) circle::$8 +(signed word~) circle::$9 +(label) circle::@1 +(label) circle::@11 +(label) circle::@12 +(label) circle::@13 +(label) circle::@14 +(label) circle::@15 +(label) circle::@16 +(label) circle::@17 +(label) circle::@18 +(label) circle::@2 +(label) circle::@4 +(label) circle::@5 +(label) circle::@8 +(label) circle::@return +(signed word) circle::p +(signed word) circle::p#0 +(signed word) circle::p#1 +(signed word) circle::p#10 +(signed word) circle::p#11 +(signed word) circle::p#12 +(signed word) circle::p#13 +(signed word) circle::p#14 +(signed word) circle::p#15 +(signed word) circle::p#2 +(signed word) circle::p#3 +(signed word) circle::p#4 +(signed word) circle::p#5 +(signed word) circle::p#6 +(signed word) circle::p#7 +(signed word) circle::p#8 +(signed word) circle::p#9 +(signed word) circle::r +(signed word) circle::r#0 +(signed word) circle::r#1 +(signed word) circle::x1 +(signed word) circle::x1#0 +(signed word) circle::x1#1 +(signed word) circle::x1#10 +(signed word) circle::x1#11 +(signed word) circle::x1#12 +(signed word) circle::x1#13 +(signed word) circle::x1#14 +(signed word) circle::x1#2 +(signed word) circle::x1#3 +(signed word) circle::x1#4 +(signed word) circle::x1#5 +(signed word) circle::x1#6 +(signed word) circle::x1#7 +(signed word) circle::x1#8 +(signed word) circle::x1#9 +(signed word) circle::xc +(signed word) circle::xc#0 +(signed word) circle::xc#1 +(signed word) circle::xc#10 +(signed word) circle::xc#11 +(signed word) circle::xc#12 +(signed word) circle::xc#13 +(signed word) circle::xc#14 +(signed word) circle::xc#2 +(signed word) circle::xc#3 +(signed word) circle::xc#4 +(signed word) circle::xc#5 +(signed word) circle::xc#6 +(signed word) circle::xc#7 +(signed word) circle::xc#8 +(signed word) circle::xc#9 +(signed word) circle::y +(signed word) circle::y#0 +(signed word) circle::y#1 +(signed word) circle::y#10 +(signed word) circle::y#11 +(signed word) circle::y#12 +(signed word) circle::y#13 +(signed word) circle::y#14 +(signed word) circle::y#2 +(signed word) circle::y#3 +(signed word) circle::y#4 +(signed word) circle::y#5 +(signed word) circle::y#6 +(signed word) circle::y#7 +(signed word) circle::y#8 +(signed word) circle::y#9 +(signed word) circle::yc +(signed word) circle::yc#0 +(signed word) circle::yc#1 +(signed word) circle::yc#10 +(signed word) circle::yc#11 +(signed word) circle::yc#12 +(signed word) circle::yc#13 +(signed word) circle::yc#14 +(signed word) circle::yc#2 +(signed word) circle::yc#3 +(signed word) circle::yc#4 +(signed word) circle::yc#5 +(signed word) circle::yc#6 +(signed word) circle::yc#7 +(signed word) circle::yc#8 +(signed word) circle::yc#9 +(void()) fill((byte*) fill::start , (signed word) fill::size , (byte) fill::val) +(byte*~) fill::$0 +(bool~) fill::$1 +(label) fill::@1 +(label) fill::@2 +(label) fill::@return +(byte*) fill::addr +(byte*) fill::addr#0 +(byte*) fill::addr#1 +(byte*) fill::addr#2 +(byte*) fill::addr#3 +(byte*) fill::end +(byte*) fill::end#0 +(byte*) fill::end#1 +(byte*) fill::end#2 +(signed word) fill::size +(signed word) fill::size#0 +(signed word) fill::size#1 +(signed word) fill::size#2 +(byte*) fill::start +(byte*) fill::start#0 +(byte*) fill::start#1 +(byte*) fill::start#2 +(byte) fill::val +(byte) fill::val#0 +(byte) fill::val#1 +(byte) fill::val#2 +(byte) fill::val#3 +(byte) fill::val#4 +(void()) main() +(number~) main::$10 +(number~) main::$11 +(byte~) main::$12 +(byte~) main::$2 +(byte~) main::$3 +(number~) main::$4 +(word~) main::$5 +(number~) main::$6 +(number~) main::$7 +(word~) main::$8 +(number~) main::$9 +(label) main::@1 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@return +(void()) plot((signed word) plot::x , (signed word) plot::y) +(number~) plot::$0 +(byte~) plot::$1 +(number~) plot::$2 +(signed word~) plot::$3 +(number~) plot::$4 +(number~) plot::$5 +(byte~) plot::$6 +(label) plot::@return +(byte*) plot::location +(byte*) plot::location#0 +(byte*) plot::location#1 +(byte*) plot::location#2 +(byte*) plot::location#3 +(signed word) plot::x +(signed word) plot::x#0 +(signed word) plot::x#1 +(signed word) plot::x#2 +(signed word) plot::x#3 +(signed word) plot::x#4 +(signed word) plot::x#5 +(signed word) plot::x#6 +(signed word) plot::x#7 +(signed word) plot::x#8 +(signed word) plot::y +(signed word) plot::y#0 +(signed word) plot::y#1 +(signed word) plot::y#2 +(signed word) plot::y#3 +(signed word) plot::y#4 +(signed word) plot::y#5 +(signed word) plot::y#6 +(signed word) plot::y#7 +(signed word) plot::y#8 + +Adding number conversion cast (unumber) $20 in (byte) VIC_BMM#0 ← (number) $20 +Adding number conversion cast (unumber) $10 in (byte) VIC_DEN#0 ← (number) $10 +Adding number conversion cast (unumber) 8 in (byte) VIC_RSEL#0 ← (number) 8 +Adding number conversion cast (unumber) 6 in (byte) BLUE#0 ← (number) 6 +Adding number conversion cast (snumber) $28*$19*8 in (signed word) fill::size#0 ← (number) $28*(number) $19*(number) 8 +Adding number conversion cast (unumber) 0 in (byte) fill::val#0 ← (number) 0 +Adding number conversion cast (snumber) $28*$19 in (signed word) fill::size#1 ← (number) $28*(number) $19 +Adding number conversion cast (unumber) $16 in (byte) fill::val#1 ← (number) $16 +Adding number conversion cast (unumber) 3 in (number~) main::$4 ← (byte~) main::$3 | (number) 3 +Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (byte~) main::$3 | (unumber)(number) 3 +Adding number conversion cast (unumber) $3fff in (number~) main::$6 ← (word~) main::$5 & (number) $3fff +Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (word~) main::$5 & (unumber)(number) $3fff +Adding number conversion cast (unumber) $40 in (number~) main::$7 ← (unumber~) main::$6 / (number) $40 +Adding number conversion cast (unumber) main::$7 in (number~) main::$7 ← (unumber~) main::$6 / (unumber)(number) $40 +Adding number conversion cast (unumber) $3fff in (number~) main::$9 ← (word~) main::$8 & (number) $3fff +Adding number conversion cast (unumber) main::$9 in (number~) main::$9 ← (word~) main::$8 & (unumber)(number) $3fff +Adding number conversion cast (unumber) $400 in (number~) main::$10 ← (unumber~) main::$9 / (number) $400 +Adding number conversion cast (unumber) main::$10 in (number~) main::$10 ← (unumber~) main::$9 / (unumber)(number) $400 +Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (unumber~) main::$7 | (unumber~) main::$10 +Adding number conversion cast (snumber) $64 in (signed word) circle::xc#0 ← (number) $64 +Adding number conversion cast (snumber) $64 in (signed word) circle::yc#0 ← (number) $64 +Adding number conversion cast (snumber) $32 in (signed word) circle::r#0 ← (number) $32 +Adding number conversion cast (snumber) 1 in (signed word~) circle::$0 ← (signed word) circle::r#1 << (number) 1 +Adding number conversion cast (snumber) 3 in (number~) circle::$1 ← (number) 3 - (signed word~) circle::$0 +Adding number conversion cast (snumber) circle::$1 in (number~) circle::$1 ← (snumber)(number) 3 - (signed word~) circle::$0 +Adding number conversion cast (snumber) 0 in (signed word) circle::x1#0 ← (number) 0 +Adding number conversion cast (snumber) 0 in (bool~) circle::$3 ← (signed word) circle::p#3 < (number) 0 +Adding number conversion cast (snumber) 2 in (signed word~) circle::$9 ← (signed word) circle::x1#3 << (number) 2 +Adding number conversion cast (snumber) 6 in (number~) circle::$11 ← (signed word~) circle::$10 + (number) 6 +Adding number conversion cast (snumber) circle::$11 in (number~) circle::$11 ← (signed word~) circle::$10 + (snumber)(number) 6 +Adding number conversion cast (snumber) 1 in (number~) circle::$4 ← (signed word) circle::y#3 - (number) 1 +Adding number conversion cast (snumber) circle::$4 in (number~) circle::$4 ← (signed word) circle::y#3 - (snumber)(number) 1 +Adding number conversion cast (snumber) 2 in (signed word~) circle::$6 ← (signed word~) circle::$5 << (number) 2 +Adding number conversion cast (snumber) $a in (number~) circle::$8 ← (signed word~) circle::$7 + (number) $a +Adding number conversion cast (snumber) circle::$8 in (number~) circle::$8 ← (signed word~) circle::$7 + (snumber)(number) $a +Adding number conversion cast (snumber) $fff8 in (number~) plot::$0 ← (signed word) plot::x#8 & (number) $fff8 +Adding number conversion cast (snumber) plot::$0 in (number~) plot::$0 ← (signed word) plot::x#8 & (snumber)(number) $fff8 +Adding number conversion cast (unumber) 7 in (number~) plot::$2 ← (byte~) plot::$1 & (number) 7 +Adding number conversion cast (unumber) plot::$2 in (number~) plot::$2 ← (byte~) plot::$1 & (unumber)(number) 7 +Adding number conversion cast (snumber) 3 in (signed word~) plot::$3 ← (signed word) plot::y#8 >> (number) 3 +Adding number conversion cast (snumber) $140 in (number~) plot::$4 ← (signed word~) plot::$3 * (number) $140 +Adding number conversion cast (snumber) plot::$4 in (number~) plot::$4 ← (signed word~) plot::$3 * (snumber)(number) $140 +Adding number conversion cast (snumber) 7 in (number~) plot::$5 ← (signed word) plot::x#8 & (number) 7 +Adding number conversion cast (snumber) plot::$5 in (number~) plot::$5 ← (signed word) plot::x#8 & (snumber)(number) 7 +Successful SSA optimization PassNAddNumberTypeConversions +Added casts to value list in (byte[]) bitmask#0 ← (byte[]){ (byte)(number) $80, (byte)(number) $40, (byte)(number) $20, (byte)(number) $10, (byte)(number) 8, (byte)(number) 4, (byte)(number) 2, (byte)(number) 1 } +Successful SSA optimization PassNAddInitializerValueListTypeCasts +Inlining cast (byte*) BORDERCOL#0 ← (byte*)(number) $d020 +Inlining cast (byte*) D011#0 ← (byte*)(number) $d011 +Inlining cast (byte) VIC_BMM#0 ← (unumber)(number) $20 +Inlining cast (byte) VIC_DEN#0 ← (unumber)(number) $10 +Inlining cast (byte) VIC_RSEL#0 ← (unumber)(number) 8 +Inlining cast (byte*) VIC_MEMORY#0 ← (byte*)(number) $d018 +Inlining cast (byte) BLUE#0 ← (unumber)(number) 6 +Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $2000 +Inlining cast (signed word) fill::size#0 ← (snumber)(number) $28*(number) $19*(number) 8 +Inlining cast (byte) fill::val#0 ← (unumber)(number) 0 +Inlining cast (signed word) fill::size#1 ← (snumber)(number) $28*(number) $19 +Inlining cast (byte) fill::val#1 ← (unumber)(number) $16 +Inlining cast (word~) main::$5 ← (word)(byte*) SCREEN#0 +Inlining cast (word~) main::$8 ← (word)(byte*) BITMAP#0 +Inlining cast (byte~) main::$12 ← (byte)(unumber~) main::$11 +Inlining cast (signed word) circle::xc#0 ← (snumber)(number) $64 +Inlining cast (signed word) circle::yc#0 ← (snumber)(number) $64 +Inlining cast (signed word) circle::r#0 ← (snumber)(number) $32 +Inlining cast (signed word) circle::x1#0 ← (snumber)(number) 0 +Successful SSA optimization Pass2InlineCast +Simplifying constant pointer cast (byte*) 53280 +Simplifying constant pointer cast (byte*) 53265 +Simplifying constant integer cast $20 +Simplifying constant integer cast $10 +Simplifying constant integer cast 8 +Simplifying constant pointer cast (byte*) 53272 +Simplifying constant integer cast 6 +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant pointer cast (byte*) 8192 +Simplifying constant integer cast $80 +Simplifying constant integer cast $40 +Simplifying constant integer cast $20 +Simplifying constant integer cast $10 +Simplifying constant integer cast 8 +Simplifying constant integer cast 4 +Simplifying constant integer cast 2 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast $16 +Simplifying constant integer cast 3 +Simplifying constant integer cast $3fff +Simplifying constant integer cast $40 +Simplifying constant integer cast $3fff +Simplifying constant integer cast $400 +Simplifying constant integer cast $64 +Simplifying constant integer cast $64 +Simplifying constant integer cast $32 +Simplifying constant integer cast 1 +Simplifying constant integer cast 3 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast 6 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast $a +Simplifying constant integer cast $fff8 +Simplifying constant integer cast 7 +Simplifying constant integer cast 3 +Simplifying constant integer cast $140 +Simplifying constant integer cast 7 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) $20 +Finalized unsigned number type (byte) $10 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 6 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $16 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (word) $400 +Finalized signed number type (signed byte) $64 +Finalized signed number type (signed byte) $64 +Finalized signed number type (signed byte) $32 +Finalized signed number type (signed byte) 1 +Finalized signed number type (signed byte) 3 +Finalized signed number type (signed byte) 0 +Finalized signed number type (signed byte) 0 +Finalized signed number type (signed byte) 2 +Finalized signed number type (signed byte) 6 +Finalized signed number type (signed byte) 1 +Finalized signed number type (signed byte) 2 +Finalized signed number type (signed byte) $a +Finalized signed number type (signed dword) $fff8 +Finalized unsigned number type (byte) 7 +Finalized signed number type (signed byte) 3 +Finalized signed number type (signed word) $140 +Finalized signed number type (signed byte) 7 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Inferred type updated to byte in (unumber~) main::$4 ← (byte~) main::$3 | (byte) 3 +Inferred type updated to word in (unumber~) main::$6 ← (word~) main::$5 & (word) $3fff +Inferred type updated to word in (unumber~) main::$7 ← (word~) main::$6 / (byte) $40 +Inferred type updated to word in (unumber~) main::$9 ← (word~) main::$8 & (word) $3fff +Inferred type updated to word in (unumber~) main::$10 ← (word~) main::$9 / (word) $400 +Inferred type updated to word in (unumber~) main::$11 ← (word~) main::$7 | (word~) main::$10 +Inferred type updated to signed word in (snumber~) circle::$1 ← (signed byte) 3 - (signed word~) circle::$0 +Inferred type updated to signed word in (snumber~) circle::$11 ← (signed word~) circle::$10 + (signed byte) 6 +Inferred type updated to signed word in (snumber~) circle::$4 ← (signed word) circle::y#3 - (signed byte) 1 +Inferred type updated to signed word in (snumber~) circle::$8 ← (signed word~) circle::$7 + (signed byte) $a +Inferred type updated to signed word in (snumber~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 +Inferred type updated to byte in (unumber~) plot::$2 ← (byte~) plot::$1 & (byte) 7 +Inferred type updated to signed word in (snumber~) plot::$4 ← (signed word~) plot::$3 * (signed word) $140 +Inferred type updated to signed byte in (snumber~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 +Alias (signed word) circle::y#0 = (signed word) circle::r#1 +Alias (signed word) circle::p#0 = (signed word~) circle::$1 +Alias (signed word) circle::p#3 = (signed word) circle::p#6 (signed word) circle::p#4 (signed word) circle::p#5 +Alias (signed word) circle::x1#14 = (signed word) circle::x1#2 (signed word) circle::x1#3 (signed word) circle::x1#4 +Alias (signed word) circle::y#13 = (signed word) circle::y#2 (signed word) circle::y#14 (signed word) circle::y#3 +Alias (signed word) circle::xc#10 = (signed word) circle::xc#11 (signed word) circle::xc#12 (signed word) circle::xc#9 +Alias (signed word) circle::yc#10 = (signed word) circle::yc#11 (signed word) circle::yc#12 (signed word) circle::yc#9 +Alias (signed word) circle::p#1 = (signed word~) circle::$11 +Alias (signed word) circle::y#1 = (signed word~) circle::$4 +Alias (signed word) circle::p#2 = (signed word~) circle::$8 +Alias (signed word) plot::x#0 = (signed word~) circle::$12 +Alias (signed word) plot::y#0 = (signed word~) circle::$13 +Alias (signed word) circle::xc#1 = (signed word) circle::xc#2 (signed word) circle::xc#3 (signed word) circle::xc#4 (signed word) circle::xc#5 (signed word) circle::xc#6 (signed word) circle::xc#7 (signed word) circle::xc#8 (signed word) circle::xc#14 +Alias (signed word) circle::x1#10 = (signed word) circle::x1#6 (signed word) circle::x1#5 (signed word) circle::x1#7 (signed word) circle::x1#8 (signed word) circle::x1#9 (signed word) circle::x1#11 (signed word) circle::x1#12 (signed word) circle::x1#13 +Alias (signed word) circle::yc#1 = (signed word) circle::yc#2 (signed word) circle::yc#3 (signed word) circle::yc#4 (signed word) circle::yc#5 (signed word) circle::yc#6 (signed word) circle::yc#7 (signed word) circle::yc#8 (signed word) circle::yc#14 +Alias (signed word) circle::y#10 = (signed word) circle::y#5 (signed word) circle::y#4 (signed word) circle::y#6 (signed word) circle::y#7 (signed word) circle::y#8 (signed word) circle::y#9 (signed word) circle::y#11 (signed word) circle::y#12 +Alias (signed word) circle::p#10 = (signed word) circle::p#14 (signed word) circle::p#15 (signed word) circle::p#13 (signed word) circle::p#12 (signed word) circle::p#11 (signed word) circle::p#9 (signed word) circle::p#8 (signed word) circle::p#7 +Alias (signed word) plot::x#1 = (signed word~) circle::$15 +Alias (signed word) plot::y#1 = (signed word~) circle::$16 +Alias (signed word) plot::x#2 = (signed word~) circle::$18 +Alias (signed word) plot::y#2 = (signed word~) circle::$19 +Alias (signed word) plot::x#3 = (signed word~) circle::$21 +Alias (signed word) plot::y#3 = (signed word~) circle::$22 +Alias (signed word) plot::x#4 = (signed word~) circle::$24 +Alias (signed word) plot::y#4 = (signed word~) circle::$25 +Alias (signed word) plot::x#5 = (signed word~) circle::$27 +Alias (signed word) plot::y#5 = (signed word~) circle::$28 +Alias (signed word) plot::x#6 = (signed word~) circle::$30 +Alias (signed word) plot::y#6 = (signed word~) circle::$31 +Alias (signed word) plot::x#7 = (signed word~) circle::$33 +Alias (signed word) plot::y#7 = (signed word~) circle::$34 +Alias (byte*) fill::end#0 = (byte*~) fill::$0 +Alias (byte*) fill::addr#0 = (byte*) fill::start#2 +Alias (byte) fill::val#2 = (byte) fill::val#3 +Alias (byte*) fill::addr#2 = (byte*) fill::addr#3 +Alias (byte*) fill::end#1 = (byte*) fill::end#2 +Successful SSA optimization Pass2AliasElimination +Alias (signed word) circle::xc#1 = (signed word) circle::xc#10 +Alias (signed word) circle::x1#10 = (signed word) circle::x1#14 +Alias (signed word) circle::yc#1 = (signed word) circle::yc#10 +Successful SSA optimization Pass2AliasElimination +Identical Phi Values (signed word) circle::y#0 (signed word) circle::r#0 +Identical Phi Values (signed word) circle::xc#13 (signed word) circle::xc#0 +Identical Phi Values (signed word) circle::yc#13 (signed word) circle::yc#0 +Identical Phi Values (signed word) circle::xc#1 (signed word) circle::xc#13 +Identical Phi Values (signed word) circle::yc#1 (signed word) circle::yc#13 +Identical Phi Values (byte*) fill::end#1 (byte*) fill::end#0 +Identical Phi Values (byte) fill::val#2 (byte) fill::val#4 +Successful SSA optimization Pass2IdenticalPhiElimination +Simple Condition (bool~) circle::$2 [46] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 +Simple Condition (bool~) circle::$3 [49] if((signed word) circle::p#3<(signed byte) 0) goto circle::@4 +Simple Condition (bool~) fill::$1 [134] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 +Successful SSA optimization Pass2ConditionalJumpSimplification +Constant right-side identified [11] (signed word) fill::size#0 ← (snumber)(number) $28*(number) $19*(number) 8 +Constant right-side identified [15] (signed word) fill::size#1 ← (snumber)(number) $28*(number) $19 +Successful SSA optimization Pass2ConstantRValueConsolidation +Identified constant from value list (byte[]) { (byte) $80, (byte) $40, (byte) $20, (byte) $10, (byte) 8, (byte) 4, (byte) 2, (byte) 1 } +Successful SSA optimization Pass2ConstantInitializerValueLists +Constant (const byte*) BORDERCOL#0 = (byte*) 53280 +Constant (const byte*) D011#0 = (byte*) 53265 +Constant (const byte) VIC_BMM#0 = $20 +Constant (const byte) VIC_DEN#0 = $10 +Constant (const byte) VIC_RSEL#0 = 8 +Constant (const byte*) VIC_MEMORY#0 = (byte*) 53272 +Constant (const byte) BLUE#0 = 6 +Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte*) BITMAP#0 = (byte*) 8192 +Constant (const byte[]) bitmask#0 = { $80, $40, $20, $10, 8, 4, 2, 1 } +Constant (const signed word) fill::size#0 = (snumber)$28*$19*8 +Constant (const byte) fill::val#0 = 0 +Constant (const signed word) fill::size#1 = (snumber)$28*$19 +Constant (const byte) fill::val#1 = $16 +Constant (const signed word) circle::xc#0 = $64 +Constant (const signed word) circle::yc#0 = $64 +Constant (const signed word) circle::r#0 = $32 +Constant (const signed word) circle::x1#0 = 0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte*) fill::start#0 = BITMAP#0 +Constant (const byte*) fill::start#1 = SCREEN#0 +Constant (const byte*) plot::location#0 = BITMAP#0 +Successful SSA optimization Pass2ConstantIdentification +Constant value identified (word)SCREEN#0 in [23] (word~) main::$5 ← (word)(const byte*) SCREEN#0 +Constant value identified (word)BITMAP#0 in [26] (word~) main::$8 ← (word)(const byte*) BITMAP#0 +Successful SSA optimization Pass2ConstantValues +if() condition always true - replacing block destination [36] if(true) goto main::@1 +Successful SSA optimization Pass2ConstantIfs +Removing unused block main::@return +Successful SSA optimization Pass2EliminateUnusedBlocks +Constant right-side identified [3] (byte~) main::$2 ← (const byte) VIC_BMM#0 | (const byte) VIC_DEN#0 +Constant right-side identified [17] (signed word~) circle::$0 ← (const signed word) circle::r#0 << (signed byte) 1 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::$2 = VIC_BMM#0|VIC_DEN#0 +Constant (const word) main::$5 = (word)SCREEN#0 +Constant (const word) main::$8 = (word)BITMAP#0 +Constant (const signed word) circle::$0 = circle::r#0<<1 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [3] (byte~) main::$3 ← (const byte) main::$2 | (const byte) VIC_RSEL#0 +Constant right-side identified [6] (word~) main::$6 ← (const word) main::$5 & (word) $3fff +Constant right-side identified [8] (word~) main::$9 ← (const word) main::$8 & (word) $3fff +Constant right-side identified [14] (signed word) circle::p#0 ← (signed byte) 3 - (const signed word) circle::$0 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::$3 = main::$2|VIC_RSEL#0 +Constant (const word) main::$6 = main::$5&$3fff +Constant (const word) main::$9 = main::$8&$3fff +Constant (const signed word) circle::p#0 = 3-circle::$0 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [3] (byte~) main::$4 ← (const byte) main::$3 | (byte) 3 +Constant right-side identified [5] (word~) main::$7 ← (const word) main::$6 / (byte) $40 +Constant right-side identified [6] (word~) main::$10 ← (const word) main::$9 / (word) $400 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::$4 = main::$3|3 +Constant (const word) main::$7 = main::$6/$40 +Constant (const word) main::$10 = main::$9/$400 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [4] (word~) main::$11 ← (const word) main::$7 | (const word) main::$10 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const word) main::$11 = main::$7|main::$10 +Successful SSA optimization Pass2ConstantIdentification +Constant value identified (byte)main::$11 in [5] (byte~) main::$12 ← (byte)(const word) main::$11 +Successful SSA optimization Pass2ConstantValues +Constant (const byte) main::$12 = (byte)main::$11 +Successful SSA optimization Pass2ConstantIdentification +Rewriting multiplication to use shift and addition[51] (signed word~) plot::$4 ← (signed word~) plot::$3 * (signed word) $140 +Inlining constant with var siblings (const signed word) circle::x1#0 +Inlining constant with var siblings (const signed word) circle::p#0 +Inlining constant with var siblings (const byte*) plot::location#0 +Inlining constant with var siblings (const signed word) fill::size#0 +Inlining constant with var siblings (const byte) fill::val#0 +Inlining constant with var siblings (const signed word) fill::size#1 +Inlining constant with var siblings (const byte) fill::val#1 +Constant inlined fill::val#0 = (byte) 0 +Constant inlined circle::$0 = (const signed word) circle::r#0<<(signed byte) 1 +Constant inlined plot::location#0 = (const byte*) BITMAP#0 +Constant inlined fill::val#1 = (byte) $16 +Constant inlined main::$12 = (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 +Constant inlined fill::size#1 = (signed word)(number) $28*(number) $19 +Constant inlined fill::size#0 = (signed word)(number) $28*(number) $19*(number) 8 +Constant inlined circle::p#0 = (signed byte) 3-(const signed word) circle::r#0<<(signed byte) 1 +Constant inlined main::$10 = (word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 +Constant inlined main::$11 = (word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 +Constant inlined fill::start#1 = (const byte*) SCREEN#0 +Constant inlined fill::start#0 = (const byte*) BITMAP#0 +Constant inlined main::$2 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0 +Constant inlined circle::x1#0 = (signed byte) 0 +Constant inlined main::$5 = (word)(const byte*) SCREEN#0 +Constant inlined main::$6 = (word)(const byte*) SCREEN#0&(word) $3fff +Constant inlined main::$3 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0 +Constant inlined main::$4 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 +Constant inlined main::$9 = (word)(const byte*) BITMAP#0&(word) $3fff +Constant inlined main::$7 = (word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40 +Constant inlined main::$8 = (word)(const byte*) BITMAP#0 +Successful SSA optimization Pass2ConstantInlining +Alias (signed word~) plot::$4 = (signed word) plot::$9 +Successful SSA optimization Pass2AliasElimination +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @4 +Adding NOP phi() at start of @8 +Adding NOP phi() at start of @9 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of main::@5 +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of circle +CALL GRAPH +Calls in [] to main:3 +Calls in [main] to fill:7 fill:9 circle:13 +Calls in [circle] to plot:33 plot:38 plot:43 plot:48 plot:53 plot:58 plot:63 plot:68 + +Created 11 initial phi equivalence classes +Coalesced [26] circle::y#17 ← circle::y#1 +Coalesced [27] circle::p#18 ← circle::p#2 +Coalesced [31] plot::x#16 ← plot::x#0 +Coalesced [32] plot::y#16 ← plot::y#0 +Coalesced [36] plot::x#9 ← plot::x#1 +Coalesced [37] plot::y#9 ← plot::y#1 +Coalesced [41] plot::x#10 ← plot::x#2 +Coalesced [42] plot::y#10 ← plot::y#2 +Coalesced [46] plot::x#11 ← plot::x#3 +Coalesced [47] plot::y#11 ← plot::y#3 +Coalesced [51] plot::x#12 ← plot::x#4 +Coalesced [52] plot::y#12 ← plot::y#4 +Coalesced [56] plot::x#13 ← plot::x#5 +Coalesced [57] plot::y#13 ← plot::y#5 +Coalesced [61] plot::x#14 ← plot::x#6 +Coalesced [62] plot::y#14 ← plot::y#6 +Coalesced [66] plot::x#15 ← plot::x#7 +Coalesced [67] plot::y#15 ← plot::y#7 +Coalesced [70] circle::x1#15 ← circle::x1#1 +Coalesced [71] circle::y#15 ← circle::y#10 +Coalesced [72] circle::p#16 ← circle::p#10 +Coalesced (already) [76] circle::y#16 ← circle::y#13 +Coalesced [77] circle::p#17 ← circle::p#1 +Coalesced [95] fill::addr#4 ← fill::addr#0 +Coalesced [101] fill::addr#5 ← fill::addr#1 +Coalesced down to 8 phi equivalence classes +Culled Empty Block (label) @4 +Culled Empty Block (label) @9 +Culled Empty Block (label) main::@5 +Renumbering block @8 to @1 +Renumbering block main::@3 to main::@2 +Renumbering block main::@4 to main::@3 +Renumbering block circle::@4 to circle::@3 +Renumbering block circle::@5 to circle::@4 +Renumbering block circle::@8 to circle::@5 +Renumbering block circle::@11 to circle::@6 +Renumbering block circle::@12 to circle::@7 +Renumbering block circle::@13 to circle::@8 +Renumbering block circle::@14 to circle::@9 +Renumbering block circle::@15 to circle::@10 +Renumbering block circle::@16 to circle::@11 +Renumbering block circle::@17 to circle::@12 +Renumbering block circle::@18 to circle::@13 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@2 +Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of circle + +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] phi() + [5] call fill + to:main::@2 +main::@2: scope:[main] from main + [6] phi() + [7] call fill + to:main::@3 +main::@3: scope:[main] from main::@2 + [8] *((const byte*) BORDERCOL#0) ← (const byte) BLUE#0 + [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 + [10] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 + [11] call circle + to:main::@1 +main::@1: scope:[main] from main::@1 main::@3 + [12] phi() + to:main::@1 +circle: scope:[circle] from main::@3 + [13] phi() + to:circle::@1 +circle::@1: scope:[circle] from circle circle::@13 + [14] (signed word) circle::p#3 ← phi( circle/(signed byte) 3-(const signed word) circle::r#0<<(signed byte) 1 circle::@13/(signed word) circle::p#10 ) + [14] (signed word) circle::y#13 ← phi( circle/(const signed word) circle::r#0 circle::@13/(signed word) circle::y#10 ) + [14] (signed word) circle::x1#10 ← phi( circle/(signed byte) 0 circle::@13/(signed word) circle::x1#1 ) + [15] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 + to:circle::@return +circle::@return: scope:[circle] from circle::@1 + [16] return + to:@return +circle::@2: scope:[circle] from circle::@1 + [17] if((signed word) circle::p#3<(signed byte) 0) goto circle::@3 + to:circle::@5 +circle::@5: scope:[circle] from circle::@2 + [18] (signed word) circle::y#1 ← (signed word) circle::y#13 - (signed byte) 1 + [19] (signed word~) circle::$5 ← (signed word) circle::x1#10 - (signed word) circle::y#1 + [20] (signed word~) circle::$6 ← (signed word~) circle::$5 << (signed byte) 2 + [21] (signed word~) circle::$7 ← (signed word) circle::p#3 + (signed word~) circle::$6 + [22] (signed word) circle::p#2 ← (signed word~) circle::$7 + (signed byte) $a + to:circle::@4 +circle::@4: scope:[circle] from circle::@3 circle::@5 + [23] (signed word) circle::p#10 ← phi( circle::@3/(signed word) circle::p#1 circle::@5/(signed word) circle::p#2 ) + [23] (signed word) circle::y#10 ← phi( circle::@3/(signed word) circle::y#13 circle::@5/(signed word) circle::y#1 ) + [24] (signed word) plot::x#0 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 + [25] (signed word) plot::y#0 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 + [26] call plot + to:circle::@6 +circle::@6: scope:[circle] from circle::@4 + [27] (signed word) plot::x#1 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 + [28] (signed word) plot::y#1 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 + [29] call plot + to:circle::@7 +circle::@7: scope:[circle] from circle::@6 + [30] (signed word) plot::x#2 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 + [31] (signed word) plot::y#2 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 + [32] call plot + to:circle::@8 +circle::@8: scope:[circle] from circle::@7 + [33] (signed word) plot::x#3 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 + [34] (signed word) plot::y#3 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 + [35] call plot + to:circle::@9 +circle::@9: scope:[circle] from circle::@8 + [36] (signed word) plot::x#4 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 + [37] (signed word) plot::y#4 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 + [38] call plot + to:circle::@10 +circle::@10: scope:[circle] from circle::@9 + [39] (signed word) plot::x#5 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 + [40] (signed word) plot::y#5 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 + [41] call plot + to:circle::@11 +circle::@11: scope:[circle] from circle::@10 + [42] (signed word) plot::x#6 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 + [43] (signed word) plot::y#6 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 + [44] call plot + to:circle::@12 +circle::@12: scope:[circle] from circle::@11 + [45] (signed word) plot::x#7 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 + [46] (signed word) plot::y#7 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 + [47] call plot + to:circle::@13 +circle::@13: scope:[circle] from circle::@12 + [48] (signed word) circle::x1#1 ← ++ (signed word) circle::x1#10 + to:circle::@1 +circle::@3: scope:[circle] from circle::@2 + [49] (signed word~) circle::$9 ← (signed word) circle::x1#10 << (signed byte) 2 + [50] (signed word~) circle::$10 ← (signed word) circle::p#3 + (signed word~) circle::$9 + [51] (signed word) circle::p#1 ← (signed word~) circle::$10 + (signed byte) 6 + to:circle::@4 +plot: scope:[plot] from circle::@10 circle::@11 circle::@12 circle::@4 circle::@6 circle::@7 circle::@8 circle::@9 + [52] (signed word) plot::y#8 ← phi( circle::@6/(signed word) plot::y#1 circle::@7/(signed word) plot::y#2 circle::@8/(signed word) plot::y#3 circle::@9/(signed word) plot::y#4 circle::@10/(signed word) plot::y#5 circle::@11/(signed word) plot::y#6 circle::@12/(signed word) plot::y#7 circle::@4/(signed word) plot::y#0 ) + [52] (signed word) plot::x#8 ← phi( circle::@6/(signed word) plot::x#1 circle::@7/(signed word) plot::x#2 circle::@8/(signed word) plot::x#3 circle::@9/(signed word) plot::x#4 circle::@10/(signed word) plot::x#5 circle::@11/(signed word) plot::x#6 circle::@12/(signed word) plot::x#7 circle::@4/(signed word) plot::x#0 ) + [53] (signed word~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 + [54] (byte*) plot::location#1 ← (const byte*) BITMAP#0 + (signed word~) plot::$0 + [55] (byte~) plot::$1 ← < (signed word) plot::y#8 + [56] (byte~) plot::$2 ← (byte~) plot::$1 & (byte) 7 + [57] (byte*) plot::location#2 ← (byte*) plot::location#1 + (byte~) plot::$2 + [58] (signed word~) plot::$3 ← (signed word) plot::y#8 >> (signed byte) 3 + [59] (signed word) plot::$7 ← (signed word~) plot::$3 << (byte) 2 + [60] (signed word) plot::$8 ← (signed word) plot::$7 + (signed word~) plot::$3 + [61] (signed word~) plot::$4 ← (signed word) plot::$8 << (byte) 6 + [62] (byte*) plot::location#3 ← (byte*) plot::location#2 + (signed word~) plot::$4 + [63] (signed byte~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 + [64] (byte~) plot::$6 ← *((byte*) plot::location#3) | *((const byte[]) bitmask#0 + (signed byte~) plot::$5) + [65] *((byte*) plot::location#3) ← (byte~) plot::$6 + to:plot::@return +plot::@return: scope:[plot] from plot + [66] return + to:@return +fill: scope:[fill] from main main::@2 + [67] (byte) fill::val#4 ← phi( main/(byte) 0 main::@2/(byte) $16 ) + [67] (signed word) fill::size#2 ← phi( main/(signed word)(number) $28*(number) $19*(number) 8 main::@2/(signed word)(number) $28*(number) $19 ) + [67] (byte*) fill::addr#0 ← phi( main/(const byte*) BITMAP#0 main::@2/(const byte*) SCREEN#0 ) + [68] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (signed word) fill::size#2 + to:fill::@1 +fill::@1: scope:[fill] from fill fill::@2 + [69] (byte*) fill::addr#2 ← phi( fill/(byte*) fill::addr#0 fill::@2/(byte*) fill::addr#1 ) + [70] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 + to:fill::@return +fill::@return: scope:[fill] from fill::@1 + [71] return + to:@return +fill::@2: scope:[fill] from fill::@1 + [72] *((byte*) fill::addr#2) ← (byte) fill::val#4 + [73] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2 + to:fill::@1 + + +VARIABLE REGISTER WEIGHTS +(byte*) BITMAP +(byte) BLUE +(byte*) BORDERCOL +(byte*) D011 +(byte*) SCREEN +(byte) VIC_BMM +(byte) VIC_DEN +(byte*) VIC_MEMORY +(byte) VIC_RSEL +(byte[]) bitmask +(void()) circle((signed word) circle::xc , (signed word) circle::yc , (signed word) circle::r) +(signed word~) circle::$10 22.0 +(signed word~) circle::$5 22.0 +(signed word~) circle::$6 22.0 +(signed word~) circle::$7 22.0 +(signed word~) circle::$9 22.0 +(signed word) circle::p +(signed word) circle::p#1 22.0 +(signed word) circle::p#10 1.2692307692307692 +(signed word) circle::p#2 22.0 +(signed word) circle::p#3 6.285714285714286 +(signed word) circle::r +(signed word) circle::x1 +(signed word) circle::x1#1 22.0 +(signed word) circle::x1#10 3.9722222222222214 +(signed word) circle::xc +(signed word) circle::y +(signed word) circle::y#1 6.6000000000000005 +(signed word) circle::y#10 4.653846153846153 +(signed word) circle::y#13 7.333333333333333 +(signed word) circle::yc +(void()) fill((byte*) fill::start , (signed word) fill::size , (byte) fill::val) +(byte*) fill::addr +(byte*) fill::addr#0 2.0 +(byte*) fill::addr#1 22.0 +(byte*) fill::addr#2 15.333333333333332 +(byte*) fill::end +(byte*) fill::end#0 2.6 +(signed word) fill::size +(signed word) fill::size#2 2.0 +(byte*) fill::start +(byte) fill::val +(byte) fill::val#4 1.8333333333333333 +(void()) main() +(void()) plot((signed word) plot::x , (signed word) plot::y) +(signed word~) plot::$0 4.0 +(byte~) plot::$1 4.0 +(byte~) plot::$2 4.0 +(signed word~) plot::$3 3.0 +(signed word~) plot::$4 4.0 +(signed byte~) plot::$5 4.0 +(byte~) plot::$6 4.0 +(signed word) plot::$7 4.0 +(signed word) plot::$8 4.0 +(byte*) plot::location +(byte*) plot::location#1 1.3333333333333333 +(byte*) plot::location#2 0.8 +(byte*) plot::location#3 2.0 +(signed word) plot::x +(signed word) plot::x#0 11.0 +(signed word) plot::x#1 11.0 +(signed word) plot::x#2 11.0 +(signed word) plot::x#3 11.0 +(signed word) plot::x#4 11.0 +(signed word) plot::x#5 11.0 +(signed word) plot::x#6 11.0 +(signed word) plot::x#7 11.0 +(signed word) plot::x#8 8.363636363636363 +(signed word) plot::y +(signed word) plot::y#0 22.0 +(signed word) plot::y#1 22.0 +(signed word) plot::y#2 22.0 +(signed word) plot::y#3 22.0 +(signed word) plot::y#4 22.0 +(signed word) plot::y#5 22.0 +(signed word) plot::y#6 22.0 +(signed word) plot::y#7 22.0 +(signed word) plot::y#8 15.333333333333336 + +Initial phi equivalence classes +[ circle::x1#10 circle::x1#1 ] +[ circle::y#13 circle::y#10 circle::y#1 ] +[ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] +[ plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] +[ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 ] +[ fill::size#2 ] +[ fill::val#4 ] +[ fill::addr#2 fill::addr#0 fill::addr#1 ] +Added variable circle::$5 to zero page equivalence class [ circle::$5 ] +Added variable circle::$6 to zero page equivalence class [ circle::$6 ] +Added variable circle::$7 to zero page equivalence class [ circle::$7 ] +Added variable circle::$9 to zero page equivalence class [ circle::$9 ] +Added variable circle::$10 to zero page equivalence class [ circle::$10 ] +Added variable plot::$0 to zero page equivalence class [ plot::$0 ] +Added variable plot::location#1 to zero page equivalence class [ plot::location#1 ] +Added variable plot::$1 to zero page equivalence class [ plot::$1 ] +Added variable plot::$2 to zero page equivalence class [ plot::$2 ] +Added variable plot::location#2 to zero page equivalence class [ plot::location#2 ] +Added variable plot::$3 to zero page equivalence class [ plot::$3 ] +Added variable plot::$7 to zero page equivalence class [ plot::$7 ] +Added variable plot::$8 to zero page equivalence class [ plot::$8 ] +Added variable plot::$4 to zero page equivalence class [ plot::$4 ] +Added variable plot::location#3 to zero page equivalence class [ plot::location#3 ] +Added variable plot::$5 to zero page equivalence class [ plot::$5 ] +Added variable plot::$6 to zero page equivalence class [ plot::$6 ] +Added variable fill::end#0 to zero page equivalence class [ fill::end#0 ] +Complete equivalence classes +[ circle::x1#10 circle::x1#1 ] +[ circle::y#13 circle::y#10 circle::y#1 ] +[ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] +[ plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] +[ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 ] +[ fill::size#2 ] +[ fill::val#4 ] +[ fill::addr#2 fill::addr#0 fill::addr#1 ] +[ circle::$5 ] +[ circle::$6 ] +[ circle::$7 ] +[ circle::$9 ] +[ circle::$10 ] +[ plot::$0 ] +[ plot::location#1 ] +[ plot::$1 ] +[ plot::$2 ] +[ plot::location#2 ] +[ plot::$3 ] +[ plot::$7 ] +[ plot::$8 ] +[ plot::$4 ] +[ plot::location#3 ] +[ plot::$5 ] +[ plot::$6 ] +[ fill::end#0 ] +Allocated zp ZP_WORD:2 [ circle::x1#10 circle::x1#1 ] +Allocated zp ZP_WORD:4 [ circle::y#13 circle::y#10 circle::y#1 ] +Allocated zp ZP_WORD:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] +Allocated zp ZP_WORD:8 [ plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] +Allocated zp ZP_WORD:10 [ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 ] +Allocated zp ZP_WORD:12 [ fill::size#2 ] +Allocated zp ZP_BYTE:14 [ fill::val#4 ] +Allocated zp ZP_WORD:15 [ fill::addr#2 fill::addr#0 fill::addr#1 ] +Allocated zp ZP_WORD:17 [ circle::$5 ] +Allocated zp ZP_WORD:19 [ circle::$6 ] +Allocated zp ZP_WORD:21 [ circle::$7 ] +Allocated zp ZP_WORD:23 [ circle::$9 ] +Allocated zp ZP_WORD:25 [ circle::$10 ] +Allocated zp ZP_WORD:27 [ plot::$0 ] +Allocated zp ZP_WORD:29 [ plot::location#1 ] +Allocated zp ZP_BYTE:31 [ plot::$1 ] +Allocated zp ZP_BYTE:32 [ plot::$2 ] +Allocated zp ZP_WORD:33 [ plot::location#2 ] +Allocated zp ZP_WORD:35 [ plot::$3 ] +Allocated zp ZP_WORD:37 [ plot::$7 ] +Allocated zp ZP_WORD:39 [ plot::$8 ] +Allocated zp ZP_WORD:41 [ plot::$4 ] +Allocated zp ZP_WORD:43 [ plot::location#3 ] +Allocated zp ZP_BYTE:45 [ plot::$5 ] +Allocated zp ZP_BYTE:46 [ plot::$6 ] +Allocated zp ZP_WORD:47 [ fill::end#0 ] + +INITIAL ASM +Target platform is c64basic + // File Comments +// Plots a circle on a bitmap using Bresenham's Circle algorithm +// Coded by Richard-William Loerakker +// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac + // Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" + // Global Constants & labels + .label BORDERCOL = $d020 + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_MEMORY = $d018 + .const BLUE = 6 + .label SCREEN = $400 + .label BITMAP = $2000 + // @begin +bbegin: + // [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 + // @1 +b1: + // [2] call main + // [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main + // [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend + // @end +bend: + // main +main: { + // [5] call fill + // [67] phi from main to fill [phi:main->fill] + fill_from_main: + // [67] phi (byte) fill::val#4 = (byte) 0 [phi:main->fill#0] -- vbuz1=vbuc1 + lda #0 + sta.z fill.val + // [67] phi (signed word) fill::size#2 = (signed word)(number) $28*(number) $19*(number) 8 [phi:main->fill#1] -- vwsz1=vwsc1 + lda #<$28*$19*8 + sta.z fill.size + lda #>$28*$19*8 + sta.z fill.size+1 + // [67] phi (byte*) fill::addr#0 = (const byte*) BITMAP#0 [phi:main->fill#2] -- pbuz1=pbuc1 + lda #BITMAP + sta.z fill.addr+1 + jsr fill + // [6] phi from main to main::@2 [phi:main->main::@2] + b2_from_main: + jmp b2 + // main::@2 + b2: + // [7] call fill + // [67] phi from main::@2 to fill [phi:main::@2->fill] + fill_from_b2: + // [67] phi (byte) fill::val#4 = (byte) $16 [phi:main::@2->fill#0] -- vbuz1=vbuc1 + lda #$16 + sta.z fill.val + // [67] phi (signed word) fill::size#2 = (signed word)(number) $28*(number) $19 [phi:main::@2->fill#1] -- vwsz1=vwsc1 + lda #<$28*$19 + sta.z fill.size + lda #>$28*$19 + sta.z fill.size+1 + // [67] phi (byte*) fill::addr#0 = (const byte*) SCREEN#0 [phi:main::@2->fill#2] -- pbuz1=pbuc1 + lda #SCREEN + sta.z fill.addr+1 + jsr fill + jmp b3 + // main::@3 + b3: + // [8] *((const byte*) BORDERCOL#0) ← (const byte) BLUE#0 -- _deref_pbuc1=vbuc2 + lda #BLUE + sta BORDERCOL + // [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + // [10] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 -- _deref_pbuc1=vbuc2 + lda #(SCREEN&$3fff)/$40|(BITMAP&$3fff)/$400 + sta VIC_MEMORY + // [11] call circle + // [13] phi from main::@3 to circle [phi:main::@3->circle] + circle_from_b3: + jsr circle + // [12] phi from main::@1 main::@3 to main::@1 [phi:main::@1/main::@3->main::@1] + b1_from_b1: + b1_from_b3: + jmp b1 + // main::@1 + b1: + jmp b1_from_b1 +} + // circle +circle: { + .const xc = $64 + .const yc = $64 + .const r = $32 + .label _5 = $11 + .label _6 = $13 + .label _7 = $15 + .label _9 = $17 + .label _10 = $19 + .label p = 6 + .label y = 4 + .label x1 = 2 + // [14] phi from circle to circle::@1 [phi:circle->circle::@1] + b1_from_circle: + // [14] phi (signed word) circle::p#3 = (signed byte) 3-(const signed word) circle::r#0<<(signed byte) 1 [phi:circle->circle::@1#0] -- vwsz1=vwsc1 + lda #<3-(r<<1) + sta.z p + lda #>3-(r<<1) + sta.z p+1 + // [14] phi (signed word) circle::y#13 = (const signed word) circle::r#0 [phi:circle->circle::@1#1] -- vwsz1=vwsc1 + lda #r + sta.z y+1 + // [14] phi (signed word) circle::x1#10 = (signed byte) 0 [phi:circle->circle::@1#2] -- vwsz1=vbsc1 + lda #<0 + sta.z x1 + lda #>0 + sta.z x1+1 + jmp b1 + // circle::@1 + b1: + // [15] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 -- vwsz1_le_vwsz2_then_la1 + lda.z y + cmp.z x1 + lda.z y+1 + sbc.z x1+1 + bvc !+ + eor #$80 + !: + bpl b2 + jmp breturn + // circle::@return + breturn: + // [16] return + rts + // circle::@2 + b2: + // [17] if((signed word) circle::p#3<(signed byte) 0) goto circle::@3 -- vwsz1_lt_0_then_la1 + lda.z p+1 + bmi b3 + jmp b5 + // circle::@5 + b5: + // [18] (signed word) circle::y#1 ← (signed word) circle::y#13 - (signed byte) 1 -- vwsz1=vwsz1_minus_1 + sec + lda.z y + sbc #1 + sta.z y + bcs !+ + dec.z y+1 + !: + // [19] (signed word~) circle::$5 ← (signed word) circle::x1#10 - (signed word) circle::y#1 -- vwsz1=vwsz2_minus_vwsz3 + lda.z x1 + sec + sbc.z y + sta.z _5 + lda.z x1+1 + sbc.z y+1 + sta.z _5+1 + // [20] (signed word~) circle::$6 ← (signed word~) circle::$5 << (signed byte) 2 -- vwsz1=vwsz2_rol_2 + lda.z _5 + asl + sta.z _6 + lda.z _5+1 + rol + sta.z _6+1 + asl.z _6 + rol.z _6+1 + // [21] (signed word~) circle::$7 ← (signed word) circle::p#3 + (signed word~) circle::$6 -- vwsz1=vwsz2_plus_vwsz3 + lda.z p + clc + adc.z _6 + sta.z _7 + lda.z p+1 + adc.z _6+1 + sta.z _7+1 + // [22] (signed word) circle::p#2 ← (signed word~) circle::$7 + (signed byte) $a -- vwsz1=vwsz2_plus_vbsc1 + lda.z _7 + clc + adc #<$a + sta.z p + lda.z _7+1 + adc #>$a + sta.z p+1 + // [23] phi from circle::@3 circle::@5 to circle::@4 [phi:circle::@3/circle::@5->circle::@4] + b4_from_b3: + b4_from_b5: + // [23] phi (signed word) circle::p#10 = (signed word) circle::p#1 [phi:circle::@3/circle::@5->circle::@4#0] -- register_copy + // [23] phi (signed word) circle::y#10 = (signed word) circle::y#13 [phi:circle::@3/circle::@5->circle::@4#1] -- register_copy + jmp b4 + // circle::@4 + b4: + // [24] (signed word) plot::x#0 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + // [25] (signed word) plot::y#0 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + // [26] call plot + // [52] phi from circle::@4 to plot [phi:circle::@4->plot] + plot_from_b4: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#0 [phi:circle::@4->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#0 [phi:circle::@4->plot#1] -- register_copy + jsr plot + jmp b6 + // circle::@6 + b6: + // [27] (signed word) plot::x#1 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + // [28] (signed word) plot::y#1 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + // [29] call plot + // [52] phi from circle::@6 to plot [phi:circle::@6->plot] + plot_from_b6: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#1 [phi:circle::@6->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#1 [phi:circle::@6->plot#1] -- register_copy + jsr plot + jmp b7 + // circle::@7 + b7: + // [30] (signed word) plot::x#2 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + // [31] (signed word) plot::y#2 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #yc + sta.z plot.y+1 + // [32] call plot + // [52] phi from circle::@7 to plot [phi:circle::@7->plot] + plot_from_b7: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#2 [phi:circle::@7->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#2 [phi:circle::@7->plot#1] -- register_copy + jsr plot + jmp b8 + // circle::@8 + b8: + // [33] (signed word) plot::x#3 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + // [34] (signed word) plot::y#3 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #yc + sta.z plot.y+1 + // [35] call plot + // [52] phi from circle::@8 to plot [phi:circle::@8->plot] + plot_from_b8: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#3 [phi:circle::@8->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#3 [phi:circle::@8->plot#1] -- register_copy + jsr plot + jmp b9 + // circle::@9 + b9: + // [36] (signed word) plot::x#4 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #xc + sta.z plot.x+1 + // [37] (signed word) plot::y#4 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + // [38] call plot + // [52] phi from circle::@9 to plot [phi:circle::@9->plot] + plot_from_b9: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#4 [phi:circle::@9->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#4 [phi:circle::@9->plot#1] -- register_copy + jsr plot + jmp b10 + // circle::@10 + b10: + // [39] (signed word) plot::x#5 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z y+1 + sta.z plot.x+1 + // [40] (signed word) plot::y#5 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + // [41] call plot + // [52] phi from circle::@10 to plot [phi:circle::@10->plot] + plot_from_b10: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#5 [phi:circle::@10->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#5 [phi:circle::@10->plot#1] -- register_copy + jsr plot + jmp b11 + // circle::@11 + b11: + // [42] (signed word) plot::x#6 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #xc + sta.z plot.x+1 + // [43] (signed word) plot::y#6 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + // [44] call plot + // [52] phi from circle::@11 to plot [phi:circle::@11->plot] + plot_from_b11: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#6 [phi:circle::@11->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#6 [phi:circle::@11->plot#1] -- register_copy + jsr plot + jmp b12 + // circle::@12 + b12: + // [45] (signed word) plot::x#7 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z y+1 + sta.z plot.x+1 + // [46] (signed word) plot::y#7 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + // [47] call plot + // [52] phi from circle::@12 to plot [phi:circle::@12->plot] + plot_from_b12: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#7 [phi:circle::@12->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#7 [phi:circle::@12->plot#1] -- register_copy + jsr plot + jmp b13 + // circle::@13 + b13: + // [48] (signed word) circle::x1#1 ← ++ (signed word) circle::x1#10 -- vwsz1=_inc_vwsz1 + inc.z x1 + bne !+ + inc.z x1+1 + !: + // [14] phi from circle::@13 to circle::@1 [phi:circle::@13->circle::@1] + b1_from_b13: + // [14] phi (signed word) circle::p#3 = (signed word) circle::p#10 [phi:circle::@13->circle::@1#0] -- register_copy + // [14] phi (signed word) circle::y#13 = (signed word) circle::y#10 [phi:circle::@13->circle::@1#1] -- register_copy + // [14] phi (signed word) circle::x1#10 = (signed word) circle::x1#1 [phi:circle::@13->circle::@1#2] -- register_copy + jmp b1 + // circle::@3 + b3: + // [49] (signed word~) circle::$9 ← (signed word) circle::x1#10 << (signed byte) 2 -- vwsz1=vwsz2_rol_2 + lda.z x1 + asl + sta.z _9 + lda.z x1+1 + rol + sta.z _9+1 + asl.z _9 + rol.z _9+1 + // [50] (signed word~) circle::$10 ← (signed word) circle::p#3 + (signed word~) circle::$9 -- vwsz1=vwsz2_plus_vwsz3 + lda.z p + clc + adc.z _9 + sta.z _10 + lda.z p+1 + adc.z _9+1 + sta.z _10+1 + // [51] (signed word) circle::p#1 ← (signed word~) circle::$10 + (signed byte) 6 -- vwsz1=vwsz2_plus_vbsc1 + lda.z _10 + clc + adc #<6 + sta.z p + lda.z _10+1 + adc #>6 + sta.z p+1 + jmp b4_from_b3 +} + // plot +// plot(signed word zeropage(8) x, signed word zeropage($a) y) +plot: { + .label _0 = $1b + .label _1 = $1f + .label _2 = $20 + .label _3 = $23 + .label _4 = $29 + .label _5 = $2d + .label _6 = $2e + .label x = 8 + .label y = $a + .label location = $1d + .label location_2 = $21 + .label location_3 = $2b + .label _7 = $25 + .label _8 = $27 + // [53] (signed word~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 -- vwsz1=vwsz2_band_vdsc1 + lda.z x + and #<$fff8 + sta.z _0 + lda.z x+1 + and #>$fff8 + sta.z _0+1 + // [54] (byte*) plot::location#1 ← (const byte*) BITMAP#0 + (signed word~) plot::$0 -- pbuz1=pbuc1_plus_vwsz2 + lda #BITMAP + adc.z _0+1 + sta.z location+1 + // [55] (byte~) plot::$1 ← < (signed word) plot::y#8 -- vbuz1=_lo_vwsz2 + lda.z y + sta.z _1 + // [56] (byte~) plot::$2 ← (byte~) plot::$1 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and.z _1 + sta.z _2 + // [57] (byte*) plot::location#2 ← (byte*) plot::location#1 + (byte~) plot::$2 -- pbuz1=pbuz2_plus_vbuz3 + lda.z _2 + clc + adc.z location + sta.z location_2 + lda #0 + adc.z location+1 + sta.z location_2+1 + // [58] (signed word~) plot::$3 ← (signed word) plot::y#8 >> (signed byte) 3 -- vwsz1=vwsz2_ror_3 + lda.z y+1 + cmp #$80 + ror + sta.z _3+1 + lda.z y + ror + sta.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + // [59] (signed word) plot::$7 ← (signed word~) plot::$3 << (byte) 2 -- vwsz1=vwsz2_rol_2 + lda.z _3 + asl + sta.z _7 + lda.z _3+1 + rol + sta.z _7+1 + asl.z _7 + rol.z _7+1 + // [60] (signed word) plot::$8 ← (signed word) plot::$7 + (signed word~) plot::$3 -- vwsz1=vwsz2_plus_vwsz3 + lda.z _7 + clc + adc.z _3 + sta.z _8 + lda.z _7+1 + adc.z _3+1 + sta.z _8+1 + // [61] (signed word~) plot::$4 ← (signed word) plot::$8 << (byte) 6 -- vwsz1=vwsz2_rol_6 + lda.z _8 + asl + sta.z _4 + lda.z _8+1 + rol + sta.z _4+1 + asl.z _4 + rol.z _4+1 + asl.z _4 + rol.z _4+1 + asl.z _4 + rol.z _4+1 + asl.z _4 + rol.z _4+1 + asl.z _4 + rol.z _4+1 + // [62] (byte*) plot::location#3 ← (byte*) plot::location#2 + (signed word~) plot::$4 -- pbuz1=pbuz2_plus_vwsz3 + lda.z location_2 + clc + adc.z _4 + sta.z location_3 + lda.z location_2+1 + adc.z _4+1 + sta.z location_3+1 + // [63] (signed byte~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 -- vbsz1=vwsz2_band_vbsc1 + lda #7 + and.z x + sta.z _5 + // [64] (byte~) plot::$6 ← *((byte*) plot::location#3) | *((const byte[]) bitmask#0 + (signed byte~) plot::$5) -- vbuz1=_deref_pbuz2_bor_pbuc1_derefidx_vbsz3 + ldy #0 + lda (location_3),y + ldy.z _5 + ora bitmask,y + sta.z _6 + // [65] *((byte*) plot::location#3) ← (byte~) plot::$6 -- _deref_pbuz1=vbuz2 + lda.z _6 + ldy #0 + sta (location_3),y + jmp breturn + // plot::@return + breturn: + // [66] return + rts +} + // fill +// Fill some memory with a value +// fill(signed word zeropage($c) size, byte zeropage($e) val) +fill: { + .label end = $2f + .label addr = $f + .label size = $c + .label val = $e + // [68] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (signed word) fill::size#2 -- pbuz1=pbuz2_plus_vwsz3 + lda.z addr + clc + adc.z size + sta.z end + lda.z addr+1 + adc.z size+1 + sta.z end+1 + // [69] phi from fill fill::@2 to fill::@1 [phi:fill/fill::@2->fill::@1] + b1_from_fill: + b1_from_b2: + // [69] phi (byte*) fill::addr#2 = (byte*) fill::addr#0 [phi:fill/fill::@2->fill::@1#0] -- register_copy + jmp b1 + // fill::@1 + b1: + // [70] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 -- pbuz1_neq_pbuz2_then_la1 + lda.z addr+1 + cmp.z end+1 + bne b2 + lda.z addr + cmp.z end + bne b2 + jmp breturn + // fill::@return + breturn: + // [71] return + rts + // fill::@2 + b2: + // [72] *((byte*) fill::addr#2) ← (byte) fill::val#4 -- _deref_pbuz1=vbuz2 + lda.z val + ldy #0 + sta (addr),y + // [73] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2 -- pbuz1=_inc_pbuz1 + inc.z addr + bne !+ + inc.z addr+1 + !: + jmp b1_from_b2 +} + // File Data + bitmask: .byte $80, $40, $20, $10, 8, 4, 2, 1 + +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [8] *((const byte*) BORDERCOL#0) ← (const byte) BLUE#0 [ ] ( main:2 [ ] ) 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 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [15] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 [ circle::x1#10 circle::y#13 circle::p#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#3 ] ) always clobbers reg byte a +Statement [17] if((signed word) circle::p#3<(signed byte) 0) goto circle::@3 [ circle::x1#10 circle::y#13 circle::p#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#3 ] ) always clobbers reg byte a +Statement [18] (signed word) circle::y#1 ← (signed word) circle::y#13 - (signed byte) 1 [ circle::x1#10 circle::p#3 circle::y#1 ] ( main:2::circle:11 [ circle::x1#10 circle::p#3 circle::y#1 ] ) always clobbers reg byte a +Statement [19] (signed word~) circle::$5 ← (signed word) circle::x1#10 - (signed word) circle::y#1 [ circle::x1#10 circle::p#3 circle::y#1 circle::$5 ] ( main:2::circle:11 [ circle::x1#10 circle::p#3 circle::y#1 circle::$5 ] ) always clobbers reg byte a +Statement [20] (signed word~) circle::$6 ← (signed word~) circle::$5 << (signed byte) 2 [ circle::x1#10 circle::p#3 circle::y#1 circle::$6 ] ( main:2::circle:11 [ circle::x1#10 circle::p#3 circle::y#1 circle::$6 ] ) always clobbers reg byte a +Statement [21] (signed word~) circle::$7 ← (signed word) circle::p#3 + (signed word~) circle::$6 [ circle::x1#10 circle::y#1 circle::$7 ] ( main:2::circle:11 [ circle::x1#10 circle::y#1 circle::$7 ] ) always clobbers reg byte a +Statement [22] (signed word) circle::p#2 ← (signed word~) circle::$7 + (signed byte) $a [ circle::x1#10 circle::y#1 circle::p#2 ] ( main:2::circle:11 [ circle::x1#10 circle::y#1 circle::p#2 ] ) always clobbers reg byte a +Statement [24] (signed word) plot::x#0 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 ] ) always clobbers reg byte a +Statement [25] (signed word) plot::y#0 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 plot::y#0 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 plot::y#0 ] ) always clobbers reg byte a +Statement [27] (signed word) plot::x#1 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 ] ) always clobbers reg byte a +Statement [28] (signed word) plot::y#1 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 plot::y#1 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 plot::y#1 ] ) always clobbers reg byte a +Statement [30] (signed word) plot::x#2 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 ] ) always clobbers reg byte a +Statement [31] (signed word) plot::y#2 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 plot::y#2 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 plot::y#2 ] ) always clobbers reg byte a +Statement [33] (signed word) plot::x#3 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 ] ) always clobbers reg byte a +Statement [34] (signed word) plot::y#3 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 plot::y#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 plot::y#3 ] ) always clobbers reg byte a +Statement [36] (signed word) plot::x#4 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 ] ) always clobbers reg byte a +Statement [37] (signed word) plot::y#4 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 plot::y#4 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 plot::y#4 ] ) always clobbers reg byte a +Statement [39] (signed word) plot::x#5 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 ] ) always clobbers reg byte a +Statement [40] (signed word) plot::y#5 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 plot::y#5 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 plot::y#5 ] ) always clobbers reg byte a +Statement [42] (signed word) plot::x#6 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 ] ) always clobbers reg byte a +Statement [43] (signed word) plot::y#6 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 plot::y#6 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 plot::y#6 ] ) always clobbers reg byte a +Statement [45] (signed word) plot::x#7 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 ] ) always clobbers reg byte a +Statement [46] (signed word) plot::y#7 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 plot::y#7 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 plot::y#7 ] ) always clobbers reg byte a +Statement [49] (signed word~) circle::$9 ← (signed word) circle::x1#10 << (signed byte) 2 [ circle::x1#10 circle::y#13 circle::p#3 circle::$9 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#3 circle::$9 ] ) always clobbers reg byte a +Statement [50] (signed word~) circle::$10 ← (signed word) circle::p#3 + (signed word~) circle::$9 [ circle::x1#10 circle::y#13 circle::$10 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::$10 ] ) always clobbers reg byte a +Statement [51] (signed word) circle::p#1 ← (signed word~) circle::$10 + (signed byte) 6 [ circle::x1#10 circle::y#13 circle::p#1 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#1 ] ) always clobbers reg byte a +Statement [53] (signed word~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 [ plot::x#8 plot::y#8 plot::$0 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] ) always clobbers reg byte a +Statement [54] (byte*) plot::location#1 ← (const byte*) BITMAP#0 + (signed word~) plot::$0 [ plot::x#8 plot::y#8 plot::location#1 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] ) always clobbers reg byte a +Statement [55] (byte~) plot::$1 ← < (signed word) plot::y#8 [ plot::x#8 plot::y#8 plot::location#1 plot::$1 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] ) always clobbers reg byte a +Statement [57] (byte*) plot::location#2 ← (byte*) plot::location#1 + (byte~) plot::$2 [ plot::x#8 plot::y#8 plot::location#2 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] ) always clobbers reg byte a +Statement [58] (signed word~) plot::$3 ← (signed word) plot::y#8 >> (signed byte) 3 [ plot::x#8 plot::location#2 plot::$3 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] ) always clobbers reg byte a +Statement [59] (signed word) plot::$7 ← (signed word~) plot::$3 << (byte) 2 [ plot::x#8 plot::location#2 plot::$3 plot::$7 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] ) always clobbers reg byte a +Statement [60] (signed word) plot::$8 ← (signed word) plot::$7 + (signed word~) plot::$3 [ plot::x#8 plot::location#2 plot::$8 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] ) always clobbers reg byte a +Statement [61] (signed word~) plot::$4 ← (signed word) plot::$8 << (byte) 6 [ plot::x#8 plot::location#2 plot::$4 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] ) always clobbers reg byte a +Statement [62] (byte*) plot::location#3 ← (byte*) plot::location#2 + (signed word~) plot::$4 [ plot::x#8 plot::location#3 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] ) always clobbers reg byte a +Statement [63] (signed byte~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 [ plot::location#3 plot::$5 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] ) always clobbers reg byte a +Statement [64] (byte~) plot::$6 ← *((byte*) plot::location#3) | *((const byte[]) bitmask#0 + (signed byte~) plot::$5) [ plot::location#3 plot::$6 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] ) always clobbers reg byte a reg byte y +Statement [65] *((byte*) plot::location#3) ← (byte~) plot::$6 [ ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 ] ) always clobbers reg byte y +Statement [68] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (signed word) fill::size#2 [ fill::addr#0 fill::val#4 fill::end#0 ] ( main:2::fill:5 [ fill::addr#0 fill::val#4 fill::end#0 ] main:2::fill:7 [ fill::addr#0 fill::val#4 fill::end#0 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:14 [ fill::val#4 ] +Statement [70] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 [ fill::val#4 fill::end#0 fill::addr#2 ] ( main:2::fill:5 [ fill::val#4 fill::end#0 fill::addr#2 ] main:2::fill:7 [ fill::val#4 fill::end#0 fill::addr#2 ] ) always clobbers reg byte a +Statement [72] *((byte*) fill::addr#2) ← (byte) fill::val#4 [ fill::val#4 fill::end#0 fill::addr#2 ] ( main:2::fill:5 [ fill::val#4 fill::end#0 fill::addr#2 ] main:2::fill:7 [ fill::val#4 fill::end#0 fill::addr#2 ] ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:14 [ fill::val#4 ] +Statement [8] *((const byte*) BORDERCOL#0) ← (const byte) BLUE#0 [ ] ( main:2 [ ] ) 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 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [15] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 [ circle::x1#10 circle::y#13 circle::p#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#3 ] ) always clobbers reg byte a +Statement [17] if((signed word) circle::p#3<(signed byte) 0) goto circle::@3 [ circle::x1#10 circle::y#13 circle::p#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#3 ] ) always clobbers reg byte a +Statement [18] (signed word) circle::y#1 ← (signed word) circle::y#13 - (signed byte) 1 [ circle::x1#10 circle::p#3 circle::y#1 ] ( main:2::circle:11 [ circle::x1#10 circle::p#3 circle::y#1 ] ) always clobbers reg byte a +Statement [19] (signed word~) circle::$5 ← (signed word) circle::x1#10 - (signed word) circle::y#1 [ circle::x1#10 circle::p#3 circle::y#1 circle::$5 ] ( main:2::circle:11 [ circle::x1#10 circle::p#3 circle::y#1 circle::$5 ] ) always clobbers reg byte a +Statement [20] (signed word~) circle::$6 ← (signed word~) circle::$5 << (signed byte) 2 [ circle::x1#10 circle::p#3 circle::y#1 circle::$6 ] ( main:2::circle:11 [ circle::x1#10 circle::p#3 circle::y#1 circle::$6 ] ) always clobbers reg byte a +Statement [21] (signed word~) circle::$7 ← (signed word) circle::p#3 + (signed word~) circle::$6 [ circle::x1#10 circle::y#1 circle::$7 ] ( main:2::circle:11 [ circle::x1#10 circle::y#1 circle::$7 ] ) always clobbers reg byte a +Statement [22] (signed word) circle::p#2 ← (signed word~) circle::$7 + (signed byte) $a [ circle::x1#10 circle::y#1 circle::p#2 ] ( main:2::circle:11 [ circle::x1#10 circle::y#1 circle::p#2 ] ) always clobbers reg byte a +Statement [24] (signed word) plot::x#0 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 ] ) always clobbers reg byte a +Statement [25] (signed word) plot::y#0 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 plot::y#0 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#0 plot::y#0 ] ) always clobbers reg byte a +Statement [27] (signed word) plot::x#1 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 ] ) always clobbers reg byte a +Statement [28] (signed word) plot::y#1 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 plot::y#1 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#1 plot::y#1 ] ) always clobbers reg byte a +Statement [30] (signed word) plot::x#2 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 ] ) always clobbers reg byte a +Statement [31] (signed word) plot::y#2 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 plot::y#2 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#2 plot::y#2 ] ) always clobbers reg byte a +Statement [33] (signed word) plot::x#3 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 ] ) always clobbers reg byte a +Statement [34] (signed word) plot::y#3 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 plot::y#3 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#3 plot::y#3 ] ) always clobbers reg byte a +Statement [36] (signed word) plot::x#4 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 ] ) always clobbers reg byte a +Statement [37] (signed word) plot::y#4 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 plot::y#4 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#4 plot::y#4 ] ) always clobbers reg byte a +Statement [39] (signed word) plot::x#5 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 ] ) always clobbers reg byte a +Statement [40] (signed word) plot::y#5 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 plot::y#5 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#5 plot::y#5 ] ) always clobbers reg byte a +Statement [42] (signed word) plot::x#6 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 ] ) always clobbers reg byte a +Statement [43] (signed word) plot::y#6 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 plot::y#6 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#6 plot::y#6 ] ) always clobbers reg byte a +Statement [45] (signed word) plot::x#7 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 ] ) always clobbers reg byte a +Statement [46] (signed word) plot::y#7 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 plot::y#7 ] ( main:2::circle:11 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#7 plot::y#7 ] ) always clobbers reg byte a +Statement [49] (signed word~) circle::$9 ← (signed word) circle::x1#10 << (signed byte) 2 [ circle::x1#10 circle::y#13 circle::p#3 circle::$9 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#3 circle::$9 ] ) always clobbers reg byte a +Statement [50] (signed word~) circle::$10 ← (signed word) circle::p#3 + (signed word~) circle::$9 [ circle::x1#10 circle::y#13 circle::$10 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::$10 ] ) always clobbers reg byte a +Statement [51] (signed word) circle::p#1 ← (signed word~) circle::$10 + (signed byte) 6 [ circle::x1#10 circle::y#13 circle::p#1 ] ( main:2::circle:11 [ circle::x1#10 circle::y#13 circle::p#1 ] ) always clobbers reg byte a +Statement [53] (signed word~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 [ plot::x#8 plot::y#8 plot::$0 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::$0 ] ) always clobbers reg byte a +Statement [54] (byte*) plot::location#1 ← (const byte*) BITMAP#0 + (signed word~) plot::$0 [ plot::x#8 plot::y#8 plot::location#1 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 ] ) always clobbers reg byte a +Statement [55] (byte~) plot::$1 ← < (signed word) plot::y#8 [ plot::x#8 plot::y#8 plot::location#1 plot::$1 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#1 plot::$1 ] ) always clobbers reg byte a +Statement [57] (byte*) plot::location#2 ← (byte*) plot::location#1 + (byte~) plot::$2 [ plot::x#8 plot::y#8 plot::location#2 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::y#8 plot::location#2 ] ) always clobbers reg byte a +Statement [58] (signed word~) plot::$3 ← (signed word) plot::y#8 >> (signed byte) 3 [ plot::x#8 plot::location#2 plot::$3 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 ] ) always clobbers reg byte a +Statement [59] (signed word) plot::$7 ← (signed word~) plot::$3 << (byte) 2 [ plot::x#8 plot::location#2 plot::$3 plot::$7 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$3 plot::$7 ] ) always clobbers reg byte a +Statement [60] (signed word) plot::$8 ← (signed word) plot::$7 + (signed word~) plot::$3 [ plot::x#8 plot::location#2 plot::$8 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$8 ] ) always clobbers reg byte a +Statement [61] (signed word~) plot::$4 ← (signed word) plot::$8 << (byte) 6 [ plot::x#8 plot::location#2 plot::$4 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#2 plot::$4 ] ) always clobbers reg byte a +Statement [62] (byte*) plot::location#3 ← (byte*) plot::location#2 + (signed word~) plot::$4 [ plot::x#8 plot::location#3 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::x#8 plot::location#3 ] ) always clobbers reg byte a +Statement [63] (signed byte~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 [ plot::location#3 plot::$5 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$5 ] ) always clobbers reg byte a +Statement [64] (byte~) plot::$6 ← *((byte*) plot::location#3) | *((const byte[]) bitmask#0 + (signed byte~) plot::$5) [ plot::location#3 plot::$6 ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 plot::location#3 plot::$6 ] ) always clobbers reg byte a reg byte y +Statement [65] *((byte*) plot::location#3) ← (byte~) plot::$6 [ ] ( main:2::circle:11::plot:26 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:29 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:32 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:35 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:38 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:41 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:44 [ circle::x1#10 circle::y#10 circle::p#10 ] main:2::circle:11::plot:47 [ circle::x1#10 circle::y#10 circle::p#10 ] ) always clobbers reg byte y +Statement [68] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (signed word) fill::size#2 [ fill::addr#0 fill::val#4 fill::end#0 ] ( main:2::fill:5 [ fill::addr#0 fill::val#4 fill::end#0 ] main:2::fill:7 [ fill::addr#0 fill::val#4 fill::end#0 ] ) always clobbers reg byte a +Statement [70] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 [ fill::val#4 fill::end#0 fill::addr#2 ] ( main:2::fill:5 [ fill::val#4 fill::end#0 fill::addr#2 ] main:2::fill:7 [ fill::val#4 fill::end#0 fill::addr#2 ] ) always clobbers reg byte a +Statement [72] *((byte*) fill::addr#2) ← (byte) fill::val#4 [ fill::val#4 fill::end#0 fill::addr#2 ] ( main:2::fill:5 [ fill::val#4 fill::end#0 fill::addr#2 ] main:2::fill:7 [ fill::val#4 fill::end#0 fill::addr#2 ] ) always clobbers reg byte a reg byte y +Potential registers zp ZP_WORD:2 [ circle::x1#10 circle::x1#1 ] : zp ZP_WORD:2 , +Potential registers zp ZP_WORD:4 [ circle::y#13 circle::y#10 circle::y#1 ] : zp ZP_WORD:4 , +Potential registers zp ZP_WORD:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] : zp ZP_WORD:6 , +Potential registers zp ZP_WORD:8 [ plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] : zp ZP_WORD:8 , +Potential registers zp ZP_WORD:10 [ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 ] : zp ZP_WORD:10 , +Potential registers zp ZP_WORD:12 [ fill::size#2 ] : zp ZP_WORD:12 , +Potential registers zp ZP_BYTE:14 [ fill::val#4 ] : zp ZP_BYTE:14 , reg byte x , +Potential registers zp ZP_WORD:15 [ fill::addr#2 fill::addr#0 fill::addr#1 ] : zp ZP_WORD:15 , +Potential registers zp ZP_WORD:17 [ circle::$5 ] : zp ZP_WORD:17 , +Potential registers zp ZP_WORD:19 [ circle::$6 ] : zp ZP_WORD:19 , +Potential registers zp ZP_WORD:21 [ circle::$7 ] : zp ZP_WORD:21 , +Potential registers zp ZP_WORD:23 [ circle::$9 ] : zp ZP_WORD:23 , +Potential registers zp ZP_WORD:25 [ circle::$10 ] : zp ZP_WORD:25 , +Potential registers zp ZP_WORD:27 [ plot::$0 ] : zp ZP_WORD:27 , +Potential registers zp ZP_WORD:29 [ plot::location#1 ] : zp ZP_WORD:29 , +Potential registers zp ZP_BYTE:31 [ plot::$1 ] : zp ZP_BYTE:31 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:32 [ plot::$2 ] : zp ZP_BYTE:32 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:33 [ plot::location#2 ] : zp ZP_WORD:33 , +Potential registers zp ZP_WORD:35 [ plot::$3 ] : zp ZP_WORD:35 , +Potential registers zp ZP_WORD:37 [ plot::$7 ] : zp ZP_WORD:37 , +Potential registers zp ZP_WORD:39 [ plot::$8 ] : zp ZP_WORD:39 , +Potential registers zp ZP_WORD:41 [ plot::$4 ] : zp ZP_WORD:41 , +Potential registers zp ZP_WORD:43 [ plot::location#3 ] : zp ZP_WORD:43 , +Potential registers zp ZP_BYTE:45 [ plot::$5 ] : zp ZP_BYTE:45 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:46 [ plot::$6 ] : zp ZP_BYTE:46 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:47 [ fill::end#0 ] : zp ZP_WORD:47 , + +REGISTER UPLIFT SCOPES +Uplift Scope [plot] 191.33: zp ZP_WORD:10 [ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 ] 96.36: zp ZP_WORD:8 [ plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] 4: zp ZP_WORD:27 [ plot::$0 ] 4: zp ZP_BYTE:31 [ plot::$1 ] 4: zp ZP_BYTE:32 [ plot::$2 ] 4: zp ZP_WORD:37 [ plot::$7 ] 4: zp ZP_WORD:39 [ plot::$8 ] 4: zp ZP_WORD:41 [ plot::$4 ] 4: zp ZP_BYTE:45 [ plot::$5 ] 4: zp ZP_BYTE:46 [ plot::$6 ] 3: zp ZP_WORD:35 [ plot::$3 ] 2: zp ZP_WORD:43 [ plot::location#3 ] 1.33: zp ZP_WORD:29 [ plot::location#1 ] 0.8: zp ZP_WORD:33 [ plot::location#2 ] +Uplift Scope [circle] 51.55: zp ZP_WORD:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] 25.97: zp ZP_WORD:2 [ circle::x1#10 circle::x1#1 ] 22: zp ZP_WORD:17 [ circle::$5 ] 22: zp ZP_WORD:19 [ circle::$6 ] 22: zp ZP_WORD:21 [ circle::$7 ] 22: zp ZP_WORD:23 [ circle::$9 ] 22: zp ZP_WORD:25 [ circle::$10 ] 18.59: zp ZP_WORD:4 [ circle::y#13 circle::y#10 circle::y#1 ] +Uplift Scope [fill] 39.33: zp ZP_WORD:15 [ fill::addr#2 fill::addr#0 fill::addr#1 ] 2.6: zp ZP_WORD:47 [ fill::end#0 ] 2: zp ZP_WORD:12 [ fill::size#2 ] 1.83: zp ZP_BYTE:14 [ fill::val#4 ] +Uplift Scope [main] +Uplift Scope [] + +Uplifting [plot] best 6419 combination zp ZP_WORD:10 [ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 ] zp ZP_WORD:8 [ plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] zp ZP_WORD:27 [ plot::$0 ] reg byte a [ plot::$1 ] reg byte a [ plot::$2 ] zp ZP_WORD:37 [ plot::$7 ] zp ZP_WORD:39 [ plot::$8 ] zp ZP_WORD:41 [ plot::$4 ] reg byte a [ plot::$5 ] reg byte a [ plot::$6 ] zp ZP_WORD:35 [ plot::$3 ] zp ZP_WORD:43 [ plot::location#3 ] zp ZP_WORD:29 [ plot::location#1 ] zp ZP_WORD:33 [ plot::location#2 ] +Limited combination testing to 100 combinations of 256 possible. +Uplifting [circle] best 6419 combination zp ZP_WORD:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] zp ZP_WORD:2 [ circle::x1#10 circle::x1#1 ] zp ZP_WORD:17 [ circle::$5 ] zp ZP_WORD:19 [ circle::$6 ] zp ZP_WORD:21 [ circle::$7 ] zp ZP_WORD:23 [ circle::$9 ] zp ZP_WORD:25 [ circle::$10 ] zp ZP_WORD:4 [ circle::y#13 circle::y#10 circle::y#1 ] +Uplifting [fill] best 6403 combination zp ZP_WORD:15 [ fill::addr#2 fill::addr#0 fill::addr#1 ] zp ZP_WORD:47 [ fill::end#0 ] zp ZP_WORD:12 [ fill::size#2 ] reg byte x [ fill::val#4 ] +Uplifting [main] best 6403 combination +Uplifting [] best 6403 combination +Coalescing zero page register [ zp ZP_WORD:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] ] with [ zp ZP_WORD:21 [ circle::$7 ] ] - score: 2 +Coalescing zero page register [ zp ZP_WORD:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 circle::$7 ] ] with [ zp ZP_WORD:25 [ circle::$10 ] ] - score: 2 +Coalescing zero page register [ zp ZP_WORD:10 [ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 ] ] with [ zp ZP_WORD:35 [ plot::$3 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:12 [ fill::size#2 ] ] with [ zp ZP_WORD:47 [ fill::end#0 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:17 [ circle::$5 ] ] with [ zp ZP_WORD:19 [ circle::$6 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:27 [ plot::$0 ] ] with [ zp ZP_WORD:29 [ plot::location#1 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:33 [ plot::location#2 ] ] with [ zp ZP_WORD:43 [ plot::location#3 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:37 [ plot::$7 ] ] with [ zp ZP_WORD:39 [ plot::$8 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:27 [ plot::$0 plot::location#1 ] ] with [ zp ZP_WORD:33 [ plot::location#2 plot::location#3 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:37 [ plot::$7 plot::$8 ] ] with [ zp ZP_WORD:41 [ plot::$4 ] ] - score: 1 +Coalescing zero page register [ zp ZP_WORD:12 [ fill::size#2 fill::end#0 ] ] with [ zp ZP_WORD:2 [ circle::x1#10 circle::x1#1 ] ] +Coalescing zero page register [ zp ZP_WORD:15 [ fill::addr#2 fill::addr#0 fill::addr#1 ] ] with [ zp ZP_WORD:4 [ circle::y#13 circle::y#10 circle::y#1 ] ] +Coalescing zero page register [ zp ZP_WORD:17 [ circle::$5 circle::$6 ] ] with [ zp ZP_WORD:8 [ plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] ] +Coalescing zero page register [ zp ZP_WORD:23 [ circle::$9 ] ] with [ zp ZP_WORD:10 [ plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 plot::$3 ] ] +Allocated (was zp ZP_WORD:6) zp ZP_WORD:2 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 circle::$7 circle::$10 ] +Allocated (was zp ZP_WORD:12) zp ZP_WORD:4 [ fill::size#2 fill::end#0 circle::x1#10 circle::x1#1 ] +Allocated (was zp ZP_WORD:15) zp ZP_WORD:6 [ fill::addr#2 fill::addr#0 fill::addr#1 circle::y#13 circle::y#10 circle::y#1 ] +Allocated (was zp ZP_WORD:17) zp ZP_WORD:8 [ circle::$5 circle::$6 plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] +Allocated (was zp ZP_WORD:23) zp ZP_WORD:10 [ circle::$9 plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 plot::$3 ] +Allocated (was zp ZP_WORD:27) zp ZP_WORD:12 [ plot::$0 plot::location#1 plot::location#2 plot::location#3 ] +Allocated (was zp ZP_WORD:37) zp ZP_WORD:14 [ plot::$7 plot::$8 plot::$4 ] + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +// Plots a circle on a bitmap using Bresenham's Circle algorithm +// Coded by Richard-William Loerakker +// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac + // Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" + // Global Constants & labels + .label BORDERCOL = $d020 + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_MEMORY = $d018 + .const BLUE = 6 + .label SCREEN = $400 + .label BITMAP = $2000 + // @begin +bbegin: + // [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 + // @1 +b1: + // [2] call main + // [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main + // [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend + // @end +bend: + // main +main: { + // [5] call fill + // [67] phi from main to fill [phi:main->fill] + fill_from_main: + // [67] phi (byte) fill::val#4 = (byte) 0 [phi:main->fill#0] -- vbuxx=vbuc1 + ldx #0 + // [67] phi (signed word) fill::size#2 = (signed word)(number) $28*(number) $19*(number) 8 [phi:main->fill#1] -- vwsz1=vwsc1 + lda #<$28*$19*8 + sta.z fill.size + lda #>$28*$19*8 + sta.z fill.size+1 + // [67] phi (byte*) fill::addr#0 = (const byte*) BITMAP#0 [phi:main->fill#2] -- pbuz1=pbuc1 + lda #BITMAP + sta.z fill.addr+1 + jsr fill + // [6] phi from main to main::@2 [phi:main->main::@2] + b2_from_main: + jmp b2 + // main::@2 + b2: + // [7] call fill + // [67] phi from main::@2 to fill [phi:main::@2->fill] + fill_from_b2: + // [67] phi (byte) fill::val#4 = (byte) $16 [phi:main::@2->fill#0] -- vbuxx=vbuc1 + ldx #$16 + // [67] phi (signed word) fill::size#2 = (signed word)(number) $28*(number) $19 [phi:main::@2->fill#1] -- vwsz1=vwsc1 + lda #<$28*$19 + sta.z fill.size + lda #>$28*$19 + sta.z fill.size+1 + // [67] phi (byte*) fill::addr#0 = (const byte*) SCREEN#0 [phi:main::@2->fill#2] -- pbuz1=pbuc1 + lda #SCREEN + sta.z fill.addr+1 + jsr fill + jmp b3 + // main::@3 + b3: + // [8] *((const byte*) BORDERCOL#0) ← (const byte) BLUE#0 -- _deref_pbuc1=vbuc2 + lda #BLUE + sta BORDERCOL + // [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + // [10] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 -- _deref_pbuc1=vbuc2 + lda #(SCREEN&$3fff)/$40|(BITMAP&$3fff)/$400 + sta VIC_MEMORY + // [11] call circle + // [13] phi from main::@3 to circle [phi:main::@3->circle] + circle_from_b3: + jsr circle + // [12] phi from main::@1 main::@3 to main::@1 [phi:main::@1/main::@3->main::@1] + b1_from_b1: + b1_from_b3: + jmp b1 + // main::@1 + b1: + jmp b1_from_b1 +} + // circle +circle: { + .const xc = $64 + .const yc = $64 + .const r = $32 + .label _5 = 8 + .label _6 = 8 + .label _7 = 2 + .label _9 = $a + .label _10 = 2 + .label p = 2 + .label y = 6 + .label x1 = 4 + // [14] phi from circle to circle::@1 [phi:circle->circle::@1] + b1_from_circle: + // [14] phi (signed word) circle::p#3 = (signed byte) 3-(const signed word) circle::r#0<<(signed byte) 1 [phi:circle->circle::@1#0] -- vwsz1=vwsc1 + lda #<3-(r<<1) + sta.z p + lda #>3-(r<<1) + sta.z p+1 + // [14] phi (signed word) circle::y#13 = (const signed word) circle::r#0 [phi:circle->circle::@1#1] -- vwsz1=vwsc1 + lda #r + sta.z y+1 + // [14] phi (signed word) circle::x1#10 = (signed byte) 0 [phi:circle->circle::@1#2] -- vwsz1=vbsc1 + lda #<0 + sta.z x1 + lda #>0 + sta.z x1+1 + jmp b1 + // circle::@1 + b1: + // [15] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 -- vwsz1_le_vwsz2_then_la1 + lda.z y + cmp.z x1 + lda.z y+1 + sbc.z x1+1 + bvc !+ + eor #$80 + !: + bpl b2 + jmp breturn + // circle::@return + breturn: + // [16] return + rts + // circle::@2 + b2: + // [17] if((signed word) circle::p#3<(signed byte) 0) goto circle::@3 -- vwsz1_lt_0_then_la1 + lda.z p+1 + bmi b3 + jmp b5 + // circle::@5 + b5: + // [18] (signed word) circle::y#1 ← (signed word) circle::y#13 - (signed byte) 1 -- vwsz1=vwsz1_minus_1 + sec + lda.z y + sbc #1 + sta.z y + bcs !+ + dec.z y+1 + !: + // [19] (signed word~) circle::$5 ← (signed word) circle::x1#10 - (signed word) circle::y#1 -- vwsz1=vwsz2_minus_vwsz3 + lda.z x1 + sec + sbc.z y + sta.z _5 + lda.z x1+1 + sbc.z y+1 + sta.z _5+1 + // [20] (signed word~) circle::$6 ← (signed word~) circle::$5 << (signed byte) 2 -- vwsz1=vwsz1_rol_2 + asl.z _6 + rol.z _6+1 + asl.z _6 + rol.z _6+1 + // [21] (signed word~) circle::$7 ← (signed word) circle::p#3 + (signed word~) circle::$6 -- vwsz1=vwsz1_plus_vwsz2 + lda.z _7 + clc + adc.z _6 + sta.z _7 + lda.z _7+1 + adc.z _6+1 + sta.z _7+1 + // [22] (signed word) circle::p#2 ← (signed word~) circle::$7 + (signed byte) $a -- vwsz1=vwsz1_plus_vbsc1 + lda.z p + clc + adc #<$a + sta.z p + lda.z p+1 + adc #>$a + sta.z p+1 + // [23] phi from circle::@3 circle::@5 to circle::@4 [phi:circle::@3/circle::@5->circle::@4] + b4_from_b3: + b4_from_b5: + // [23] phi (signed word) circle::p#10 = (signed word) circle::p#1 [phi:circle::@3/circle::@5->circle::@4#0] -- register_copy + // [23] phi (signed word) circle::y#10 = (signed word) circle::y#13 [phi:circle::@3/circle::@5->circle::@4#1] -- register_copy + jmp b4 + // circle::@4 + b4: + // [24] (signed word) plot::x#0 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + // [25] (signed word) plot::y#0 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + // [26] call plot + // [52] phi from circle::@4 to plot [phi:circle::@4->plot] + plot_from_b4: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#0 [phi:circle::@4->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#0 [phi:circle::@4->plot#1] -- register_copy + jsr plot + jmp b6 + // circle::@6 + b6: + // [27] (signed word) plot::x#1 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + // [28] (signed word) plot::y#1 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + // [29] call plot + // [52] phi from circle::@6 to plot [phi:circle::@6->plot] + plot_from_b6: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#1 [phi:circle::@6->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#1 [phi:circle::@6->plot#1] -- register_copy + jsr plot + jmp b7 + // circle::@7 + b7: + // [30] (signed word) plot::x#2 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + // [31] (signed word) plot::y#2 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #yc + sta.z plot.y+1 + // [32] call plot + // [52] phi from circle::@7 to plot [phi:circle::@7->plot] + plot_from_b7: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#2 [phi:circle::@7->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#2 [phi:circle::@7->plot#1] -- register_copy + jsr plot + jmp b8 + // circle::@8 + b8: + // [33] (signed word) plot::x#3 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + // [34] (signed word) plot::y#3 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #yc + sta.z plot.y+1 + // [35] call plot + // [52] phi from circle::@8 to plot [phi:circle::@8->plot] + plot_from_b8: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#3 [phi:circle::@8->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#3 [phi:circle::@8->plot#1] -- register_copy + jsr plot + jmp b9 + // circle::@9 + b9: + // [36] (signed word) plot::x#4 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #xc + sta.z plot.x+1 + // [37] (signed word) plot::y#4 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + // [38] call plot + // [52] phi from circle::@9 to plot [phi:circle::@9->plot] + plot_from_b9: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#4 [phi:circle::@9->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#4 [phi:circle::@9->plot#1] -- register_copy + jsr plot + jmp b10 + // circle::@10 + b10: + // [39] (signed word) plot::x#5 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z y+1 + sta.z plot.x+1 + // [40] (signed word) plot::y#5 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + // [41] call plot + // [52] phi from circle::@10 to plot [phi:circle::@10->plot] + plot_from_b10: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#5 [phi:circle::@10->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#5 [phi:circle::@10->plot#1] -- register_copy + jsr plot + jmp b11 + // circle::@11 + b11: + // [42] (signed word) plot::x#6 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #xc + sta.z plot.x+1 + // [43] (signed word) plot::y#6 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + // [44] call plot + // [52] phi from circle::@11 to plot [phi:circle::@11->plot] + plot_from_b11: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#6 [phi:circle::@11->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#6 [phi:circle::@11->plot#1] -- register_copy + jsr plot + jmp b12 + // circle::@12 + b12: + // [45] (signed word) plot::x#7 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z y+1 + sta.z plot.x+1 + // [46] (signed word) plot::y#7 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + // [47] call plot + // [52] phi from circle::@12 to plot [phi:circle::@12->plot] + plot_from_b12: + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#7 [phi:circle::@12->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#7 [phi:circle::@12->plot#1] -- register_copy + jsr plot + jmp b13 + // circle::@13 + b13: + // [48] (signed word) circle::x1#1 ← ++ (signed word) circle::x1#10 -- vwsz1=_inc_vwsz1 + inc.z x1 + bne !+ + inc.z x1+1 + !: + // [14] phi from circle::@13 to circle::@1 [phi:circle::@13->circle::@1] + b1_from_b13: + // [14] phi (signed word) circle::p#3 = (signed word) circle::p#10 [phi:circle::@13->circle::@1#0] -- register_copy + // [14] phi (signed word) circle::y#13 = (signed word) circle::y#10 [phi:circle::@13->circle::@1#1] -- register_copy + // [14] phi (signed word) circle::x1#10 = (signed word) circle::x1#1 [phi:circle::@13->circle::@1#2] -- register_copy + jmp b1 + // circle::@3 + b3: + // [49] (signed word~) circle::$9 ← (signed word) circle::x1#10 << (signed byte) 2 -- vwsz1=vwsz2_rol_2 + lda.z x1 + asl + sta.z _9 + lda.z x1+1 + rol + sta.z _9+1 + asl.z _9 + rol.z _9+1 + // [50] (signed word~) circle::$10 ← (signed word) circle::p#3 + (signed word~) circle::$9 -- vwsz1=vwsz1_plus_vwsz2 + lda.z _10 + clc + adc.z _9 + sta.z _10 + lda.z _10+1 + adc.z _9+1 + sta.z _10+1 + // [51] (signed word) circle::p#1 ← (signed word~) circle::$10 + (signed byte) 6 -- vwsz1=vwsz1_plus_vbsc1 + lda.z p + clc + adc #<6 + sta.z p + lda.z p+1 + adc #>6 + sta.z p+1 + jmp b4_from_b3 +} + // plot +// plot(signed word zeropage(8) x, signed word zeropage($a) y) +plot: { + .label _0 = $c + .label _3 = $a + .label _4 = $e + .label x = 8 + .label y = $a + .label location = $c + .label _7 = $e + .label _8 = $e + // [53] (signed word~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 -- vwsz1=vwsz2_band_vdsc1 + lda.z x + and #<$fff8 + sta.z _0 + lda.z x+1 + and #>$fff8 + sta.z _0+1 + // [54] (byte*) plot::location#1 ← (const byte*) BITMAP#0 + (signed word~) plot::$0 -- pbuz1=pbuc1_plus_vwsz1 + lda #BITMAP + adc.z location+1 + sta.z location+1 + // [55] (byte~) plot::$1 ← < (signed word) plot::y#8 -- vbuaa=_lo_vwsz1 + lda.z y + // [56] (byte~) plot::$2 ← (byte~) plot::$1 & (byte) 7 -- vbuaa=vbuaa_band_vbuc1 + and #7 + // [57] (byte*) plot::location#2 ← (byte*) plot::location#1 + (byte~) plot::$2 -- pbuz1=pbuz1_plus_vbuaa + clc + adc.z location + sta.z location + bcc !+ + inc.z location+1 + !: + // [58] (signed word~) plot::$3 ← (signed word) plot::y#8 >> (signed byte) 3 -- vwsz1=vwsz1_ror_3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + // [59] (signed word) plot::$7 ← (signed word~) plot::$3 << (byte) 2 -- vwsz1=vwsz2_rol_2 + lda.z _3 + asl + sta.z _7 + lda.z _3+1 + rol + sta.z _7+1 + asl.z _7 + rol.z _7+1 + // [60] (signed word) plot::$8 ← (signed word) plot::$7 + (signed word~) plot::$3 -- vwsz1=vwsz1_plus_vwsz2 + lda.z _8 + clc + adc.z _3 + sta.z _8 + lda.z _8+1 + adc.z _3+1 + sta.z _8+1 + // [61] (signed word~) plot::$4 ← (signed word) plot::$8 << (byte) 6 -- vwsz1=vwsz1_rol_6 + lda.z _4+1 + sta.z $ff + lda.z _4 + sta.z _4+1 + lda #0 + sta.z _4 + lsr.z $ff + ror.z _4+1 + ror.z _4 + lsr.z $ff + ror.z _4+1 + ror.z _4 + // [62] (byte*) plot::location#3 ← (byte*) plot::location#2 + (signed word~) plot::$4 -- pbuz1=pbuz1_plus_vwsz2 + lda.z location + clc + adc.z _4 + sta.z location + lda.z location+1 + adc.z _4+1 + sta.z location+1 + // [63] (signed byte~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 -- vbsaa=vwsz1_band_vbsc1 + lda #7 + and.z x + // [64] (byte~) plot::$6 ← *((byte*) plot::location#3) | *((const byte[]) bitmask#0 + (signed byte~) plot::$5) -- vbuaa=_deref_pbuz1_bor_pbuc1_derefidx_vbsaa + tay + lda bitmask,y + ldy #0 + ora (location),y + // [65] *((byte*) plot::location#3) ← (byte~) plot::$6 -- _deref_pbuz1=vbuaa + ldy #0 + sta (location),y + jmp breturn + // plot::@return + breturn: + // [66] return + rts +} + // fill +// Fill some memory with a value +// fill(signed word zeropage(4) size, byte register(X) val) +fill: { + .label end = 4 + .label addr = 6 + .label size = 4 + // [68] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (signed word) fill::size#2 -- pbuz1=pbuz2_plus_vwsz1 + lda.z addr + clc + adc.z end + sta.z end + lda.z addr+1 + adc.z end+1 + sta.z end+1 + // [69] phi from fill fill::@2 to fill::@1 [phi:fill/fill::@2->fill::@1] + b1_from_fill: + b1_from_b2: + // [69] phi (byte*) fill::addr#2 = (byte*) fill::addr#0 [phi:fill/fill::@2->fill::@1#0] -- register_copy + jmp b1 + // fill::@1 + b1: + // [70] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 -- pbuz1_neq_pbuz2_then_la1 + lda.z addr+1 + cmp.z end+1 + bne b2 + lda.z addr + cmp.z end + bne b2 + jmp breturn + // fill::@return + breturn: + // [71] return + rts + // fill::@2 + b2: + // [72] *((byte*) fill::addr#2) ← (byte) fill::val#4 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (addr),y + // [73] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2 -- pbuz1=_inc_pbuz1 + inc.z addr + bne !+ + inc.z addr+1 + !: + jmp b1_from_b2 +} + // File Data + bitmask: .byte $80, $40, $20, $10, 8, 4, 2, 1 + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp bend +Removing instruction jmp b2 +Removing instruction jmp b3 +Removing instruction jmp b1 +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp b5 +Removing instruction jmp b4 +Removing instruction jmp b6 +Removing instruction jmp b7 +Removing instruction jmp b8 +Removing instruction jmp b9 +Removing instruction jmp b10 +Removing instruction jmp b11 +Removing instruction jmp b12 +Removing instruction jmp b13 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction lda #>0 +Removing instruction ldy #0 +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Replacing label b1_from_b1 with b1 +Replacing label b4_from_b3 with b4 +Replacing label b1_from_b2 with b1 +Removing instruction b1_from_bbegin: +Removing instruction b1: +Removing instruction main_from_b1: +Removing instruction bend_from_b1: +Removing instruction b2_from_main: +Removing instruction fill_from_b2: +Removing instruction b1_from_b1: +Removing instruction b1_from_b3: +Removing instruction b4_from_b3: +Removing instruction b4_from_b5: +Removing instruction b1_from_fill: +Removing instruction b1_from_b2: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction bend: +Removing instruction fill_from_main: +Removing instruction b2: +Removing instruction b3: +Removing instruction circle_from_b3: +Removing instruction b1_from_circle: +Removing instruction breturn: +Removing instruction b5: +Removing instruction plot_from_b4: +Removing instruction b6: +Removing instruction plot_from_b6: +Removing instruction b7: +Removing instruction plot_from_b7: +Removing instruction b8: +Removing instruction plot_from_b8: +Removing instruction b9: +Removing instruction plot_from_b9: +Removing instruction b10: +Removing instruction plot_from_b10: +Removing instruction b11: +Removing instruction plot_from_b11: +Removing instruction b12: +Removing instruction plot_from_b12: +Removing instruction b13: +Removing instruction b1_from_b13: +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 +Fixing long branch [81] bmi b3 to bpl + +FINAL SYMBOL TABLE +(label) @1 +(label) @begin +(label) @end +(byte*) BITMAP +(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(byte) BLUE +(const byte) BLUE#0 BLUE = (byte) 6 +(byte*) BORDERCOL +(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280 +(byte*) D011 +(const byte*) D011#0 D011 = (byte*) 53265 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(byte) VIC_BMM +(const byte) VIC_BMM#0 VIC_BMM = (byte) $20 +(byte) VIC_DEN +(const byte) VIC_DEN#0 VIC_DEN = (byte) $10 +(byte*) VIC_MEMORY +(const byte*) VIC_MEMORY#0 VIC_MEMORY = (byte*) 53272 +(byte) VIC_RSEL +(const byte) VIC_RSEL#0 VIC_RSEL = (byte) 8 +(byte[]) bitmask +(const byte[]) bitmask#0 bitmask = { (byte) $80, (byte) $40, (byte) $20, (byte) $10, (byte) 8, (byte) 4, (byte) 2, (byte) 1 } +(void()) circle((signed word) circle::xc , (signed word) circle::yc , (signed word) circle::r) +(signed word~) circle::$10 $10 zp ZP_WORD:2 22.0 +(signed word~) circle::$5 $5 zp ZP_WORD:8 22.0 +(signed word~) circle::$6 $6 zp ZP_WORD:8 22.0 +(signed word~) circle::$7 $7 zp ZP_WORD:2 22.0 +(signed word~) circle::$9 $9 zp ZP_WORD:10 22.0 +(label) circle::@1 +(label) circle::@10 +(label) circle::@11 +(label) circle::@12 +(label) circle::@13 +(label) circle::@2 +(label) circle::@3 +(label) circle::@4 +(label) circle::@5 +(label) circle::@6 +(label) circle::@7 +(label) circle::@8 +(label) circle::@9 +(label) circle::@return +(signed word) circle::p +(signed word) circle::p#1 p zp ZP_WORD:2 22.0 +(signed word) circle::p#10 p zp ZP_WORD:2 1.2692307692307692 +(signed word) circle::p#2 p zp ZP_WORD:2 22.0 +(signed word) circle::p#3 p zp ZP_WORD:2 6.285714285714286 +(signed word) circle::r +(const signed word) circle::r#0 r = (signed byte) $32 +(signed word) circle::x1 +(signed word) circle::x1#1 x1 zp ZP_WORD:4 22.0 +(signed word) circle::x1#10 x1 zp ZP_WORD:4 3.9722222222222214 +(signed word) circle::xc +(const signed word) circle::xc#0 xc = (signed byte) $64 +(signed word) circle::y +(signed word) circle::y#1 y zp ZP_WORD:6 6.6000000000000005 +(signed word) circle::y#10 y zp ZP_WORD:6 4.653846153846153 +(signed word) circle::y#13 y zp ZP_WORD:6 7.333333333333333 +(signed word) circle::yc +(const signed word) circle::yc#0 yc = (signed byte) $64 +(void()) fill((byte*) fill::start , (signed word) fill::size , (byte) fill::val) +(label) fill::@1 +(label) fill::@2 +(label) fill::@return +(byte*) fill::addr +(byte*) fill::addr#0 addr zp ZP_WORD:6 2.0 +(byte*) fill::addr#1 addr zp ZP_WORD:6 22.0 +(byte*) fill::addr#2 addr zp ZP_WORD:6 15.333333333333332 +(byte*) fill::end +(byte*) fill::end#0 end zp ZP_WORD:4 2.6 +(signed word) fill::size +(signed word) fill::size#2 size zp ZP_WORD:4 2.0 +(byte*) fill::start +(byte) fill::val +(byte) fill::val#4 reg byte x 1.8333333333333333 +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@3 +(void()) plot((signed word) plot::x , (signed word) plot::y) +(signed word~) plot::$0 $0 zp ZP_WORD:12 4.0 +(byte~) plot::$1 reg byte a 4.0 +(byte~) plot::$2 reg byte a 4.0 +(signed word~) plot::$3 $3 zp ZP_WORD:10 3.0 +(signed word~) plot::$4 $4 zp ZP_WORD:14 4.0 +(signed byte~) plot::$5 reg byte a 4.0 +(byte~) plot::$6 reg byte a 4.0 +(signed word) plot::$7 $7 zp ZP_WORD:14 4.0 +(signed word) plot::$8 $8 zp ZP_WORD:14 4.0 +(label) plot::@return +(byte*) plot::location +(byte*) plot::location#1 location zp ZP_WORD:12 1.3333333333333333 +(byte*) plot::location#2 location zp ZP_WORD:12 0.8 +(byte*) plot::location#3 location zp ZP_WORD:12 2.0 +(signed word) plot::x +(signed word) plot::x#0 x zp ZP_WORD:8 11.0 +(signed word) plot::x#1 x zp ZP_WORD:8 11.0 +(signed word) plot::x#2 x zp ZP_WORD:8 11.0 +(signed word) plot::x#3 x zp ZP_WORD:8 11.0 +(signed word) plot::x#4 x zp ZP_WORD:8 11.0 +(signed word) plot::x#5 x zp ZP_WORD:8 11.0 +(signed word) plot::x#6 x zp ZP_WORD:8 11.0 +(signed word) plot::x#7 x zp ZP_WORD:8 11.0 +(signed word) plot::x#8 x zp ZP_WORD:8 8.363636363636363 +(signed word) plot::y +(signed word) plot::y#0 y zp ZP_WORD:10 22.0 +(signed word) plot::y#1 y zp ZP_WORD:10 22.0 +(signed word) plot::y#2 y zp ZP_WORD:10 22.0 +(signed word) plot::y#3 y zp ZP_WORD:10 22.0 +(signed word) plot::y#4 y zp ZP_WORD:10 22.0 +(signed word) plot::y#5 y zp ZP_WORD:10 22.0 +(signed word) plot::y#6 y zp ZP_WORD:10 22.0 +(signed word) plot::y#7 y zp ZP_WORD:10 22.0 +(signed word) plot::y#8 y zp ZP_WORD:10 15.333333333333336 + +zp ZP_WORD:2 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 circle::$7 circle::$10 ] +zp ZP_WORD:4 [ fill::size#2 fill::end#0 circle::x1#10 circle::x1#1 ] +reg byte x [ fill::val#4 ] +zp ZP_WORD:6 [ fill::addr#2 fill::addr#0 fill::addr#1 circle::y#13 circle::y#10 circle::y#1 ] +zp ZP_WORD:8 [ circle::$5 circle::$6 plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] +zp ZP_WORD:10 [ circle::$9 plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 plot::$3 ] +zp ZP_WORD:12 [ plot::$0 plot::location#1 plot::location#2 plot::location#3 ] +reg byte a [ plot::$1 ] +reg byte a [ plot::$2 ] +zp ZP_WORD:14 [ plot::$7 plot::$8 plot::$4 ] +reg byte a [ plot::$5 ] +reg byte a [ plot::$6 ] + + +FINAL ASSEMBLER +Score: 6073 + + // File Comments +// Plots a circle on a bitmap using Bresenham's Circle algorithm +// Coded by Richard-William Loerakker +// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac + // Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + // Global Constants & labels + .label BORDERCOL = $d020 + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label VIC_MEMORY = $d018 + .const BLUE = 6 + .label SCREEN = $400 + .label BITMAP = $2000 + // @begin + // [1] phi from @begin to @1 [phi:@begin->@1] + // @1 + // [2] call main + // [4] phi from @1 to main [phi:@1->main] + // [3] phi from @1 to @end [phi:@1->@end] + // @end + // main +main: { + // fill(BITMAP,40*25*8,0) + // [5] call fill + // [67] phi from main to fill [phi:main->fill] + // [67] phi (byte) fill::val#4 = (byte) 0 [phi:main->fill#0] -- vbuxx=vbuc1 + ldx #0 + // [67] phi (signed word) fill::size#2 = (signed word)(number) $28*(number) $19*(number) 8 [phi:main->fill#1] -- vwsz1=vwsc1 + lda #<$28*$19*8 + sta.z fill.size + lda #>$28*$19*8 + sta.z fill.size+1 + // [67] phi (byte*) fill::addr#0 = (const byte*) BITMAP#0 [phi:main->fill#2] -- pbuz1=pbuc1 + lda #BITMAP + sta.z fill.addr+1 + jsr fill + // [6] phi from main to main::@2 [phi:main->main::@2] + // main::@2 + // fill(SCREEN,40*25,$16) + // [7] call fill + // [67] phi from main::@2 to fill [phi:main::@2->fill] + // [67] phi (byte) fill::val#4 = (byte) $16 [phi:main::@2->fill#0] -- vbuxx=vbuc1 + ldx #$16 + // [67] phi (signed word) fill::size#2 = (signed word)(number) $28*(number) $19 [phi:main::@2->fill#1] -- vwsz1=vwsc1 + lda #<$28*$19 + sta.z fill.size + lda #>$28*$19 + sta.z fill.size+1 + // [67] phi (byte*) fill::addr#0 = (const byte*) SCREEN#0 [phi:main::@2->fill#2] -- pbuz1=pbuc1 + lda #SCREEN + sta.z fill.addr+1 + jsr fill + // main::@3 + // *BORDERCOL = BLUE + // [8] *((const byte*) BORDERCOL#0) ← (const byte) BLUE#0 -- _deref_pbuc1=vbuc2 + lda #BLUE + sta BORDERCOL + // *D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3 + // [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + // *VIC_MEMORY = (byte)((((word)SCREEN&$3fff)/$40)|(((word)BITMAP&$3fff)/$400)) + // [10] *((const byte*) VIC_MEMORY#0) ← (byte)(word)(const byte*) SCREEN#0&(word) $3fff/(byte) $40|(word)(const byte*) BITMAP#0&(word) $3fff/(word) $400 -- _deref_pbuc1=vbuc2 + lda #(SCREEN&$3fff)/$40|(BITMAP&$3fff)/$400 + sta VIC_MEMORY + // circle(100,100,50) + // [11] call circle + // [13] phi from main::@3 to circle [phi:main::@3->circle] + jsr circle + // [12] phi from main::@1 main::@3 to main::@1 [phi:main::@1/main::@3->main::@1] + // main::@1 + b1: + jmp b1 +} + // circle +circle: { + .const xc = $64 + .const yc = $64 + .const r = $32 + .label _5 = 8 + .label _6 = 8 + .label _7 = 2 + .label _9 = $a + .label _10 = 2 + .label p = 2 + .label y = 6 + .label x1 = 4 + // [14] phi from circle to circle::@1 [phi:circle->circle::@1] + // [14] phi (signed word) circle::p#3 = (signed byte) 3-(const signed word) circle::r#0<<(signed byte) 1 [phi:circle->circle::@1#0] -- vwsz1=vwsc1 + lda #<3-(r<<1) + sta.z p + lda #>3-(r<<1) + sta.z p+1 + // [14] phi (signed word) circle::y#13 = (const signed word) circle::r#0 [phi:circle->circle::@1#1] -- vwsz1=vwsc1 + lda #r + sta.z y+1 + // [14] phi (signed word) circle::x1#10 = (signed byte) 0 [phi:circle->circle::@1#2] -- vwsz1=vbsc1 + lda #<0 + sta.z x1 + sta.z x1+1 + // circle::@1 + b1: + // for(int x = 0; x <= y; x ++) + // [15] if((signed word) circle::x1#10<=(signed word) circle::y#13) goto circle::@2 -- vwsz1_le_vwsz2_then_la1 + lda.z y + cmp.z x1 + lda.z y+1 + sbc.z x1+1 + bvc !+ + eor #$80 + !: + bpl b2 + // circle::@return + // } + // [16] return + rts + // circle::@2 + b2: + // if(p < 0) + // [17] if((signed word) circle::p#3<(signed byte) 0) goto circle::@3 -- vwsz1_lt_0_then_la1 + lda.z p+1 + bpl !b3+ + jmp b3 + !b3: + // circle::@5 + // y=y-1 + // [18] (signed word) circle::y#1 ← (signed word) circle::y#13 - (signed byte) 1 -- vwsz1=vwsz1_minus_1 + sec + lda.z y + sbc #1 + sta.z y + bcs !+ + dec.z y+1 + !: + // x-y + // [19] (signed word~) circle::$5 ← (signed word) circle::x1#10 - (signed word) circle::y#1 -- vwsz1=vwsz2_minus_vwsz3 + lda.z x1 + sec + sbc.z y + sta.z _5 + lda.z x1+1 + sbc.z y+1 + sta.z _5+1 + // (x-y) << 2 + // [20] (signed word~) circle::$6 ← (signed word~) circle::$5 << (signed byte) 2 -- vwsz1=vwsz1_rol_2 + asl.z _6 + rol.z _6+1 + asl.z _6 + rol.z _6+1 + // p + ((x-y) << 2) + // [21] (signed word~) circle::$7 ← (signed word) circle::p#3 + (signed word~) circle::$6 -- vwsz1=vwsz1_plus_vwsz2 + lda.z _7 + clc + adc.z _6 + sta.z _7 + lda.z _7+1 + adc.z _6+1 + sta.z _7+1 + // p = p + ((x-y) << 2) + 10 + // [22] (signed word) circle::p#2 ← (signed word~) circle::$7 + (signed byte) $a -- vwsz1=vwsz1_plus_vbsc1 + lda.z p + clc + adc #<$a + sta.z p + lda.z p+1 + adc #>$a + sta.z p+1 + // [23] phi from circle::@3 circle::@5 to circle::@4 [phi:circle::@3/circle::@5->circle::@4] + // [23] phi (signed word) circle::p#10 = (signed word) circle::p#1 [phi:circle::@3/circle::@5->circle::@4#0] -- register_copy + // [23] phi (signed word) circle::y#10 = (signed word) circle::y#13 [phi:circle::@3/circle::@5->circle::@4#1] -- register_copy + // circle::@4 + b4: + // plot(xc+x,yc-y) + // [24] (signed word) plot::x#0 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + // [25] (signed word) plot::y#0 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + // [26] call plot + // [52] phi from circle::@4 to plot [phi:circle::@4->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#0 [phi:circle::@4->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#0 [phi:circle::@4->plot#1] -- register_copy + jsr plot + // circle::@6 + // plot(xc-x,yc-y) + // [27] (signed word) plot::x#1 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + // [28] (signed word) plot::y#1 ← (const signed word) circle::yc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z y+1 + sta.z plot.y+1 + // [29] call plot + // [52] phi from circle::@6 to plot [phi:circle::@6->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#1 [phi:circle::@6->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#1 [phi:circle::@6->plot#1] -- register_copy + jsr plot + // circle::@7 + // plot(xc+x,yc+y) + // [30] (signed word) plot::x#2 ← (const signed word) circle::xc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #xc + sta.z plot.x+1 + // [31] (signed word) plot::y#2 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #yc + sta.z plot.y+1 + // [32] call plot + // [52] phi from circle::@7 to plot [phi:circle::@7->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#2 [phi:circle::@7->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#2 [phi:circle::@7->plot#1] -- register_copy + jsr plot + // circle::@8 + // plot(xc-x,yc+y) + // [33] (signed word) plot::x#3 ← (const signed word) circle::xc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z x1+1 + sta.z plot.x+1 + // [34] (signed word) plot::y#3 ← (const signed word) circle::yc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #yc + sta.z plot.y+1 + // [35] call plot + // [52] phi from circle::@8 to plot [phi:circle::@8->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#3 [phi:circle::@8->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#3 [phi:circle::@8->plot#1] -- register_copy + jsr plot + // circle::@9 + // plot(xc+y,yc-x) + // [36] (signed word) plot::x#4 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #xc + sta.z plot.x+1 + // [37] (signed word) plot::y#4 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + // [38] call plot + // [52] phi from circle::@9 to plot [phi:circle::@9->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#4 [phi:circle::@9->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#4 [phi:circle::@9->plot#1] -- register_copy + jsr plot + // circle::@10 + // plot(xc-y,yc-x) + // [39] (signed word) plot::x#5 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z y+1 + sta.z plot.x+1 + // [40] (signed word) plot::y#5 ← (const signed word) circle::yc#0 - (signed word) circle::x1#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #yc + sbc.z x1+1 + sta.z plot.y+1 + // [41] call plot + // [52] phi from circle::@10 to plot [phi:circle::@10->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#5 [phi:circle::@10->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#5 [phi:circle::@10->plot#1] -- register_copy + jsr plot + // circle::@11 + // plot(xc+y,yc+x) + // [42] (signed word) plot::x#6 ← (const signed word) circle::xc#0 + (signed word) circle::y#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z y + clc + adc #xc + sta.z plot.x+1 + // [43] (signed word) plot::y#6 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + // [44] call plot + // [52] phi from circle::@11 to plot [phi:circle::@11->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#6 [phi:circle::@11->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#6 [phi:circle::@11->plot#1] -- register_copy + jsr plot + // circle::@12 + // plot(xc-y,yc+x) + // [45] (signed word) plot::x#7 ← (const signed word) circle::xc#0 - (signed word) circle::y#10 -- vwsz1=vwsc1_minus_vwsz2 + lda #xc + sbc.z y+1 + sta.z plot.x+1 + // [46] (signed word) plot::y#7 ← (const signed word) circle::yc#0 + (signed word) circle::x1#10 -- vwsz1=vwsc1_plus_vwsz2 + lda.z x1 + clc + adc #yc + sta.z plot.y+1 + // [47] call plot + // [52] phi from circle::@12 to plot [phi:circle::@12->plot] + // [52] phi (signed word) plot::y#8 = (signed word) plot::y#7 [phi:circle::@12->plot#0] -- register_copy + // [52] phi (signed word) plot::x#8 = (signed word) plot::x#7 [phi:circle::@12->plot#1] -- register_copy + jsr plot + // circle::@13 + // for(int x = 0; x <= y; x ++) + // [48] (signed word) circle::x1#1 ← ++ (signed word) circle::x1#10 -- vwsz1=_inc_vwsz1 + inc.z x1 + bne !+ + inc.z x1+1 + !: + // [14] phi from circle::@13 to circle::@1 [phi:circle::@13->circle::@1] + // [14] phi (signed word) circle::p#3 = (signed word) circle::p#10 [phi:circle::@13->circle::@1#0] -- register_copy + // [14] phi (signed word) circle::y#13 = (signed word) circle::y#10 [phi:circle::@13->circle::@1#1] -- register_copy + // [14] phi (signed word) circle::x1#10 = (signed word) circle::x1#1 [phi:circle::@13->circle::@1#2] -- register_copy + jmp b1 + // circle::@3 + b3: + // x << 2 + // [49] (signed word~) circle::$9 ← (signed word) circle::x1#10 << (signed byte) 2 -- vwsz1=vwsz2_rol_2 + lda.z x1 + asl + sta.z _9 + lda.z x1+1 + rol + sta.z _9+1 + asl.z _9 + rol.z _9+1 + // p + (x << 2) + // [50] (signed word~) circle::$10 ← (signed word) circle::p#3 + (signed word~) circle::$9 -- vwsz1=vwsz1_plus_vwsz2 + lda.z _10 + clc + adc.z _9 + sta.z _10 + lda.z _10+1 + adc.z _9+1 + sta.z _10+1 + // p = p + (x << 2) + 6 + // [51] (signed word) circle::p#1 ← (signed word~) circle::$10 + (signed byte) 6 -- vwsz1=vwsz1_plus_vbsc1 + lda.z p + clc + adc #<6 + sta.z p + lda.z p+1 + adc #>6 + sta.z p+1 + jmp b4 +} + // plot +// plot(signed word zeropage(8) x, signed word zeropage($a) y) +plot: { + .label _0 = $c + .label _3 = $a + .label _4 = $e + .label x = 8 + .label y = $a + .label location = $c + .label _7 = $e + .label _8 = $e + // x & $fff8 + // [53] (signed word~) plot::$0 ← (signed word) plot::x#8 & (signed dword) $fff8 -- vwsz1=vwsz2_band_vdsc1 + lda.z x + and #<$fff8 + sta.z _0 + lda.z x+1 + and #>$fff8 + sta.z _0+1 + // location += x & $fff8 + // [54] (byte*) plot::location#1 ← (const byte*) BITMAP#0 + (signed word~) plot::$0 -- pbuz1=pbuc1_plus_vwsz1 + lda #BITMAP + adc.z location+1 + sta.z location+1 + // > 3 + // [58] (signed word~) plot::$3 ← (signed word) plot::y#8 >> (signed byte) 3 -- vwsz1=vwsz1_ror_3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + lda.z _3+1 + cmp #$80 + ror.z _3+1 + ror.z _3 + // (y >> 3) * 320 + // [59] (signed word) plot::$7 ← (signed word~) plot::$3 << (byte) 2 -- vwsz1=vwsz2_rol_2 + lda.z _3 + asl + sta.z _7 + lda.z _3+1 + rol + sta.z _7+1 + asl.z _7 + rol.z _7+1 + // [60] (signed word) plot::$8 ← (signed word) plot::$7 + (signed word~) plot::$3 -- vwsz1=vwsz1_plus_vwsz2 + lda.z _8 + clc + adc.z _3 + sta.z _8 + lda.z _8+1 + adc.z _3+1 + sta.z _8+1 + // [61] (signed word~) plot::$4 ← (signed word) plot::$8 << (byte) 6 -- vwsz1=vwsz1_rol_6 + lda.z _4+1 + sta.z $ff + lda.z _4 + sta.z _4+1 + lda #0 + sta.z _4 + lsr.z $ff + ror.z _4+1 + ror.z _4 + lsr.z $ff + ror.z _4+1 + ror.z _4 + // location += ((y >> 3) * 320) + // [62] (byte*) plot::location#3 ← (byte*) plot::location#2 + (signed word~) plot::$4 -- pbuz1=pbuz1_plus_vwsz2 + lda.z location + clc + adc.z _4 + sta.z location + lda.z location+1 + adc.z _4+1 + sta.z location+1 + // x & 7 + // [63] (signed byte~) plot::$5 ← (signed word) plot::x#8 & (signed byte) 7 -- vbsaa=vwsz1_band_vbsc1 + lda #7 + and.z x + // (*location) | bitmask[x & 7] + // [64] (byte~) plot::$6 ← *((byte*) plot::location#3) | *((const byte[]) bitmask#0 + (signed byte~) plot::$5) -- vbuaa=_deref_pbuz1_bor_pbuc1_derefidx_vbsaa + tay + lda bitmask,y + ldy #0 + ora (location),y + // (*location) = (*location) | bitmask[x & 7] + // [65] *((byte*) plot::location#3) ← (byte~) plot::$6 -- _deref_pbuz1=vbuaa + sta (location),y + // plot::@return + // } + // [66] return + rts +} + // fill +// Fill some memory with a value +// fill(signed word zeropage(4) size, byte register(X) val) +fill: { + .label end = 4 + .label addr = 6 + .label size = 4 + // end = start + size + // [68] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (signed word) fill::size#2 -- pbuz1=pbuz2_plus_vwsz1 + lda.z addr + clc + adc.z end + sta.z end + lda.z addr+1 + adc.z end+1 + sta.z end+1 + // [69] phi from fill fill::@2 to fill::@1 [phi:fill/fill::@2->fill::@1] + // [69] phi (byte*) fill::addr#2 = (byte*) fill::addr#0 [phi:fill/fill::@2->fill::@1#0] -- register_copy + // fill::@1 + b1: + // for(byte* addr = start; addr!=end; addr++) + // [70] if((byte*) fill::addr#2!=(byte*) fill::end#0) goto fill::@2 -- pbuz1_neq_pbuz2_then_la1 + lda.z addr+1 + cmp.z end+1 + bne b2 + lda.z addr + cmp.z end + bne b2 + // fill::@return + // } + // [71] return + rts + // fill::@2 + b2: + // *addr = val + // [72] *((byte*) fill::addr#2) ← (byte) fill::val#4 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (addr),y + // for(byte* addr = start; addr!=end; addr++) + // [73] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2 -- pbuz1=_inc_pbuz1 + inc.z addr + bne !+ + inc.z addr+1 + !: + jmp b1 +} + // File Data + bitmask: .byte $80, $40, $20, $10, 8, 4, 2, 1 + diff --git a/src/test/ref/bitmap-circle.sym b/src/test/ref/bitmap-circle.sym new file mode 100644 index 000000000..d8c9ba0aa --- /dev/null +++ b/src/test/ref/bitmap-circle.sym @@ -0,0 +1,128 @@ +(label) @1 +(label) @begin +(label) @end +(byte*) BITMAP +(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(byte) BLUE +(const byte) BLUE#0 BLUE = (byte) 6 +(byte*) BORDERCOL +(const byte*) BORDERCOL#0 BORDERCOL = (byte*) 53280 +(byte*) D011 +(const byte*) D011#0 D011 = (byte*) 53265 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(byte) VIC_BMM +(const byte) VIC_BMM#0 VIC_BMM = (byte) $20 +(byte) VIC_DEN +(const byte) VIC_DEN#0 VIC_DEN = (byte) $10 +(byte*) VIC_MEMORY +(const byte*) VIC_MEMORY#0 VIC_MEMORY = (byte*) 53272 +(byte) VIC_RSEL +(const byte) VIC_RSEL#0 VIC_RSEL = (byte) 8 +(byte[]) bitmask +(const byte[]) bitmask#0 bitmask = { (byte) $80, (byte) $40, (byte) $20, (byte) $10, (byte) 8, (byte) 4, (byte) 2, (byte) 1 } +(void()) circle((signed word) circle::xc , (signed word) circle::yc , (signed word) circle::r) +(signed word~) circle::$10 $10 zp ZP_WORD:2 22.0 +(signed word~) circle::$5 $5 zp ZP_WORD:8 22.0 +(signed word~) circle::$6 $6 zp ZP_WORD:8 22.0 +(signed word~) circle::$7 $7 zp ZP_WORD:2 22.0 +(signed word~) circle::$9 $9 zp ZP_WORD:10 22.0 +(label) circle::@1 +(label) circle::@10 +(label) circle::@11 +(label) circle::@12 +(label) circle::@13 +(label) circle::@2 +(label) circle::@3 +(label) circle::@4 +(label) circle::@5 +(label) circle::@6 +(label) circle::@7 +(label) circle::@8 +(label) circle::@9 +(label) circle::@return +(signed word) circle::p +(signed word) circle::p#1 p zp ZP_WORD:2 22.0 +(signed word) circle::p#10 p zp ZP_WORD:2 1.2692307692307692 +(signed word) circle::p#2 p zp ZP_WORD:2 22.0 +(signed word) circle::p#3 p zp ZP_WORD:2 6.285714285714286 +(signed word) circle::r +(const signed word) circle::r#0 r = (signed byte) $32 +(signed word) circle::x1 +(signed word) circle::x1#1 x1 zp ZP_WORD:4 22.0 +(signed word) circle::x1#10 x1 zp ZP_WORD:4 3.9722222222222214 +(signed word) circle::xc +(const signed word) circle::xc#0 xc = (signed byte) $64 +(signed word) circle::y +(signed word) circle::y#1 y zp ZP_WORD:6 6.6000000000000005 +(signed word) circle::y#10 y zp ZP_WORD:6 4.653846153846153 +(signed word) circle::y#13 y zp ZP_WORD:6 7.333333333333333 +(signed word) circle::yc +(const signed word) circle::yc#0 yc = (signed byte) $64 +(void()) fill((byte*) fill::start , (signed word) fill::size , (byte) fill::val) +(label) fill::@1 +(label) fill::@2 +(label) fill::@return +(byte*) fill::addr +(byte*) fill::addr#0 addr zp ZP_WORD:6 2.0 +(byte*) fill::addr#1 addr zp ZP_WORD:6 22.0 +(byte*) fill::addr#2 addr zp ZP_WORD:6 15.333333333333332 +(byte*) fill::end +(byte*) fill::end#0 end zp ZP_WORD:4 2.6 +(signed word) fill::size +(signed word) fill::size#2 size zp ZP_WORD:4 2.0 +(byte*) fill::start +(byte) fill::val +(byte) fill::val#4 reg byte x 1.8333333333333333 +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@3 +(void()) plot((signed word) plot::x , (signed word) plot::y) +(signed word~) plot::$0 $0 zp ZP_WORD:12 4.0 +(byte~) plot::$1 reg byte a 4.0 +(byte~) plot::$2 reg byte a 4.0 +(signed word~) plot::$3 $3 zp ZP_WORD:10 3.0 +(signed word~) plot::$4 $4 zp ZP_WORD:14 4.0 +(signed byte~) plot::$5 reg byte a 4.0 +(byte~) plot::$6 reg byte a 4.0 +(signed word) plot::$7 $7 zp ZP_WORD:14 4.0 +(signed word) plot::$8 $8 zp ZP_WORD:14 4.0 +(label) plot::@return +(byte*) plot::location +(byte*) plot::location#1 location zp ZP_WORD:12 1.3333333333333333 +(byte*) plot::location#2 location zp ZP_WORD:12 0.8 +(byte*) plot::location#3 location zp ZP_WORD:12 2.0 +(signed word) plot::x +(signed word) plot::x#0 x zp ZP_WORD:8 11.0 +(signed word) plot::x#1 x zp ZP_WORD:8 11.0 +(signed word) plot::x#2 x zp ZP_WORD:8 11.0 +(signed word) plot::x#3 x zp ZP_WORD:8 11.0 +(signed word) plot::x#4 x zp ZP_WORD:8 11.0 +(signed word) plot::x#5 x zp ZP_WORD:8 11.0 +(signed word) plot::x#6 x zp ZP_WORD:8 11.0 +(signed word) plot::x#7 x zp ZP_WORD:8 11.0 +(signed word) plot::x#8 x zp ZP_WORD:8 8.363636363636363 +(signed word) plot::y +(signed word) plot::y#0 y zp ZP_WORD:10 22.0 +(signed word) plot::y#1 y zp ZP_WORD:10 22.0 +(signed word) plot::y#2 y zp ZP_WORD:10 22.0 +(signed word) plot::y#3 y zp ZP_WORD:10 22.0 +(signed word) plot::y#4 y zp ZP_WORD:10 22.0 +(signed word) plot::y#5 y zp ZP_WORD:10 22.0 +(signed word) plot::y#6 y zp ZP_WORD:10 22.0 +(signed word) plot::y#7 y zp ZP_WORD:10 22.0 +(signed word) plot::y#8 y zp ZP_WORD:10 15.333333333333336 + +zp ZP_WORD:2 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 circle::$7 circle::$10 ] +zp ZP_WORD:4 [ fill::size#2 fill::end#0 circle::x1#10 circle::x1#1 ] +reg byte x [ fill::val#4 ] +zp ZP_WORD:6 [ fill::addr#2 fill::addr#0 fill::addr#1 circle::y#13 circle::y#10 circle::y#1 ] +zp ZP_WORD:8 [ circle::$5 circle::$6 plot::x#8 plot::x#1 plot::x#2 plot::x#3 plot::x#4 plot::x#5 plot::x#6 plot::x#7 plot::x#0 ] +zp ZP_WORD:10 [ circle::$9 plot::y#8 plot::y#1 plot::y#2 plot::y#3 plot::y#4 plot::y#5 plot::y#6 plot::y#7 plot::y#0 plot::$3 ] +zp ZP_WORD:12 [ plot::$0 plot::location#1 plot::location#2 plot::location#3 ] +reg byte a [ plot::$1 ] +reg byte a [ plot::$2 ] +zp ZP_WORD:14 [ plot::$7 plot::$8 plot::$4 ] +reg byte a [ plot::$5 ] +reg byte a [ plot::$6 ] diff --git a/src/test/ref/cia-timer-cyclecount.log b/src/test/ref/cia-timer-cyclecount.log index b5d277f63..cdb2c207e 100644 --- a/src/test/ref/cia-timer-cyclecount.log +++ b/src/test/ref/cia-timer-cyclecount.log @@ -903,9 +903,11 @@ print_word_at: { clc adc #2 sta.z print_byte_at.at + bcc !+ lda.z at+1 adc #0 sta.z print_byte_at.at+1 + !: // [25] call print_byte_at // [27] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at] print_byte_at_from_b1: @@ -1128,17 +1130,17 @@ Uplift Scope [clock_start] Uplift Scope [RADIX] Uplift Scope [] -Uplifting [main] best 1746 combination zp ZP_DWORD:16 [ main::$1 ] zp ZP_DWORD:20 [ main::cyclecount#0 ] -Uplifting [clock] best 1746 combination zp ZP_DWORD:12 [ clock::return#2 ] zp ZP_DWORD:30 [ clock::return#0 ] -Uplifting [print_char_at] best 1739 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] -Uplifting [print_byte_at] best 1731 combination zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] -Uplifting [print_word_at] best 1731 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] -Uplifting [print_dword_at] best 1731 combination zp ZP_DWORD:24 [ print_dword_at::dw#0 ] -Uplifting [clock_start] best 1731 combination -Uplifting [RADIX] best 1731 combination -Uplifting [] best 1731 combination +Uplifting [main] best 1748 combination zp ZP_DWORD:16 [ main::$1 ] zp ZP_DWORD:20 [ main::cyclecount#0 ] +Uplifting [clock] best 1748 combination zp ZP_DWORD:12 [ clock::return#2 ] zp ZP_DWORD:30 [ clock::return#0 ] +Uplifting [print_char_at] best 1741 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] +Uplifting [print_byte_at] best 1733 combination zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] +Uplifting [print_word_at] best 1733 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] +Uplifting [print_dword_at] best 1733 combination zp ZP_DWORD:24 [ print_dword_at::dw#0 ] +Uplifting [clock_start] best 1733 combination +Uplifting [RADIX] best 1733 combination +Uplifting [] best 1733 combination Attempting to uplift remaining variables inzp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] -Uplifting [print_byte_at] best 1731 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] +Uplifting [print_byte_at] best 1733 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] Coalescing zero page register [ zp ZP_WORD:4 [ print_word_at::at#2 ] ] with [ zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] ] - score: 2 Coalescing zero page register [ zp ZP_DWORD:12 [ clock::return#2 ] ] with [ zp ZP_DWORD:16 [ main::$1 ] ] - score: 1 Coalescing zero page register [ zp ZP_DWORD:12 [ clock::return#2 main::$1 ] ] with [ zp ZP_DWORD:30 [ clock::return#0 ] ] - score: 1 diff --git a/src/test/ref/cia-timer-simple.log b/src/test/ref/cia-timer-simple.log index d87dce1b1..b3a088472 100644 --- a/src/test/ref/cia-timer-simple.log +++ b/src/test/ref/cia-timer-simple.log @@ -838,9 +838,11 @@ print_word_at: { clc adc #2 sta.z print_byte_at.at + bcc !+ lda.z at+1 adc #0 sta.z print_byte_at.at+1 + !: // [22] call print_byte_at // [24] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at] print_byte_at_from_b1: @@ -1057,17 +1059,17 @@ Uplift Scope [RADIX] Uplift Scope [main] Uplift Scope [] -Uplifting [clock] best 1062 combination zp ZP_DWORD:12 [ clock::return#2 ] zp ZP_DWORD:22 [ clock::return#0 ] -Uplifting [print_char_at] best 1055 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] -Uplifting [print_byte_at] best 1047 combination zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] -Uplifting [print_word_at] best 1047 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] -Uplifting [print_dword_at] best 1047 combination zp ZP_DWORD:16 [ print_dword_at::dw#0 ] -Uplifting [clock_start] best 1047 combination -Uplifting [RADIX] best 1047 combination -Uplifting [main] best 1047 combination -Uplifting [] best 1047 combination +Uplifting [clock] best 1064 combination zp ZP_DWORD:12 [ clock::return#2 ] zp ZP_DWORD:22 [ clock::return#0 ] +Uplifting [print_char_at] best 1057 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] +Uplifting [print_byte_at] best 1049 combination zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] +Uplifting [print_word_at] best 1049 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] +Uplifting [print_dword_at] best 1049 combination zp ZP_DWORD:16 [ print_dword_at::dw#0 ] +Uplifting [clock_start] best 1049 combination +Uplifting [RADIX] best 1049 combination +Uplifting [main] best 1049 combination +Uplifting [] best 1049 combination Attempting to uplift remaining variables inzp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] -Uplifting [print_byte_at] best 1047 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] +Uplifting [print_byte_at] best 1049 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] Coalescing zero page register [ zp ZP_WORD:4 [ print_word_at::at#2 ] ] with [ zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] ] - score: 2 Coalescing zero page register [ zp ZP_DWORD:12 [ clock::return#2 ] ] with [ zp ZP_DWORD:16 [ print_dword_at::dw#0 ] ] - score: 1 Coalescing zero page register [ zp ZP_DWORD:12 [ clock::return#2 print_dword_at::dw#0 ] ] with [ zp ZP_DWORD:22 [ clock::return#0 ] ] - score: 1 diff --git a/src/test/ref/examples/rotate/rotate.log b/src/test/ref/examples/rotate/rotate.log index 256838676..e972d9b04 100644 --- a/src/test/ref/examples/rotate/rotate.log +++ b/src/test/ref/examples/rotate/rotate.log @@ -3182,9 +3182,11 @@ print_word_at: { clc adc #2 sta.z print_byte_at.at + bcc !+ lda.z at+1 adc #0 sta.z print_byte_at.at+1 + !: // [74] call print_byte_at // [76] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at] print_byte_at_from_b1: @@ -4091,50 +4093,50 @@ Uplift Scope [RADIX] Uplift Scope [main] Uplift Scope [] -Uplifting [anim] best 45223 combination zp ZP_BYTE:4 [ anim::sprite_msb#10 anim::sprite_msb#5 anim::sprite_msb#2 anim::sprite_msb#1 ] zp ZP_WORD:36 [ anim::$6 ] zp ZP_WORD:40 [ anim::$8 ] zp ZP_WORD:44 [ anim::$11 ] zp ZP_WORD:46 [ anim::$12 ] zp ZP_WORD:50 [ anim::$13 ] zp ZP_WORD:52 [ anim::$14 ] reg byte a [ anim::$20 ] reg byte a [ anim::$24 ] reg byte a [ anim::$27 ] zp ZP_BYTE:3 [ anim::i#10 anim::i#1 ] zp ZP_BYTE:56 [ anim::$17 ] zp ZP_BYTE:62 [ anim::i2#0 ] zp ZP_BYTE:61 [ anim::ypos#0 ] zp ZP_WORD:48 [ anim::xr#1 ] zp ZP_WORD:57 [ anim::xpos#0 ] zp ZP_WORD:54 [ anim::yr#1 ] zp ZP_BYTE:35 [ anim::y#0 ] zp ZP_DWORD:68 [ anim::$29 ] zp ZP_DWORD:72 [ anim::cyclecount#0 ] zp ZP_WORD:38 [ anim::xr#0 ] zp ZP_WORD:42 [ anim::yr#0 ] zp ZP_BYTE:34 [ anim::x#0 ] zp ZP_BYTE:2 [ anim::angle#9 anim::angle#1 ] +Uplifting [anim] best 45225 combination zp ZP_BYTE:4 [ anim::sprite_msb#10 anim::sprite_msb#5 anim::sprite_msb#2 anim::sprite_msb#1 ] zp ZP_WORD:36 [ anim::$6 ] zp ZP_WORD:40 [ anim::$8 ] zp ZP_WORD:44 [ anim::$11 ] zp ZP_WORD:46 [ anim::$12 ] zp ZP_WORD:50 [ anim::$13 ] zp ZP_WORD:52 [ anim::$14 ] reg byte a [ anim::$20 ] reg byte a [ anim::$24 ] reg byte a [ anim::$27 ] zp ZP_BYTE:3 [ anim::i#10 anim::i#1 ] zp ZP_BYTE:56 [ anim::$17 ] zp ZP_BYTE:62 [ anim::i2#0 ] zp ZP_BYTE:61 [ anim::ypos#0 ] zp ZP_WORD:48 [ anim::xr#1 ] zp ZP_WORD:57 [ anim::xpos#0 ] zp ZP_WORD:54 [ anim::yr#1 ] zp ZP_BYTE:35 [ anim::y#0 ] zp ZP_DWORD:68 [ anim::$29 ] zp ZP_DWORD:72 [ anim::cyclecount#0 ] zp ZP_WORD:38 [ anim::xr#0 ] zp ZP_WORD:42 [ anim::yr#0 ] zp ZP_BYTE:34 [ anim::x#0 ] zp ZP_BYTE:2 [ anim::angle#9 anim::angle#1 ] Limited combination testing to 100 combinations of 2880 possible. -Uplifting [mulf8s_prepared] best 44002 combination reg byte y [ mulf8s_prepared::b#4 mulf8s_prepared::b#0 mulf8s_prepared::b#2 mulf8s_prepared::b#1 mulf8s_prepared::b#3 ] zp ZP_WORD:16 [ mulf8s_prepared::m#4 mulf8s_prepared::m#5 mulf8s_prepared::m#1 mulf8s_prepared::m#0 mulf8s_prepared::m#2 ] reg byte a [ mulf8s_prepared::$8 ] reg byte a [ mulf8s_prepared::$15 ] reg byte a [ mulf8s_prepared::$12 ] zp ZP_BYTE:92 [ mulf8s_prepared::$16 ] +Uplifting [mulf8s_prepared] best 44004 combination reg byte y [ mulf8s_prepared::b#4 mulf8s_prepared::b#0 mulf8s_prepared::b#2 mulf8s_prepared::b#1 mulf8s_prepared::b#3 ] zp ZP_WORD:16 [ mulf8s_prepared::m#4 mulf8s_prepared::m#5 mulf8s_prepared::m#1 mulf8s_prepared::m#0 mulf8s_prepared::m#2 ] reg byte a [ mulf8s_prepared::$8 ] reg byte a [ mulf8s_prepared::$15 ] reg byte a [ mulf8s_prepared::$12 ] zp ZP_BYTE:92 [ mulf8s_prepared::$16 ] Limited combination testing to 100 combinations of 512 possible. -Uplifting [mulf8u_prepare] best 43399 combination reg byte a [ mulf8u_prepare::a#2 mulf8u_prepare::a#3 mulf8u_prepare::a#4 ] -Uplifting [mulf_init] best 43149 combination zp ZP_WORD:32 [ mulf_init::sqr#3 mulf_init::sqr#4 mulf_init::sqr#1 mulf_init::sqr#2 ] zp ZP_WORD:26 [ mulf_init::sqr2_lo#2 mulf_init::sqr2_lo#1 ] zp ZP_WORD:20 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_lo#1 ] reg byte x [ mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 ] reg byte a [ mulf_init::$9 ] reg byte a [ mulf_init::$12 ] reg byte a [ mulf_init::$13 ] zp ZP_BYTE:28 [ mulf_init::x_255#2 mulf_init::x_255#1 ] zp ZP_BYTE:31 [ mulf_init::dir#2 mulf_init::dir#4 ] zp ZP_BYTE:22 [ mulf_init::c#2 mulf_init::c#1 ] zp ZP_WORD:29 [ mulf_init::sqr2_hi#2 mulf_init::sqr2_hi#1 ] zp ZP_WORD:23 [ mulf_init::sqr1_hi#2 mulf_init::sqr1_hi#1 ] +Uplifting [mulf8u_prepare] best 43401 combination reg byte a [ mulf8u_prepare::a#2 mulf8u_prepare::a#3 mulf8u_prepare::a#4 ] +Uplifting [mulf_init] best 43151 combination zp ZP_WORD:32 [ mulf_init::sqr#3 mulf_init::sqr#4 mulf_init::sqr#1 mulf_init::sqr#2 ] zp ZP_WORD:26 [ mulf_init::sqr2_lo#2 mulf_init::sqr2_lo#1 ] zp ZP_WORD:20 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_lo#1 ] reg byte x [ mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 ] reg byte a [ mulf_init::$9 ] reg byte a [ mulf_init::$12 ] reg byte a [ mulf_init::$13 ] zp ZP_BYTE:28 [ mulf_init::x_255#2 mulf_init::x_255#1 ] zp ZP_BYTE:31 [ mulf_init::dir#2 mulf_init::dir#4 ] zp ZP_BYTE:22 [ mulf_init::c#2 mulf_init::c#1 ] zp ZP_WORD:29 [ mulf_init::sqr2_hi#2 mulf_init::sqr2_hi#1 ] zp ZP_WORD:23 [ mulf_init::sqr1_hi#2 mulf_init::sqr1_hi#1 ] Limited combination testing to 100 combinations of 1024 possible. -Uplifting [init] best 42999 combination reg byte x [ init::i#2 init::i#1 ] -Uplifting [clock] best 42999 combination zp ZP_DWORD:64 [ clock::return#2 ] zp ZP_DWORD:82 [ clock::return#0 ] -Uplifting [print_char_at] best 42992 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:13 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] -Uplifting [print_byte_at] best 42984 combination zp ZP_WORD:10 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:9 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] -Uplifting [print_word_at] best 42984 combination zp ZP_WORD:5 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:7 [ print_word_at::at#2 ] -Uplifting [mulf8u_prepared] best 42980 combination reg byte a [ mulf8u_prepared::b#0 ] zp ZP_WORD:87 [ mulf8u_prepared::return#2 ] zp ZP_WORD:93 [ mulf8u_prepared::return#0 ] -Uplifting [print_dword_at] best 42980 combination zp ZP_DWORD:76 [ print_dword_at::dw#0 ] -Uplifting [clock_start] best 42980 combination -Uplifting [RADIX] best 42980 combination -Uplifting [main] best 42980 combination -Uplifting [] best 42980 combination +Uplifting [init] best 43001 combination reg byte x [ init::i#2 init::i#1 ] +Uplifting [clock] best 43001 combination zp ZP_DWORD:64 [ clock::return#2 ] zp ZP_DWORD:82 [ clock::return#0 ] +Uplifting [print_char_at] best 42994 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:13 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] +Uplifting [print_byte_at] best 42986 combination zp ZP_WORD:10 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:9 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] +Uplifting [print_word_at] best 42986 combination zp ZP_WORD:5 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:7 [ print_word_at::at#2 ] +Uplifting [mulf8u_prepared] best 42982 combination reg byte a [ mulf8u_prepared::b#0 ] zp ZP_WORD:87 [ mulf8u_prepared::return#2 ] zp ZP_WORD:93 [ mulf8u_prepared::return#0 ] +Uplifting [print_dword_at] best 42982 combination zp ZP_DWORD:76 [ print_dword_at::dw#0 ] +Uplifting [clock_start] best 42982 combination +Uplifting [RADIX] best 42982 combination +Uplifting [main] best 42982 combination +Uplifting [] best 42982 combination Attempting to uplift remaining variables inzp ZP_BYTE:4 [ anim::sprite_msb#10 anim::sprite_msb#5 anim::sprite_msb#2 anim::sprite_msb#1 ] -Uplifting [anim] best 42980 combination zp ZP_BYTE:4 [ anim::sprite_msb#10 anim::sprite_msb#5 anim::sprite_msb#2 anim::sprite_msb#1 ] +Uplifting [anim] best 42982 combination zp ZP_BYTE:4 [ anim::sprite_msb#10 anim::sprite_msb#5 anim::sprite_msb#2 anim::sprite_msb#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:3 [ anim::i#10 anim::i#1 ] -Uplifting [anim] best 42980 combination zp ZP_BYTE:3 [ anim::i#10 anim::i#1 ] +Uplifting [anim] best 42982 combination zp ZP_BYTE:3 [ anim::i#10 anim::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:56 [ anim::$17 ] -Uplifting [anim] best 42380 combination reg byte a [ anim::$17 ] +Uplifting [anim] best 42382 combination reg byte a [ anim::$17 ] Attempting to uplift remaining variables inzp ZP_BYTE:62 [ anim::i2#0 ] -Uplifting [anim] best 41680 combination reg byte x [ anim::i2#0 ] +Uplifting [anim] best 41682 combination reg byte x [ anim::i2#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:61 [ anim::ypos#0 ] -Uplifting [anim] best 41480 combination reg byte y [ anim::ypos#0 ] +Uplifting [anim] best 41482 combination reg byte y [ anim::ypos#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:35 [ anim::y#0 ] -Uplifting [anim] best 41480 combination zp ZP_BYTE:35 [ anim::y#0 ] +Uplifting [anim] best 41482 combination zp ZP_BYTE:35 [ anim::y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:34 [ anim::x#0 ] -Uplifting [anim] best 41480 combination zp ZP_BYTE:34 [ anim::x#0 ] +Uplifting [anim] best 41482 combination zp ZP_BYTE:34 [ anim::x#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:28 [ mulf_init::x_255#2 mulf_init::x_255#1 ] -Uplifting [mulf_init] best 41340 combination reg byte x [ mulf_init::x_255#2 mulf_init::x_255#1 ] +Uplifting [mulf_init] best 41342 combination reg byte x [ mulf_init::x_255#2 mulf_init::x_255#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:31 [ mulf_init::dir#2 mulf_init::dir#4 ] -Uplifting [mulf_init] best 41340 combination zp ZP_BYTE:31 [ mulf_init::dir#2 mulf_init::dir#4 ] +Uplifting [mulf_init] best 41342 combination zp ZP_BYTE:31 [ mulf_init::dir#2 mulf_init::dir#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:22 [ mulf_init::c#2 mulf_init::c#1 ] -Uplifting [mulf_init] best 41340 combination zp ZP_BYTE:22 [ mulf_init::c#2 mulf_init::c#1 ] +Uplifting [mulf_init] best 41342 combination zp ZP_BYTE:22 [ mulf_init::c#2 mulf_init::c#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:9 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] -Uplifting [print_byte_at] best 41340 combination zp ZP_BYTE:9 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] +Uplifting [print_byte_at] best 41342 combination zp ZP_BYTE:9 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:92 [ mulf8s_prepared::$16 ] -Uplifting [mulf8s_prepared] best 41334 combination reg byte a [ mulf8s_prepared::$16 ] +Uplifting [mulf8s_prepared] best 41336 combination reg byte a [ mulf8s_prepared::$16 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ anim::angle#9 anim::angle#1 ] -Uplifting [anim] best 41334 combination zp ZP_BYTE:2 [ anim::angle#9 anim::angle#1 ] +Uplifting [anim] best 41336 combination zp ZP_BYTE:2 [ anim::angle#9 anim::angle#1 ] Coalescing zero page register [ zp ZP_WORD:7 [ print_word_at::at#2 ] ] with [ zp ZP_WORD:10 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] ] - score: 2 Coalescing zero page register [ zp ZP_WORD:16 [ mulf8s_prepared::m#4 mulf8s_prepared::m#5 mulf8s_prepared::m#1 mulf8s_prepared::m#0 mulf8s_prepared::m#2 ] ] with [ zp ZP_WORD:36 [ anim::$6 ] ] - score: 1 Coalescing zero page register [ zp ZP_WORD:16 [ mulf8s_prepared::m#4 mulf8s_prepared::m#5 mulf8s_prepared::m#1 mulf8s_prepared::m#0 mulf8s_prepared::m#2 anim::$6 ] ] with [ zp ZP_WORD:40 [ anim::$8 ] ] - score: 1 diff --git a/src/test/ref/screen-center-angle.log b/src/test/ref/screen-center-angle.log index 5f082b2e6..0b329456b 100644 --- a/src/test/ref/screen-center-angle.log +++ b/src/test/ref/screen-center-angle.log @@ -2960,9 +2960,11 @@ print_word_at: { clc adc #2 sta.z print_byte_at.at + bcc !+ lda.z at+1 adc #0 sta.z print_byte_at.at+1 + !: // [32] call print_byte_at // [34] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at] print_byte_at_from_b1: @@ -4060,47 +4062,47 @@ Uplift Scope [RADIX] Uplift Scope [clock_start] Uplift Scope [] -Uplifting [atan2_16] best 1159771 combination reg byte y [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ] zp ZP_WORD:29 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ] zp ZP_WORD:31 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ] zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] zp ZP_WORD:19 [ 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:21 [ 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 a [ atan2_16::$24 ] reg byte a [ atan2_16::$23 ] reg byte x [ atan2_16::i#2 atan2_16::i#1 ] zp ZP_WORD:76 [ atan2_16::return#2 ] zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] zp ZP_WORD:72 [ atan2_16::x#0 ] zp ZP_WORD:74 [ atan2_16::y#0 ] +Uplifting [atan2_16] best 1159773 combination reg byte y [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ] zp ZP_WORD:29 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ] zp ZP_WORD:31 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ] zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] zp ZP_WORD:19 [ 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:21 [ 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 a [ atan2_16::$24 ] reg byte a [ atan2_16::$23 ] reg byte x [ atan2_16::i#2 atan2_16::i#1 ] zp ZP_WORD:76 [ atan2_16::return#2 ] zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] zp ZP_WORD:72 [ atan2_16::x#0 ] zp ZP_WORD:74 [ atan2_16::y#0 ] Limited combination testing to 100 combinations of 144 possible. -Uplifting [init_font_hex] best 1140771 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp ZP_BYTE:88 [ init_font_hex::$0 ] zp ZP_BYTE:91 [ init_font_hex::idx#3 ] zp ZP_WORD:36 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp ZP_WORD:38 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp ZP_WORD:33 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ] +Uplifting [init_font_hex] best 1140773 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp ZP_BYTE:88 [ init_font_hex::$0 ] zp ZP_BYTE:91 [ init_font_hex::idx#3 ] zp ZP_WORD:36 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp ZP_WORD:38 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp ZP_WORD:33 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ] Limited combination testing to 100 combinations of 6912 possible. -Uplifting [init_angle_screen] best 1139171 combination zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$4 ] reg byte a [ init_angle_screen::$7 ] zp ZP_WORD:78 [ init_angle_screen::angle_w#0 ] zp ZP_WORD:80 [ init_angle_screen::$11 ] zp ZP_BYTE:83 [ init_angle_screen::$13 ] zp ZP_BYTE:84 [ init_angle_screen::$14 ] zp ZP_BYTE:85 [ init_angle_screen::$15 ] zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] zp ZP_WORD:70 [ init_angle_screen::yw#0 ] zp ZP_WORD:67 [ init_angle_screen::xw#0 ] zp ZP_BYTE:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] zp ZP_WORD:15 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#1 ] zp ZP_WORD:13 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#1 ] +Uplifting [init_angle_screen] best 1139173 combination zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$4 ] reg byte a [ init_angle_screen::$7 ] zp ZP_WORD:78 [ init_angle_screen::angle_w#0 ] zp ZP_WORD:80 [ init_angle_screen::$11 ] zp ZP_BYTE:83 [ init_angle_screen::$13 ] zp ZP_BYTE:84 [ init_angle_screen::$14 ] zp ZP_BYTE:85 [ init_angle_screen::$15 ] zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] zp ZP_WORD:70 [ init_angle_screen::yw#0 ] zp ZP_WORD:67 [ init_angle_screen::xw#0 ] zp ZP_BYTE:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] zp ZP_WORD:15 [ init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#1 ] zp ZP_WORD:13 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#1 ] Limited combination testing to 100 combinations of 65536 possible. -Uplifting [print_char_at] best 1139164 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] -Uplifting [print_byte_at] best 1139156 combination zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] -Uplifting [print_word_at] best 1139156 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] -Uplifting [main] best 1139156 combination zp ZP_DWORD:47 [ main::$4 ] zp ZP_DWORD:51 [ main::cyclecount#0 ] -Uplifting [clock] best 1139156 combination zp ZP_DWORD:43 [ clock::return#2 ] zp ZP_DWORD:61 [ clock::return#0 ] -Uplifting [print_dword_at] best 1139156 combination zp ZP_DWORD:55 [ print_dword_at::dw#0 ] -Uplifting [RADIX] best 1139156 combination -Uplifting [clock_start] best 1139156 combination -Uplifting [] best 1139156 combination +Uplifting [print_char_at] best 1139166 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] +Uplifting [print_byte_at] best 1139158 combination zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] +Uplifting [print_word_at] best 1139158 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] +Uplifting [main] best 1139158 combination zp ZP_DWORD:47 [ main::$4 ] zp ZP_DWORD:51 [ main::cyclecount#0 ] +Uplifting [clock] best 1139158 combination zp ZP_DWORD:43 [ clock::return#2 ] zp ZP_DWORD:61 [ clock::return#0 ] +Uplifting [print_dword_at] best 1139158 combination zp ZP_DWORD:55 [ print_dword_at::dw#0 ] +Uplifting [RADIX] best 1139158 combination +Uplifting [clock_start] best 1139158 combination +Uplifting [] best 1139158 combination Attempting to uplift remaining variables inzp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -Uplifting [init_font_hex] best 1139156 combination zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +Uplifting [init_font_hex] best 1139158 combination zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:88 [ init_font_hex::$0 ] -Uplifting [init_font_hex] best 1139156 combination zp ZP_BYTE:88 [ init_font_hex::$0 ] +Uplifting [init_font_hex] best 1139158 combination zp ZP_BYTE:88 [ init_font_hex::$0 ] Attempting to uplift remaining variables inzp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] -Uplifting [init_angle_screen] best 1139156 combination zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] +Uplifting [init_angle_screen] best 1139158 combination zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:83 [ init_angle_screen::$13 ] -Uplifting [init_angle_screen] best 1138556 combination reg byte a [ init_angle_screen::$13 ] +Uplifting [init_angle_screen] best 1138558 combination reg byte a [ init_angle_screen::$13 ] Attempting to uplift remaining variables inzp ZP_BYTE:84 [ init_angle_screen::$14 ] -Uplifting [init_angle_screen] best 1138156 combination reg byte a [ init_angle_screen::$14 ] +Uplifting [init_angle_screen] best 1138158 combination reg byte a [ init_angle_screen::$14 ] Attempting to uplift remaining variables inzp ZP_BYTE:85 [ init_angle_screen::$15 ] -Uplifting [init_angle_screen] best 1137556 combination reg byte a [ init_angle_screen::$15 ] +Uplifting [init_angle_screen] best 1137558 combination reg byte a [ init_angle_screen::$15 ] Attempting to uplift remaining variables inzp ZP_BYTE:91 [ init_font_hex::idx#3 ] -Uplifting [init_font_hex] best 1136956 combination reg byte y [ init_font_hex::idx#3 ] +Uplifting [init_font_hex] best 1136958 combination reg byte y [ init_font_hex::idx#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] -Uplifting [init_font_hex] best 1136956 combination zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Uplifting [init_font_hex] best 1136958 combination zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] -Uplifting [init_angle_screen] best 1136956 combination zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] +Uplifting [init_angle_screen] best 1136958 combination zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] -Uplifting [init_angle_screen] best 1136956 combination zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] +Uplifting [init_angle_screen] best 1136958 combination zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] -Uplifting [init_angle_screen] best 1136956 combination zp ZP_BYTE:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] +Uplifting [init_angle_screen] best 1136958 combination zp ZP_BYTE:12 [ init_angle_screen::y#5 init_angle_screen::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ] -Uplifting [init_font_hex] best 1136956 combination zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ] +Uplifting [init_font_hex] best 1136958 combination zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] -Uplifting [print_byte_at] best 1136956 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] +Uplifting [print_byte_at] best 1136958 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] Coalescing zero page register [ zp ZP_WORD:4 [ print_word_at::at#2 ] ] with [ zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] ] - score: 2 Coalescing zero page register [ zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] ] with [ zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] ] - score: 1 Coalescing zero page register [ zp ZP_DWORD:43 [ clock::return#2 ] ] with [ zp ZP_DWORD:47 [ main::$4 ] ] - score: 1 diff --git a/src/test/ref/screen-center-distance.log b/src/test/ref/screen-center-distance.log index c07098924..a1f2b3438 100644 --- a/src/test/ref/screen-center-distance.log +++ b/src/test/ref/screen-center-distance.log @@ -3456,9 +3456,11 @@ print_word_at: { clc adc #2 sta.z print_byte_at.at + bcc !+ lda.z at+1 adc #0 sta.z print_byte_at.at+1 + !: // [32] call print_byte_at // [34] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at] print_byte_at_from_b1: @@ -4665,46 +4667,46 @@ Uplift Scope [RADIX] Uplift Scope [clock_start] Uplift Scope [] -Uplifting [bsearch16u] best 263251 combination reg byte x [ bsearch16u::num#5 bsearch16u::num#1 bsearch16u::num#3 bsearch16u::num#0 ] zp ZP_WORD:23 [ bsearch16u::return#1 bsearch16u::return#6 bsearch16u::return#2 bsearch16u::items#2 bsearch16u::items#8 bsearch16u::$2 bsearch16u::items#0 ] reg byte a [ bsearch16u::$6 ] reg byte a [ bsearch16u::$16 ] zp ZP_WORD:95 [ bsearch16u::result#0 ] zp ZP_WORD:93 [ bsearch16u::pivot#0 ] zp ZP_WORD:82 [ bsearch16u::return#3 ] zp ZP_WORD:80 [ bsearch16u::key#0 ] -Uplifting [init_font_hex] best 244251 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp ZP_BYTE:41 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp ZP_BYTE:102 [ init_font_hex::$0 ] zp ZP_BYTE:105 [ init_font_hex::idx#3 ] zp ZP_WORD:35 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp ZP_BYTE:39 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp ZP_WORD:37 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp ZP_WORD:32 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp ZP_BYTE:34 [ init_font_hex::c#6 init_font_hex::c#1 ] +Uplifting [bsearch16u] best 263253 combination reg byte x [ bsearch16u::num#5 bsearch16u::num#1 bsearch16u::num#3 bsearch16u::num#0 ] zp ZP_WORD:23 [ bsearch16u::return#1 bsearch16u::return#6 bsearch16u::return#2 bsearch16u::items#2 bsearch16u::items#8 bsearch16u::$2 bsearch16u::items#0 ] reg byte a [ bsearch16u::$6 ] reg byte a [ bsearch16u::$16 ] zp ZP_WORD:95 [ bsearch16u::result#0 ] zp ZP_WORD:93 [ bsearch16u::pivot#0 ] zp ZP_WORD:82 [ bsearch16u::return#3 ] zp ZP_WORD:80 [ bsearch16u::key#0 ] +Uplifting [init_font_hex] best 244253 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp ZP_BYTE:41 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp ZP_BYTE:102 [ init_font_hex::$0 ] zp ZP_BYTE:105 [ init_font_hex::idx#3 ] zp ZP_WORD:35 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp ZP_BYTE:39 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp ZP_WORD:37 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp ZP_WORD:32 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp ZP_BYTE:34 [ init_font_hex::c#6 init_font_hex::c#1 ] Limited combination testing to 100 combinations of 6912 possible. -Uplifting [init_dist_screen] best 241051 combination reg byte a [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] zp ZP_BYTE:21 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] reg byte a [ init_dist_screen::x2#0 ] zp ZP_WORD:72 [ init_dist_screen::xds#0 ] zp ZP_WORD:74 [ init_dist_screen::ds#0 ] zp ZP_BYTE:20 [ init_dist_screen::x#2 init_dist_screen::x#1 ] reg byte a [ init_dist_screen::d#0 ] zp ZP_BYTE:19 [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] zp ZP_BYTE:64 [ init_dist_screen::y2#0 ] zp ZP_BYTE:14 [ init_dist_screen::y#10 init_dist_screen::y#1 ] zp ZP_WORD:17 [ init_dist_screen::screen_bottomline#11 init_dist_screen::screen_bottomline#1 ] zp ZP_WORD:15 [ init_dist_screen::screen_topline#11 init_dist_screen::screen_topline#1 ] zp ZP_WORD:67 [ init_dist_screen::yds#0 ] +Uplifting [init_dist_screen] best 241053 combination reg byte a [ init_dist_screen::xd#0 init_dist_screen::$16 init_dist_screen::$14 ] zp ZP_BYTE:21 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] reg byte a [ init_dist_screen::x2#0 ] zp ZP_WORD:72 [ init_dist_screen::xds#0 ] zp ZP_WORD:74 [ init_dist_screen::ds#0 ] zp ZP_BYTE:20 [ init_dist_screen::x#2 init_dist_screen::x#1 ] reg byte a [ init_dist_screen::d#0 ] zp ZP_BYTE:19 [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] zp ZP_BYTE:64 [ init_dist_screen::y2#0 ] zp ZP_BYTE:14 [ init_dist_screen::y#10 init_dist_screen::y#1 ] zp ZP_WORD:17 [ init_dist_screen::screen_bottomline#11 init_dist_screen::screen_bottomline#1 ] zp ZP_WORD:15 [ init_dist_screen::screen_topline#11 init_dist_screen::screen_topline#1 ] zp ZP_WORD:67 [ init_dist_screen::yds#0 ] Limited combination testing to 100 combinations of 6144 possible. -Uplifting [sqr] best 240714 combination reg byte a [ sqr::val#2 sqr::val#1 sqr::val#0 ] zp ZP_WORD:70 [ sqr::return#3 ] zp ZP_WORD:98 [ sqr::return#0 ] zp ZP_WORD:65 [ sqr::return#2 ] reg byte a [ sqr::$0 ] -Uplifting [sqrt] best 239811 combination reg byte a [ sqrt::return#2 ] zp ZP_WORD:76 [ sqrt::val#0 ] reg byte a [ sqrt::return#0 ] zp ZP_WORD:84 [ sqrt::found#0 ] zp ZP_WORD:86 [ sqrt::$3 ] zp ZP_WORD:88 [ sqrt::$1 ] -Uplifting [init_squares] best 239611 combination reg byte x [ init_squares::i#2 init_squares::i#1 ] reg byte a [ init_squares::$3 ] reg byte a [ init_squares::$4 ] zp ZP_WORD:29 [ init_squares::squares#2 init_squares::squares#1 ] zp ZP_WORD:27 [ init_squares::sqr#2 init_squares::sqr#1 ] -Uplifting [print_char_at] best 239604 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:12 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] -Uplifting [print_byte_at] best 239596 combination zp ZP_WORD:9 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] -Uplifting [print_word_at] best 239596 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] -Uplifting [main] best 239596 combination zp ZP_DWORD:46 [ main::$4 ] zp ZP_DWORD:50 [ main::cyclecount#0 ] -Uplifting [clock] best 239596 combination zp ZP_DWORD:42 [ clock::return#2 ] zp ZP_DWORD:60 [ clock::return#0 ] -Uplifting [print_dword_at] best 239596 combination zp ZP_DWORD:54 [ print_dword_at::dw#0 ] -Uplifting [malloc] best 239596 combination -Uplifting [RADIX] best 239596 combination -Uplifting [clock_start] best 239596 combination -Uplifting [] best 239596 combination +Uplifting [sqr] best 240716 combination reg byte a [ sqr::val#2 sqr::val#1 sqr::val#0 ] zp ZP_WORD:70 [ sqr::return#3 ] zp ZP_WORD:98 [ sqr::return#0 ] zp ZP_WORD:65 [ sqr::return#2 ] reg byte a [ sqr::$0 ] +Uplifting [sqrt] best 239813 combination reg byte a [ sqrt::return#2 ] zp ZP_WORD:76 [ sqrt::val#0 ] reg byte a [ sqrt::return#0 ] zp ZP_WORD:84 [ sqrt::found#0 ] zp ZP_WORD:86 [ sqrt::$3 ] zp ZP_WORD:88 [ sqrt::$1 ] +Uplifting [init_squares] best 239613 combination reg byte x [ init_squares::i#2 init_squares::i#1 ] reg byte a [ init_squares::$3 ] reg byte a [ init_squares::$4 ] zp ZP_WORD:29 [ init_squares::squares#2 init_squares::squares#1 ] zp ZP_WORD:27 [ init_squares::sqr#2 init_squares::sqr#1 ] +Uplifting [print_char_at] best 239606 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:12 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] +Uplifting [print_byte_at] best 239598 combination zp ZP_WORD:9 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] +Uplifting [print_word_at] best 239598 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ] +Uplifting [main] best 239598 combination zp ZP_DWORD:46 [ main::$4 ] zp ZP_DWORD:50 [ main::cyclecount#0 ] +Uplifting [clock] best 239598 combination zp ZP_DWORD:42 [ clock::return#2 ] zp ZP_DWORD:60 [ clock::return#0 ] +Uplifting [print_dword_at] best 239598 combination zp ZP_DWORD:54 [ print_dword_at::dw#0 ] +Uplifting [malloc] best 239598 combination +Uplifting [RADIX] best 239598 combination +Uplifting [clock_start] best 239598 combination +Uplifting [] best 239598 combination Attempting to uplift remaining variables inzp ZP_BYTE:41 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -Uplifting [init_font_hex] best 239596 combination zp ZP_BYTE:41 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +Uplifting [init_font_hex] best 239598 combination zp ZP_BYTE:41 [ init_font_hex::idx#5 init_font_hex::idx#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:102 [ init_font_hex::$0 ] -Uplifting [init_font_hex] best 239596 combination zp ZP_BYTE:102 [ init_font_hex::$0 ] +Uplifting [init_font_hex] best 239598 combination zp ZP_BYTE:102 [ init_font_hex::$0 ] Attempting to uplift remaining variables inzp ZP_BYTE:21 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] -Uplifting [init_dist_screen] best 239596 combination zp ZP_BYTE:21 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] +Uplifting [init_dist_screen] best 239598 combination zp ZP_BYTE:21 [ init_dist_screen::xb#2 init_dist_screen::xb#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:105 [ init_font_hex::idx#3 ] -Uplifting [init_font_hex] best 238996 combination reg byte y [ init_font_hex::idx#3 ] +Uplifting [init_font_hex] best 238998 combination reg byte y [ init_font_hex::idx#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:39 [ init_font_hex::c1#4 init_font_hex::c1#1 ] -Uplifting [init_font_hex] best 238996 combination zp ZP_BYTE:39 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Uplifting [init_font_hex] best 238998 combination zp ZP_BYTE:39 [ init_font_hex::c1#4 init_font_hex::c1#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:20 [ init_dist_screen::x#2 init_dist_screen::x#1 ] -Uplifting [init_dist_screen] best 238996 combination zp ZP_BYTE:20 [ init_dist_screen::x#2 init_dist_screen::x#1 ] +Uplifting [init_dist_screen] best 238998 combination zp ZP_BYTE:20 [ init_dist_screen::x#2 init_dist_screen::x#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:19 [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] -Uplifting [init_dist_screen] best 238926 combination reg byte a [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] +Uplifting [init_dist_screen] best 238928 combination reg byte a [ init_dist_screen::yd#0 init_dist_screen::$7 init_dist_screen::$5 ] Attempting to uplift remaining variables inzp ZP_BYTE:64 [ init_dist_screen::y2#0 ] -Uplifting [init_dist_screen] best 238826 combination reg byte a [ init_dist_screen::y2#0 ] +Uplifting [init_dist_screen] best 238828 combination reg byte a [ init_dist_screen::y2#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:34 [ init_font_hex::c#6 init_font_hex::c#1 ] -Uplifting [init_font_hex] best 238826 combination zp ZP_BYTE:34 [ init_font_hex::c#6 init_font_hex::c#1 ] +Uplifting [init_font_hex] best 238828 combination zp ZP_BYTE:34 [ init_font_hex::c#6 init_font_hex::c#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:14 [ init_dist_screen::y#10 init_dist_screen::y#1 ] -Uplifting [init_dist_screen] best 238826 combination zp ZP_BYTE:14 [ init_dist_screen::y#10 init_dist_screen::y#1 ] +Uplifting [init_dist_screen] best 238828 combination zp ZP_BYTE:14 [ init_dist_screen::y#10 init_dist_screen::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] -Uplifting [print_byte_at] best 238826 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] +Uplifting [print_byte_at] best 238828 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] Coalescing zero page register [ zp ZP_WORD:4 [ print_word_at::at#2 ] ] with [ zp ZP_WORD:9 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] ] - score: 2 Coalescing zero page register [ zp ZP_WORD:23 [ bsearch16u::return#1 bsearch16u::return#6 bsearch16u::return#2 bsearch16u::items#2 bsearch16u::items#8 bsearch16u::$2 bsearch16u::items#0 ] ] with [ zp ZP_WORD:82 [ bsearch16u::return#3 ] ] - score: 1 Coalescing zero page register [ zp ZP_DWORD:42 [ clock::return#2 ] ] with [ zp ZP_DWORD:46 [ main::$4 ] ] - score: 1