diff --git a/src/main/kc/stdlib/bitmap2.kc b/src/main/kc/stdlib/bitmap2.kc index 36726a6b8..77c28e262 100644 --- a/src/main/kc/stdlib/bitmap2.kc +++ b/src/main/kc/stdlib/bitmap2.kc @@ -1,4 +1,4 @@ -// Simple Singlecolor Bitmap Routines +// Simple single-color (320x200) bitmap routines import "string" // The adddress of the bitmap screen (used for colors) @@ -48,3 +48,59 @@ void bitmap_plot(word x, byte y) { plotter += ( x & $fff8 ); *plotter |= bitmap_plot_bit[ dy) { + // X is the driver + word e = dy/2; + do { + bitmap_plot(x,(byte)y); + x += sx; + e += dy; + if(dx < e) { + y += sy; + e -= dx; + } + } while (x != x2); + } else { + // Y is the driver + word e = dx/2; + do { + bitmap_plot(x,(byte)y); + y += sy; + e += dx; + if(dyw&0x80) { + return -w; + } else { + return w; + } +} + +// Get the sign of a 16-bit unsigned number treated as a signed number. +// Returns unsigned -1 if the number is +word sgn_u16(word w) { + if(>w&0x80) { + return 0xffff; + } else { + return 1; + } +} + diff --git a/src/main/script/kickc.sh b/src/main/script/kickc.sh index 7ff62b9cc..2a92082f8 100755 --- a/src/main/script/kickc.sh +++ b/src/main/script/kickc.sh @@ -19,5 +19,5 @@ while [[ "$#" -gt 0 ]]; do case $1 in *) export PARAM="$PARAM $1"; shift;; esac; done -echo java -jar $KICKC_JAR -I $KICKC_STDLIB_HOME -F $KICKC_FRAGMENT_HOME $PARAM -java -jar $KICKC_JAR -I $KICKC_STDLIB_HOME -F $KICKC_FRAGMENT_HOME $PARAM \ No newline at end of file +echo java -jar $KICKC_JAR -F $KICKC_FRAGMENT_HOME $PARAM -I $KICKC_STDLIB_HOME +java -jar $KICKC_JAR -F $KICKC_FRAGMENT_HOME $PARAM -I $KICKC_STDLIB_HOME \ 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 70f007ac7..6954db2b0 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -136,6 +136,11 @@ public class TestPrograms { compileAndCompare("memcpy-0"); } + @Test + public void testBitmapPlot3() throws IOException, URISyntaxException { + compileAndCompare("bitmap-plot-3"); + } + @Test public void testBitmapPlot2() throws IOException, URISyntaxException { compileAndCompare("bitmap-plot-2"); diff --git a/src/test/kc/bitmap-plot-3.kc b/src/test/kc/bitmap-plot-3.kc new file mode 100644 index 000000000..7ec672f13 --- /dev/null +++ b/src/test/kc/bitmap-plot-3.kc @@ -0,0 +1,23 @@ +// Tests the simple bitmap plotter +// Plots a few lines using the bresenham line algorithm +import "c64" +import "bitmap2" +import "print" + +byte* BITMAP = 0x2000; +byte* SCREEN = 0x0400; + +byte[0x180] align(0x100) SINTAB = kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }}; +byte* COSTAB = SINTAB+0x40; + +void main() { + bitmap_init(BITMAP, SCREEN); + bitmap_clear(BLACK, WHITE); + *D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3; + *D018 = toD018(SCREEN, BITMAP); + for( byte i=0, a=0; i!=8; i++, a+=32) { + bitmap_line( (word)COSTAB[a]+120, (word)SINTAB[a], (word)COSTAB[a+32]+120, (word)SINTAB[a+32]); + } + while(true) + (*(SCREEN+999))++; +} diff --git a/src/test/ref/bitmap-plot-0.log b/src/test/ref/bitmap-plot-0.log index b1f7b3cfe..bfe92f66a 100644 --- a/src/test/ref/bitmap-plot-0.log +++ b/src/test/ref/bitmap-plot-0.log @@ -2,6 +2,8 @@ Resolved forward reference frame_cnt to (byte) frame_cnt Resolved forward reference frame_cnt to (byte) frame_cnt Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq() Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Warning! Adding boolean cast to non-boolean condition (number~) abs_u16::$1 +Warning! Adding boolean cast to non-boolean condition (number~) sgn_u16::$1 Warning! Adding boolean cast to non-boolean sub-expression (byte) frame_cnt Identified constant variable (byte*) BITMAP Identified constant variable (byte*) SCREEN @@ -18,12 +20,15 @@ Culled Empty Block (label) @7 Culled Empty Block (label) bitmap_init::@8 Culled Empty Block (label) @9 Culled Empty Block (label) @10 +Culled Empty Block (label) @11 +Culled Empty Block (label) @12 +Culled Empty Block (label) @13 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::@6 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@10 -Culled Empty Block (label) @13 +Culled Empty Block (label) @16 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -82,7 +87,7 @@ memset::@return: scope:[memset] from memset::@2 (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } - to:@11 + to:@14 bitmap_init: scope:[bitmap_init] from main (byte*) bitmap_init::screen#1 ← phi( main/(byte*) bitmap_init::screen#0 ) (byte*) bitmap_init::gfx#1 ← phi( main/(byte*) bitmap_init::gfx#0 ) @@ -207,17 +212,17 @@ bitmap_plot: scope:[bitmap_plot] from main::@2 bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot return to:@return -@11: scope:[] from @8 +@14: scope:[] from @8 (byte*) bitmap_screen#24 ← phi( @8/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#25 ← phi( @8/(byte*) bitmap_gfx#0 ) (byte*) BITMAP#0 ← ((byte*)) (number) $2000 (byte*) SCREEN#0 ← ((byte*)) (number) $400 (byte[$100]) plots_per_frame#0 ← { fill( $100, 0) } - to:@12 -main: scope:[main] from @14 - (byte) frame_cnt#21 ← phi( @14/(byte) frame_cnt#9 ) - (byte*) bitmap_screen#12 ← phi( @14/(byte*) bitmap_screen#14 ) - (byte*) bitmap_gfx#13 ← phi( @14/(byte*) bitmap_gfx#15 ) + to:@15 +main: scope:[main] from @17 + (byte) frame_cnt#21 ← phi( @17/(byte) frame_cnt#9 ) + (byte*) bitmap_screen#12 ← phi( @17/(byte*) bitmap_screen#14 ) + (byte*) bitmap_gfx#13 ← phi( @17/(byte*) bitmap_gfx#15 ) (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 call bitmap_init @@ -376,11 +381,11 @@ main::@return: scope:[main] from main::@1 (byte*) bitmap_screen#4 ← (byte*) bitmap_screen#9 return to:@return -@12: scope:[] from @11 - (byte*) bitmap_screen#19 ← phi( @11/(byte*) bitmap_screen#24 ) - (byte*) bitmap_gfx#20 ← phi( @11/(byte*) bitmap_gfx#25 ) +@15: scope:[] from @14 + (byte*) bitmap_screen#19 ← phi( @14/(byte*) bitmap_screen#24 ) + (byte*) bitmap_gfx#20 ← phi( @14/(byte*) bitmap_gfx#25 ) (byte) frame_cnt#0 ← (number) 1 - to:@14 + to:@17 init_irq: scope:[init_irq] from main::@11 asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 @@ -397,7 +402,7 @@ init_irq::@return: scope:[init_irq] from init_irq return to:@return irq: scope:[irq] from - (byte) frame_cnt#4 ← phi( @14/(byte) frame_cnt#9 ) + (byte) frame_cnt#4 ← phi( @17/(byte) frame_cnt#9 ) *((byte*) BGCOL#0) ← (byte) WHITE#0 (bool~) irq::$1 ← (number) 0 != (byte) frame_cnt#4 (bool~) irq::$0 ← ! (bool~) irq::$1 @@ -417,25 +422,25 @@ irq::@return: scope:[irq] from irq::@1 (byte) frame_cnt#2 ← (byte) frame_cnt#6 return to:@return -@14: scope:[] from @12 - (byte*) bitmap_screen#14 ← phi( @12/(byte*) bitmap_screen#19 ) - (byte*) bitmap_gfx#15 ← phi( @12/(byte*) bitmap_gfx#20 ) - (byte) frame_cnt#9 ← phi( @12/(byte) frame_cnt#0 ) +@17: scope:[] from @15 + (byte*) bitmap_screen#14 ← phi( @15/(byte*) bitmap_screen#19 ) + (byte*) bitmap_gfx#15 ← phi( @15/(byte*) bitmap_gfx#20 ) + (byte) frame_cnt#9 ← phi( @15/(byte) frame_cnt#0 ) call main - to:@15 -@15: scope:[] from @14 - (byte*) bitmap_screen#10 ← phi( @14/(byte*) bitmap_screen#4 ) - (byte*) bitmap_gfx#10 ← phi( @14/(byte*) bitmap_gfx#4 ) + to:@18 +@18: scope:[] from @17 + (byte*) bitmap_screen#10 ← phi( @17/(byte*) bitmap_screen#4 ) + (byte*) bitmap_gfx#10 ← phi( @17/(byte*) bitmap_gfx#4 ) (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 to:@end -@end: scope:[] from @15 +@end: scope:[] from @18 SYMBOL TABLE SSA -(label) @11 -(label) @12 (label) @14 (label) @15 +(label) @17 +(label) @18 (label) @8 (label) @begin (label) @end @@ -1332,9 +1337,9 @@ Added new block during phi lifting main::@19(between main::@17 and main::@5) Added new block during phi lifting irq::@3(between irq and irq::@1) Adding NOP phi() at start of @begin Adding NOP phi() at start of @8 -Adding NOP phi() at start of @11 Adding NOP phi() at start of @14 -Adding NOP phi() at start of @15 +Adding NOP phi() at start of @17 +Adding NOP phi() at start of @18 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@12 @@ -1374,8 +1379,8 @@ Coalesced [106] frame_cnt#23 ← frame_cnt#1 Coalesced [111] frame_cnt#22 ← frame_cnt#0 Coalesced down to 13 phi equivalence classes Culled Empty Block (label) @8 -Culled Empty Block (label) @11 -Culled Empty Block (label) @15 +Culled Empty Block (label) @14 +Culled Empty Block (label) @18 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@14 Culled Empty Block (label) main::@19 @@ -1389,8 +1394,8 @@ Culled Empty Block (label) bitmap_init::@11 Culled Empty Block (label) bitmap_init::@12 Culled Empty Block (label) bitmap_init::@9 Culled Empty Block (label) irq::@3 -Renumbering block @12 to @1 -Renumbering block @14 to @2 +Renumbering block @15 to @1 +Renumbering block @17 to @2 Renumbering block bitmap_init::@5 to bitmap_init::@3 Renumbering block bitmap_init::@6 to bitmap_init::@4 Renumbering block bitmap_init::@7 to bitmap_init::@5 diff --git a/src/test/ref/bitmap-plot-1.log b/src/test/ref/bitmap-plot-1.log index 70c2a4367..8b6824d51 100644 --- a/src/test/ref/bitmap-plot-1.log +++ b/src/test/ref/bitmap-plot-1.log @@ -6,6 +6,8 @@ Fixing pointer increment (signed word*) sin16s_gen2::sintab ← ++ (signed word* Fixing pointer array-indexing *((signed word[$200]) SINUS + (word) main::idx_x) Fixing pointer array-indexing *((signed word[$200]) SINUS + (word) main::idx_y) Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Warning! Adding boolean cast to non-boolean condition (number~) abs_u16::$1 +Warning! Adding boolean cast to non-boolean condition (number~) sgn_u16::$1 Warning! Adding boolean cast to non-boolean sub-expression (byte) frame_cnt Identified constant variable (byte*) BITMAP Identified constant variable (byte*) SCREEN @@ -50,12 +52,15 @@ Culled Empty Block (label) @27 Culled Empty Block (label) bitmap_init::@8 Culled Empty Block (label) @29 Culled Empty Block (label) @30 +Culled Empty Block (label) @31 +Culled Empty Block (label) @32 +Culled Empty Block (label) @33 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::@6 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@7 Culled Empty Block (label) main::@10 -Culled Empty Block (label) @33 +Culled Empty Block (label) @36 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -576,7 +581,7 @@ memset::@return: scope:[memset] from memset::@2 (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } - to:@31 + to:@34 bitmap_init: scope:[bitmap_init] from main::@12 (byte*) bitmap_init::screen#1 ← phi( main::@12/(byte*) bitmap_init::screen#0 ) (byte*) bitmap_init::gfx#1 ← phi( main::@12/(byte*) bitmap_init::gfx#0 ) @@ -701,7 +706,7 @@ bitmap_plot: scope:[bitmap_plot] from main::@17 bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot return to:@return -@31: scope:[] from @28 +@34: scope:[] from @28 (byte*) bitmap_screen#25 ← phi( @28/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#26 ← phi( @28/(byte*) bitmap_gfx#0 ) (word) rem16u#34 ← phi( @28/(word) rem16u#35 ) @@ -709,12 +714,12 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot (byte*) SCREEN#0 ← ((byte*)) (number) $400 (byte[$100]) plots_per_frame#0 ← { fill( $100, 0) } (signed word[$200]) SINUS#0 ← { fill( $200, 0) } - to:@32 -main: scope:[main] from @34 - (byte) frame_cnt#24 ← phi( @34/(byte) frame_cnt#9 ) - (byte*) bitmap_screen#17 ← phi( @34/(byte*) bitmap_screen#14 ) - (byte*) bitmap_gfx#18 ← phi( @34/(byte*) bitmap_gfx#15 ) - (word) rem16u#23 ← phi( @34/(word) rem16u#25 ) + to:@35 +main: scope:[main] from @37 + (byte) frame_cnt#24 ← phi( @37/(byte) frame_cnt#9 ) + (byte*) bitmap_screen#17 ← phi( @37/(byte*) bitmap_screen#14 ) + (byte*) bitmap_gfx#18 ← phi( @37/(byte*) bitmap_gfx#15 ) + (word) rem16u#23 ← phi( @37/(word) rem16u#25 ) (signed word*) sin16s_gen2::sintab#1 ← (signed word[$200]) SINUS#0 (word) sin16s_gen2::wavelength#0 ← (number) $200 (signed word) sin16s_gen2::min#0 ← (number) -$1001 @@ -922,12 +927,12 @@ main::@return: scope:[main] from main::@1 (byte*) bitmap_screen#4 ← (byte*) bitmap_screen#9 return to:@return -@32: scope:[] from @31 - (byte*) bitmap_screen#20 ← phi( @31/(byte*) bitmap_screen#25 ) - (byte*) bitmap_gfx#21 ← phi( @31/(byte*) bitmap_gfx#26 ) - (word) rem16u#29 ← phi( @31/(word) rem16u#34 ) +@35: scope:[] from @34 + (byte*) bitmap_screen#20 ← phi( @34/(byte*) bitmap_screen#25 ) + (byte*) bitmap_gfx#21 ← phi( @34/(byte*) bitmap_gfx#26 ) + (word) rem16u#29 ← phi( @34/(word) rem16u#34 ) (byte) frame_cnt#0 ← (number) 1 - to:@34 + to:@37 init_irq: scope:[init_irq] from main::@11 asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 @@ -944,7 +949,7 @@ init_irq::@return: scope:[init_irq] from init_irq return to:@return irq: scope:[irq] from - (byte) frame_cnt#4 ← phi( @34/(byte) frame_cnt#9 ) + (byte) frame_cnt#4 ← phi( @37/(byte) frame_cnt#9 ) *((byte*) BGCOL#0) ← (byte) WHITE#0 (bool~) irq::$1 ← (number) 0 != (byte) frame_cnt#4 (bool~) irq::$0 ← ! (bool~) irq::$1 @@ -964,30 +969,30 @@ irq::@return: scope:[irq] from irq::@1 (byte) frame_cnt#2 ← (byte) frame_cnt#6 return to:@return -@34: scope:[] from @32 - (byte*) bitmap_screen#14 ← phi( @32/(byte*) bitmap_screen#20 ) - (byte*) bitmap_gfx#15 ← phi( @32/(byte*) bitmap_gfx#21 ) - (word) rem16u#25 ← phi( @32/(word) rem16u#29 ) - (byte) frame_cnt#9 ← phi( @32/(byte) frame_cnt#0 ) +@37: scope:[] from @35 + (byte*) bitmap_screen#14 ← phi( @35/(byte*) bitmap_screen#20 ) + (byte*) bitmap_gfx#15 ← phi( @35/(byte*) bitmap_gfx#21 ) + (word) rem16u#25 ← phi( @35/(word) rem16u#29 ) + (byte) frame_cnt#9 ← phi( @35/(byte) frame_cnt#0 ) call main - to:@35 -@35: scope:[] from @34 - (byte*) bitmap_screen#10 ← phi( @34/(byte*) bitmap_screen#4 ) - (byte*) bitmap_gfx#10 ← phi( @34/(byte*) bitmap_gfx#4 ) - (word) rem16u#19 ← phi( @34/(word) rem16u#9 ) + to:@38 +@38: scope:[] from @37 + (byte*) bitmap_screen#10 ← phi( @37/(byte*) bitmap_screen#4 ) + (byte*) bitmap_gfx#10 ← phi( @37/(byte*) bitmap_gfx#4 ) + (word) rem16u#19 ← phi( @37/(word) rem16u#9 ) (word) rem16u#10 ← (word) rem16u#19 (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 to:@end -@end: scope:[] from @35 +@end: scope:[] from @38 SYMBOL TABLE SSA (label) @17 (label) @28 -(label) @31 -(label) @32 (label) @34 (label) @35 +(label) @37 +(label) @38 (label) @6 (label) @begin (label) @end @@ -2808,9 +2813,9 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @6 Adding NOP phi() at start of @17 Adding NOP phi() at start of @28 -Adding NOP phi() at start of @31 Adding NOP phi() at start of @34 -Adding NOP phi() at start of @35 +Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@12 @@ -2907,8 +2912,8 @@ Coalesced down to 30 phi equivalence classes Culled Empty Block (label) @6 Culled Empty Block (label) @17 Culled Empty Block (label) @28 -Culled Empty Block (label) @31 -Culled Empty Block (label) @35 +Culled Empty Block (label) @34 +Culled Empty Block (label) @38 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@15 Culled Empty Block (label) main::@8 @@ -2932,8 +2937,8 @@ Culled Empty Block (label) divr16u::@8 Culled Empty Block (label) divr16u::@10 Culled Empty Block (label) divr16u::@9 Culled Empty Block (label) irq::@3 -Renumbering block @32 to @1 -Renumbering block @34 to @2 +Renumbering block @35 to @1 +Renumbering block @37 to @2 Renumbering block div32u16u::@2 to div32u16u::@1 Renumbering block div32u16u::@3 to div32u16u::@2 Renumbering block mul16u::@4 to mul16u::@3 diff --git a/src/test/ref/bitmap-plot-2.log b/src/test/ref/bitmap-plot-2.log index 76f04e727..62c923f89 100644 --- a/src/test/ref/bitmap-plot-2.log +++ b/src/test/ref/bitmap-plot-2.log @@ -6,6 +6,8 @@ Fixing pointer increment (signed word*) sin16s_gen2::sintab ← ++ (signed word* Fixing pointer array-indexing *((signed word[$200]) SINUS + (word) main::idx_x) Fixing pointer array-indexing *((signed word[$200]) SINUS + (word) main::idx_y) Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Warning! Adding boolean cast to non-boolean condition (number~) abs_u16::$1 +Warning! Adding boolean cast to non-boolean condition (number~) sgn_u16::$1 Warning! Adding boolean cast to non-boolean sub-expression (byte) frame_cnt Identified constant variable (byte*) BITMAP Identified constant variable (byte*) SCREEN @@ -50,6 +52,9 @@ Culled Empty Block (label) @27 Culled Empty Block (label) bitmap_init::@8 Culled Empty Block (label) @29 Culled Empty Block (label) @30 +Culled Empty Block (label) @31 +Culled Empty Block (label) @32 +Culled Empty Block (label) @33 Culled Empty Block (label) main::toD0181_@1 Culled Empty Block (label) main::@9 Culled Empty Block (label) main::@3 @@ -63,7 +68,7 @@ Culled Empty Block (label) main::@20 Culled Empty Block (label) main::@19 Culled Empty Block (label) main::@21 Culled Empty Block (label) main::@22 -Culled Empty Block (label) @33 +Culled Empty Block (label) @36 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -585,7 +590,7 @@ memset::@return: scope:[memset] from memset::@2 (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } - to:@31 + to:@34 bitmap_init: scope:[bitmap_init] from main::@24 (byte*) bitmap_init::screen#1 ← phi( main::@24/(byte*) bitmap_init::screen#0 ) (byte*) bitmap_init::gfx#1 ← phi( main::@24/(byte*) bitmap_init::gfx#0 ) @@ -710,7 +715,7 @@ bitmap_plot: scope:[bitmap_plot] from main::@29 bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot return to:@return -@31: scope:[] from @28 +@34: scope:[] from @28 (byte*) bitmap_screen#26 ← phi( @28/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#27 ← phi( @28/(byte*) bitmap_gfx#0 ) (word) rem16u#35 ← phi( @28/(word) rem16u#36 ) @@ -718,12 +723,12 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot (byte*) SCREEN#0 ← ((byte*)) (number) $400 (byte[$100]) plots_per_frame#0 ← { fill( $100, 0) } (signed word[$200]) SINUS#0 ← { fill( $200, 0) } - to:@32 -main: scope:[main] from @34 - (byte) frame_cnt#26 ← phi( @34/(byte) frame_cnt#8 ) - (byte*) bitmap_screen#17 ← phi( @34/(byte*) bitmap_screen#14 ) - (byte*) bitmap_gfx#18 ← phi( @34/(byte*) bitmap_gfx#15 ) - (word) rem16u#23 ← phi( @34/(word) rem16u#25 ) + to:@35 +main: scope:[main] from @37 + (byte) frame_cnt#26 ← phi( @37/(byte) frame_cnt#8 ) + (byte*) bitmap_screen#17 ← phi( @37/(byte*) bitmap_screen#14 ) + (byte*) bitmap_gfx#18 ← phi( @37/(byte*) bitmap_gfx#15 ) + (word) rem16u#23 ← phi( @37/(word) rem16u#25 ) (signed word*) sin16s_gen2::sintab#1 ← (signed word[$200]) SINUS#0 (word) sin16s_gen2::wavelength#0 ← (number) $200 (signed word) sin16s_gen2::min#0 ← (number) -$1001 @@ -995,12 +1000,12 @@ main::@return: scope:[main] from main::@17 (byte*) bitmap_screen#4 ← (byte*) bitmap_screen#9 return to:@return -@32: scope:[] from @31 - (byte*) bitmap_screen#21 ← phi( @31/(byte*) bitmap_screen#26 ) - (byte*) bitmap_gfx#22 ← phi( @31/(byte*) bitmap_gfx#27 ) - (word) rem16u#30 ← phi( @31/(word) rem16u#35 ) +@35: scope:[] from @34 + (byte*) bitmap_screen#21 ← phi( @34/(byte*) bitmap_screen#26 ) + (byte*) bitmap_gfx#22 ← phi( @34/(byte*) bitmap_gfx#27 ) + (word) rem16u#30 ← phi( @34/(word) rem16u#35 ) (byte) frame_cnt#0 ← (number) 1 - to:@34 + to:@37 init_irq: scope:[init_irq] from main::@23 asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 @@ -1017,7 +1022,7 @@ init_irq::@return: scope:[init_irq] from init_irq return to:@return irq: scope:[irq] from - (byte) frame_cnt#4 ← phi( @34/(byte) frame_cnt#8 ) + (byte) frame_cnt#4 ← phi( @37/(byte) frame_cnt#8 ) *((byte*) BGCOL#0) ← (byte) WHITE#0 (bool~) irq::$1 ← (number) 0 != (byte) frame_cnt#4 (bool~) irq::$0 ← ! (bool~) irq::$1 @@ -1037,30 +1042,30 @@ irq::@return: scope:[irq] from irq::@1 (byte) frame_cnt#2 ← (byte) frame_cnt#6 return to:@return -@34: scope:[] from @32 - (byte*) bitmap_screen#14 ← phi( @32/(byte*) bitmap_screen#21 ) - (byte*) bitmap_gfx#15 ← phi( @32/(byte*) bitmap_gfx#22 ) - (word) rem16u#25 ← phi( @32/(word) rem16u#30 ) - (byte) frame_cnt#8 ← phi( @32/(byte) frame_cnt#0 ) +@37: scope:[] from @35 + (byte*) bitmap_screen#14 ← phi( @35/(byte*) bitmap_screen#21 ) + (byte*) bitmap_gfx#15 ← phi( @35/(byte*) bitmap_gfx#22 ) + (word) rem16u#25 ← phi( @35/(word) rem16u#30 ) + (byte) frame_cnt#8 ← phi( @35/(byte) frame_cnt#0 ) call main - to:@35 -@35: scope:[] from @34 - (byte*) bitmap_screen#10 ← phi( @34/(byte*) bitmap_screen#4 ) - (byte*) bitmap_gfx#10 ← phi( @34/(byte*) bitmap_gfx#4 ) - (word) rem16u#19 ← phi( @34/(word) rem16u#9 ) + to:@38 +@38: scope:[] from @37 + (byte*) bitmap_screen#10 ← phi( @37/(byte*) bitmap_screen#4 ) + (byte*) bitmap_gfx#10 ← phi( @37/(byte*) bitmap_gfx#4 ) + (word) rem16u#19 ← phi( @37/(word) rem16u#9 ) (word) rem16u#10 ← (word) rem16u#19 (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 to:@end -@end: scope:[] from @35 +@end: scope:[] from @38 SYMBOL TABLE SSA (label) @17 (label) @28 -(label) @31 -(label) @32 (label) @34 (label) @35 +(label) @37 +(label) @38 (label) @6 (label) @begin (label) @end @@ -2998,9 +3003,9 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @6 Adding NOP phi() at start of @17 Adding NOP phi() at start of @28 -Adding NOP phi() at start of @31 Adding NOP phi() at start of @34 -Adding NOP phi() at start of @35 +Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main Adding NOP phi() at start of main::@24 @@ -3104,8 +3109,8 @@ Coalesced down to 32 phi equivalence classes Culled Empty Block (label) @6 Culled Empty Block (label) @17 Culled Empty Block (label) @28 -Culled Empty Block (label) @31 -Culled Empty Block (label) @35 +Culled Empty Block (label) @34 +Culled Empty Block (label) @38 Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@27 Culled Empty Block (label) main::@11 @@ -3132,8 +3137,8 @@ Culled Empty Block (label) divr16u::@8 Culled Empty Block (label) divr16u::@10 Culled Empty Block (label) divr16u::@9 Culled Empty Block (label) irq::@3 -Renumbering block @32 to @1 -Renumbering block @34 to @2 +Renumbering block @35 to @1 +Renumbering block @37 to @2 Renumbering block div32u16u::@2 to div32u16u::@1 Renumbering block div32u16u::@3 to div32u16u::@2 Renumbering block mul16u::@4 to mul16u::@3 diff --git a/src/test/ref/bitmap-plot-3.asm b/src/test/ref/bitmap-plot-3.asm new file mode 100644 index 000000000..14aecd34a --- /dev/null +++ b/src/test/ref/bitmap-plot-3.asm @@ -0,0 +1,432 @@ +// Tests the simple bitmap plotter +// Plots a few lines using the bresenham line algorithm +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label D018 = $d018 + .const WHITE = 1 + .label BITMAP = $2000 + .label SCREEN = $400 + .label COSTAB = SINTAB+$40 +main: { + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label _6 = 8 + .label _10 = $18 + .label a = 2 + .label i = 3 + jsr bitmap_init + jsr bitmap_clear + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + lda #toD0181_return + sta D018 + lda #0 + sta i + sta a + b1: + ldy a + lda COSTAB,y + sta _6 + lda #0 + sta _6+1 + lda #$78 + clc + adc bitmap_line.x1 + sta bitmap_line.x1 + bcc !+ + inc bitmap_line.x1+1 + !: + ldy a + lda SINTAB,y + sta bitmap_line.y1 + lda #0 + sta bitmap_line.y1+1 + lda COSTAB+$20,y + sta _10 + lda #0 + sta _10+1 + lda #$78 + clc + adc bitmap_line.x2 + sta bitmap_line.x2 + bcc !+ + inc bitmap_line.x2+1 + !: + ldy a + lda SINTAB+$20,y + sta bitmap_line.y2 + lda #0 + sta bitmap_line.y2+1 + jsr bitmap_line + lax a + axs #-[$20] + stx a + inc i + lda #8 + cmp i + bne b1 + b2: + inc SCREEN+$3e7 + jmp b2 +} +// Draw a line on the bitmap using bresenhams algorithm +// bitmap_line(word zeropage(8) x1, word zeropage(6) y1, word zeropage($18) x2, word zeropage($1a) y2) +bitmap_line: { + .label dx = $1c + .label dy = $10 + .label sx = $1e + .label sy = $e + .label e1 = $a + .label e = 4 + .label y = 6 + .label x = 8 + .label x1 = 8 + .label y1 = 6 + .label x2 = $18 + .label y2 = $1a + lda x2 + sec + sbc x1 + sta abs_u16.w + lda x2+1 + sbc x1+1 + sta abs_u16.w+1 + jsr abs_u16 + lda abs_u16.return + sta dx + lda abs_u16.return+1 + sta dx+1 + lda y2 + sec + sbc y1 + sta abs_u16.w + lda y2+1 + sbc y1+1 + sta abs_u16.w+1 + jsr abs_u16 + lda x2 + sec + sbc x1 + sta sgn_u16.w + lda x2+1 + sbc x1+1 + sta sgn_u16.w+1 + jsr sgn_u16 + lda sgn_u16.return + sta sx + lda sgn_u16.return+1 + sta sx+1 + lda y2 + sec + sbc y1 + sta sgn_u16.w + lda y2+1 + sbc y1+1 + sta sgn_u16.w+1 + jsr sgn_u16 + lda dy+1 + cmp dx+1 + bcc b1 + bne !+ + lda dy + cmp dx + bcc b1 + !: + lda dx+1 + lsr + sta e+1 + lda dx + ror + sta e + b4: + lda y + tax + jsr bitmap_plot + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + lda e + clc + adc dx + sta e + lda e+1 + adc dx+1 + sta e+1 + cmp dy+1 + bne !+ + lda e + cmp dy + beq b5 + !: + bcc b5 + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + lda e + sec + sbc dy + sta e + lda e+1 + sbc dy+1 + sta e+1 + b5: + lda y+1 + cmp y2+1 + bne b4 + lda y + cmp y2 + bne b4 + b2: + lda y + tax + jsr bitmap_plot + rts + b1: + lda dy+1 + lsr + sta e1+1 + lda dy + ror + sta e1 + b7: + lda y + tax + jsr bitmap_plot + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + lda e1 + clc + adc dy + sta e1 + lda e1+1 + adc dy+1 + sta e1+1 + cmp dx+1 + bne !+ + lda e1 + cmp dx + beq b8 + !: + bcc b8 + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + lda e1 + sec + sbc dx + sta e1 + lda e1+1 + sbc dx+1 + sta e1+1 + b8: + lda x+1 + cmp x2+1 + bne b7 + lda x + cmp x2 + bne b7 + jmp b2 +} +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage(8) x, byte register(X) y) +bitmap_plot: { + .label _1 = $22 + .label plotter = $20 + .label x = 8 + lda bitmap_plot_yhi,x + sta plotter+1 + lda bitmap_plot_ylo,x + sta plotter + lda x + and #<$fff8 + sta _1 + lda x+1 + and #>$fff8 + sta _1+1 + lda plotter + clc + adc _1 + sta plotter + lda plotter+1 + adc _1+1 + sta plotter+1 + lda x + tay + lda bitmap_plot_bit,y + ldy #0 + ora (plotter),y + sta (plotter),y + rts +} +// Get the sign of a 16-bit unsigned number treated as a signed number. +// Returns unsigned -1 if the number is +// sgn_u16(word zeropage($c) w) +sgn_u16: { + .label w = $c + .label return = $e + lda w+1 + and #$80 + cmp #0 + bne b1 + lda #1 + sta return + lda #0 + sta return+1 + rts + b1: + lda #<$ffff + sta return + lda #>$ffff + sta return+1 + rts +} +// Get the absolute value of a 16-bit unsigned number treated as a signed number. +// abs_u16(word zeropage($10) w) +abs_u16: { + .label w = $10 + .label return = $10 + lda w+1 + and #$80 + cmp #0 + bne b1 + rts + b1: + sec + lda #0 + sbc return + sta return + lda #0 + sbc return+1 + sta return+1 + rts +} +// Clear all graphics on the bitmap +// bgcol - the background color to fill the screen with +// fgcol - the foreground color to fill the screen with +bitmap_clear: { + .const col = WHITE*$10 + ldx #col + lda #<$3e8 + sta memset.num + lda #>$3e8 + sta memset.num+1 + lda #SCREEN + sta memset.str+1 + jsr memset + ldx #0 + lda #<$1f40 + sta memset.num + lda #>$1f40 + sta memset.num+1 + lda #BITMAP + sta memset.str+1 + jsr memset + rts +} +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zeropage($12) str, byte register(X) c, word zeropage($14) num) +memset: { + .label end = $14 + .label dst = $12 + .label str = $12 + .label num = $14 + lda end + clc + adc str + sta end + lda end+1 + adc str+1 + sta end+1 + b1: + txa + ldy #0 + sta (dst),y + inc dst + bne !+ + inc dst+1 + !: + lda dst+1 + cmp end+1 + bne b1 + lda dst + cmp end + bne b1 + rts +} +// Initialize bitmap plotting tables +bitmap_init: { + .label _7 = $24 + .label yoffs = $16 + ldx #0 + lda #$80 + b1: + sta bitmap_plot_bit,x + lsr + cmp #0 + bne b2 + lda #$80 + b2: + inx + cpx #0 + bne b1 + lda #BITMAP + sta yoffs+1 + ldx #0 + b3: + lda #7 + sax _7 + lda yoffs + ora _7 + sta bitmap_plot_ylo,x + lda yoffs+1 + sta bitmap_plot_yhi,x + lda #7 + cmp _7 + bne b4 + clc + lda yoffs + adc #<$28*8 + sta yoffs + lda yoffs+1 + adc #>$28*8 + sta yoffs+1 + b4: + inx + cpx #0 + bne b3 + rts +} + // Tables for the plotter - initialized by calling bitmap_init(); + bitmap_plot_ylo: .fill $100, 0 + bitmap_plot_yhi: .fill $100, 0 + bitmap_plot_bit: .fill $100, 0 + .align $100 +SINTAB: +.fill $180, 99.5+99.5*sin(i*2*PI/256) diff --git a/src/test/ref/bitmap-plot-3.cfg b/src/test/ref/bitmap-plot-3.cfg new file mode 100644 index 000000000..d8bcb48ac --- /dev/null +++ b/src/test/ref/bitmap-plot-3.cfg @@ -0,0 +1,237 @@ +@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 bitmap_init + to:main::@4 +main::@4: scope:[main] from main + [6] phi() + [7] call bitmap_clear + to:main::@5 +main::@5: scope:[main] from main::@4 + [8] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 + to:main::toD0181 +main::toD0181: scope:[main] from main::@5 + [9] phi() + to:main::@3 +main::@3: scope:[main] from main::toD0181 + [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 + to:main::@1 +main::@1: scope:[main] from main::@3 main::@6 + [11] (byte) main::i#2 ← phi( main::@6/(byte) main::i#1 main::@3/(byte) 0 ) + [11] (byte) main::a#2 ← phi( main::@6/(byte) main::a#1 main::@3/(byte) 0 ) + [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) + [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 + [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) + [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) + [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 + [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) + [18] call bitmap_line + to:main::@6 +main::@6: scope:[main] from main::@1 + [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 + [20] (byte) main::i#1 ← ++ (byte) main::i#2 + [21] if((byte) main::i#1!=(byte) 8) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@2 main::@6 + [22] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) + to:main::@2 +bitmap_line: scope:[bitmap_line] from main::@1 + [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 + [24] call abs_u16 + [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 + to:bitmap_line::@10 +bitmap_line::@10: scope:[bitmap_line] from bitmap_line + [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 + [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 + [28] call abs_u16 + [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 + to:bitmap_line::@11 +bitmap_line::@11: scope:[bitmap_line] from bitmap_line::@10 + [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 + [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 + [32] call sgn_u16 + [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 + to:bitmap_line::@12 +bitmap_line::@12: scope:[bitmap_line] from bitmap_line::@11 + [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 + [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 + [36] call sgn_u16 + [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 + to:bitmap_line::@13 +bitmap_line::@13: scope:[bitmap_line] from bitmap_line::@12 + [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 + [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 + to:bitmap_line::@3 +bitmap_line::@3: scope:[bitmap_line] from bitmap_line::@13 + [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 + to:bitmap_line::@4 +bitmap_line::@4: scope:[bitmap_line] from bitmap_line::@3 bitmap_line::@5 + [41] (word) bitmap_line::e#3 ← phi( bitmap_line::@3/(word) bitmap_line::e#0 bitmap_line::@5/(word) bitmap_line::e#6 ) + [41] (word) bitmap_line::x#11 ← phi( bitmap_line::@3/(word) bitmap_line::x1#0 bitmap_line::@5/(word) bitmap_line::x#10 ) + [41] (word) bitmap_line::y#3 ← phi( bitmap_line::@3/(word) bitmap_line::y1#0 bitmap_line::@5/(word) bitmap_line::y#1 ) + [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 + [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 + [44] call bitmap_plot + to:bitmap_line::@14 +bitmap_line::@14: scope:[bitmap_line] from bitmap_line::@4 + [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 + [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 + [47] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 + to:bitmap_line::@6 +bitmap_line::@6: scope:[bitmap_line] from bitmap_line::@14 + [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 + [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 + to:bitmap_line::@5 +bitmap_line::@5: scope:[bitmap_line] from bitmap_line::@14 bitmap_line::@6 + [50] (word) bitmap_line::e#6 ← phi( bitmap_line::@14/(word) bitmap_line::e#1 bitmap_line::@6/(word) bitmap_line::e#2 ) + [50] (word) bitmap_line::x#10 ← phi( bitmap_line::@14/(word) bitmap_line::x#11 bitmap_line::@6/(word) bitmap_line::x#1 ) + [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 + to:bitmap_line::@2 +bitmap_line::@2: scope:[bitmap_line] from bitmap_line::@5 bitmap_line::@8 + [52] (word) bitmap_line::x#5 ← phi( bitmap_line::@8/(word) bitmap_line::x#13 bitmap_line::@5/(word) bitmap_line::x#10 ) + [52] (word) bitmap_line::y#6 ← phi( bitmap_line::@8/(word) bitmap_line::y#11 bitmap_line::@5/(word) bitmap_line::y#1 ) + [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 + [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 + [55] call bitmap_plot + to:bitmap_line::@return +bitmap_line::@return: scope:[bitmap_line] from bitmap_line::@2 + [56] return + to:@return +bitmap_line::@1: scope:[bitmap_line] from bitmap_line::@13 + [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 + to:bitmap_line::@7 +bitmap_line::@7: scope:[bitmap_line] from bitmap_line::@1 bitmap_line::@8 + [58] (word) bitmap_line::e1#3 ← phi( bitmap_line::@1/(word) bitmap_line::e1#0 bitmap_line::@8/(word) bitmap_line::e1#6 ) + [58] (word) bitmap_line::x#6 ← phi( bitmap_line::@1/(word) bitmap_line::x1#0 bitmap_line::@8/(word) bitmap_line::x#13 ) + [58] (word) bitmap_line::y#13 ← phi( bitmap_line::@1/(word) bitmap_line::y1#0 bitmap_line::@8/(word) bitmap_line::y#11 ) + [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 + [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 + [61] call bitmap_plot + to:bitmap_line::@15 +bitmap_line::@15: scope:[bitmap_line] from bitmap_line::@7 + [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 + [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 + [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 + to:bitmap_line::@9 +bitmap_line::@9: scope:[bitmap_line] from bitmap_line::@15 + [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 + [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 + to:bitmap_line::@8 +bitmap_line::@8: scope:[bitmap_line] from bitmap_line::@15 bitmap_line::@9 + [67] (word) bitmap_line::e1#6 ← phi( bitmap_line::@9/(word) bitmap_line::e1#2 bitmap_line::@15/(word) bitmap_line::e1#1 ) + [67] (word) bitmap_line::y#11 ← phi( bitmap_line::@9/(word) bitmap_line::y#2 bitmap_line::@15/(word) bitmap_line::y#13 ) + [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 + to:bitmap_line::@2 +bitmap_plot: scope:[bitmap_plot] from bitmap_line::@2 bitmap_line::@4 bitmap_line::@7 + [69] (word) bitmap_plot::x#3 ← phi( bitmap_line::@2/(word) bitmap_plot::x#1 bitmap_line::@4/(word) bitmap_plot::x#0 bitmap_line::@7/(word) bitmap_plot::x#2 ) + [69] (byte) bitmap_plot::y#3 ← phi( bitmap_line::@2/(byte) bitmap_plot::y#1 bitmap_line::@4/(byte) bitmap_plot::y#0 bitmap_line::@7/(byte) bitmap_plot::y#2 ) + [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) + [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 + [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 + [73] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 + [74] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) + to:bitmap_plot::@return +bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot + [75] return + to:@return +sgn_u16: scope:[sgn_u16] from bitmap_line::@11 bitmap_line::@12 + [76] (word) sgn_u16::w#2 ← phi( bitmap_line::@11/(word) sgn_u16::w#0 bitmap_line::@12/(word) sgn_u16::w#1 ) + [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 + [78] (byte~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (byte) $80 + [79] if((byte) 0!=(byte~) sgn_u16::$1) goto sgn_u16::@1 + to:sgn_u16::@return +sgn_u16::@1: scope:[sgn_u16] from sgn_u16 + [80] phi() + to:sgn_u16::@return +sgn_u16::@return: scope:[sgn_u16] from sgn_u16 sgn_u16::@1 + [81] (word) sgn_u16::return#4 ← phi( sgn_u16::@1/(word) $ffff sgn_u16/(byte) 1 ) + [82] return + to:@return +abs_u16: scope:[abs_u16] from bitmap_line bitmap_line::@10 + [83] (word) abs_u16::w#2 ← phi( bitmap_line/(word) abs_u16::w#0 bitmap_line::@10/(word) abs_u16::w#1 ) + [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 + [85] (byte~) abs_u16::$1 ← (byte~) abs_u16::$0 & (byte) $80 + [86] if((byte) 0!=(byte~) abs_u16::$1) goto abs_u16::@1 + to:abs_u16::@return +abs_u16::@1: scope:[abs_u16] from abs_u16 + [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 + to:abs_u16::@return +abs_u16::@return: scope:[abs_u16] from abs_u16 abs_u16::@1 + [88] (word) abs_u16::return#4 ← phi( abs_u16::@1/(word) abs_u16::return#2 abs_u16/(word) abs_u16::w#2 ) + [89] return + to:@return +bitmap_clear: scope:[bitmap_clear] from main::@4 + [90] phi() + [91] call memset + to:bitmap_clear::@1 +bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear + [92] phi() + [93] call memset + to:bitmap_clear::@return +bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 + [94] return + to:@return +memset: scope:[memset] from bitmap_clear bitmap_clear::@1 + [95] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) + [95] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) + [95] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 + [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@1 + [98] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) + [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 + [100] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 + to:memset::@return +memset::@return: scope:[memset] from memset::@1 + [102] return + to:@return +bitmap_init: scope:[bitmap_init] from main + [103] phi() + to:bitmap_init::@1 +bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2 + [104] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 ) + [104] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 ) + [105] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 + [106] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 + [107] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 + to:bitmap_init::@2 +bitmap_init::@6: scope:[bitmap_init] from bitmap_init::@1 + [108] phi() + to:bitmap_init::@2 +bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 + [109] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 ) + [110] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 + [111] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 + to:bitmap_init::@3 +bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 + [112] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [112] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) + [113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 + [114] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 + [115] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 + [116] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 + [117] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 + [118] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 + [119] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 + to:bitmap_init::@5 +bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@3 + [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 + to:bitmap_init::@4 +bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@3 bitmap_init::@5 + [121] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 ) + [122] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 + [123] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 + to:bitmap_init::@return +bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4 + [124] return + to:@return diff --git a/src/test/ref/bitmap-plot-3.log b/src/test/ref/bitmap-plot-3.log new file mode 100644 index 000000000..1bd934cf0 --- /dev/null +++ b/src/test/ref/bitmap-plot-3.log @@ -0,0 +1,5487 @@ +Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Warning! Adding boolean cast to non-boolean condition (number~) abs_u16::$1 +Warning! Adding boolean cast to non-boolean condition (number~) sgn_u16::$1 +Identified constant variable (byte*) BITMAP +Identified constant variable (byte*) SCREEN +Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx +Inlined call (byte~) main::$5 ← call toD018 (byte*) SCREEN (byte*) BITMAP +Culled Empty Block (label) @1 +Culled Empty Block (label) @2 +Culled Empty Block (label) @3 +Culled Empty Block (label) @4 +Culled Empty Block (label) @5 +Culled Empty Block (label) @6 +Culled Empty Block (label) memset::@3 +Culled Empty Block (label) @7 +Culled Empty Block (label) bitmap_init::@8 +Culled Empty Block (label) @9 +Culled Empty Block (label) @10 +Culled Empty Block (label) @11 +Culled Empty Block (label) bitmap_line::@7 +Culled Empty Block (label) bitmap_line::@8 +Culled Empty Block (label) bitmap_line::@12 +Culled Empty Block (label) @12 +Culled Empty Block (label) abs_u16::@4 +Culled Empty Block (label) abs_u16::@2 +Culled Empty Block (label) abs_u16::@5 +Culled Empty Block (label) abs_u16::@6 +Culled Empty Block (label) @13 +Culled Empty Block (label) sgn_u16::@4 +Culled Empty Block (label) sgn_u16::@2 +Culled Empty Block (label) sgn_u16::@5 +Culled Empty Block (label) sgn_u16::@6 +Culled Empty Block (label) @14 +Culled Empty Block (label) @15 +Culled Empty Block (label) @16 +Culled Empty Block (label) @17 +Culled Empty Block (label) @18 +Culled Empty Block (label) @19 +Culled Empty Block (label) @20 +Culled Empty Block (label) @21 +Culled Empty Block (label) @22 +Culled Empty Block (label) @23 +Culled Empty Block (label) @24 +Culled Empty Block (label) @25 +Culled Empty Block (label) @26 +Culled Empty Block (label) @27 +Culled Empty Block (label) @28 +Culled Empty Block (label) @29 +Culled Empty Block (label) @30 +Culled Empty Block (label) @31 +Culled Empty Block (label) @32 +Culled Empty Block (label) @33 +Culled Empty Block (label) @34 +Culled Empty Block (label) main::toD0181_@1 +Culled Empty Block (label) main::@2 +Culled Empty Block (label) main::@6 +Culled Empty Block (label) main::@5 +Culled Empty Block (label) main::@7 +Culled Empty Block (label) main::@8 + +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + (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*) D018#0 ← ((byte*)) (number) $d018 + (byte) BLACK#0 ← (number) 0 + (byte) WHITE#0 ← (number) 1 + to:@8 +memset: scope:[memset] from bitmap_clear bitmap_clear::@1 + (byte) memset::c#3 ← phi( bitmap_clear/(byte) memset::c#0 bitmap_clear::@1/(byte) memset::c#1 ) + (word) memset::num#2 ← phi( bitmap_clear/(word) memset::num#0 bitmap_clear::@1/(word) memset::num#1 ) + (void*) memset::str#2 ← phi( bitmap_clear/(void*) memset::str#0 bitmap_clear::@1/(void*) memset::str#1 ) + (byte*~) memset::$0 ← ((byte*)) (void*) memset::str#2 + (byte*~) memset::$1 ← (byte*~) memset::$0 + (word) memset::num#2 + (byte*) memset::end#0 ← (byte*~) memset::$1 + (byte*) memset::dst#0 ← ((byte*)) (void*) memset::str#2 + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@1 + (void*) memset::str#4 ← phi( memset/(void*) memset::str#2 memset::@1/(void*) memset::str#4 ) + (byte*) memset::end#1 ← phi( memset/(byte*) memset::end#0 memset::@1/(byte*) memset::end#1 ) + (byte*) memset::dst#2 ← phi( memset/(byte*) memset::dst#0 memset::@1/(byte*) memset::dst#1 ) + (byte) memset::c#2 ← phi( memset/(byte) memset::c#3 memset::@1/(byte) memset::c#2 ) + *((byte*) memset::dst#2) ← (byte) memset::c#2 + (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + (bool~) memset::$2 ← (byte*) memset::dst#1 != (byte*) memset::end#1 + if((bool~) memset::$2) goto memset::@1 + to:memset::@2 +memset::@2: scope:[memset] from memset::@1 + (void*) memset::str#3 ← phi( memset::@1/(void*) memset::str#4 ) + (void*) memset::return#0 ← (void*) memset::str#3 + to:memset::@return +memset::@return: scope:[memset] from memset::@2 + (void*) memset::return#4 ← phi( memset::@2/(void*) memset::return#0 ) + (void*) memset::return#1 ← (void*) memset::return#4 + return + to:@return +@8: scope:[] from @begin + (byte*) bitmap_screen#0 ← (byte*) 0 + (byte*) bitmap_gfx#0 ← (byte*) 0 + (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } + (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } + (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } + to:@35 +bitmap_init: scope:[bitmap_init] from main + (byte*) bitmap_init::screen#1 ← phi( main/(byte*) bitmap_init::screen#0 ) + (byte*) bitmap_init::gfx#1 ← phi( main/(byte*) bitmap_init::gfx#0 ) + (byte*) bitmap_gfx#1 ← (byte*) bitmap_init::gfx#1 + (byte*) bitmap_screen#1 ← (byte*) bitmap_init::screen#1 + (byte) bitmap_init::bits#0 ← (number) $80 + (byte) bitmap_init::x#0 ← (byte) 0 + to:bitmap_init::@1 +bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2 + (byte*) bitmap_screen#24 ← phi( bitmap_init/(byte*) bitmap_screen#1 bitmap_init::@2/(byte*) bitmap_screen#22 ) + (byte*) bitmap_gfx#25 ← phi( bitmap_init/(byte*) bitmap_gfx#1 bitmap_init::@2/(byte*) bitmap_gfx#23 ) + (byte*) bitmap_init::gfx#4 ← phi( bitmap_init/(byte*) bitmap_init::gfx#1 bitmap_init::@2/(byte*) bitmap_init::gfx#3 ) + (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) bitmap_init::x#0 bitmap_init::@2/(byte) bitmap_init::x#1 ) + (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) bitmap_init::bits#0 bitmap_init::@2/(byte) bitmap_init::bits#4 ) + *((byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 + (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (number) 1 + (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (number) 0 + (bool~) bitmap_init::$1 ← ! (bool~) bitmap_init::$0 + if((bool~) bitmap_init::$1) goto bitmap_init::@2 + to:bitmap_init::@3 +bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@3 + (byte*) bitmap_screen#22 ← phi( bitmap_init::@1/(byte*) bitmap_screen#24 bitmap_init::@3/(byte*) bitmap_screen#25 ) + (byte*) bitmap_gfx#23 ← phi( bitmap_init::@1/(byte*) bitmap_gfx#25 bitmap_init::@3/(byte*) bitmap_gfx#26 ) + (byte*) bitmap_init::gfx#3 ← phi( bitmap_init::@1/(byte*) bitmap_init::gfx#4 bitmap_init::@3/(byte*) bitmap_init::gfx#5 ) + (byte) bitmap_init::bits#4 ← phi( bitmap_init::@1/(byte) bitmap_init::bits#1 bitmap_init::@3/(byte) bitmap_init::bits#2 ) + (byte) bitmap_init::x#3 ← phi( bitmap_init::@1/(byte) bitmap_init::x#2 bitmap_init::@3/(byte) bitmap_init::x#4 ) + (byte) bitmap_init::x#1 ← (byte) bitmap_init::x#3 + rangenext(0,$ff) + (bool~) bitmap_init::$2 ← (byte) bitmap_init::x#1 != rangelast(0,$ff) + if((bool~) bitmap_init::$2) goto bitmap_init::@1 + to:bitmap_init::@4 +bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@1 + (byte*) bitmap_screen#25 ← phi( bitmap_init::@1/(byte*) bitmap_screen#24 ) + (byte*) bitmap_gfx#26 ← phi( bitmap_init::@1/(byte*) bitmap_gfx#25 ) + (byte*) bitmap_init::gfx#5 ← phi( bitmap_init::@1/(byte*) bitmap_init::gfx#4 ) + (byte) bitmap_init::x#4 ← phi( bitmap_init::@1/(byte) bitmap_init::x#2 ) + (byte) bitmap_init::bits#2 ← (number) $80 + to:bitmap_init::@2 +bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@2 + (byte*) bitmap_screen#20 ← phi( bitmap_init::@2/(byte*) bitmap_screen#22 ) + (byte*) bitmap_gfx#21 ← phi( bitmap_init::@2/(byte*) bitmap_gfx#23 ) + (byte*) bitmap_init::gfx#2 ← phi( bitmap_init::@2/(byte*) bitmap_init::gfx#3 ) + (byte*) bitmap_init::yoffs#0 ← (byte*) bitmap_init::gfx#2 + (byte) bitmap_init::y#0 ← (byte) 0 + to:bitmap_init::@5 +bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@4 bitmap_init::@6 + (byte*) bitmap_screen#15 ← phi( bitmap_init::@4/(byte*) bitmap_screen#20 bitmap_init::@6/(byte*) bitmap_screen#11 ) + (byte*) bitmap_gfx#16 ← phi( bitmap_init::@4/(byte*) bitmap_gfx#21 bitmap_init::@6/(byte*) bitmap_gfx#11 ) + (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@4/(byte*) bitmap_init::yoffs#0 bitmap_init::@6/(byte*) bitmap_init::yoffs#4 ) + (byte) bitmap_init::y#2 ← phi( bitmap_init::@4/(byte) bitmap_init::y#0 bitmap_init::@6/(byte) bitmap_init::y#1 ) + (number~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (number) 7 + (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 + (number~) bitmap_init::$5 ← (number~) bitmap_init::$3 | (byte~) bitmap_init::$4 + *((byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (number~) bitmap_init::$5 + (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 + *((byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 + (number~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (number) 7 + (bool~) bitmap_init::$8 ← (number~) bitmap_init::$7 == (number) 7 + (bool~) bitmap_init::$9 ← ! (bool~) bitmap_init::$8 + if((bool~) bitmap_init::$9) goto bitmap_init::@6 + to:bitmap_init::@7 +bitmap_init::@6: scope:[bitmap_init] from bitmap_init::@5 bitmap_init::@7 + (byte*) bitmap_screen#11 ← phi( bitmap_init::@5/(byte*) bitmap_screen#15 bitmap_init::@7/(byte*) bitmap_screen#16 ) + (byte*) bitmap_gfx#11 ← phi( bitmap_init::@5/(byte*) bitmap_gfx#16 bitmap_init::@7/(byte*) bitmap_gfx#17 ) + (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@5/(byte*) bitmap_init::yoffs#2 bitmap_init::@7/(byte*) bitmap_init::yoffs#1 ) + (byte) bitmap_init::y#3 ← phi( bitmap_init::@5/(byte) bitmap_init::y#2 bitmap_init::@7/(byte) bitmap_init::y#4 ) + (byte) bitmap_init::y#1 ← (byte) bitmap_init::y#3 + rangenext(0,$ff) + (bool~) bitmap_init::$11 ← (byte) bitmap_init::y#1 != rangelast(0,$ff) + if((bool~) bitmap_init::$11) goto bitmap_init::@5 + to:bitmap_init::@return +bitmap_init::@7: scope:[bitmap_init] from bitmap_init::@5 + (byte*) bitmap_screen#16 ← phi( bitmap_init::@5/(byte*) bitmap_screen#15 ) + (byte*) bitmap_gfx#17 ← phi( bitmap_init::@5/(byte*) bitmap_gfx#16 ) + (byte) bitmap_init::y#4 ← phi( bitmap_init::@5/(byte) bitmap_init::y#2 ) + (byte*) bitmap_init::yoffs#3 ← phi( bitmap_init::@5/(byte*) bitmap_init::yoffs#2 ) + (byte*~) bitmap_init::$10 ← (byte*) bitmap_init::yoffs#3 + (number) $28*(number) 8 + (byte*) bitmap_init::yoffs#1 ← (byte*~) bitmap_init::$10 + to:bitmap_init::@6 +bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@6 + (byte*) bitmap_screen#6 ← phi( bitmap_init::@6/(byte*) bitmap_screen#11 ) + (byte*) bitmap_gfx#6 ← phi( bitmap_init::@6/(byte*) bitmap_gfx#11 ) + (byte*) bitmap_gfx#2 ← (byte*) bitmap_gfx#6 + (byte*) bitmap_screen#2 ← (byte*) bitmap_screen#6 + return + to:@return +bitmap_clear: scope:[bitmap_clear] from main::@10 + (byte*) bitmap_gfx#12 ← phi( main::@10/(byte*) bitmap_gfx#3 ) + (byte*) bitmap_screen#7 ← phi( main::@10/(byte*) bitmap_screen#3 ) + (byte) bitmap_clear::bgcol#1 ← phi( main::@10/(byte) bitmap_clear::bgcol#0 ) + (byte) bitmap_clear::fgcol#1 ← phi( main::@10/(byte) bitmap_clear::fgcol#0 ) + (number~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (number) $10 + (number~) bitmap_clear::$1 ← (number~) bitmap_clear::$0 + (byte) bitmap_clear::bgcol#1 + (byte) bitmap_clear::col#0 ← (number~) bitmap_clear::$1 + (void*) memset::str#0 ← (void*)(byte*) bitmap_screen#7 + (byte) memset::c#0 ← (byte) bitmap_clear::col#0 + (word) memset::num#0 ← (word) $3e8 + call memset + (void*) memset::return#2 ← (void*) memset::return#1 + to:bitmap_clear::@1 +bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear + (byte*) bitmap_gfx#7 ← phi( bitmap_clear/(byte*) bitmap_gfx#12 ) + (void*) memset::str#1 ← (void*)(byte*) bitmap_gfx#7 + (byte) memset::c#1 ← (number) 0 + (word) memset::num#1 ← (word) $1f40 + call memset + (void*) memset::return#3 ← (void*) memset::return#1 + to:bitmap_clear::@2 +bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1 + to:bitmap_clear::@return +bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@2 + return + to:@return +bitmap_plot: scope:[bitmap_plot] from bitmap_line::@2 bitmap_line::@4 bitmap_line::@9 + (word) bitmap_plot::x#3 ← phi( bitmap_line::@2/(word) bitmap_plot::x#1 bitmap_line::@4/(word) bitmap_plot::x#0 bitmap_line::@9/(word) bitmap_plot::x#2 ) + (byte) bitmap_plot::y#3 ← phi( bitmap_line::@2/(byte) bitmap_plot::y#1 bitmap_line::@4/(byte) bitmap_plot::y#0 bitmap_line::@9/(byte) bitmap_plot::y#2 ) + (byte*~) bitmap_plot::$0 ← ((byte*)) { *((byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3), *((byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) } + (byte*) bitmap_plot::plotter#0 ← (byte*~) bitmap_plot::$0 + (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (number) $fff8 + (byte*) bitmap_plot::plotter#1 ← (byte*) bitmap_plot::plotter#0 + (number~) bitmap_plot::$1 + (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 + *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) + to:bitmap_plot::@return +bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot + return + to:@return +bitmap_line: scope:[bitmap_line] from main::@1 + (word) bitmap_line::y2#4 ← phi( main::@1/(word) bitmap_line::y2#0 ) + (word) bitmap_line::x2#1 ← phi( main::@1/(word) bitmap_line::x2#0 ) + (word) bitmap_line::y1#1 ← phi( main::@1/(word) bitmap_line::y1#0 ) + (word) bitmap_line::x1#1 ← phi( main::@1/(word) bitmap_line::x1#0 ) + (word) bitmap_line::x#0 ← (word) bitmap_line::x1#1 + (word) bitmap_line::y#0 ← (word) bitmap_line::y1#1 + (word~) bitmap_line::$0 ← (word) bitmap_line::x2#1 - (word) bitmap_line::x1#1 + (word) abs_u16::w#0 ← (word~) bitmap_line::$0 + call abs_u16 + (word) abs_u16::return#0 ← (word) abs_u16::return#4 + to:bitmap_line::@13 +bitmap_line::@13: scope:[bitmap_line] from bitmap_line + (word) bitmap_line::x#17 ← phi( bitmap_line/(word) bitmap_line::x#0 ) + (word) bitmap_line::y#17 ← phi( bitmap_line/(word) bitmap_line::y#0 ) + (word) bitmap_line::x1#3 ← phi( bitmap_line/(word) bitmap_line::x1#1 ) + (word) bitmap_line::x2#4 ← phi( bitmap_line/(word) bitmap_line::x2#1 ) + (word) bitmap_line::y1#2 ← phi( bitmap_line/(word) bitmap_line::y1#1 ) + (word) bitmap_line::y2#1 ← phi( bitmap_line/(word) bitmap_line::y2#4 ) + (word) abs_u16::return#5 ← phi( bitmap_line/(word) abs_u16::return#0 ) + (word~) bitmap_line::$1 ← (word) abs_u16::return#5 + (word) bitmap_line::dx#0 ← (word~) bitmap_line::$1 + (word~) bitmap_line::$2 ← (word) bitmap_line::y2#1 - (word) bitmap_line::y1#2 + (word) abs_u16::w#1 ← (word~) bitmap_line::$2 + call abs_u16 + (word) abs_u16::return#1 ← (word) abs_u16::return#4 + to:bitmap_line::@14 +bitmap_line::@14: scope:[bitmap_line] from bitmap_line::@13 + (word) bitmap_line::x#16 ← phi( bitmap_line::@13/(word) bitmap_line::x#17 ) + (word) bitmap_line::y#16 ← phi( bitmap_line::@13/(word) bitmap_line::y#17 ) + (word) bitmap_line::dx#9 ← phi( bitmap_line::@13/(word) bitmap_line::dx#0 ) + (word) bitmap_line::y1#4 ← phi( bitmap_line::@13/(word) bitmap_line::y1#2 ) + (word) bitmap_line::y2#5 ← phi( bitmap_line::@13/(word) bitmap_line::y2#1 ) + (word) bitmap_line::x1#2 ← phi( bitmap_line::@13/(word) bitmap_line::x1#3 ) + (word) bitmap_line::x2#2 ← phi( bitmap_line::@13/(word) bitmap_line::x2#4 ) + (word) abs_u16::return#6 ← phi( bitmap_line::@13/(word) abs_u16::return#1 ) + (word~) bitmap_line::$3 ← (word) abs_u16::return#6 + (word) bitmap_line::dy#0 ← (word~) bitmap_line::$3 + (word~) bitmap_line::$4 ← (word) bitmap_line::x2#2 - (word) bitmap_line::x1#2 + (word) sgn_u16::w#0 ← (word~) bitmap_line::$4 + call sgn_u16 + (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 + to:bitmap_line::@15 +bitmap_line::@15: scope:[bitmap_line] from bitmap_line::@14 + (word) bitmap_line::x2#10 ← phi( bitmap_line::@14/(word) bitmap_line::x2#2 ) + (word) bitmap_line::x#15 ← phi( bitmap_line::@14/(word) bitmap_line::x#16 ) + (word) bitmap_line::y#15 ← phi( bitmap_line::@14/(word) bitmap_line::y#16 ) + (word) bitmap_line::dy#6 ← phi( bitmap_line::@14/(word) bitmap_line::dy#0 ) + (word) bitmap_line::dx#6 ← phi( bitmap_line::@14/(word) bitmap_line::dx#9 ) + (word) bitmap_line::y1#3 ← phi( bitmap_line::@14/(word) bitmap_line::y1#4 ) + (word) bitmap_line::y2#2 ← phi( bitmap_line::@14/(word) bitmap_line::y2#5 ) + (word) sgn_u16::return#5 ← phi( bitmap_line::@14/(word) sgn_u16::return#0 ) + (word~) bitmap_line::$5 ← (word) sgn_u16::return#5 + (word) bitmap_line::sx#0 ← (word~) bitmap_line::$5 + (word~) bitmap_line::$6 ← (word) bitmap_line::y2#2 - (word) bitmap_line::y1#3 + (word) sgn_u16::w#1 ← (word~) bitmap_line::$6 + call sgn_u16 + (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 + to:bitmap_line::@16 +bitmap_line::@16: scope:[bitmap_line] from bitmap_line::@15 + (word) bitmap_line::y2#10 ← phi( bitmap_line::@15/(word) bitmap_line::y2#2 ) + (word) bitmap_line::x2#9 ← phi( bitmap_line::@15/(word) bitmap_line::x2#10 ) + (word) bitmap_line::sx#8 ← phi( bitmap_line::@15/(word) bitmap_line::sx#0 ) + (word) bitmap_line::x#14 ← phi( bitmap_line::@15/(word) bitmap_line::x#15 ) + (word) bitmap_line::y#14 ← phi( bitmap_line::@15/(word) bitmap_line::y#15 ) + (word) bitmap_line::dy#1 ← phi( bitmap_line::@15/(word) bitmap_line::dy#6 ) + (word) bitmap_line::dx#1 ← phi( bitmap_line::@15/(word) bitmap_line::dx#6 ) + (word) sgn_u16::return#6 ← phi( bitmap_line::@15/(word) sgn_u16::return#1 ) + (word~) bitmap_line::$7 ← (word) sgn_u16::return#6 + (word) bitmap_line::sy#0 ← (word~) bitmap_line::$7 + (bool~) bitmap_line::$8 ← (word) bitmap_line::dx#1 > (word) bitmap_line::dy#1 + if((bool~) bitmap_line::$8) goto bitmap_line::@1 + to:bitmap_line::@3 +bitmap_line::@1: scope:[bitmap_line] from bitmap_line::@16 + (word) bitmap_line::sy#9 ← phi( bitmap_line::@16/(word) bitmap_line::sy#0 ) + (word) bitmap_line::x2#8 ← phi( bitmap_line::@16/(word) bitmap_line::x2#9 ) + (word) bitmap_line::dx#11 ← phi( bitmap_line::@16/(word) bitmap_line::dx#1 ) + (word) bitmap_line::sx#6 ← phi( bitmap_line::@16/(word) bitmap_line::sx#8 ) + (word) bitmap_line::x#12 ← phi( bitmap_line::@16/(word) bitmap_line::x#14 ) + (word) bitmap_line::y#12 ← phi( bitmap_line::@16/(word) bitmap_line::y#14 ) + (word) bitmap_line::dy#2 ← phi( bitmap_line::@16/(word) bitmap_line::dy#1 ) + (number~) bitmap_line::$17 ← (word) bitmap_line::dy#2 / (number) 2 + (word) bitmap_line::e1#0 ← (number~) bitmap_line::$17 + to:bitmap_line::@9 +bitmap_line::@3: scope:[bitmap_line] from bitmap_line::@16 + (word) bitmap_line::sx#9 ← phi( bitmap_line::@16/(word) bitmap_line::sx#8 ) + (word) bitmap_line::y2#9 ← phi( bitmap_line::@16/(word) bitmap_line::y2#10 ) + (word) bitmap_line::dy#9 ← phi( bitmap_line::@16/(word) bitmap_line::dy#1 ) + (word) bitmap_line::sy#5 ← phi( bitmap_line::@16/(word) bitmap_line::sy#0 ) + (word) bitmap_line::x#9 ← phi( bitmap_line::@16/(word) bitmap_line::x#14 ) + (word) bitmap_line::y#9 ← phi( bitmap_line::@16/(word) bitmap_line::y#14 ) + (word) bitmap_line::dx#2 ← phi( bitmap_line::@16/(word) bitmap_line::dx#1 ) + (number~) bitmap_line::$11 ← (word) bitmap_line::dx#2 / (number) 2 + (word) bitmap_line::e#0 ← (number~) bitmap_line::$11 + to:bitmap_line::@4 +bitmap_line::@4: scope:[bitmap_line] from bitmap_line::@3 bitmap_line::@5 + (word) bitmap_line::sx#5 ← phi( bitmap_line::@3/(word) bitmap_line::sx#9 bitmap_line::@5/(word) bitmap_line::sx#10 ) + (word) bitmap_line::y2#8 ← phi( bitmap_line::@3/(word) bitmap_line::y2#9 bitmap_line::@5/(word) bitmap_line::y2#3 ) + (word) bitmap_line::dy#7 ← phi( bitmap_line::@3/(word) bitmap_line::dy#9 bitmap_line::@5/(word) bitmap_line::dy#10 ) + (word) bitmap_line::dx#7 ← phi( bitmap_line::@3/(word) bitmap_line::dx#2 bitmap_line::@5/(word) bitmap_line::dx#10 ) + (word) bitmap_line::e#5 ← phi( bitmap_line::@3/(word) bitmap_line::e#0 bitmap_line::@5/(word) bitmap_line::e#6 ) + (word) bitmap_line::sy#3 ← phi( bitmap_line::@3/(word) bitmap_line::sy#5 bitmap_line::@5/(word) bitmap_line::sy#6 ) + (word) bitmap_line::x#3 ← phi( bitmap_line::@3/(word) bitmap_line::x#9 bitmap_line::@5/(word) bitmap_line::x#10 ) + (word) bitmap_line::y#3 ← phi( bitmap_line::@3/(word) bitmap_line::y#9 bitmap_line::@5/(word) bitmap_line::y#5 ) + (byte~) bitmap_line::$12 ← ((byte)) (word) bitmap_line::y#3 + (word) bitmap_plot::x#0 ← (word) bitmap_line::x#3 + (byte) bitmap_plot::y#0 ← (byte~) bitmap_line::$12 + call bitmap_plot + to:bitmap_line::@17 +bitmap_line::@17: scope:[bitmap_line] from bitmap_line::@4 + (word) bitmap_line::sx#3 ← phi( bitmap_line::@4/(word) bitmap_line::sx#5 ) + (word) bitmap_line::x#11 ← phi( bitmap_line::@4/(word) bitmap_line::x#3 ) + (word) bitmap_line::y2#6 ← phi( bitmap_line::@4/(word) bitmap_line::y2#8 ) + (word) bitmap_line::dy#3 ← phi( bitmap_line::@4/(word) bitmap_line::dy#7 ) + (word) bitmap_line::dx#3 ← phi( bitmap_line::@4/(word) bitmap_line::dx#7 ) + (word) bitmap_line::e#3 ← phi( bitmap_line::@4/(word) bitmap_line::e#5 ) + (word) bitmap_line::sy#1 ← phi( bitmap_line::@4/(word) bitmap_line::sy#3 ) + (word) bitmap_line::y#4 ← phi( bitmap_line::@4/(word) bitmap_line::y#3 ) + (word) bitmap_line::y#1 ← (word) bitmap_line::y#4 + (word) bitmap_line::sy#1 + (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#3 + (bool~) bitmap_line::$14 ← (word) bitmap_line::dy#3 < (word) bitmap_line::e#1 + (bool~) bitmap_line::$15 ← ! (bool~) bitmap_line::$14 + if((bool~) bitmap_line::$15) goto bitmap_line::@5 + to:bitmap_line::@6 +bitmap_line::@5: scope:[bitmap_line] from bitmap_line::@17 bitmap_line::@6 + (word) bitmap_line::sx#10 ← phi( bitmap_line::@17/(word) bitmap_line::sx#3 bitmap_line::@6/(word) bitmap_line::sx#1 ) + (word) bitmap_line::dy#10 ← phi( bitmap_line::@17/(word) bitmap_line::dy#3 bitmap_line::@6/(word) bitmap_line::dy#4 ) + (word) bitmap_line::dx#10 ← phi( bitmap_line::@17/(word) bitmap_line::dx#3 bitmap_line::@6/(word) bitmap_line::dx#13 ) + (word) bitmap_line::e#6 ← phi( bitmap_line::@17/(word) bitmap_line::e#1 bitmap_line::@6/(word) bitmap_line::e#2 ) + (word) bitmap_line::sy#6 ← phi( bitmap_line::@17/(word) bitmap_line::sy#1 bitmap_line::@6/(word) bitmap_line::sy#8 ) + (word) bitmap_line::x#10 ← phi( bitmap_line::@17/(word) bitmap_line::x#11 bitmap_line::@6/(word) bitmap_line::x#1 ) + (word) bitmap_line::y2#3 ← phi( bitmap_line::@17/(word) bitmap_line::y2#6 bitmap_line::@6/(word) bitmap_line::y2#7 ) + (word) bitmap_line::y#5 ← phi( bitmap_line::@17/(word) bitmap_line::y#1 bitmap_line::@6/(word) bitmap_line::y#10 ) + (bool~) bitmap_line::$16 ← (word) bitmap_line::y#5 != (word) bitmap_line::y2#3 + if((bool~) bitmap_line::$16) goto bitmap_line::@4 + to:bitmap_line::@2 +bitmap_line::@6: scope:[bitmap_line] from bitmap_line::@17 + (word) bitmap_line::dx#13 ← phi( bitmap_line::@17/(word) bitmap_line::dx#3 ) + (word) bitmap_line::sy#8 ← phi( bitmap_line::@17/(word) bitmap_line::sy#1 ) + (word) bitmap_line::y2#7 ← phi( bitmap_line::@17/(word) bitmap_line::y2#6 ) + (word) bitmap_line::y#10 ← phi( bitmap_line::@17/(word) bitmap_line::y#1 ) + (word) bitmap_line::dy#4 ← phi( bitmap_line::@17/(word) bitmap_line::dy#3 ) + (word) bitmap_line::e#4 ← phi( bitmap_line::@17/(word) bitmap_line::e#1 ) + (word) bitmap_line::sx#1 ← phi( bitmap_line::@17/(word) bitmap_line::sx#3 ) + (word) bitmap_line::x#4 ← phi( bitmap_line::@17/(word) bitmap_line::x#11 ) + (word) bitmap_line::x#1 ← (word) bitmap_line::x#4 + (word) bitmap_line::sx#1 + (word) bitmap_line::e#2 ← (word) bitmap_line::e#4 - (word) bitmap_line::dy#4 + to:bitmap_line::@5 +bitmap_line::@2: scope:[bitmap_line] from bitmap_line::@10 bitmap_line::@5 + (word) bitmap_line::x#5 ← phi( bitmap_line::@10/(word) bitmap_line::x#8 bitmap_line::@5/(word) bitmap_line::x#10 ) + (word) bitmap_line::y#6 ← phi( bitmap_line::@10/(word) bitmap_line::y#11 bitmap_line::@5/(word) bitmap_line::y#5 ) + (byte~) bitmap_line::$9 ← ((byte)) (word) bitmap_line::y#6 + (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 + (byte) bitmap_plot::y#1 ← (byte~) bitmap_line::$9 + call bitmap_plot + to:bitmap_line::@18 +bitmap_line::@18: scope:[bitmap_line] from bitmap_line::@2 + to:bitmap_line::@return +bitmap_line::@9: scope:[bitmap_line] from bitmap_line::@1 bitmap_line::@10 + (word) bitmap_line::sy#7 ← phi( bitmap_line::@1/(word) bitmap_line::sy#9 bitmap_line::@10/(word) bitmap_line::sy#10 ) + (word) bitmap_line::x2#7 ← phi( bitmap_line::@1/(word) bitmap_line::x2#8 bitmap_line::@10/(word) bitmap_line::x2#3 ) + (word) bitmap_line::dx#8 ← phi( bitmap_line::@1/(word) bitmap_line::dx#11 bitmap_line::@10/(word) bitmap_line::dx#12 ) + (word) bitmap_line::dy#8 ← phi( bitmap_line::@1/(word) bitmap_line::dy#2 bitmap_line::@10/(word) bitmap_line::dy#11 ) + (word) bitmap_line::e1#5 ← phi( bitmap_line::@1/(word) bitmap_line::e1#0 bitmap_line::@10/(word) bitmap_line::e1#6 ) + (word) bitmap_line::sx#4 ← phi( bitmap_line::@1/(word) bitmap_line::sx#6 bitmap_line::@10/(word) bitmap_line::sx#7 ) + (word) bitmap_line::x#6 ← phi( bitmap_line::@1/(word) bitmap_line::x#12 bitmap_line::@10/(word) bitmap_line::x#8 ) + (word) bitmap_line::y#7 ← phi( bitmap_line::@1/(word) bitmap_line::y#12 bitmap_line::@10/(word) bitmap_line::y#11 ) + (byte~) bitmap_line::$18 ← ((byte)) (word) bitmap_line::y#7 + (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 + (byte) bitmap_plot::y#2 ← (byte~) bitmap_line::$18 + call bitmap_plot + to:bitmap_line::@19 +bitmap_line::@19: scope:[bitmap_line] from bitmap_line::@9 + (word) bitmap_line::sy#4 ← phi( bitmap_line::@9/(word) bitmap_line::sy#7 ) + (word) bitmap_line::y#13 ← phi( bitmap_line::@9/(word) bitmap_line::y#7 ) + (word) bitmap_line::x2#6 ← phi( bitmap_line::@9/(word) bitmap_line::x2#7 ) + (word) bitmap_line::dx#4 ← phi( bitmap_line::@9/(word) bitmap_line::dx#8 ) + (word) bitmap_line::dy#5 ← phi( bitmap_line::@9/(word) bitmap_line::dy#8 ) + (word) bitmap_line::e1#3 ← phi( bitmap_line::@9/(word) bitmap_line::e1#5 ) + (word) bitmap_line::sx#2 ← phi( bitmap_line::@9/(word) bitmap_line::sx#4 ) + (word) bitmap_line::x#7 ← phi( bitmap_line::@9/(word) bitmap_line::x#6 ) + (word) bitmap_line::x#2 ← (word) bitmap_line::x#7 + (word) bitmap_line::sx#2 + (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#5 + (bool~) bitmap_line::$20 ← (word) bitmap_line::dx#4 < (word) bitmap_line::e1#1 + (bool~) bitmap_line::$21 ← ! (bool~) bitmap_line::$20 + if((bool~) bitmap_line::$21) goto bitmap_line::@10 + to:bitmap_line::@11 +bitmap_line::@10: scope:[bitmap_line] from bitmap_line::@11 bitmap_line::@19 + (word) bitmap_line::sy#10 ← phi( bitmap_line::@11/(word) bitmap_line::sy#2 bitmap_line::@19/(word) bitmap_line::sy#4 ) + (word) bitmap_line::dx#12 ← phi( bitmap_line::@11/(word) bitmap_line::dx#5 bitmap_line::@19/(word) bitmap_line::dx#4 ) + (word) bitmap_line::dy#11 ← phi( bitmap_line::@11/(word) bitmap_line::dy#12 bitmap_line::@19/(word) bitmap_line::dy#5 ) + (word) bitmap_line::e1#6 ← phi( bitmap_line::@11/(word) bitmap_line::e1#2 bitmap_line::@19/(word) bitmap_line::e1#1 ) + (word) bitmap_line::sx#7 ← phi( bitmap_line::@11/(word) bitmap_line::sx#11 bitmap_line::@19/(word) bitmap_line::sx#2 ) + (word) bitmap_line::y#11 ← phi( bitmap_line::@11/(word) bitmap_line::y#2 bitmap_line::@19/(word) bitmap_line::y#13 ) + (word) bitmap_line::x2#3 ← phi( bitmap_line::@11/(word) bitmap_line::x2#5 bitmap_line::@19/(word) bitmap_line::x2#6 ) + (word) bitmap_line::x#8 ← phi( bitmap_line::@11/(word) bitmap_line::x#13 bitmap_line::@19/(word) bitmap_line::x#2 ) + (bool~) bitmap_line::$22 ← (word) bitmap_line::x#8 != (word) bitmap_line::x2#3 + if((bool~) bitmap_line::$22) goto bitmap_line::@9 + to:bitmap_line::@2 +bitmap_line::@11: scope:[bitmap_line] from bitmap_line::@19 + (word) bitmap_line::dy#12 ← phi( bitmap_line::@19/(word) bitmap_line::dy#5 ) + (word) bitmap_line::sx#11 ← phi( bitmap_line::@19/(word) bitmap_line::sx#2 ) + (word) bitmap_line::x2#5 ← phi( bitmap_line::@19/(word) bitmap_line::x2#6 ) + (word) bitmap_line::x#13 ← phi( bitmap_line::@19/(word) bitmap_line::x#2 ) + (word) bitmap_line::dx#5 ← phi( bitmap_line::@19/(word) bitmap_line::dx#4 ) + (word) bitmap_line::e1#4 ← phi( bitmap_line::@19/(word) bitmap_line::e1#1 ) + (word) bitmap_line::sy#2 ← phi( bitmap_line::@19/(word) bitmap_line::sy#4 ) + (word) bitmap_line::y#8 ← phi( bitmap_line::@19/(word) bitmap_line::y#13 ) + (word) bitmap_line::y#2 ← (word) bitmap_line::y#8 + (word) bitmap_line::sy#2 + (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#4 - (word) bitmap_line::dx#5 + to:bitmap_line::@10 +bitmap_line::@return: scope:[bitmap_line] from bitmap_line::@18 + return + to:@return +abs_u16: scope:[abs_u16] from bitmap_line bitmap_line::@13 + (word) abs_u16::w#2 ← phi( bitmap_line/(word) abs_u16::w#0 bitmap_line::@13/(word) abs_u16::w#1 ) + (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 + (number~) abs_u16::$1 ← (byte~) abs_u16::$0 & (number) $80 + (bool~) abs_u16::$3 ← (number) 0 != (number~) abs_u16::$1 + if((bool~) abs_u16::$3) goto abs_u16::@1 + to:abs_u16::@3 +abs_u16::@1: scope:[abs_u16] from abs_u16 + (word) abs_u16::w#3 ← phi( abs_u16/(word) abs_u16::w#2 ) + (word~) abs_u16::$2 ← - (word) abs_u16::w#3 + (word) abs_u16::return#2 ← (word~) abs_u16::$2 + to:abs_u16::@return +abs_u16::@3: scope:[abs_u16] from abs_u16 + (word) abs_u16::w#4 ← phi( abs_u16/(word) abs_u16::w#2 ) + (word) abs_u16::return#3 ← (word) abs_u16::w#4 + to:abs_u16::@return +abs_u16::@return: scope:[abs_u16] from abs_u16::@1 abs_u16::@3 + (word) abs_u16::return#7 ← phi( abs_u16::@1/(word) abs_u16::return#2 abs_u16::@3/(word) abs_u16::return#3 ) + (word) abs_u16::return#4 ← (word) abs_u16::return#7 + return + to:@return +sgn_u16: scope:[sgn_u16] from bitmap_line::@14 bitmap_line::@15 + (word) sgn_u16::w#2 ← phi( bitmap_line::@14/(word) sgn_u16::w#0 bitmap_line::@15/(word) sgn_u16::w#1 ) + (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 + (number~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (number) $80 + (bool~) sgn_u16::$2 ← (number) 0 != (number~) sgn_u16::$1 + if((bool~) sgn_u16::$2) goto sgn_u16::@1 + to:sgn_u16::@3 +sgn_u16::@1: scope:[sgn_u16] from sgn_u16 + (word) sgn_u16::return#2 ← (number) $ffff + to:sgn_u16::@return +sgn_u16::@3: scope:[sgn_u16] from sgn_u16 + (word) sgn_u16::return#3 ← (number) 1 + to:sgn_u16::@return +sgn_u16::@return: scope:[sgn_u16] from sgn_u16::@1 sgn_u16::@3 + (word) sgn_u16::return#7 ← phi( sgn_u16::@1/(word) sgn_u16::return#2 sgn_u16::@3/(word) sgn_u16::return#3 ) + (word) sgn_u16::return#4 ← (word) sgn_u16::return#7 + return + to:@return +@35: scope:[] from @8 + (byte*) bitmap_screen#19 ← phi( @8/(byte*) bitmap_screen#0 ) + (byte*) bitmap_gfx#20 ← phi( @8/(byte*) bitmap_gfx#0 ) + (byte*) BITMAP#0 ← ((byte*)) (number) $2000 + (byte*) SCREEN#0 ← ((byte*)) (number) $400 + (byte[$180]) SINTAB#0 ← kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} + (byte*~) $0 ← (byte[$180]) SINTAB#0 + (number) $40 + (byte*) COSTAB#0 ← (byte*~) $0 + to:@36 +main: scope:[main] from @36 + (byte*) COSTAB#8 ← phi( @36/(byte*) COSTAB#9 ) + (byte*) bitmap_screen#12 ← phi( @36/(byte*) bitmap_screen#14 ) + (byte*) bitmap_gfx#13 ← phi( @36/(byte*) bitmap_gfx#15 ) + (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 + (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 + call bitmap_init + to:main::@10 +main::@10: scope:[main] from main + (byte*) COSTAB#7 ← phi( main/(byte*) COSTAB#8 ) + (byte*) bitmap_screen#8 ← phi( main/(byte*) bitmap_screen#2 ) + (byte*) bitmap_gfx#8 ← phi( main/(byte*) bitmap_gfx#2 ) + (byte*) bitmap_gfx#3 ← (byte*) bitmap_gfx#8 + (byte*) bitmap_screen#3 ← (byte*) bitmap_screen#8 + (byte) bitmap_clear::bgcol#0 ← (byte) BLACK#0 + (byte) bitmap_clear::fgcol#0 ← (byte) WHITE#0 + call bitmap_clear + to:main::@11 +main::@11: scope:[main] from main::@10 + (byte*) bitmap_screen#28 ← phi( main::@10/(byte*) bitmap_screen#3 ) + (byte*) bitmap_gfx#29 ← phi( main::@10/(byte*) bitmap_gfx#3 ) + (byte*) COSTAB#6 ← phi( main::@10/(byte*) COSTAB#7 ) + (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 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 + to:main::toD0181 +main::toD0181: scope:[main] from main::@11 + (byte*) bitmap_screen#27 ← phi( main::@11/(byte*) bitmap_screen#28 ) + (byte*) bitmap_gfx#28 ← phi( main::@11/(byte*) bitmap_gfx#29 ) + (byte*) COSTAB#5 ← phi( main::@11/(byte*) COSTAB#6 ) + (byte*) main::toD0181_gfx#1 ← phi( main::@11/(byte*) main::toD0181_gfx#0 ) + (byte*) main::toD0181_screen#1 ← phi( main::@11/(byte*) main::toD0181_screen#0 ) + (word~) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 + (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff + (number~) main::toD0181_$2#0 ← (number~) main::toD0181_$1#0 * (number) 4 + (number~) main::toD0181_$3#0 ← > (number~) main::toD0181_$2#0 + (word~) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 + (byte~) main::toD0181_$5#0 ← > (word~) main::toD0181_$4#0 + (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4 + (number~) main::toD0181_$7#0 ← (number~) main::toD0181_$6#0 & (number) $f + (number~) main::toD0181_$8#0 ← (number~) main::toD0181_$3#0 | (number~) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (number~) main::toD0181_$8#0 + to:main::toD0181_@return +main::toD0181_@return: scope:[main] from main::toD0181 + (byte*) bitmap_screen#26 ← phi( main::toD0181/(byte*) bitmap_screen#27 ) + (byte*) bitmap_gfx#27 ← phi( main::toD0181/(byte*) bitmap_gfx#28 ) + (byte*) COSTAB#4 ← phi( main::toD0181/(byte*) COSTAB#5 ) + (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) + (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 + to:main::@9 +main::@9: scope:[main] from main::toD0181_@return + (byte*) bitmap_screen#23 ← phi( main::toD0181_@return/(byte*) bitmap_screen#26 ) + (byte*) bitmap_gfx#24 ← phi( main::toD0181_@return/(byte*) bitmap_gfx#27 ) + (byte*) COSTAB#3 ← phi( main::toD0181_@return/(byte*) COSTAB#4 ) + (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) + (byte~) main::$5 ← (byte) main::toD0181_return#3 + *((byte*) D018#0) ← (byte~) main::$5 + (byte) main::i#0 ← (number) 0 + (byte) main::a#0 ← (number) 0 + to:main::@1 +main::@1: scope:[main] from main::@12 main::@9 + (byte*) bitmap_screen#21 ← phi( main::@12/(byte*) bitmap_screen#17 main::@9/(byte*) bitmap_screen#23 ) + (byte*) bitmap_gfx#22 ← phi( main::@12/(byte*) bitmap_gfx#18 main::@9/(byte*) bitmap_gfx#24 ) + (byte) main::i#3 ← phi( main::@12/(byte) main::i#1 main::@9/(byte) main::i#0 ) + (byte) main::a#2 ← phi( main::@12/(byte) main::a#1 main::@9/(byte) main::a#0 ) + (byte*) COSTAB#1 ← phi( main::@12/(byte*) COSTAB#2 main::@9/(byte*) COSTAB#3 ) + (word~) main::$6 ← ((word)) *((byte*) COSTAB#1 + (byte) main::a#2) + (number~) main::$7 ← (word~) main::$6 + (number) $78 + (word~) main::$8 ← ((word)) *((byte[$180]) SINTAB#0 + (byte) main::a#2) + (number~) main::$9 ← (byte) main::a#2 + (number) $20 + (word~) main::$10 ← ((word)) *((byte*) COSTAB#1 + (number~) main::$9) + (number~) main::$11 ← (word~) main::$10 + (number) $78 + (number~) main::$12 ← (byte) main::a#2 + (number) $20 + (word~) main::$13 ← ((word)) *((byte[$180]) SINTAB#0 + (number~) main::$12) + (word) bitmap_line::x1#0 ← (number~) main::$7 + (word) bitmap_line::y1#0 ← (word~) main::$8 + (word) bitmap_line::x2#0 ← (number~) main::$11 + (word) bitmap_line::y2#0 ← (word~) main::$13 + call bitmap_line + to:main::@12 +main::@12: scope:[main] from main::@1 + (byte*) bitmap_screen#17 ← phi( main::@1/(byte*) bitmap_screen#21 ) + (byte*) bitmap_gfx#18 ← phi( main::@1/(byte*) bitmap_gfx#22 ) + (byte*) COSTAB#2 ← phi( main::@1/(byte*) COSTAB#1 ) + (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 ) + (byte) main::a#3 ← phi( main::@1/(byte) main::a#2 ) + (byte) main::a#1 ← (byte) main::a#3 + (number) $20 + (byte) main::i#1 ← ++ (byte) main::i#2 + (bool~) main::$15 ← (byte) main::i#1 != (number) 8 + if((bool~) main::$15) goto main::@1 + to:main::@3 +main::@3: scope:[main] from main::@12 main::@4 + (byte*) bitmap_screen#13 ← phi( main::@12/(byte*) bitmap_screen#17 main::@4/(byte*) bitmap_screen#18 ) + (byte*) bitmap_gfx#14 ← phi( main::@12/(byte*) bitmap_gfx#18 main::@4/(byte*) bitmap_gfx#19 ) + if(true) goto main::@4 + to:main::@return +main::@4: scope:[main] from main::@3 + (byte*) bitmap_screen#18 ← phi( main::@3/(byte*) bitmap_screen#13 ) + (byte*) bitmap_gfx#19 ← phi( main::@3/(byte*) bitmap_gfx#14 ) + (byte*~) main::$18 ← (byte*) SCREEN#0 + (number) $3e7 + *((byte*~) main::$18) ← ++ *((byte*~) main::$18) + to:main::@3 +main::@return: scope:[main] from main::@3 + (byte*) bitmap_screen#9 ← phi( main::@3/(byte*) bitmap_screen#13 ) + (byte*) bitmap_gfx#9 ← phi( main::@3/(byte*) bitmap_gfx#14 ) + (byte*) bitmap_gfx#4 ← (byte*) bitmap_gfx#9 + (byte*) bitmap_screen#4 ← (byte*) bitmap_screen#9 + return + to:@return +@36: scope:[] from @35 + (byte*) COSTAB#9 ← phi( @35/(byte*) COSTAB#0 ) + (byte*) bitmap_screen#14 ← phi( @35/(byte*) bitmap_screen#19 ) + (byte*) bitmap_gfx#15 ← phi( @35/(byte*) bitmap_gfx#20 ) + call main + to:@37 +@37: scope:[] from @36 + (byte*) bitmap_screen#10 ← phi( @36/(byte*) bitmap_screen#4 ) + (byte*) bitmap_gfx#10 ← phi( @36/(byte*) bitmap_gfx#4 ) + (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 + (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 + to:@end +@end: scope:[] from @37 + +SYMBOL TABLE SSA +(byte*~) $0 +(label) @35 +(label) @36 +(label) @37 +(label) @8 +(label) @begin +(label) @end +(byte*) BITMAP +(byte*) BITMAP#0 +(byte) BLACK +(byte) BLACK#0 +(byte*) COSTAB +(byte*) COSTAB#0 +(byte*) COSTAB#1 +(byte*) COSTAB#2 +(byte*) COSTAB#3 +(byte*) COSTAB#4 +(byte*) COSTAB#5 +(byte*) COSTAB#6 +(byte*) COSTAB#7 +(byte*) COSTAB#8 +(byte*) COSTAB#9 +(byte*) D011 +(byte*) D011#0 +(byte*) D018 +(byte*) D018#0 +(byte*) SCREEN +(byte*) SCREEN#0 +(byte[$180]) SINTAB +(byte[$180]) SINTAB#0 +(byte) VIC_BMM +(byte) VIC_BMM#0 +(byte) VIC_DEN +(byte) VIC_DEN#0 +(byte) VIC_RSEL +(byte) VIC_RSEL#0 +(byte) WHITE +(byte) WHITE#0 +(word()) abs_u16((word) abs_u16::w) +(byte~) abs_u16::$0 +(number~) abs_u16::$1 +(word~) abs_u16::$2 +(bool~) abs_u16::$3 +(label) abs_u16::@1 +(label) abs_u16::@3 +(label) abs_u16::@return +(word) abs_u16::return +(word) abs_u16::return#0 +(word) abs_u16::return#1 +(word) abs_u16::return#2 +(word) abs_u16::return#3 +(word) abs_u16::return#4 +(word) abs_u16::return#5 +(word) abs_u16::return#6 +(word) abs_u16::return#7 +(word) abs_u16::w +(word) abs_u16::w#0 +(word) abs_u16::w#1 +(word) abs_u16::w#2 +(word) abs_u16::w#3 +(word) abs_u16::w#4 +(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) +(number~) bitmap_clear::$0 +(number~) bitmap_clear::$1 +(label) bitmap_clear::@1 +(label) bitmap_clear::@2 +(label) bitmap_clear::@return +(byte) bitmap_clear::bgcol +(byte) bitmap_clear::bgcol#0 +(byte) bitmap_clear::bgcol#1 +(byte) bitmap_clear::col +(byte) bitmap_clear::col#0 +(byte) bitmap_clear::fgcol +(byte) bitmap_clear::fgcol#0 +(byte) bitmap_clear::fgcol#1 +(byte*) bitmap_gfx +(byte*) bitmap_gfx#0 +(byte*) bitmap_gfx#1 +(byte*) bitmap_gfx#10 +(byte*) bitmap_gfx#11 +(byte*) bitmap_gfx#12 +(byte*) bitmap_gfx#13 +(byte*) bitmap_gfx#14 +(byte*) bitmap_gfx#15 +(byte*) bitmap_gfx#16 +(byte*) bitmap_gfx#17 +(byte*) bitmap_gfx#18 +(byte*) bitmap_gfx#19 +(byte*) bitmap_gfx#2 +(byte*) bitmap_gfx#20 +(byte*) bitmap_gfx#21 +(byte*) bitmap_gfx#22 +(byte*) bitmap_gfx#23 +(byte*) bitmap_gfx#24 +(byte*) bitmap_gfx#25 +(byte*) bitmap_gfx#26 +(byte*) bitmap_gfx#27 +(byte*) bitmap_gfx#28 +(byte*) bitmap_gfx#29 +(byte*) bitmap_gfx#3 +(byte*) bitmap_gfx#4 +(byte*) bitmap_gfx#5 +(byte*) bitmap_gfx#6 +(byte*) bitmap_gfx#7 +(byte*) bitmap_gfx#8 +(byte*) bitmap_gfx#9 +(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen) +(bool~) bitmap_init::$0 +(bool~) bitmap_init::$1 +(byte*~) bitmap_init::$10 +(bool~) bitmap_init::$11 +(bool~) bitmap_init::$2 +(number~) bitmap_init::$3 +(byte~) bitmap_init::$4 +(number~) bitmap_init::$5 +(byte~) bitmap_init::$6 +(number~) bitmap_init::$7 +(bool~) bitmap_init::$8 +(bool~) bitmap_init::$9 +(label) bitmap_init::@1 +(label) bitmap_init::@2 +(label) bitmap_init::@3 +(label) bitmap_init::@4 +(label) bitmap_init::@5 +(label) bitmap_init::@6 +(label) bitmap_init::@7 +(label) bitmap_init::@return +(byte) bitmap_init::bits +(byte) bitmap_init::bits#0 +(byte) bitmap_init::bits#1 +(byte) bitmap_init::bits#2 +(byte) bitmap_init::bits#3 +(byte) bitmap_init::bits#4 +(byte*) bitmap_init::gfx +(byte*) bitmap_init::gfx#0 +(byte*) bitmap_init::gfx#1 +(byte*) bitmap_init::gfx#2 +(byte*) bitmap_init::gfx#3 +(byte*) bitmap_init::gfx#4 +(byte*) bitmap_init::gfx#5 +(byte*) bitmap_init::screen +(byte*) bitmap_init::screen#0 +(byte*) bitmap_init::screen#1 +(byte) bitmap_init::x +(byte) bitmap_init::x#0 +(byte) bitmap_init::x#1 +(byte) bitmap_init::x#2 +(byte) bitmap_init::x#3 +(byte) bitmap_init::x#4 +(byte) bitmap_init::y +(byte) bitmap_init::y#0 +(byte) bitmap_init::y#1 +(byte) bitmap_init::y#2 +(byte) bitmap_init::y#3 +(byte) bitmap_init::y#4 +(byte*) bitmap_init::yoffs +(byte*) bitmap_init::yoffs#0 +(byte*) bitmap_init::yoffs#1 +(byte*) bitmap_init::yoffs#2 +(byte*) bitmap_init::yoffs#3 +(byte*) bitmap_init::yoffs#4 +(void()) bitmap_line((word) bitmap_line::x1 , (word) bitmap_line::y1 , (word) bitmap_line::x2 , (word) bitmap_line::y2) +(word~) bitmap_line::$0 +(word~) bitmap_line::$1 +(number~) bitmap_line::$11 +(byte~) bitmap_line::$12 +(bool~) bitmap_line::$14 +(bool~) bitmap_line::$15 +(bool~) bitmap_line::$16 +(number~) bitmap_line::$17 +(byte~) bitmap_line::$18 +(word~) bitmap_line::$2 +(bool~) bitmap_line::$20 +(bool~) bitmap_line::$21 +(bool~) bitmap_line::$22 +(word~) bitmap_line::$3 +(word~) bitmap_line::$4 +(word~) bitmap_line::$5 +(word~) bitmap_line::$6 +(word~) bitmap_line::$7 +(bool~) bitmap_line::$8 +(byte~) bitmap_line::$9 +(label) bitmap_line::@1 +(label) bitmap_line::@10 +(label) bitmap_line::@11 +(label) bitmap_line::@13 +(label) bitmap_line::@14 +(label) bitmap_line::@15 +(label) bitmap_line::@16 +(label) bitmap_line::@17 +(label) bitmap_line::@18 +(label) bitmap_line::@19 +(label) bitmap_line::@2 +(label) bitmap_line::@3 +(label) bitmap_line::@4 +(label) bitmap_line::@5 +(label) bitmap_line::@6 +(label) bitmap_line::@9 +(label) bitmap_line::@return +(word) bitmap_line::dx +(word) bitmap_line::dx#0 +(word) bitmap_line::dx#1 +(word) bitmap_line::dx#10 +(word) bitmap_line::dx#11 +(word) bitmap_line::dx#12 +(word) bitmap_line::dx#13 +(word) bitmap_line::dx#2 +(word) bitmap_line::dx#3 +(word) bitmap_line::dx#4 +(word) bitmap_line::dx#5 +(word) bitmap_line::dx#6 +(word) bitmap_line::dx#7 +(word) bitmap_line::dx#8 +(word) bitmap_line::dx#9 +(word) bitmap_line::dy +(word) bitmap_line::dy#0 +(word) bitmap_line::dy#1 +(word) bitmap_line::dy#10 +(word) bitmap_line::dy#11 +(word) bitmap_line::dy#12 +(word) bitmap_line::dy#2 +(word) bitmap_line::dy#3 +(word) bitmap_line::dy#4 +(word) bitmap_line::dy#5 +(word) bitmap_line::dy#6 +(word) bitmap_line::dy#7 +(word) bitmap_line::dy#8 +(word) bitmap_line::dy#9 +(word) bitmap_line::e +(word) bitmap_line::e#0 +(word) bitmap_line::e#1 +(word) bitmap_line::e#2 +(word) bitmap_line::e#3 +(word) bitmap_line::e#4 +(word) bitmap_line::e#5 +(word) bitmap_line::e#6 +(word) bitmap_line::e1 +(word) bitmap_line::e1#0 +(word) bitmap_line::e1#1 +(word) bitmap_line::e1#2 +(word) bitmap_line::e1#3 +(word) bitmap_line::e1#4 +(word) bitmap_line::e1#5 +(word) bitmap_line::e1#6 +(word) bitmap_line::sx +(word) bitmap_line::sx#0 +(word) bitmap_line::sx#1 +(word) bitmap_line::sx#10 +(word) bitmap_line::sx#11 +(word) bitmap_line::sx#2 +(word) bitmap_line::sx#3 +(word) bitmap_line::sx#4 +(word) bitmap_line::sx#5 +(word) bitmap_line::sx#6 +(word) bitmap_line::sx#7 +(word) bitmap_line::sx#8 +(word) bitmap_line::sx#9 +(word) bitmap_line::sy +(word) bitmap_line::sy#0 +(word) bitmap_line::sy#1 +(word) bitmap_line::sy#10 +(word) bitmap_line::sy#2 +(word) bitmap_line::sy#3 +(word) bitmap_line::sy#4 +(word) bitmap_line::sy#5 +(word) bitmap_line::sy#6 +(word) bitmap_line::sy#7 +(word) bitmap_line::sy#8 +(word) bitmap_line::sy#9 +(word) bitmap_line::x +(word) bitmap_line::x#0 +(word) bitmap_line::x#1 +(word) bitmap_line::x#10 +(word) bitmap_line::x#11 +(word) bitmap_line::x#12 +(word) bitmap_line::x#13 +(word) bitmap_line::x#14 +(word) bitmap_line::x#15 +(word) bitmap_line::x#16 +(word) bitmap_line::x#17 +(word) bitmap_line::x#2 +(word) bitmap_line::x#3 +(word) bitmap_line::x#4 +(word) bitmap_line::x#5 +(word) bitmap_line::x#6 +(word) bitmap_line::x#7 +(word) bitmap_line::x#8 +(word) bitmap_line::x#9 +(word) bitmap_line::x1 +(word) bitmap_line::x1#0 +(word) bitmap_line::x1#1 +(word) bitmap_line::x1#2 +(word) bitmap_line::x1#3 +(word) bitmap_line::x2 +(word) bitmap_line::x2#0 +(word) bitmap_line::x2#1 +(word) bitmap_line::x2#10 +(word) bitmap_line::x2#2 +(word) bitmap_line::x2#3 +(word) bitmap_line::x2#4 +(word) bitmap_line::x2#5 +(word) bitmap_line::x2#6 +(word) bitmap_line::x2#7 +(word) bitmap_line::x2#8 +(word) bitmap_line::x2#9 +(word) bitmap_line::y +(word) bitmap_line::y#0 +(word) bitmap_line::y#1 +(word) bitmap_line::y#10 +(word) bitmap_line::y#11 +(word) bitmap_line::y#12 +(word) bitmap_line::y#13 +(word) bitmap_line::y#14 +(word) bitmap_line::y#15 +(word) bitmap_line::y#16 +(word) bitmap_line::y#17 +(word) bitmap_line::y#2 +(word) bitmap_line::y#3 +(word) bitmap_line::y#4 +(word) bitmap_line::y#5 +(word) bitmap_line::y#6 +(word) bitmap_line::y#7 +(word) bitmap_line::y#8 +(word) bitmap_line::y#9 +(word) bitmap_line::y1 +(word) bitmap_line::y1#0 +(word) bitmap_line::y1#1 +(word) bitmap_line::y1#2 +(word) bitmap_line::y1#3 +(word) bitmap_line::y1#4 +(word) bitmap_line::y2 +(word) bitmap_line::y2#0 +(word) bitmap_line::y2#1 +(word) bitmap_line::y2#10 +(word) bitmap_line::y2#2 +(word) bitmap_line::y2#3 +(word) bitmap_line::y2#4 +(word) bitmap_line::y2#5 +(word) bitmap_line::y2#6 +(word) bitmap_line::y2#7 +(word) bitmap_line::y2#8 +(word) bitmap_line::y2#9 +(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) +(byte*~) bitmap_plot::$0 +(number~) bitmap_plot::$1 +(byte~) bitmap_plot::$2 +(label) bitmap_plot::@return +(byte*) bitmap_plot::plotter +(byte*) bitmap_plot::plotter#0 +(byte*) bitmap_plot::plotter#1 +(word) bitmap_plot::x +(word) bitmap_plot::x#0 +(word) bitmap_plot::x#1 +(word) bitmap_plot::x#2 +(word) bitmap_plot::x#3 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 +(byte) bitmap_plot::y#1 +(byte) bitmap_plot::y#2 +(byte) bitmap_plot::y#3 +(byte[$100]) bitmap_plot_bit +(byte[$100]) bitmap_plot_bit#0 +(byte[$100]) bitmap_plot_yhi +(byte[$100]) bitmap_plot_yhi#0 +(byte[$100]) bitmap_plot_ylo +(byte[$100]) bitmap_plot_ylo#0 +(byte*) bitmap_screen +(byte*) bitmap_screen#0 +(byte*) bitmap_screen#1 +(byte*) bitmap_screen#10 +(byte*) bitmap_screen#11 +(byte*) bitmap_screen#12 +(byte*) bitmap_screen#13 +(byte*) bitmap_screen#14 +(byte*) bitmap_screen#15 +(byte*) bitmap_screen#16 +(byte*) bitmap_screen#17 +(byte*) bitmap_screen#18 +(byte*) bitmap_screen#19 +(byte*) bitmap_screen#2 +(byte*) bitmap_screen#20 +(byte*) bitmap_screen#21 +(byte*) bitmap_screen#22 +(byte*) bitmap_screen#23 +(byte*) bitmap_screen#24 +(byte*) bitmap_screen#25 +(byte*) bitmap_screen#26 +(byte*) bitmap_screen#27 +(byte*) bitmap_screen#28 +(byte*) bitmap_screen#3 +(byte*) bitmap_screen#4 +(byte*) bitmap_screen#5 +(byte*) bitmap_screen#6 +(byte*) bitmap_screen#7 +(byte*) bitmap_screen#8 +(byte*) bitmap_screen#9 +(void()) main() +(word~) main::$10 +(number~) main::$11 +(number~) main::$12 +(word~) main::$13 +(bool~) main::$15 +(byte*~) main::$18 +(byte~) main::$2 +(byte~) main::$3 +(number~) main::$4 +(byte~) main::$5 +(word~) main::$6 +(number~) main::$7 +(word~) main::$8 +(number~) main::$9 +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@3 +(label) main::@4 +(label) main::@9 +(label) main::@return +(byte) main::a +(byte) main::a#0 +(byte) main::a#1 +(byte) main::a#2 +(byte) main::a#3 +(byte) main::i +(byte) main::i#0 +(byte) main::i#1 +(byte) main::i#2 +(byte) main::i#3 +(label) main::toD0181 +(word~) main::toD0181_$0 +(word~) main::toD0181_$0#0 +(number~) main::toD0181_$1 +(number~) main::toD0181_$1#0 +(number~) main::toD0181_$2 +(number~) main::toD0181_$2#0 +(number~) main::toD0181_$3 +(number~) main::toD0181_$3#0 +(word~) main::toD0181_$4 +(word~) main::toD0181_$4#0 +(byte~) main::toD0181_$5 +(byte~) main::toD0181_$5#0 +(number~) main::toD0181_$6 +(number~) main::toD0181_$6#0 +(number~) main::toD0181_$7 +(number~) main::toD0181_$7#0 +(number~) main::toD0181_$8 +(number~) main::toD0181_$8#0 +(label) main::toD0181_@return +(byte*) main::toD0181_gfx +(byte*) main::toD0181_gfx#0 +(byte*) main::toD0181_gfx#1 +(byte) main::toD0181_return +(byte) main::toD0181_return#0 +(byte) main::toD0181_return#1 +(byte) main::toD0181_return#2 +(byte) main::toD0181_return#3 +(byte*) main::toD0181_screen +(byte*) main::toD0181_screen#0 +(byte*) main::toD0181_screen#1 +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(byte*~) memset::$0 +(byte*~) memset::$1 +(bool~) memset::$2 +(label) memset::@1 +(label) memset::@2 +(label) memset::@return +(byte) memset::c +(byte) memset::c#0 +(byte) memset::c#1 +(byte) memset::c#2 +(byte) memset::c#3 +(byte*) memset::dst +(byte*) memset::dst#0 +(byte*) memset::dst#1 +(byte*) memset::dst#2 +(byte*) memset::end +(byte*) memset::end#0 +(byte*) memset::end#1 +(word) memset::num +(word) memset::num#0 +(word) memset::num#1 +(word) memset::num#2 +(void*) memset::return +(void*) memset::return#0 +(void*) memset::return#1 +(void*) memset::return#2 +(void*) memset::return#3 +(void*) memset::return#4 +(void*) memset::str +(void*) memset::str#0 +(void*) memset::str#1 +(void*) memset::str#2 +(void*) memset::str#3 +(void*) memset::str#4 +(word()) sgn_u16((word) sgn_u16::w) +(byte~) sgn_u16::$0 +(number~) sgn_u16::$1 +(bool~) sgn_u16::$2 +(label) sgn_u16::@1 +(label) sgn_u16::@3 +(label) sgn_u16::@return +(word) sgn_u16::return +(word) sgn_u16::return#0 +(word) sgn_u16::return#1 +(word) sgn_u16::return#2 +(word) sgn_u16::return#3 +(word) sgn_u16::return#4 +(word) sgn_u16::return#5 +(word) sgn_u16::return#6 +(word) sgn_u16::return#7 +(word) sgn_u16::w +(word) sgn_u16::w#0 +(word) sgn_u16::w#1 +(word) sgn_u16::w#2 + +Fixing inline constructor with bitmap_plot::$3 ← (byte)*(bitmap_plot_yhi#0 + bitmap_plot::y#3) w= (byte)*(bitmap_plot_ylo#0 + bitmap_plot::y#3) +Successful SSA optimization Pass2FixInlineConstructorsNew +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) 0 in (byte) BLACK#0 ← (number) 0 +Adding number conversion cast (unumber) 1 in (byte) WHITE#0 ← (number) 1 +Adding number conversion cast (unumber) $80 in (byte) bitmap_init::bits#0 ← (number) $80 +Adding number conversion cast (unumber) 1 in (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (number) 1 +Adding number conversion cast (unumber) 0 in (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (number) 0 +Adding number conversion cast (unumber) $80 in (byte) bitmap_init::bits#2 ← (number) $80 +Adding number conversion cast (unumber) 7 in (number~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (number) 7 +Adding number conversion cast (unumber) bitmap_init::$3 in (number~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (unumber)(number) 7 +Adding number conversion cast (unumber) bitmap_init::$5 in (number~) bitmap_init::$5 ← (unumber~) bitmap_init::$3 | (byte~) bitmap_init::$4 +Adding number conversion cast (unumber) 7 in (number~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (number) 7 +Adding number conversion cast (unumber) bitmap_init::$7 in (number~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (unumber)(number) 7 +Adding number conversion cast (unumber) 7 in (bool~) bitmap_init::$8 ← (unumber~) bitmap_init::$7 == (number) 7 +Adding number conversion cast (unumber) $28*8 in (byte*~) bitmap_init::$10 ← (byte*) bitmap_init::yoffs#3 + (number) $28*(number) 8 +Adding number conversion cast (unumber) $10 in (number~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (number) $10 +Adding number conversion cast (unumber) bitmap_clear::$0 in (number~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (unumber)(number) $10 +Adding number conversion cast (unumber) bitmap_clear::$1 in (number~) bitmap_clear::$1 ← (unumber~) bitmap_clear::$0 + (byte) bitmap_clear::bgcol#1 +Adding number conversion cast (unumber) 0 in (byte) memset::c#1 ← (number) 0 +Adding number conversion cast (unumber) $fff8 in (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (number) $fff8 +Adding number conversion cast (unumber) bitmap_plot::$1 in (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (unumber)(number) $fff8 +Adding number conversion cast (unumber) 2 in (number~) bitmap_line::$17 ← (word) bitmap_line::dy#2 / (number) 2 +Adding number conversion cast (unumber) bitmap_line::$17 in (number~) bitmap_line::$17 ← (word) bitmap_line::dy#2 / (unumber)(number) 2 +Adding number conversion cast (unumber) 2 in (number~) bitmap_line::$11 ← (word) bitmap_line::dx#2 / (number) 2 +Adding number conversion cast (unumber) bitmap_line::$11 in (number~) bitmap_line::$11 ← (word) bitmap_line::dx#2 / (unumber)(number) 2 +Adding number conversion cast (unumber) $80 in (number~) abs_u16::$1 ← (byte~) abs_u16::$0 & (number) $80 +Adding number conversion cast (unumber) abs_u16::$1 in (number~) abs_u16::$1 ← (byte~) abs_u16::$0 & (unumber)(number) $80 +Adding number conversion cast (unumber) 0 in (bool~) abs_u16::$3 ← (number) 0 != (unumber~) abs_u16::$1 +Adding number conversion cast (unumber) $80 in (number~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (number) $80 +Adding number conversion cast (unumber) sgn_u16::$1 in (number~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (unumber)(number) $80 +Adding number conversion cast (unumber) 0 in (bool~) sgn_u16::$2 ← (number) 0 != (unumber~) sgn_u16::$1 +Adding number conversion cast (unumber) $ffff in (word) sgn_u16::return#2 ← (number) $ffff +Adding number conversion cast (unumber) 1 in (word) sgn_u16::return#3 ← (number) 1 +Adding number conversion cast (unumber) $40 in (byte*~) $0 ← (byte[$180]) SINTAB#0 + (number) $40 +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::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff +Adding number conversion cast (unumber) main::toD0181_$1#0 in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (unumber)(number) $3fff +Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (number) 4 +Adding number conversion cast (unumber) main::toD0181_$2#0 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (unumber)(number) 4 +Adding number conversion cast (unumber) main::toD0181_$3#0 in (number~) main::toD0181_$3#0 ← > (unumber~) main::toD0181_$2#0 +Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4 +Adding number conversion cast (unumber) main::toD0181_$6#0 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (unumber)(number) 4 +Adding number conversion cast (unumber) $f in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (number) $f +Adding number conversion cast (unumber) main::toD0181_$7#0 in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (unumber)(number) $f +Adding number conversion cast (unumber) main::toD0181_$8#0 in (number~) main::toD0181_$8#0 ← (unumber~) main::toD0181_$3#0 | (unumber~) main::toD0181_$7#0 +Adding number conversion cast (unumber) 0 in (byte) main::i#0 ← (number) 0 +Adding number conversion cast (unumber) 0 in (byte) main::a#0 ← (number) 0 +Adding number conversion cast (unumber) $78 in (number~) main::$7 ← (word~) main::$6 + (number) $78 +Adding number conversion cast (unumber) main::$7 in (number~) main::$7 ← (word~) main::$6 + (unumber)(number) $78 +Adding number conversion cast (unumber) $20 in (number~) main::$9 ← (byte) main::a#2 + (number) $20 +Adding number conversion cast (unumber) main::$9 in (number~) main::$9 ← (byte) main::a#2 + (unumber)(number) $20 +Adding number conversion cast (unumber) $78 in (number~) main::$11 ← (word~) main::$10 + (number) $78 +Adding number conversion cast (unumber) main::$11 in (number~) main::$11 ← (word~) main::$10 + (unumber)(number) $78 +Adding number conversion cast (unumber) $20 in (number~) main::$12 ← (byte) main::a#2 + (number) $20 +Adding number conversion cast (unumber) main::$12 in (number~) main::$12 ← (byte) main::a#2 + (unumber)(number) $20 +Adding number conversion cast (unumber) $20 in (byte) main::a#1 ← (byte) main::a#3 + (number) $20 +Adding number conversion cast (unumber) 8 in (bool~) main::$15 ← (byte) main::i#1 != (number) 8 +Adding number conversion cast (unumber) $3e7 in (byte*~) main::$18 ← (byte*) SCREEN#0 + (number) $3e7 +Successful SSA optimization PassNAddNumberTypeConversions +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*) D018#0 ← (byte*)(number) $d018 +Inlining cast (byte) BLACK#0 ← (unumber)(number) 0 +Inlining cast (byte) WHITE#0 ← (unumber)(number) 1 +Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 +Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 +Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80 +Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80 +Inlining cast (byte) memset::c#1 ← (unumber)(number) 0 +Inlining cast (byte~) bitmap_line::$12 ← (byte)(word) bitmap_line::y#3 +Inlining cast (byte~) bitmap_line::$9 ← (byte)(word) bitmap_line::y#6 +Inlining cast (byte~) bitmap_line::$18 ← (byte)(word) bitmap_line::y#7 +Inlining cast (word) sgn_u16::return#2 ← (unumber)(number) $ffff +Inlining cast (word) sgn_u16::return#3 ← (unumber)(number) 1 +Inlining cast (byte*) BITMAP#0 ← (byte*)(number) $2000 +Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 +Inlining cast (word~) main::toD0181_$0#0 ← (word)(byte*) main::toD0181_screen#1 +Inlining cast (word~) main::toD0181_$4#0 ← (word)(byte*) main::toD0181_gfx#1 +Inlining cast (byte) main::i#0 ← (unumber)(number) 0 +Inlining cast (byte) main::a#0 ← (unumber)(number) 0 +Inlining cast (word~) main::$6 ← (word)*((byte*) COSTAB#1 + (byte) main::a#2) +Inlining cast (word~) main::$8 ← (word)*((byte[$180]) SINTAB#0 + (byte) main::a#2) +Inlining cast (word~) main::$10 ← (word)*((byte*) COSTAB#1 + (unumber~) main::$9) +Inlining cast (word~) main::$13 ← (word)*((byte[$180]) SINTAB#0 + (unumber~) main::$12) +Successful SSA optimization Pass2InlineCast +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 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast $80 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast $80 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast $10 +Simplifying constant integer cast 0 +Simplifying constant integer cast *((byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) +Simplifying constant integer cast *((byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) +Simplifying constant integer cast $fff8 +Simplifying constant integer cast 2 +Simplifying constant integer cast 2 +Simplifying constant integer cast $80 +Simplifying constant integer cast 0 +Simplifying constant integer cast $80 +Simplifying constant integer cast 0 +Simplifying constant integer cast $ffff +Simplifying constant integer cast 1 +Simplifying constant pointer cast (byte*) 8192 +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant integer cast $40 +Simplifying constant integer cast 3 +Simplifying constant integer cast $3fff +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast $f +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast $78 +Simplifying constant integer cast $20 +Simplifying constant integer cast $78 +Simplifying constant integer cast $20 +Simplifying constant integer cast $20 +Simplifying constant integer cast 8 +Simplifying constant integer cast $3e7 +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) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) $10 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $fff8 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (word) $ffff +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (word) $3fff +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) 4 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $78 +Finalized unsigned number type (byte) $20 +Finalized unsigned number type (byte) $78 +Finalized unsigned number type (byte) $20 +Finalized unsigned number type (byte) $20 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (word) $3e7 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Inferred type updated to byte in (unumber~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (byte) 7 +Inferred type updated to byte in (unumber~) bitmap_init::$5 ← (byte~) bitmap_init::$3 | (byte~) bitmap_init::$4 +Inferred type updated to byte in (unumber~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 +Inferred type updated to byte in (unumber~) bitmap_clear::$0 ← (byte) bitmap_clear::fgcol#1 * (byte) $10 +Inferred type updated to byte in (unumber~) bitmap_clear::$1 ← (byte~) bitmap_clear::$0 + (byte) bitmap_clear::bgcol#1 +Inferred type updated to word in (unumber~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 +Inferred type updated to word in (unumber~) bitmap_line::$17 ← (word) bitmap_line::dy#2 / (byte) 2 +Inferred type updated to word in (unumber~) bitmap_line::$11 ← (word) bitmap_line::dx#2 / (byte) 2 +Inferred type updated to byte in (unumber~) abs_u16::$1 ← (byte~) abs_u16::$0 & (byte) $80 +Inferred type updated to byte in (unumber~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (byte) $80 +Inferred type updated to byte in (unumber~) main::$4 ← (byte~) main::$3 | (byte) 3 +Inferred type updated to word in (unumber~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (word) $3fff +Inferred type updated to word in (unumber~) main::toD0181_$2#0 ← (word~) main::toD0181_$1#0 * (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0181_$3#0 ← > (word~) main::toD0181_$2#0 +Inferred type updated to byte in (unumber~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0181_$7#0 ← (byte~) main::toD0181_$6#0 & (byte) $f +Inferred type updated to byte in (unumber~) main::toD0181_$8#0 ← (byte~) main::toD0181_$3#0 | (byte~) main::toD0181_$7#0 +Inferred type updated to word in (unumber~) main::$7 ← (word~) main::$6 + (byte) $78 +Inferred type updated to byte in (unumber~) main::$9 ← (byte) main::a#2 + (byte) $20 +Inferred type updated to word in (unumber~) main::$11 ← (word~) main::$10 + (byte) $78 +Inferred type updated to byte in (unumber~) main::$12 ← (byte) main::a#2 + (byte) $20 +Adding pointer type conversion cast (byte*) bitmap_plot::$0 in (byte*~) bitmap_plot::$0 ← (word~) bitmap_plot::$3 +Successful SSA optimization PassNAddTypeConversionAssignment +Inversing boolean not [36] (bool~) bitmap_init::$1 ← (byte) bitmap_init::bits#1 != (byte) 0 from [35] (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (byte) 0 +Inversing boolean not [56] (bool~) bitmap_init::$9 ← (byte~) bitmap_init::$7 != (byte) 7 from [55] (bool~) bitmap_init::$8 ← (byte~) bitmap_init::$7 == (byte) 7 +Inversing boolean not [142] (bool~) bitmap_line::$15 ← (word) bitmap_line::dy#3 >= (word) bitmap_line::e#1 from [141] (bool~) bitmap_line::$14 ← (word) bitmap_line::dy#3 < (word) bitmap_line::e#1 +Inversing boolean not [164] (bool~) bitmap_line::$21 ← (word) bitmap_line::dx#4 >= (word) bitmap_line::e1#1 from [163] (bool~) bitmap_line::$20 ← (word) bitmap_line::dx#4 < (word) bitmap_line::e1#1 +Successful SSA optimization Pass2UnaryNotSimplification +Alias (byte*) memset::end#0 = (byte*~) memset::$1 +Alias (void*) memset::return#0 = (void*) memset::str#3 (void*) memset::str#4 (void*) memset::return#4 (void*) memset::return#1 +Alias (byte) bitmap_init::x#2 = (byte) bitmap_init::x#4 +Alias (byte*) bitmap_init::gfx#4 = (byte*) bitmap_init::gfx#5 +Alias (byte*) bitmap_gfx#25 = (byte*) bitmap_gfx#26 +Alias (byte*) bitmap_screen#24 = (byte*) bitmap_screen#25 +Alias (byte*) bitmap_init::gfx#2 = (byte*) bitmap_init::gfx#3 (byte*) bitmap_init::yoffs#0 +Alias (byte*) bitmap_gfx#21 = (byte*) bitmap_gfx#23 +Alias (byte*) bitmap_screen#20 = (byte*) bitmap_screen#22 +Alias (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#3 +Alias (byte) bitmap_init::y#2 = (byte) bitmap_init::y#4 +Alias (byte*) bitmap_gfx#16 = (byte*) bitmap_gfx#17 +Alias (byte*) bitmap_screen#15 = (byte*) bitmap_screen#16 +Alias (byte*) bitmap_init::yoffs#1 = (byte*~) bitmap_init::$10 +Alias (byte*) bitmap_gfx#11 = (byte*) bitmap_gfx#6 (byte*) bitmap_gfx#2 +Alias (byte*) bitmap_screen#11 = (byte*) bitmap_screen#6 (byte*) bitmap_screen#2 +Alias (byte) bitmap_clear::col#0 = (byte~) bitmap_clear::$1 +Alias (byte*) bitmap_gfx#12 = (byte*) bitmap_gfx#7 +Alias (byte*) bitmap_plot::plotter#0 = (byte*~) bitmap_plot::$0 +Alias (word) bitmap_line::x#0 = (word) bitmap_line::x1#1 (word) bitmap_line::x1#3 (word) bitmap_line::x#17 (word) bitmap_line::x1#2 (word) bitmap_line::x#16 (word) bitmap_line::x#15 (word) bitmap_line::x#14 (word) bitmap_line::x#12 (word) bitmap_line::x#9 +Alias (word) bitmap_line::y#0 = (word) bitmap_line::y1#1 (word) bitmap_line::y1#2 (word) bitmap_line::y#17 (word) bitmap_line::y1#4 (word) bitmap_line::y#16 (word) bitmap_line::y1#3 (word) bitmap_line::y#15 (word) bitmap_line::y#14 (word) bitmap_line::y#12 (word) bitmap_line::y#9 +Alias (word) abs_u16::w#0 = (word~) bitmap_line::$0 +Alias (word) abs_u16::return#0 = (word) abs_u16::return#5 +Alias (word) bitmap_line::y2#1 = (word) bitmap_line::y2#4 (word) bitmap_line::y2#5 (word) bitmap_line::y2#2 (word) bitmap_line::y2#10 (word) bitmap_line::y2#9 +Alias (word) bitmap_line::x2#1 = (word) bitmap_line::x2#4 (word) bitmap_line::x2#2 (word) bitmap_line::x2#10 (word) bitmap_line::x2#9 (word) bitmap_line::x2#8 +Alias (word) bitmap_line::dx#0 = (word~) bitmap_line::$1 (word) bitmap_line::dx#9 (word) bitmap_line::dx#6 (word) bitmap_line::dx#1 (word) bitmap_line::dx#11 (word) bitmap_line::dx#2 +Alias (word) abs_u16::w#1 = (word~) bitmap_line::$2 +Alias (word) abs_u16::return#1 = (word) abs_u16::return#6 +Alias (word) bitmap_line::dy#0 = (word~) bitmap_line::$3 (word) bitmap_line::dy#6 (word) bitmap_line::dy#1 (word) bitmap_line::dy#2 (word) bitmap_line::dy#9 +Alias (word) sgn_u16::w#0 = (word~) bitmap_line::$4 +Alias (word) sgn_u16::return#0 = (word) sgn_u16::return#5 +Alias (word) bitmap_line::sx#0 = (word~) bitmap_line::$5 (word) bitmap_line::sx#8 (word) bitmap_line::sx#6 (word) bitmap_line::sx#9 +Alias (word) sgn_u16::w#1 = (word~) bitmap_line::$6 +Alias (word) sgn_u16::return#1 = (word) sgn_u16::return#6 +Alias (word) bitmap_line::sy#0 = (word~) bitmap_line::$7 (word) bitmap_line::sy#9 (word) bitmap_line::sy#5 +Alias (word) bitmap_line::e1#0 = (word~) bitmap_line::$17 +Alias (word) bitmap_line::e#0 = (word~) bitmap_line::$11 +Alias (byte) bitmap_plot::y#0 = (byte~) bitmap_line::$12 +Alias (word) bitmap_line::y#3 = (word) bitmap_line::y#4 +Alias (word) bitmap_line::sy#1 = (word) bitmap_line::sy#3 (word) bitmap_line::sy#8 +Alias (word) bitmap_line::e#3 = (word) bitmap_line::e#5 +Alias (word) bitmap_line::dx#13 = (word) bitmap_line::dx#3 (word) bitmap_line::dx#7 +Alias (word) bitmap_line::dy#3 = (word) bitmap_line::dy#7 (word) bitmap_line::dy#4 +Alias (word) bitmap_line::y2#6 = (word) bitmap_line::y2#8 (word) bitmap_line::y2#7 +Alias (word) bitmap_line::x#11 = (word) bitmap_line::x#3 (word) bitmap_line::x#4 +Alias (word) bitmap_line::sx#1 = (word) bitmap_line::sx#3 (word) bitmap_line::sx#5 +Alias (word) bitmap_line::e#1 = (word) bitmap_line::e#4 +Alias (word) bitmap_line::y#1 = (word) bitmap_line::y#10 +Alias (byte) bitmap_plot::y#1 = (byte~) bitmap_line::$9 +Alias (byte) bitmap_plot::y#2 = (byte~) bitmap_line::$18 +Alias (word) bitmap_line::x#6 = (word) bitmap_line::x#7 +Alias (word) bitmap_line::sx#11 = (word) bitmap_line::sx#2 (word) bitmap_line::sx#4 +Alias (word) bitmap_line::e1#3 = (word) bitmap_line::e1#5 +Alias (word) bitmap_line::dy#12 = (word) bitmap_line::dy#5 (word) bitmap_line::dy#8 +Alias (word) bitmap_line::dx#4 = (word) bitmap_line::dx#8 (word) bitmap_line::dx#5 +Alias (word) bitmap_line::x2#5 = (word) bitmap_line::x2#6 (word) bitmap_line::x2#7 +Alias (word) bitmap_line::y#13 = (word) bitmap_line::y#7 (word) bitmap_line::y#8 +Alias (word) bitmap_line::sy#2 = (word) bitmap_line::sy#4 (word) bitmap_line::sy#7 +Alias (word) bitmap_line::e1#1 = (word) bitmap_line::e1#4 +Alias (word) bitmap_line::x#13 = (word) bitmap_line::x#2 +Alias (word) abs_u16::w#2 = (word) abs_u16::w#3 (word) abs_u16::w#4 (word) abs_u16::return#3 +Alias (word) abs_u16::return#2 = (word~) abs_u16::$2 +Alias (word) abs_u16::return#4 = (word) abs_u16::return#7 +Alias (word) sgn_u16::return#4 = (word) sgn_u16::return#7 +Alias (byte*) bitmap_gfx#0 = (byte*) bitmap_gfx#20 (byte*) bitmap_gfx#15 +Alias (byte*) bitmap_screen#0 = (byte*) bitmap_screen#19 (byte*) bitmap_screen#14 +Alias (byte*) COSTAB#0 = (byte*~) $0 (byte*) COSTAB#9 +Alias (byte*) COSTAB#3 = (byte*) COSTAB#7 (byte*) COSTAB#8 (byte*) COSTAB#6 (byte*) COSTAB#5 (byte*) COSTAB#4 +Alias (byte*) bitmap_gfx#24 = (byte*) bitmap_gfx#3 (byte*) bitmap_gfx#8 (byte*) bitmap_gfx#29 (byte*) bitmap_gfx#28 (byte*) bitmap_gfx#27 +Alias (byte*) bitmap_screen#23 = (byte*) bitmap_screen#3 (byte*) bitmap_screen#8 (byte*) bitmap_screen#28 (byte*) bitmap_screen#27 (byte*) bitmap_screen#26 +Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 +Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 +Alias (byte) main::toD0181_return#0 = (byte~) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$5 +Alias (word) bitmap_line::x1#0 = (word~) main::$7 +Alias (word) bitmap_line::y1#0 = (word~) main::$8 +Alias (word) bitmap_line::x2#0 = (word~) main::$11 +Alias (word) bitmap_line::y2#0 = (word~) main::$13 +Alias (byte) main::a#2 = (byte) main::a#3 +Alias (byte) main::i#2 = (byte) main::i#3 +Alias (byte*) COSTAB#1 = (byte*) COSTAB#2 +Alias (byte*) bitmap_gfx#18 = (byte*) bitmap_gfx#22 +Alias (byte*) bitmap_screen#17 = (byte*) bitmap_screen#21 +Alias (byte*) bitmap_gfx#14 = (byte*) bitmap_gfx#19 (byte*) bitmap_gfx#9 (byte*) bitmap_gfx#4 +Alias (byte*) bitmap_screen#13 = (byte*) bitmap_screen#18 (byte*) bitmap_screen#9 (byte*) bitmap_screen#4 +Alias (byte*) bitmap_gfx#10 = (byte*) bitmap_gfx#5 +Alias (byte*) bitmap_screen#10 = (byte*) bitmap_screen#5 +Successful SSA optimization Pass2AliasElimination +Alias (byte) bitmap_init::x#2 = (byte) bitmap_init::x#3 +Alias (byte*) bitmap_init::gfx#2 = (byte*) bitmap_init::gfx#4 +Alias (byte*) bitmap_gfx#21 = (byte*) bitmap_gfx#25 +Alias (byte*) bitmap_screen#20 = (byte*) bitmap_screen#24 +Alias (byte) bitmap_init::y#2 = (byte) bitmap_init::y#3 +Alias (byte*) bitmap_gfx#11 = (byte*) bitmap_gfx#16 +Alias (byte*) bitmap_screen#11 = (byte*) bitmap_screen#15 +Alias (word) bitmap_line::y#1 = (word) bitmap_line::y#5 +Alias (word) bitmap_line::y2#3 = (word) bitmap_line::y2#6 +Alias (word) bitmap_line::sy#1 = (word) bitmap_line::sy#6 +Alias (word) bitmap_line::dx#10 = (word) bitmap_line::dx#13 +Alias (word) bitmap_line::dy#10 = (word) bitmap_line::dy#3 +Alias (word) bitmap_line::sx#1 = (word) bitmap_line::sx#10 +Alias (word) bitmap_line::x#13 = (word) bitmap_line::x#8 +Alias (word) bitmap_line::x2#3 = (word) bitmap_line::x2#5 +Alias (word) bitmap_line::sx#11 = (word) bitmap_line::sx#7 +Alias (word) bitmap_line::dy#11 = (word) bitmap_line::dy#12 +Alias (word) bitmap_line::dx#12 = (word) bitmap_line::dx#4 +Alias (word) bitmap_line::sy#10 = (word) bitmap_line::sy#2 +Successful SSA optimization Pass2AliasElimination +Self Phi Eliminated (byte) memset::c#2 +Self Phi Eliminated (byte*) memset::end#1 +Self Phi Eliminated (void*) memset::return#0 +Self Phi Eliminated (byte*) bitmap_init::gfx#2 +Self Phi Eliminated (byte*) bitmap_gfx#21 +Self Phi Eliminated (byte*) bitmap_screen#20 +Self Phi Eliminated (byte*) bitmap_gfx#11 +Self Phi Eliminated (byte*) bitmap_screen#11 +Self Phi Eliminated (word) bitmap_line::sy#1 +Self Phi Eliminated (word) bitmap_line::dx#10 +Self Phi Eliminated (word) bitmap_line::dy#10 +Self Phi Eliminated (word) bitmap_line::y2#3 +Self Phi Eliminated (word) bitmap_line::sx#1 +Self Phi Eliminated (word) bitmap_line::sx#11 +Self Phi Eliminated (word) bitmap_line::dy#11 +Self Phi Eliminated (word) bitmap_line::dx#12 +Self Phi Eliminated (word) bitmap_line::x2#3 +Self Phi Eliminated (word) bitmap_line::sy#10 +Self Phi Eliminated (byte*) COSTAB#1 +Self Phi Eliminated (byte*) bitmap_gfx#18 +Self Phi Eliminated (byte*) bitmap_screen#17 +Self Phi Eliminated (byte*) bitmap_gfx#14 +Self Phi Eliminated (byte*) bitmap_screen#13 +Successful SSA optimization Pass2SelfPhiElimination +Identical Phi Values (byte) memset::c#2 (byte) memset::c#3 +Identical Phi Values (byte*) memset::end#1 (byte*) memset::end#0 +Identical Phi Values (void*) memset::return#0 (void*) memset::str#2 +Identical Phi Values (byte*) bitmap_init::gfx#1 (byte*) bitmap_init::gfx#0 +Identical Phi Values (byte*) bitmap_init::screen#1 (byte*) bitmap_init::screen#0 +Identical Phi Values (byte*) bitmap_init::gfx#2 (byte*) bitmap_init::gfx#1 +Identical Phi Values (byte*) bitmap_gfx#21 (byte*) bitmap_gfx#1 +Identical Phi Values (byte*) bitmap_screen#20 (byte*) bitmap_screen#1 +Identical Phi Values (byte*) bitmap_gfx#11 (byte*) bitmap_gfx#21 +Identical Phi Values (byte*) bitmap_screen#11 (byte*) bitmap_screen#20 +Identical Phi Values (byte) bitmap_clear::fgcol#1 (byte) bitmap_clear::fgcol#0 +Identical Phi Values (byte) bitmap_clear::bgcol#1 (byte) bitmap_clear::bgcol#0 +Identical Phi Values (byte*) bitmap_screen#7 (byte*) bitmap_screen#23 +Identical Phi Values (byte*) bitmap_gfx#12 (byte*) bitmap_gfx#24 +Identical Phi Values (word) bitmap_line::x#0 (word) bitmap_line::x1#0 +Identical Phi Values (word) bitmap_line::y#0 (word) bitmap_line::y1#0 +Identical Phi Values (word) bitmap_line::x2#1 (word) bitmap_line::x2#0 +Identical Phi Values (word) bitmap_line::y2#1 (word) bitmap_line::y2#0 +Identical Phi Values (word) bitmap_line::sy#1 (word) bitmap_line::sy#0 +Identical Phi Values (word) bitmap_line::dx#10 (word) bitmap_line::dx#0 +Identical Phi Values (word) bitmap_line::dy#10 (word) bitmap_line::dy#0 +Identical Phi Values (word) bitmap_line::y2#3 (word) bitmap_line::y2#1 +Identical Phi Values (word) bitmap_line::sx#1 (word) bitmap_line::sx#0 +Identical Phi Values (word) bitmap_line::sx#11 (word) bitmap_line::sx#0 +Identical Phi Values (word) bitmap_line::dy#11 (word) bitmap_line::dy#0 +Identical Phi Values (word) bitmap_line::dx#12 (word) bitmap_line::dx#0 +Identical Phi Values (word) bitmap_line::x2#3 (word) bitmap_line::x2#1 +Identical Phi Values (word) bitmap_line::sy#10 (word) bitmap_line::sy#0 +Identical Phi Values (byte*) bitmap_gfx#13 (byte*) bitmap_gfx#0 +Identical Phi Values (byte*) bitmap_screen#12 (byte*) bitmap_screen#0 +Identical Phi Values (byte*) COSTAB#3 (byte*) COSTAB#0 +Identical Phi Values (byte*) bitmap_gfx#24 (byte*) bitmap_gfx#11 +Identical Phi Values (byte*) bitmap_screen#23 (byte*) bitmap_screen#11 +Identical Phi Values (byte*) COSTAB#1 (byte*) COSTAB#3 +Identical Phi Values (byte*) bitmap_gfx#18 (byte*) bitmap_gfx#24 +Identical Phi Values (byte*) bitmap_screen#17 (byte*) bitmap_screen#23 +Identical Phi Values (byte*) bitmap_gfx#14 (byte*) bitmap_gfx#18 +Identical Phi Values (byte*) bitmap_screen#13 (byte*) bitmap_screen#17 +Identical Phi Values (byte*) bitmap_gfx#10 (byte*) bitmap_gfx#14 +Identical Phi Values (byte*) bitmap_screen#10 (byte*) bitmap_screen#13 +Successful SSA optimization Pass2IdenticalPhiElimination +Identified duplicate assignment right side [54] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 +Successful SSA optimization Pass2DuplicateRValueIdentification +Simple Condition (bool~) memset::$2 [16] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 +Simple Condition (bool~) bitmap_init::$1 [37] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@2 +Simple Condition (bool~) bitmap_init::$2 [41] if((byte) bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 +Simple Condition (bool~) bitmap_init::$9 [57] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@6 +Simple Condition (bool~) bitmap_init::$11 [61] if((byte) bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 +Simple Condition (bool~) bitmap_line::$8 [126] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 +Simple Condition (bool~) bitmap_line::$15 [143] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 +Simple Condition (bool~) bitmap_line::$16 [146] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 +Simple Condition (bool~) bitmap_line::$21 [165] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@10 +Simple Condition (bool~) bitmap_line::$22 [168] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@9 +Simple Condition (bool~) abs_u16::$3 [177] if((byte) 0!=(byte~) abs_u16::$1) goto abs_u16::@1 +Simple Condition (bool~) sgn_u16::$2 [190] if((byte) 0!=(byte~) sgn_u16::$1) goto sgn_u16::@1 +Simple Condition (bool~) main::$15 [255] if((byte) main::i#1!=(byte) 8) goto main::@1 +Successful SSA optimization Pass2ConditionalJumpSimplification +Constant right-side identified [24] (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } +Constant right-side identified [25] (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } +Constant right-side identified [26] (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } +Successful SSA optimization Pass2ConstantRValueConsolidation +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*) D018#0 = (byte*) 53272 +Constant (const byte) BLACK#0 = 0 +Constant (const byte) WHITE#0 = 1 +Constant (const byte*) bitmap_screen#0 = (byte*) 0 +Constant (const byte*) bitmap_gfx#0 = (byte*) 0 +Constant (const byte[$100]) bitmap_plot_ylo#0 = { fill( $100, 0) } +Constant (const byte[$100]) bitmap_plot_yhi#0 = { fill( $100, 0) } +Constant (const byte[$100]) bitmap_plot_bit#0 = { fill( $100, 0) } +Constant (const byte) bitmap_init::bits#0 = $80 +Constant (const byte) bitmap_init::x#0 = 0 +Constant (const byte) bitmap_init::bits#2 = $80 +Constant (const byte) bitmap_init::y#0 = 0 +Constant (const word) memset::num#0 = $3e8 +Constant (const byte) memset::c#1 = 0 +Constant (const word) memset::num#1 = $1f40 +Constant (const word) sgn_u16::return#2 = $ffff +Constant (const word) sgn_u16::return#3 = 1 +Constant (const byte*) BITMAP#0 = (byte*) 8192 +Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte[$180]) SINTAB#0 = kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} +Constant (const byte) main::i#0 = 0 +Constant (const byte) main::a#0 = 0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte*) bitmap_init::gfx#0 = BITMAP#0 +Constant (const byte*) bitmap_init::screen#0 = SCREEN#0 +Constant (const byte) bitmap_clear::bgcol#0 = BLACK#0 +Constant (const byte) bitmap_clear::fgcol#0 = WHITE#0 +Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 +Constant (const byte*) main::toD0181_gfx#0 = BITMAP#0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte*) bitmap_gfx#1 = bitmap_init::gfx#0 +Constant (const byte*) bitmap_screen#1 = bitmap_init::screen#0 +Successful SSA optimization Pass2ConstantIdentification +Constant value identified (void*)bitmap_screen#1 in [73] (void*) memset::str#0 ← (void*)(const byte*) bitmap_screen#1 +Constant value identified (void*)bitmap_gfx#1 in [79] (void*) memset::str#1 ← (void*)(const byte*) bitmap_gfx#1 +Constant value identified (word)main::toD0181_screen#0 in [220] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0 +Constant value identified (word)main::toD0181_gfx#0 in [224] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0 +Successful SSA optimization Pass2ConstantValues +if() condition always true - replacing block destination [257] if(true) goto main::@4 +Successful SSA optimization Pass2ConstantIfs +Resolved ranged next value [39] bitmap_init::x#1 ← ++ bitmap_init::x#2 to ++ +Resolved ranged comparison value [41] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to (number) 0 +Resolved ranged next value [59] bitmap_init::y#1 ← ++ bitmap_init::y#2 to ++ +Resolved ranged comparison value [61] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to (number) 0 +Simplifying expression containing zero bitmap_clear::$0 in [71] (byte) bitmap_clear::col#0 ← (byte~) bitmap_clear::$0 + (const byte) bitmap_clear::bgcol#0 +Successful SSA optimization PassNSimplifyExpressionWithZero +Eliminating unused variable (void*) memset::return#2 and assignment [35] (void*) memset::return#2 ← (void*) memset::str#2 +Eliminating unused variable (void*) memset::return#3 and assignment [38] (void*) memset::return#3 ← (void*) memset::str#2 +Eliminating unused constant (const byte) bitmap_clear::bgcol#0 +Eliminating unused constant (const byte*) bitmap_screen#0 +Eliminating unused constant (const byte*) bitmap_gfx#0 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const byte) BLACK#0 +Successful SSA optimization PassNEliminateUnusedVars +Removing unused block main::@return +Successful SSA optimization Pass2EliminateUnusedBlocks +Adding number conversion cast (unumber) 0 in if((byte) bitmap_init::x#1!=(number) 0) goto bitmap_init::@1 +Adding number conversion cast (unumber) 0 in if((byte) bitmap_init::y#1!=(number) 0) goto bitmap_init::@5 +Successful SSA optimization PassNAddNumberTypeConversions +Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 +Successful SSA optimization Pass2InlineCast +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Alias (byte~) bitmap_init::$7 = (byte~) bitmap_init::$3 +Alias (byte) bitmap_clear::col#0 = (byte~) bitmap_clear::$0 +Successful SSA optimization Pass2AliasElimination +Constant right-side identified [30] (byte) bitmap_clear::col#0 ← (const byte) bitmap_clear::fgcol#0 * (byte) $10 +Constant right-side identified [105] (byte*) COSTAB#0 ← (const byte[$180]) SINTAB#0 + (byte) $40 +Constant right-side identified [108] (byte~) main::$2 ← (const byte) VIC_BMM#0 | (const byte) VIC_DEN#0 +Constant right-side identified [135] (byte*~) main::$18 ← (const byte*) SCREEN#0 + (word) $3e7 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) bitmap_clear::col#0 = bitmap_clear::fgcol#0*$10 +Constant (const void*) memset::str#0 = (void*)bitmap_screen#1 +Constant (const void*) memset::str#1 = (void*)bitmap_gfx#1 +Constant (const byte*) COSTAB#0 = SINTAB#0+$40 +Constant (const byte) main::$2 = VIC_BMM#0|VIC_DEN#0 +Constant (const word) main::toD0181_$0#0 = (word)main::toD0181_screen#0 +Constant (const word) main::toD0181_$4#0 = (word)main::toD0181_gfx#0 +Constant (const byte*) main::$18 = SCREEN#0+$3e7 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte) memset::c#0 = bitmap_clear::col#0 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [101] (byte~) main::$3 ← (const byte) main::$2 | (const byte) VIC_RSEL#0 +Constant right-side identified [104] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff +Constant right-side identified [107] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::$3 = main::$2|VIC_RSEL#0 +Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff +Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [101] (byte~) main::$4 ← (const byte) main::$3 | (byte) 3 +Constant right-side identified [103] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4 +Constant right-side identified [105] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::$4 = main::$3|3 +Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0/4 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [102] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0 +Constant right-side identified [103] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [102] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 +Successful SSA optimization Pass2ConstantIdentification +Inlining Noop Cast [1] (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 keeping memset::str#2 +Inlining Noop Cast [3] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 keeping memset::str#2 +Successful SSA optimization Pass2NopCastInlining +Inlining Noop Cast [34] (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 keeping bitmap_plot::plotter#0 +Successful SSA optimization Pass2NopCastInlining +Rewriting division to use shift [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 / (byte) 2 +Rewriting division to use shift [58] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 / (byte) 2 +Successful SSA optimization Pass2MultiplyToShiftRewriting +Inlining constant with var siblings (const word) memset::num#0 +Inlining constant with var siblings (const byte) memset::c#1 +Inlining constant with var siblings (const word) memset::num#1 +Inlining constant with var siblings (const void*) memset::str#0 +Inlining constant with var siblings (const void*) memset::str#1 +Inlining constant with var siblings (const byte) memset::c#0 +Inlining constant with var siblings (const byte) bitmap_init::bits#0 +Inlining constant with var siblings (const byte) bitmap_init::x#0 +Inlining constant with var siblings (const byte) bitmap_init::bits#2 +Inlining constant with var siblings (const byte) bitmap_init::y#0 +Inlining constant with var siblings (const word) sgn_u16::return#2 +Inlining constant with var siblings (const word) sgn_u16::return#3 +Inlining constant with var siblings (const byte) main::i#0 +Inlining constant with var siblings (const byte) main::a#0 +Constant inlined bitmap_init::screen#0 = (const byte*) SCREEN#0 +Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0 +Constant inlined main::toD0181_gfx#0 = (const byte*) BITMAP#0 +Constant inlined bitmap_init::gfx#0 = (const byte*) BITMAP#0 +Constant inlined memset::num#1 = (word) $1f40 +Constant inlined memset::num#0 = (word) $3e8 +Constant inlined bitmap_init::bits#0 = (byte) $80 +Constant inlined bitmap_init::bits#2 = (byte) $80 +Constant inlined main::a#0 = (byte) 0 +Constant inlined main::$18 = (const byte*) SCREEN#0+(word) $3e7 +Constant inlined sgn_u16::return#3 = (byte) 1 +Constant inlined main::i#0 = (byte) 0 +Constant inlined sgn_u16::return#2 = (word) $ffff +Constant inlined memset::str#1 = (void*)(const byte*) BITMAP#0 +Constant inlined memset::str#0 = (void*)(const byte*) SCREEN#0 +Constant inlined bitmap_gfx#1 = (const byte*) BITMAP#0 +Constant inlined main::toD0181_$0#0 = (word)(const byte*) SCREEN#0 +Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE#0 +Constant inlined main::toD0181_$1#0 = (word)(const byte*) SCREEN#0&(word) $3fff +Constant inlined main::toD0181_$6#0 = >(word)(const byte*) BITMAP#0/(byte) 4 +Constant inlined main::toD0181_$7#0 = >(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +Constant inlined bitmap_screen#1 = (const byte*) SCREEN#0 +Constant inlined main::toD0181_$2#0 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::$2 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0 +Constant inlined main::toD0181_$3#0 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4 +Constant inlined main::toD0181_$4#0 = (word)(const byte*) BITMAP#0 +Constant inlined main::toD0181_$5#0 = >(word)(const byte*) BITMAP#0 +Constant inlined bitmap_init::y#0 = (byte) 0 +Constant inlined main::$3 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0 +Constant inlined memset::c#0 = (const byte) bitmap_clear::col#0 +Constant inlined main::$4 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 +Constant inlined bitmap_init::x#0 = (byte) 0 +Constant inlined memset::c#1 = (byte) 0 +Successful SSA optimization Pass2ConstantInlining +Consolidated array index constant in assignment *(COSTAB#0+$20 + main::$9) +Consolidated array index constant in assignment *(SINTAB#0+$20 + main::$12) +Successful SSA optimization Pass2ConstantAdditionElimination +Alias (byte) main::a#2 = (byte~) main::$9 (byte~) main::$12 +Successful SSA optimization Pass2AliasElimination +Added new block during phi lifting memset::@4(between memset::@1 and memset::@1) +Added new block during phi lifting bitmap_init::@9(between bitmap_init::@2 and bitmap_init::@1) +Added new block during phi lifting bitmap_init::@10(between bitmap_init::@1 and bitmap_init::@2) +Added new block during phi lifting bitmap_init::@11(between bitmap_init::@6 and bitmap_init::@5) +Added new block during phi lifting bitmap_init::@12(between bitmap_init::@5 and bitmap_init::@6) +Added new block during phi lifting bitmap_line::@20(between bitmap_line::@5 and bitmap_line::@4) +Added new block during phi lifting bitmap_line::@21(between bitmap_line::@17 and bitmap_line::@5) +Added new block during phi lifting bitmap_line::@22(between bitmap_line::@10 and bitmap_line::@2) +Added new block during phi lifting bitmap_line::@23(between bitmap_line::@5 and bitmap_line::@2) +Added new block during phi lifting bitmap_line::@24(between bitmap_line::@10 and bitmap_line::@9) +Added new block during phi lifting bitmap_line::@25(between bitmap_line::@19 and bitmap_line::@10) +Added new block during phi lifting main::@13(between main::@12 and main::@1) +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @8 +Adding NOP phi() at start of @35 +Adding NOP phi() at start of @36 +Adding NOP phi() at start of @37 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@10 +Adding NOP phi() at start of main::toD0181 +Adding NOP phi() at start of main::toD0181_@return +Adding NOP phi() at start of main::@3 +Adding NOP phi() at start of bitmap_line::@18 +Adding NOP phi() at start of sgn_u16::@3 +Adding NOP phi() at start of sgn_u16::@1 +Adding NOP phi() at start of bitmap_clear +Adding NOP phi() at start of bitmap_clear::@1 +Adding NOP phi() at start of bitmap_clear::@2 +Adding NOP phi() at start of memset::@2 +Adding NOP phi() at start of bitmap_init +Adding NOP phi() at start of bitmap_init::@3 +Adding NOP phi() at start of bitmap_init::@4 +CALL GRAPH +Calls in [] to main:4 +Calls in [main] to bitmap_init:8 bitmap_clear:10 bitmap_line:22 +Calls in [bitmap_line] to abs_u16:32 abs_u16:37 sgn_u16:42 sgn_u16:47 bitmap_plot:60 bitmap_plot:77 bitmap_plot:94 +Calls in [bitmap_clear] to memset:136 memset:138 + +Created 30 initial phi equivalence classes +Coalesced [28] main::a#4 ← main::a#1 +Coalesced [29] main::i#4 ← main::i#1 +Coalesced [31] abs_u16::w#5 ← abs_u16::w#0 +Coalesced [36] abs_u16::w#6 ← abs_u16::w#1 +Coalesced [41] sgn_u16::w#3 ← sgn_u16::w#0 +Coalesced [46] sgn_u16::w#4 ← sgn_u16::w#1 +Coalesced [52] bitmap_line::y#18 ← bitmap_line::y1#0 +Coalesced [53] bitmap_line::x#18 ← bitmap_line::x1#0 +Coalesced [54] bitmap_line::e#7 ← bitmap_line::e#0 +Coalesced [58] bitmap_plot::y#5 ← bitmap_plot::y#0 +Coalesced [59] bitmap_plot::x#5 ← bitmap_plot::x#0 +Coalesced [66] bitmap_line::x#21 ← bitmap_line::x#1 +Coalesced [67] bitmap_line::e#10 ← bitmap_line::e#2 +Coalesced [70] bitmap_line::y#21 ← bitmap_line::y#1 +Coalesced [71] bitmap_line::x#23 ← bitmap_line::x#10 +Coalesced [75] bitmap_plot::y#4 ← bitmap_plot::y#1 +Coalesced [76] bitmap_plot::x#4 ← bitmap_plot::x#1 +Coalesced [80] bitmap_line::y#19 ← bitmap_line::y#1 +Coalesced [81] bitmap_line::x#19 ← bitmap_line::x#10 +Coalesced [82] bitmap_line::e#8 ← bitmap_line::e#6 +Coalesced (already) [83] bitmap_line::x#20 ← bitmap_line::x#11 +Coalesced [84] bitmap_line::e#9 ← bitmap_line::e#1 +Coalesced [86] bitmap_line::y#22 ← bitmap_line::y1#0 +Coalesced [87] bitmap_line::x#24 ← bitmap_line::x1#0 +Coalesced [88] bitmap_line::e1#7 ← bitmap_line::e1#0 +Coalesced [92] bitmap_plot::y#6 ← bitmap_plot::y#2 +Coalesced [93] bitmap_plot::x#6 ← bitmap_plot::x#2 +Coalesced [100] bitmap_line::y#24 ← bitmap_line::y#2 +Coalesced [101] bitmap_line::e1#9 ← bitmap_line::e1#2 +Coalesced [104] bitmap_line::y#20 ← bitmap_line::y#11 +Coalesced [105] bitmap_line::x#22 ← bitmap_line::x#13 +Coalesced (already) [106] bitmap_line::y#23 ← bitmap_line::y#11 +Coalesced (already) [107] bitmap_line::x#25 ← bitmap_line::x#13 +Coalesced [108] bitmap_line::e1#8 ← bitmap_line::e1#6 +Coalesced (already) [109] bitmap_line::y#25 ← bitmap_line::y#13 +Coalesced [110] bitmap_line::e1#10 ← bitmap_line::e1#1 +Coalesced [130] abs_u16::return#9 ← abs_u16::w#2 +Coalesced [134] abs_u16::return#8 ← abs_u16::return#2 +Coalesced [150] memset::dst#4 ← memset::dst#1 +Coalesced [170] bitmap_init::yoffs#7 ← bitmap_init::yoffs#1 +Coalesced [175] bitmap_init::y#5 ← bitmap_init::y#1 +Coalesced [176] bitmap_init::yoffs#5 ← bitmap_init::yoffs#4 +Coalesced (already) [177] bitmap_init::yoffs#6 ← bitmap_init::yoffs#2 +Coalesced [178] bitmap_init::bits#5 ← bitmap_init::bits#4 +Coalesced [179] bitmap_init::x#5 ← bitmap_init::x#1 +Coalesced [180] bitmap_init::bits#6 ← bitmap_init::bits#1 +Coalesced down to 19 phi equivalence classes +Culled Empty Block (label) @8 +Culled Empty Block (label) @35 +Culled Empty Block (label) @37 +Culled Empty Block (label) main::toD0181_@return +Culled Empty Block (label) main::@3 +Culled Empty Block (label) main::@13 +Culled Empty Block (label) bitmap_line::@23 +Culled Empty Block (label) bitmap_line::@18 +Culled Empty Block (label) bitmap_line::@20 +Culled Empty Block (label) bitmap_line::@21 +Culled Empty Block (label) bitmap_line::@22 +Culled Empty Block (label) bitmap_line::@24 +Culled Empty Block (label) bitmap_line::@25 +Culled Empty Block (label) sgn_u16::@3 +Culled Empty Block (label) abs_u16::@3 +Culled Empty Block (label) bitmap_clear::@2 +Culled Empty Block (label) memset::@2 +Culled Empty Block (label) memset::@4 +Culled Empty Block (label) bitmap_init::@3 +Culled Empty Block (label) bitmap_init::@4 +Culled Empty Block (label) bitmap_init::@11 +Culled Empty Block (label) bitmap_init::@12 +Culled Empty Block (label) bitmap_init::@9 +Renumbering block @36 to @1 +Renumbering block bitmap_init::@5 to bitmap_init::@3 +Renumbering block bitmap_init::@6 to bitmap_init::@4 +Renumbering block bitmap_init::@7 to bitmap_init::@5 +Renumbering block bitmap_init::@10 to bitmap_init::@6 +Renumbering block bitmap_line::@9 to bitmap_line::@7 +Renumbering block bitmap_line::@10 to bitmap_line::@8 +Renumbering block bitmap_line::@11 to bitmap_line::@9 +Renumbering block bitmap_line::@13 to bitmap_line::@10 +Renumbering block bitmap_line::@14 to bitmap_line::@11 +Renumbering block bitmap_line::@15 to bitmap_line::@12 +Renumbering block bitmap_line::@16 to bitmap_line::@13 +Renumbering block bitmap_line::@17 to bitmap_line::@14 +Renumbering block bitmap_line::@19 to bitmap_line::@15 +Renumbering block main::@4 to main::@2 +Renumbering block main::@9 to main::@3 +Renumbering block main::@10 to main::@4 +Renumbering block main::@11 to main::@5 +Renumbering block main::@12 to main::@6 +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::@4 +Adding NOP phi() at start of main::toD0181 +Adding NOP phi() at start of sgn_u16::@1 +Adding NOP phi() at start of bitmap_clear +Adding NOP phi() at start of bitmap_clear::@1 +Adding NOP phi() at start of bitmap_init +Adding NOP phi() at start of bitmap_init::@6 + +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 bitmap_init + to:main::@4 +main::@4: scope:[main] from main + [6] phi() + [7] call bitmap_clear + to:main::@5 +main::@5: scope:[main] from main::@4 + [8] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 + to:main::toD0181 +main::toD0181: scope:[main] from main::@5 + [9] phi() + to:main::@3 +main::@3: scope:[main] from main::toD0181 + [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 + to:main::@1 +main::@1: scope:[main] from main::@3 main::@6 + [11] (byte) main::i#2 ← phi( main::@6/(byte) main::i#1 main::@3/(byte) 0 ) + [11] (byte) main::a#2 ← phi( main::@6/(byte) main::a#1 main::@3/(byte) 0 ) + [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) + [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 + [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) + [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) + [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 + [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) + [18] call bitmap_line + to:main::@6 +main::@6: scope:[main] from main::@1 + [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 + [20] (byte) main::i#1 ← ++ (byte) main::i#2 + [21] if((byte) main::i#1!=(byte) 8) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@2 main::@6 + [22] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) + to:main::@2 +bitmap_line: scope:[bitmap_line] from main::@1 + [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 + [24] call abs_u16 + [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 + to:bitmap_line::@10 +bitmap_line::@10: scope:[bitmap_line] from bitmap_line + [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 + [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 + [28] call abs_u16 + [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 + to:bitmap_line::@11 +bitmap_line::@11: scope:[bitmap_line] from bitmap_line::@10 + [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 + [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 + [32] call sgn_u16 + [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 + to:bitmap_line::@12 +bitmap_line::@12: scope:[bitmap_line] from bitmap_line::@11 + [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 + [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 + [36] call sgn_u16 + [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 + to:bitmap_line::@13 +bitmap_line::@13: scope:[bitmap_line] from bitmap_line::@12 + [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 + [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 + to:bitmap_line::@3 +bitmap_line::@3: scope:[bitmap_line] from bitmap_line::@13 + [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 + to:bitmap_line::@4 +bitmap_line::@4: scope:[bitmap_line] from bitmap_line::@3 bitmap_line::@5 + [41] (word) bitmap_line::e#3 ← phi( bitmap_line::@3/(word) bitmap_line::e#0 bitmap_line::@5/(word) bitmap_line::e#6 ) + [41] (word) bitmap_line::x#11 ← phi( bitmap_line::@3/(word) bitmap_line::x1#0 bitmap_line::@5/(word) bitmap_line::x#10 ) + [41] (word) bitmap_line::y#3 ← phi( bitmap_line::@3/(word) bitmap_line::y1#0 bitmap_line::@5/(word) bitmap_line::y#1 ) + [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 + [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 + [44] call bitmap_plot + to:bitmap_line::@14 +bitmap_line::@14: scope:[bitmap_line] from bitmap_line::@4 + [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 + [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 + [47] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 + to:bitmap_line::@6 +bitmap_line::@6: scope:[bitmap_line] from bitmap_line::@14 + [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 + [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 + to:bitmap_line::@5 +bitmap_line::@5: scope:[bitmap_line] from bitmap_line::@14 bitmap_line::@6 + [50] (word) bitmap_line::e#6 ← phi( bitmap_line::@14/(word) bitmap_line::e#1 bitmap_line::@6/(word) bitmap_line::e#2 ) + [50] (word) bitmap_line::x#10 ← phi( bitmap_line::@14/(word) bitmap_line::x#11 bitmap_line::@6/(word) bitmap_line::x#1 ) + [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 + to:bitmap_line::@2 +bitmap_line::@2: scope:[bitmap_line] from bitmap_line::@5 bitmap_line::@8 + [52] (word) bitmap_line::x#5 ← phi( bitmap_line::@8/(word) bitmap_line::x#13 bitmap_line::@5/(word) bitmap_line::x#10 ) + [52] (word) bitmap_line::y#6 ← phi( bitmap_line::@8/(word) bitmap_line::y#11 bitmap_line::@5/(word) bitmap_line::y#1 ) + [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 + [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 + [55] call bitmap_plot + to:bitmap_line::@return +bitmap_line::@return: scope:[bitmap_line] from bitmap_line::@2 + [56] return + to:@return +bitmap_line::@1: scope:[bitmap_line] from bitmap_line::@13 + [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 + to:bitmap_line::@7 +bitmap_line::@7: scope:[bitmap_line] from bitmap_line::@1 bitmap_line::@8 + [58] (word) bitmap_line::e1#3 ← phi( bitmap_line::@1/(word) bitmap_line::e1#0 bitmap_line::@8/(word) bitmap_line::e1#6 ) + [58] (word) bitmap_line::x#6 ← phi( bitmap_line::@1/(word) bitmap_line::x1#0 bitmap_line::@8/(word) bitmap_line::x#13 ) + [58] (word) bitmap_line::y#13 ← phi( bitmap_line::@1/(word) bitmap_line::y1#0 bitmap_line::@8/(word) bitmap_line::y#11 ) + [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 + [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 + [61] call bitmap_plot + to:bitmap_line::@15 +bitmap_line::@15: scope:[bitmap_line] from bitmap_line::@7 + [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 + [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 + [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 + to:bitmap_line::@9 +bitmap_line::@9: scope:[bitmap_line] from bitmap_line::@15 + [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 + [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 + to:bitmap_line::@8 +bitmap_line::@8: scope:[bitmap_line] from bitmap_line::@15 bitmap_line::@9 + [67] (word) bitmap_line::e1#6 ← phi( bitmap_line::@9/(word) bitmap_line::e1#2 bitmap_line::@15/(word) bitmap_line::e1#1 ) + [67] (word) bitmap_line::y#11 ← phi( bitmap_line::@9/(word) bitmap_line::y#2 bitmap_line::@15/(word) bitmap_line::y#13 ) + [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 + to:bitmap_line::@2 +bitmap_plot: scope:[bitmap_plot] from bitmap_line::@2 bitmap_line::@4 bitmap_line::@7 + [69] (word) bitmap_plot::x#3 ← phi( bitmap_line::@2/(word) bitmap_plot::x#1 bitmap_line::@4/(word) bitmap_plot::x#0 bitmap_line::@7/(word) bitmap_plot::x#2 ) + [69] (byte) bitmap_plot::y#3 ← phi( bitmap_line::@2/(byte) bitmap_plot::y#1 bitmap_line::@4/(byte) bitmap_plot::y#0 bitmap_line::@7/(byte) bitmap_plot::y#2 ) + [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) + [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 + [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 + [73] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 + [74] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) + to:bitmap_plot::@return +bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot + [75] return + to:@return +sgn_u16: scope:[sgn_u16] from bitmap_line::@11 bitmap_line::@12 + [76] (word) sgn_u16::w#2 ← phi( bitmap_line::@11/(word) sgn_u16::w#0 bitmap_line::@12/(word) sgn_u16::w#1 ) + [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 + [78] (byte~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (byte) $80 + [79] if((byte) 0!=(byte~) sgn_u16::$1) goto sgn_u16::@1 + to:sgn_u16::@return +sgn_u16::@1: scope:[sgn_u16] from sgn_u16 + [80] phi() + to:sgn_u16::@return +sgn_u16::@return: scope:[sgn_u16] from sgn_u16 sgn_u16::@1 + [81] (word) sgn_u16::return#4 ← phi( sgn_u16::@1/(word) $ffff sgn_u16/(byte) 1 ) + [82] return + to:@return +abs_u16: scope:[abs_u16] from bitmap_line bitmap_line::@10 + [83] (word) abs_u16::w#2 ← phi( bitmap_line/(word) abs_u16::w#0 bitmap_line::@10/(word) abs_u16::w#1 ) + [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 + [85] (byte~) abs_u16::$1 ← (byte~) abs_u16::$0 & (byte) $80 + [86] if((byte) 0!=(byte~) abs_u16::$1) goto abs_u16::@1 + to:abs_u16::@return +abs_u16::@1: scope:[abs_u16] from abs_u16 + [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 + to:abs_u16::@return +abs_u16::@return: scope:[abs_u16] from abs_u16 abs_u16::@1 + [88] (word) abs_u16::return#4 ← phi( abs_u16::@1/(word) abs_u16::return#2 abs_u16/(word) abs_u16::w#2 ) + [89] return + to:@return +bitmap_clear: scope:[bitmap_clear] from main::@4 + [90] phi() + [91] call memset + to:bitmap_clear::@1 +bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear + [92] phi() + [93] call memset + to:bitmap_clear::@return +bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 + [94] return + to:@return +memset: scope:[memset] from bitmap_clear bitmap_clear::@1 + [95] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) + [95] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) + [95] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 + [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@1 + [98] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) + [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 + [100] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 + to:memset::@return +memset::@return: scope:[memset] from memset::@1 + [102] return + to:@return +bitmap_init: scope:[bitmap_init] from main + [103] phi() + to:bitmap_init::@1 +bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2 + [104] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 ) + [104] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 ) + [105] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 + [106] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 + [107] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 + to:bitmap_init::@2 +bitmap_init::@6: scope:[bitmap_init] from bitmap_init::@1 + [108] phi() + to:bitmap_init::@2 +bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 + [109] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 ) + [110] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 + [111] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 + to:bitmap_init::@3 +bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4 + [112] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [112] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) + [113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 + [114] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 + [115] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 + [116] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 + [117] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 + [118] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 + [119] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 + to:bitmap_init::@5 +bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@3 + [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 + to:bitmap_init::@4 +bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@3 bitmap_init::@5 + [121] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 ) + [122] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 + [123] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 + to:bitmap_init::@return +bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4 + [124] return + to:@return + + +VARIABLE REGISTER WEIGHTS +(byte*) BITMAP +(byte) BLACK +(byte*) COSTAB +(byte*) D011 +(byte*) D018 +(byte*) SCREEN +(byte[$180]) SINTAB +(byte) VIC_BMM +(byte) VIC_DEN +(byte) VIC_RSEL +(byte) WHITE +(word()) abs_u16((word) abs_u16::w) +(byte~) abs_u16::$0 4.0 +(byte~) abs_u16::$1 4.0 +(word) abs_u16::return +(word) abs_u16::return#0 4.0 +(word) abs_u16::return#1 4.0 +(word) abs_u16::return#2 4.0 +(word) abs_u16::return#4 2.0 +(word) abs_u16::w +(word) abs_u16::w#0 4.0 +(word) abs_u16::w#1 4.0 +(word) abs_u16::w#2 2.5 +(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) +(byte) bitmap_clear::bgcol +(byte) bitmap_clear::col +(byte) bitmap_clear::fgcol +(byte*) bitmap_gfx +(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen) +(byte~) bitmap_init::$4 22.0 +(byte~) bitmap_init::$5 22.0 +(byte~) bitmap_init::$6 22.0 +(byte~) bitmap_init::$7 5.5 +(byte) bitmap_init::bits +(byte) bitmap_init::bits#1 11.0 +(byte) bitmap_init::bits#3 16.5 +(byte) bitmap_init::bits#4 7.333333333333333 +(byte*) bitmap_init::gfx +(byte*) bitmap_init::screen +(byte) bitmap_init::x +(byte) bitmap_init::x#1 16.5 +(byte) bitmap_init::x#2 5.5 +(byte) bitmap_init::y +(byte) bitmap_init::y#1 16.5 +(byte) bitmap_init::y#2 5.5 +(byte*) bitmap_init::yoffs +(byte*) bitmap_init::yoffs#1 22.0 +(byte*) bitmap_init::yoffs#2 6.875 +(byte*) bitmap_init::yoffs#4 11.0 +(void()) bitmap_line((word) bitmap_line::x1 , (word) bitmap_line::y1 , (word) bitmap_line::x2 , (word) bitmap_line::y2) +(word) bitmap_line::dx +(word) bitmap_line::dx#0 8.131578947368421 +(word) bitmap_line::dy +(word) bitmap_line::dy#0 9.088235294117647 +(word) bitmap_line::e +(word) bitmap_line::e#0 4.0 +(word) bitmap_line::e#1 134.66666666666666 +(word) bitmap_line::e#2 202.0 +(word) bitmap_line::e#3 40.8 +(word) bitmap_line::e#6 151.5 +(word) bitmap_line::e1 +(word) bitmap_line::e1#0 4.0 +(word) bitmap_line::e1#1 134.66666666666666 +(word) bitmap_line::e1#2 202.0 +(word) bitmap_line::e1#3 40.8 +(word) bitmap_line::e1#6 151.5 +(word) bitmap_line::sx +(word) bitmap_line::sx#0 6.800000000000001 +(word) bitmap_line::sy +(word) bitmap_line::sy#0 7.846153846153847 +(word) bitmap_line::x +(word) bitmap_line::x#1 101.0 +(word) bitmap_line::x#10 202.0 +(word) bitmap_line::x#11 58.00000000000001 +(word) bitmap_line::x#13 57.714285714285715 +(word) bitmap_line::x#5 102.0 +(word) bitmap_line::x#6 76.25 +(word) bitmap_line::x1 +(word) bitmap_line::x1#0 0.7916666666666667 +(word) bitmap_line::x2 +(word) bitmap_line::x2#0 3.741935483870968 +(word) bitmap_line::y +(word) bitmap_line::y#1 57.714285714285715 +(word) bitmap_line::y#11 202.0 +(word) bitmap_line::y#13 43.57142857142858 +(word) bitmap_line::y#2 101.0 +(word) bitmap_line::y#3 51.0 +(word) bitmap_line::y#6 202.0 +(word) bitmap_line::y1 +(word) bitmap_line::y1#0 0.826086956521739 +(word) bitmap_line::y2 +(word) bitmap_line::y2#0 3.8666666666666667 +(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) +(word~) bitmap_plot::$1 4.0 +(byte~) bitmap_plot::$2 4.0 +(byte*) bitmap_plot::plotter +(word) bitmap_plot::plotter#0 1.0 +(byte*) bitmap_plot::plotter#1 3.0 +(word) bitmap_plot::x +(word) bitmap_plot::x#0 202.0 +(word) bitmap_plot::x#1 4.0 +(word) bitmap_plot::x#2 202.0 +(word) bitmap_plot::x#3 52.0 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 101.0 +(byte) bitmap_plot::y#1 2.0 +(byte) bitmap_plot::y#2 101.0 +(byte) bitmap_plot::y#3 208.0 +(byte[$100]) bitmap_plot_bit +(byte[$100]) bitmap_plot_yhi +(byte[$100]) bitmap_plot_ylo +(byte*) bitmap_screen +(void()) main() +(word~) main::$10 22.0 +(word~) main::$6 22.0 +(byte) main::a +(byte) main::a#1 7.333333333333333 +(byte) main::a#2 2.75 +(byte) main::i +(byte) main::i#1 16.5 +(byte) main::i#2 2.4444444444444446 +(word~) main::toD0181_$0 +(number~) main::toD0181_$1 +(number~) main::toD0181_$2 +(number~) main::toD0181_$3 +(word~) main::toD0181_$4 +(byte~) main::toD0181_$5 +(number~) main::toD0181_$6 +(number~) main::toD0181_$7 +(number~) main::toD0181_$8 +(byte*) main::toD0181_gfx +(byte) main::toD0181_return +(byte*) main::toD0181_screen +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(byte) memset::c +(byte) memset::c#3 1.5714285714285714 +(byte*) memset::dst +(byte*) memset::dst#1 16.5 +(byte*) memset::dst#2 17.5 +(byte*~) memset::dst#3 4.0 +(byte*) memset::end +(byte*) memset::end#0 2.1666666666666665 +(word) memset::num +(word) memset::num#2 2.0 +(void*) memset::return +(void*) memset::str +(void*) memset::str#2 +(word()) sgn_u16((word) sgn_u16::w) +(byte~) sgn_u16::$0 4.0 +(byte~) sgn_u16::$1 4.0 +(word) sgn_u16::return +(word) sgn_u16::return#0 4.0 +(word) sgn_u16::return#1 4.0 +(word) sgn_u16::return#4 1.0 +(word) sgn_u16::w +(word) sgn_u16::w#0 4.0 +(word) sgn_u16::w#1 4.0 +(word) sgn_u16::w#2 6.0 + +Initial phi equivalence classes +[ main::a#2 main::a#1 ] +[ main::i#2 main::i#1 ] +[ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] +[ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] +[ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 ] +[ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] +[ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] +[ bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] +[ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] +[ sgn_u16::return#4 ] +[ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 ] +[ memset::str#2 ] +[ memset::num#2 ] +[ memset::c#3 ] +[ memset::dst#2 memset::dst#3 memset::dst#1 ] +[ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] +[ bitmap_init::x#2 bitmap_init::x#1 ] +[ bitmap_init::y#2 bitmap_init::y#1 ] +[ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +Added variable main::$6 to zero page equivalence class [ main::$6 ] +Added variable main::$10 to zero page equivalence class [ main::$10 ] +Added variable bitmap_line::x2#0 to zero page equivalence class [ bitmap_line::x2#0 ] +Added variable bitmap_line::y2#0 to zero page equivalence class [ bitmap_line::y2#0 ] +Added variable abs_u16::return#0 to zero page equivalence class [ abs_u16::return#0 ] +Added variable bitmap_line::dx#0 to zero page equivalence class [ bitmap_line::dx#0 ] +Added variable abs_u16::return#1 to zero page equivalence class [ abs_u16::return#1 ] +Added variable bitmap_line::dy#0 to zero page equivalence class [ bitmap_line::dy#0 ] +Added variable sgn_u16::return#0 to zero page equivalence class [ sgn_u16::return#0 ] +Added variable bitmap_line::sx#0 to zero page equivalence class [ bitmap_line::sx#0 ] +Added variable sgn_u16::return#1 to zero page equivalence class [ sgn_u16::return#1 ] +Added variable bitmap_line::sy#0 to zero page equivalence class [ bitmap_line::sy#0 ] +Added variable bitmap_plot::plotter#0 to zero page equivalence class [ bitmap_plot::plotter#0 ] +Added variable bitmap_plot::$1 to zero page equivalence class [ bitmap_plot::$1 ] +Added variable bitmap_plot::plotter#1 to zero page equivalence class [ bitmap_plot::plotter#1 ] +Added variable bitmap_plot::$2 to zero page equivalence class [ bitmap_plot::$2 ] +Added variable sgn_u16::$0 to zero page equivalence class [ sgn_u16::$0 ] +Added variable sgn_u16::$1 to zero page equivalence class [ sgn_u16::$1 ] +Added variable abs_u16::$0 to zero page equivalence class [ abs_u16::$0 ] +Added variable abs_u16::$1 to zero page equivalence class [ abs_u16::$1 ] +Added variable memset::end#0 to zero page equivalence class [ memset::end#0 ] +Added variable bitmap_init::$7 to zero page equivalence class [ bitmap_init::$7 ] +Added variable bitmap_init::$4 to zero page equivalence class [ bitmap_init::$4 ] +Added variable bitmap_init::$5 to zero page equivalence class [ bitmap_init::$5 ] +Added variable bitmap_init::$6 to zero page equivalence class [ bitmap_init::$6 ] +Complete equivalence classes +[ main::a#2 main::a#1 ] +[ main::i#2 main::i#1 ] +[ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] +[ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] +[ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 ] +[ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] +[ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] +[ bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] +[ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] +[ sgn_u16::return#4 ] +[ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 ] +[ memset::str#2 ] +[ memset::num#2 ] +[ memset::c#3 ] +[ memset::dst#2 memset::dst#3 memset::dst#1 ] +[ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] +[ bitmap_init::x#2 bitmap_init::x#1 ] +[ bitmap_init::y#2 bitmap_init::y#1 ] +[ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +[ main::$6 ] +[ main::$10 ] +[ bitmap_line::x2#0 ] +[ bitmap_line::y2#0 ] +[ abs_u16::return#0 ] +[ bitmap_line::dx#0 ] +[ abs_u16::return#1 ] +[ bitmap_line::dy#0 ] +[ sgn_u16::return#0 ] +[ bitmap_line::sx#0 ] +[ sgn_u16::return#1 ] +[ bitmap_line::sy#0 ] +[ bitmap_plot::plotter#0 ] +[ bitmap_plot::$1 ] +[ bitmap_plot::plotter#1 ] +[ bitmap_plot::$2 ] +[ sgn_u16::$0 ] +[ sgn_u16::$1 ] +[ abs_u16::$0 ] +[ abs_u16::$1 ] +[ memset::end#0 ] +[ bitmap_init::$7 ] +[ bitmap_init::$4 ] +[ bitmap_init::$5 ] +[ bitmap_init::$6 ] +Allocated zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +Allocated zp ZP_BYTE:3 [ main::i#2 main::i#1 ] +Allocated zp ZP_WORD:4 [ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] +Allocated zp ZP_WORD:6 [ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] +Allocated zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 ] +Allocated zp ZP_WORD:10 [ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] +Allocated zp ZP_BYTE:12 [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] +Allocated zp ZP_WORD:13 [ bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] +Allocated zp ZP_WORD:15 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] +Allocated zp ZP_WORD:17 [ sgn_u16::return#4 ] +Allocated zp ZP_WORD:19 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 ] +Allocated zp ZP_WORD:21 [ memset::str#2 ] +Allocated zp ZP_WORD:23 [ memset::num#2 ] +Allocated zp ZP_BYTE:25 [ memset::c#3 ] +Allocated zp ZP_WORD:26 [ memset::dst#2 memset::dst#3 memset::dst#1 ] +Allocated zp ZP_BYTE:28 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] +Allocated zp ZP_BYTE:29 [ bitmap_init::x#2 bitmap_init::x#1 ] +Allocated zp ZP_BYTE:30 [ bitmap_init::y#2 bitmap_init::y#1 ] +Allocated zp ZP_WORD:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +Allocated zp ZP_WORD:33 [ main::$6 ] +Allocated zp ZP_WORD:35 [ main::$10 ] +Allocated zp ZP_WORD:37 [ bitmap_line::x2#0 ] +Allocated zp ZP_WORD:39 [ bitmap_line::y2#0 ] +Allocated zp ZP_WORD:41 [ abs_u16::return#0 ] +Allocated zp ZP_WORD:43 [ bitmap_line::dx#0 ] +Allocated zp ZP_WORD:45 [ abs_u16::return#1 ] +Allocated zp ZP_WORD:47 [ bitmap_line::dy#0 ] +Allocated zp ZP_WORD:49 [ sgn_u16::return#0 ] +Allocated zp ZP_WORD:51 [ bitmap_line::sx#0 ] +Allocated zp ZP_WORD:53 [ sgn_u16::return#1 ] +Allocated zp ZP_WORD:55 [ bitmap_line::sy#0 ] +Allocated zp ZP_WORD:57 [ bitmap_plot::plotter#0 ] +Allocated zp ZP_WORD:59 [ bitmap_plot::$1 ] +Allocated zp ZP_WORD:61 [ bitmap_plot::plotter#1 ] +Allocated zp ZP_BYTE:63 [ bitmap_plot::$2 ] +Allocated zp ZP_BYTE:64 [ sgn_u16::$0 ] +Allocated zp ZP_BYTE:65 [ sgn_u16::$1 ] +Allocated zp ZP_BYTE:66 [ abs_u16::$0 ] +Allocated zp ZP_BYTE:67 [ abs_u16::$1 ] +Allocated zp ZP_WORD:68 [ memset::end#0 ] +Allocated zp ZP_BYTE:70 [ bitmap_init::$7 ] +Allocated zp ZP_BYTE:71 [ bitmap_init::$4 ] +Allocated zp ZP_BYTE:72 [ bitmap_init::$5 ] +Allocated zp ZP_BYTE:73 [ bitmap_init::$6 ] + +INITIAL ASM + // File Comments +// Tests the simple bitmap plotter +// Plots a few lines using the bresenham line algorithm + // Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" + // Global Constants & labels + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label D018 = $d018 + .const WHITE = 1 + .label BITMAP = $2000 + .label SCREEN = $400 + .label COSTAB = SINTAB+$40 + // @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: { + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label _6 = $21 + .label _10 = $23 + .label a = 2 + .label i = 3 + // [5] call bitmap_init + // [103] phi from main to bitmap_init [phi:main->bitmap_init] + bitmap_init_from_main: + jsr bitmap_init + // [6] phi from main to main::@4 [phi:main->main::@4] + b4_from_main: + jmp b4 + // main::@4 + b4: + // [7] call bitmap_clear + // [90] phi from main::@4 to bitmap_clear [phi:main::@4->bitmap_clear] + bitmap_clear_from_b4: + jsr bitmap_clear + jmp b5 + // main::@5 + b5: + // [8] *((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 + // [9] phi from main::@5 to main::toD0181 [phi:main::@5->main::toD0181] + toD0181_from_b5: + jmp toD0181 + // main::toD0181 + toD0181: + jmp b3 + // main::@3 + b3: + // [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0181_return + sta D018 + // [11] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + b1_from_b3: + // [11] phi (byte) main::i#2 = (byte) 0 [phi:main::@3->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta i + // [11] phi (byte) main::a#2 = (byte) 0 [phi:main::@3->main::@1#1] -- vbuz1=vbuc1 + lda #0 + sta a + jmp b1 + // [11] phi from main::@6 to main::@1 [phi:main::@6->main::@1] + b1_from_b6: + // [11] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@6->main::@1#0] -- register_copy + // [11] phi (byte) main::a#2 = (byte) main::a#1 [phi:main::@6->main::@1#1] -- register_copy + jmp b1 + // main::@1 + b1: + // [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda COSTAB,y + sta _6 + lda #0 + sta _6+1 + // [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 -- vwuz1=vwuz2_plus_vbuc1 + lda #$78 + clc + adc _6 + sta bitmap_line.x1 + lda #0 + adc _6+1 + sta bitmap_line.x1+1 + // [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda SINTAB,y + sta bitmap_line.y1 + lda #0 + sta bitmap_line.y1+1 + // [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda COSTAB+$20,y + sta _10 + lda #0 + sta _10+1 + // [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 -- vwuz1=vwuz2_plus_vbuc1 + lda #$78 + clc + adc _10 + sta bitmap_line.x2 + lda #0 + adc _10+1 + sta bitmap_line.x2+1 + // [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda SINTAB+$20,y + sta bitmap_line.y2 + lda #0 + sta bitmap_line.y2+1 + // [18] call bitmap_line + jsr bitmap_line + jmp b6 + // main::@6 + b6: + // [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 -- vbuz1=vbuz1_plus_vbuc1 + lax a + axs #-[$20] + stx a + // [20] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 + inc i + // [21] if((byte) main::i#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp i + bne b1_from_b6 + jmp b2 + // main::@2 + b2: + // [22] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + inc SCREEN+$3e7 + jmp b2 +} + // bitmap_line +// Draw a line on the bitmap using bresenhams algorithm +// bitmap_line(word zeropage(8) x1, word zeropage(6) y1, word zeropage($25) x2, word zeropage($27) y2) +bitmap_line: { + .label dx = $2b + .label dy = $2f + .label sx = $33 + .label sy = $37 + .label e1 = $a + .label e = 4 + .label y = 6 + .label x = 8 + .label x1 = 8 + .label y1 = 6 + .label x2 = $25 + .label y2 = $27 + // [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda x2 + sec + sbc x1 + sta abs_u16.w + lda x2+1 + sbc x1+1 + sta abs_u16.w+1 + // [24] call abs_u16 + // [83] phi from bitmap_line to abs_u16 [phi:bitmap_line->abs_u16] + abs_u16_from_bitmap_line: + // [83] phi (word) abs_u16::w#2 = (word) abs_u16::w#0 [phi:bitmap_line->abs_u16#0] -- register_copy + jsr abs_u16 + // [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 -- vwuz1=vwuz2 + lda abs_u16.return_4 + sta abs_u16.return + lda abs_u16.return_4+1 + sta abs_u16.return+1 + jmp b10 + // bitmap_line::@10 + b10: + // [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 -- vwuz1=vwuz2 + lda abs_u16.return + sta dx + lda abs_u16.return+1 + sta dx+1 + // [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda y2 + sec + sbc y1 + sta abs_u16.w + lda y2+1 + sbc y1+1 + sta abs_u16.w+1 + // [28] call abs_u16 + // [83] phi from bitmap_line::@10 to abs_u16 [phi:bitmap_line::@10->abs_u16] + abs_u16_from_b10: + // [83] phi (word) abs_u16::w#2 = (word) abs_u16::w#1 [phi:bitmap_line::@10->abs_u16#0] -- register_copy + jsr abs_u16 + // [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 -- vwuz1=vwuz2 + lda abs_u16.return_4 + sta abs_u16.return_1 + lda abs_u16.return_4+1 + sta abs_u16.return_1+1 + jmp b11 + // bitmap_line::@11 + b11: + // [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 -- vwuz1=vwuz2 + lda abs_u16.return_1 + sta dy + lda abs_u16.return_1+1 + sta dy+1 + // [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda x2 + sec + sbc x1 + sta sgn_u16.w + lda x2+1 + sbc x1+1 + sta sgn_u16.w+1 + // [32] call sgn_u16 + // [76] phi from bitmap_line::@11 to sgn_u16 [phi:bitmap_line::@11->sgn_u16] + sgn_u16_from_b11: + // [76] phi (word) sgn_u16::w#2 = (word) sgn_u16::w#0 [phi:bitmap_line::@11->sgn_u16#0] -- register_copy + jsr sgn_u16 + // [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 -- vwuz1=vwuz2 + lda sgn_u16.return_4 + sta sgn_u16.return + lda sgn_u16.return_4+1 + sta sgn_u16.return+1 + jmp b12 + // bitmap_line::@12 + b12: + // [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 -- vwuz1=vwuz2 + lda sgn_u16.return + sta sx + lda sgn_u16.return+1 + sta sx+1 + // [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda y2 + sec + sbc y1 + sta sgn_u16.w + lda y2+1 + sbc y1+1 + sta sgn_u16.w+1 + // [36] call sgn_u16 + // [76] phi from bitmap_line::@12 to sgn_u16 [phi:bitmap_line::@12->sgn_u16] + sgn_u16_from_b12: + // [76] phi (word) sgn_u16::w#2 = (word) sgn_u16::w#1 [phi:bitmap_line::@12->sgn_u16#0] -- register_copy + jsr sgn_u16 + // [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 -- vwuz1=vwuz2 + lda sgn_u16.return_4 + sta sgn_u16.return_1 + lda sgn_u16.return_4+1 + sta sgn_u16.return_1+1 + jmp b13 + // bitmap_line::@13 + b13: + // [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 -- vwuz1=vwuz2 + lda sgn_u16.return_1 + sta sy + lda sgn_u16.return_1+1 + sta sy+1 + // [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 -- vwuz1_gt_vwuz2_then_la1 + lda dy+1 + cmp dx+1 + bcc b1 + bne !+ + lda dy + cmp dx + bcc b1 + !: + jmp b3 + // bitmap_line::@3 + b3: + // [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 -- vwuz1=vwuz2_ror_1 + lda dx+1 + lsr + sta e+1 + lda dx + ror + sta e + // [41] phi from bitmap_line::@3 bitmap_line::@5 to bitmap_line::@4 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4] + b4_from_b3: + b4_from_b5: + // [41] phi (word) bitmap_line::e#3 = (word) bitmap_line::e#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#0] -- register_copy + // [41] phi (word) bitmap_line::x#11 = (word) bitmap_line::x1#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#1] -- register_copy + // [41] phi (word) bitmap_line::y#3 = (word) bitmap_line::y1#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#2] -- register_copy + jmp b4 + // bitmap_line::@4 + b4: + // [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 -- vbuz1=_byte_vwuz2 + lda y + sta bitmap_plot.y + // [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 -- vwuz1=vwuz2 + lda x + sta bitmap_plot.x + lda x+1 + sta bitmap_plot.x+1 + // [44] call bitmap_plot + // [69] phi from bitmap_line::@4 to bitmap_plot [phi:bitmap_line::@4->bitmap_plot] + bitmap_plot_from_b4: + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#0 [phi:bitmap_line::@4->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#0 [phi:bitmap_line::@4->bitmap_plot#1] -- register_copy + jsr bitmap_plot + jmp b14 + // bitmap_line::@14 + b14: + // [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + // [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda e + clc + adc dx + sta e + lda e+1 + adc dx+1 + sta e+1 + // [47] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 -- vwuz1_ge_vwuz2_then_la1 + lda e+1 + cmp dy+1 + bne !+ + lda e + cmp dy + beq b5_from_b14 + !: + bcc b5_from_b14 + jmp b6 + // bitmap_line::@6 + b6: + // [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + // [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 -- vwuz1=vwuz1_minus_vwuz2 + lda e + sec + sbc dy + sta e + lda e+1 + sbc dy+1 + sta e+1 + // [50] phi from bitmap_line::@14 bitmap_line::@6 to bitmap_line::@5 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5] + b5_from_b14: + b5_from_b6: + // [50] phi (word) bitmap_line::e#6 = (word) bitmap_line::e#1 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5#0] -- register_copy + // [50] phi (word) bitmap_line::x#10 = (word) bitmap_line::x#11 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5#1] -- register_copy + jmp b5 + // bitmap_line::@5 + b5: + // [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 -- vwuz1_neq_vwuz2_then_la1 + lda y+1 + cmp y2+1 + bne b4_from_b5 + lda y + cmp y2 + bne b4_from_b5 + // [52] phi from bitmap_line::@5 bitmap_line::@8 to bitmap_line::@2 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2] + b2_from_b5: + b2_from_b8: + // [52] phi (word) bitmap_line::x#5 = (word) bitmap_line::x#10 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2#0] -- register_copy + // [52] phi (word) bitmap_line::y#6 = (word) bitmap_line::y#1 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2#1] -- register_copy + jmp b2 + // bitmap_line::@2 + b2: + // [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 -- vbuz1=_byte_vwuz2 + lda y + sta bitmap_plot.y + // [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 -- vwuz1=vwuz2 + lda x + sta bitmap_plot.x + lda x+1 + sta bitmap_plot.x+1 + // [55] call bitmap_plot + // [69] phi from bitmap_line::@2 to bitmap_plot [phi:bitmap_line::@2->bitmap_plot] + bitmap_plot_from_b2: + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#1 [phi:bitmap_line::@2->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#1 [phi:bitmap_line::@2->bitmap_plot#1] -- register_copy + jsr bitmap_plot + jmp breturn + // bitmap_line::@return + breturn: + // [56] return + rts + // bitmap_line::@1 + b1: + // [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 -- vwuz1=vwuz2_ror_1 + lda dy+1 + lsr + sta e1+1 + lda dy + ror + sta e1 + // [58] phi from bitmap_line::@1 bitmap_line::@8 to bitmap_line::@7 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7] + b7_from_b1: + b7_from_b8: + // [58] phi (word) bitmap_line::e1#3 = (word) bitmap_line::e1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#0] -- register_copy + // [58] phi (word) bitmap_line::x#6 = (word) bitmap_line::x1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#1] -- register_copy + // [58] phi (word) bitmap_line::y#13 = (word) bitmap_line::y1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#2] -- register_copy + jmp b7 + // bitmap_line::@7 + b7: + // [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 -- vbuz1=_byte_vwuz2 + lda y + sta bitmap_plot.y + // [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 -- vwuz1=vwuz2 + lda x + sta bitmap_plot.x + lda x+1 + sta bitmap_plot.x+1 + // [61] call bitmap_plot + // [69] phi from bitmap_line::@7 to bitmap_plot [phi:bitmap_line::@7->bitmap_plot] + bitmap_plot_from_b7: + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#2 [phi:bitmap_line::@7->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#2 [phi:bitmap_line::@7->bitmap_plot#1] -- register_copy + jsr bitmap_plot + jmp b15 + // bitmap_line::@15 + b15: + // [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + // [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda e1 + clc + adc dy + sta e1 + lda e1+1 + adc dy+1 + sta e1+1 + // [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 -- vwuz1_ge_vwuz2_then_la1 + lda e1+1 + cmp dx+1 + bne !+ + lda e1 + cmp dx + beq b8_from_b15 + !: + bcc b8_from_b15 + jmp b9 + // bitmap_line::@9 + b9: + // [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + // [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 -- vwuz1=vwuz1_minus_vwuz2 + lda e1 + sec + sbc dx + sta e1 + lda e1+1 + sbc dx+1 + sta e1+1 + // [67] phi from bitmap_line::@15 bitmap_line::@9 to bitmap_line::@8 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8] + b8_from_b15: + b8_from_b9: + // [67] phi (word) bitmap_line::e1#6 = (word) bitmap_line::e1#1 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8#0] -- register_copy + // [67] phi (word) bitmap_line::y#11 = (word) bitmap_line::y#13 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8#1] -- register_copy + jmp b8 + // bitmap_line::@8 + b8: + // [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 -- vwuz1_neq_vwuz2_then_la1 + lda x+1 + cmp x2+1 + bne b7_from_b8 + lda x + cmp x2 + bne b7_from_b8 + jmp b2_from_b8 +} + // bitmap_plot +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage($d) x, byte zeropage($c) y) +bitmap_plot: { + .label _1 = $3b + .label _2 = $3f + .label plotter = $39 + .label plotter_1 = $3d + .label x = $d + .label y = $c + // [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) -- vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2 + ldy y + lda bitmap_plot_yhi,y + sta plotter+1 + lda bitmap_plot_ylo,y + sta plotter + // [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 + lda x + and #<$fff8 + sta _1 + lda x+1 + and #>$fff8 + sta _1+1 + // [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz2_plus_vwuz3 + lda plotter + clc + adc _1 + sta plotter_1 + lda plotter+1 + adc _1+1 + sta plotter_1+1 + // [73] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 -- vbuz1=_lo_vwuz2 + lda x + sta _2 + // [74] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) -- _deref_pbuz1=_deref_pbuz1_bor_pbuc1_derefidx_vbuz2 + ldy #0 + lda (plotter_1),y + ldy _2 + ora bitmap_plot_bit,y + ldy #0 + sta (plotter_1),y + jmp breturn + // bitmap_plot::@return + breturn: + // [75] return + rts +} + // sgn_u16 +// Get the sign of a 16-bit unsigned number treated as a signed number. +// Returns unsigned -1 if the number is +// sgn_u16(word zeropage($f) w) +sgn_u16: { + .label _0 = $40 + .label _1 = $41 + .label w = $f + .label return = $31 + .label return_1 = $35 + .label return_4 = $11 + // [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 -- vbuz1=_hi_vwuz2 + lda w+1 + sta _0 + // [78] (byte~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (byte) $80 -- vbuz1=vbuz2_band_vbuc1 + lda #$80 + and _0 + sta _1 + // [79] if((byte) 0!=(byte~) sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp _1 + bne b1_from_sgn_u16 + // [81] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return] + breturn_from_sgn_u16: + // [81] phi (word) sgn_u16::return#4 = (byte) 1 [phi:sgn_u16->sgn_u16::@return#0] -- vwuz1=vbuc1 + lda #1 + sta return_4 + lda #0 + sta return_4+1 + jmp breturn + // [80] phi from sgn_u16 to sgn_u16::@1 [phi:sgn_u16->sgn_u16::@1] + b1_from_sgn_u16: + jmp b1 + // sgn_u16::@1 + b1: + // [81] phi from sgn_u16::@1 to sgn_u16::@return [phi:sgn_u16::@1->sgn_u16::@return] + breturn_from_b1: + // [81] phi (word) sgn_u16::return#4 = (word) $ffff [phi:sgn_u16::@1->sgn_u16::@return#0] -- vwuz1=vwuc1 + lda #<$ffff + sta return_4 + lda #>$ffff + sta return_4+1 + jmp breturn + // sgn_u16::@return + breturn: + // [82] return + rts +} + // abs_u16 +// Get the absolute value of a 16-bit unsigned number treated as a signed number. +// abs_u16(word zeropage($13) w) +abs_u16: { + .label _0 = $42 + .label _1 = $43 + .label w = $13 + .label return = $29 + .label return_1 = $2d + .label return_2 = $13 + .label return_4 = $13 + // [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 -- vbuz1=_hi_vwuz2 + lda w+1 + sta _0 + // [85] (byte~) abs_u16::$1 ← (byte~) abs_u16::$0 & (byte) $80 -- vbuz1=vbuz2_band_vbuc1 + lda #$80 + and _0 + sta _1 + // [86] if((byte) 0!=(byte~) abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp _1 + bne b1 + // [88] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return] + breturn_from_abs_u16: + breturn_from_b1: + // [88] phi (word) abs_u16::return#4 = (word) abs_u16::w#2 [phi:abs_u16/abs_u16::@1->abs_u16::@return#0] -- register_copy + jmp breturn + // abs_u16::@1 + b1: + // [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 -- vwuz1=_neg_vwuz1 + sec + lda #0 + sbc return_2 + sta return_2 + lda #0 + sbc return_2+1 + sta return_2+1 + jmp breturn_from_b1 + // abs_u16::@return + breturn: + // [89] return + rts +} + // bitmap_clear +// Clear all graphics on the bitmap +// bgcol - the background color to fill the screen with +// fgcol - the foreground color to fill the screen with +bitmap_clear: { + .const col = WHITE*$10 + // [91] call memset + // [95] phi from bitmap_clear to memset [phi:bitmap_clear->memset] + memset_from_bitmap_clear: + // [95] phi (byte) memset::c#3 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 + lda #col + sta memset.c + // [95] phi (word) memset::num#2 = (word) $3e8 [phi:bitmap_clear->memset#1] -- vwuz1=vwuc1 + lda #<$3e8 + sta memset.num + lda #>$3e8 + sta memset.num+1 + // [95] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#2] -- pvoz1=pvoc1 + lda #SCREEN + sta memset.str+1 + jsr memset + // [92] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1] + b1_from_bitmap_clear: + jmp b1 + // bitmap_clear::@1 + b1: + // [93] call memset + // [95] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] + memset_from_b1: + // [95] phi (byte) memset::c#3 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 + lda #0 + sta memset.c + // [95] phi (word) memset::num#2 = (word) $1f40 [phi:bitmap_clear::@1->memset#1] -- vwuz1=vwuc1 + lda #<$1f40 + sta memset.num + lda #>$1f40 + sta memset.num+1 + // [95] phi (void*) memset::str#2 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#2] -- pvoz1=pvoc1 + lda #BITMAP + sta memset.str+1 + jsr memset + jmp breturn + // bitmap_clear::@return + breturn: + // [94] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zeropage($15) str, byte zeropage($19) c, word zeropage($17) num) +memset: { + .label end = $44 + .label dst = $1a + .label str = $15 + .label num = $17 + .label c = $19 + // [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3 + lda str + clc + adc num + sta end + lda str+1 + adc num+1 + sta end+1 + // [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 -- pbuz1=pbuz2 + lda str + sta dst + lda str+1 + sta dst+1 + // [98] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] + b1_from_memset: + b1_from_b1: + // [98] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy + jmp b1 + // memset::@1 + b1: + // [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuz2 + lda c + ldy #0 + sta (dst),y + // [100] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + // [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + lda dst+1 + cmp end+1 + bne b1_from_b1 + lda dst + cmp end + bne b1_from_b1 + jmp breturn + // memset::@return + breturn: + // [102] return + rts +} + // bitmap_init +// Initialize bitmap plotting tables +bitmap_init: { + .label _4 = $47 + .label _5 = $48 + .label _6 = $49 + .label _7 = $46 + .label bits = $1c + .label x = $1d + .label y = $1e + .label yoffs = $1f + // [104] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] + b1_from_bitmap_init: + // [104] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuz1=vbuc1 + lda #0 + sta x + // [104] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuz1=vbuc1 + lda #$80 + sta bits + jmp b1 + // [104] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1] + b1_from_b2: + // [104] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy + // [104] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy + jmp b1 + // bitmap_init::@1 + b1: + // [105] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 -- pbuc1_derefidx_vbuz1=vbuz2 + lda bits + ldy x + sta bitmap_plot_bit,y + // [106] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuz1=vbuz1_ror_1 + lsr bits + // [107] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuz1_neq_0_then_la1 + lda bits + cmp #0 + bne b6_from_b1 + // [109] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2] + b2_from_b1: + // [109] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuz1=vbuc1 + lda #$80 + sta bits + jmp b2 + // [108] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6] + b6_from_b1: + jmp b6 + // bitmap_init::@6 + b6: + // [109] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2] + b2_from_b6: + // [109] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy + jmp b2 + // bitmap_init::@2 + b2: + // [110] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuz1=_inc_vbuz1 + inc x + // [111] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuz1_neq_0_then_la1 + lda x + cmp #0 + bne b1_from_b2 + // [112] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] + b3_from_b2: + // [112] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + lda #BITMAP + sta yoffs+1 + // [112] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuz1=vbuc1 + lda #0 + sta y + jmp b3 + // [112] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3] + b3_from_b4: + // [112] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy + // [112] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy + jmp b3 + // bitmap_init::@3 + b3: + // [113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and y + sta _7 + // [114] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuz1=_lo_pbuz2 + lda yoffs + sta _4 + // [115] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuz1=vbuz2_bor_vbuz3 + lda _7 + ora _4 + sta _5 + // [116] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 -- pbuc1_derefidx_vbuz1=vbuz2 + lda _5 + ldy y + sta bitmap_plot_ylo,y + // [117] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuz1=_hi_pbuz2 + lda yoffs+1 + sta _6 + // [118] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 -- pbuc1_derefidx_vbuz1=vbuz2 + lda _6 + ldy y + sta bitmap_plot_yhi,y + // [119] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 -- vbuz1_neq_vbuc1_then_la1 + lda #7 + cmp _7 + bne b4_from_b3 + jmp b5 + // bitmap_init::@5 + b5: + // [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda yoffs + adc #<$28*8 + sta yoffs + lda yoffs+1 + adc #>$28*8 + sta yoffs+1 + // [121] phi from bitmap_init::@3 bitmap_init::@5 to bitmap_init::@4 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4] + b4_from_b3: + b4_from_b5: + // [121] phi (byte*) bitmap_init::yoffs#4 = (byte*) bitmap_init::yoffs#2 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4#0] -- register_copy + jmp b4 + // bitmap_init::@4 + b4: + // [122] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuz1=_inc_vbuz1 + inc y + // [123] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 -- vbuz1_neq_0_then_la1 + lda y + cmp #0 + bne b3_from_b4 + jmp breturn + // bitmap_init::@return + breturn: + // [124] return + rts +} + // File Data + // Tables for the plotter - initialized by calling bitmap_init(); + bitmap_plot_ylo: .fill $100, 0 + bitmap_plot_yhi: .fill $100, 0 + bitmap_plot_bit: .fill $100, 0 + .align $100 +SINTAB: +.fill $180, 99.5+99.5*sin(i*2*PI/256) + +REGISTER UPLIFT POTENTIAL REGISTERS +Equivalence Class zp ZP_BYTE:71 [ bitmap_init::$4 ] has ALU potential. +Statement [8] *((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*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) [ main::a#2 main::i#2 main::$6 ] ( main:2 [ main::a#2 main::i#2 main::$6 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::i#2 main::i#1 ] +Statement [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 [ main::a#2 main::i#2 bitmap_line::x1#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 ] ) always clobbers reg byte a +Statement [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 ] ) always clobbers reg byte a +Statement [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 main::$10 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 main::$10 ] ) always clobbers reg byte a +Statement [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 ] ) always clobbers reg byte a +Statement [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 ] ) always clobbers reg byte a +Statement [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 [ main::i#2 main::a#1 ] ( main:2 [ main::i#2 main::a#1 ] ) always clobbers reg byte a +Statement [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#0 ] ) always clobbers reg byte a +Statement [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#0 ] ) always clobbers reg byte a +Statement [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 ] ) always clobbers reg byte a +Statement [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#1 ] ) always clobbers reg byte a +Statement [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#1 ] ) always clobbers reg byte a +Statement [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 ] ) always clobbers reg byte a +Statement [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::w#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::w#0 ] ) always clobbers reg byte a +Statement [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::return#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::return#0 ] ) always clobbers reg byte a +Statement [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 ] ) always clobbers reg byte a +Statement [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::w#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::w#1 ] ) always clobbers reg byte a +Statement [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::return#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::return#1 ] ) always clobbers reg byte a +Statement [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ) always clobbers reg byte a +Statement [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ) always clobbers reg byte a +Statement [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e#0 ] ) always clobbers reg byte a +Statement [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 ] ) always clobbers reg byte a +Statement [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 bitmap_plot::x#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 bitmap_plot::x#0 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] +Statement [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::e#3 bitmap_line::y#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::e#3 bitmap_line::y#1 ] ) always clobbers reg byte a +Statement [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ) always clobbers reg byte a +Statement [47] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ) always clobbers reg byte a +Statement [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::e#1 bitmap_line::x#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::e#1 bitmap_line::x#1 ] ) always clobbers reg byte a +Statement [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#1 bitmap_line::e#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#1 bitmap_line::e#2 ] ) always clobbers reg byte a +Statement [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#10 bitmap_line::e#6 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#10 bitmap_line::e#6 ] ) always clobbers reg byte a +Statement [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 [ bitmap_line::x#5 bitmap_plot::y#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x#5 bitmap_plot::y#1 ] ) always clobbers reg byte a +Statement [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 [ bitmap_plot::y#1 bitmap_plot::x#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_plot::y#1 bitmap_plot::x#1 ] ) always clobbers reg byte a +Statement [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e1#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e1#0 ] ) always clobbers reg byte a +Statement [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 ] ) always clobbers reg byte a +Statement [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 bitmap_plot::x#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 bitmap_plot::x#2 ] ) always clobbers reg byte a +Statement [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#3 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#3 ] ) always clobbers reg byte a +Statement [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ) always clobbers reg byte a +Statement [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ) always clobbers reg byte a +Statement [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::e1#1 bitmap_line::y#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::e1#1 bitmap_line::y#2 ] ) always clobbers reg byte a +Statement [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#2 bitmap_line::e1#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#2 bitmap_line::e1#2 ] ) always clobbers reg byte a +Statement [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#11 bitmap_line::x#13 bitmap_line::e1#6 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#11 bitmap_line::x#13 bitmap_line::e1#6 ] ) always clobbers reg byte a +Statement [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) [ bitmap_plot::x#3 bitmap_plot::plotter#0 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#0 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#0 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#0 ] ) always clobbers reg byte a +Statement [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 [ bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a +Statement [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#3 bitmap_plot::plotter#1 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#1 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#1 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#1 ] ) always clobbers reg byte a +Statement [73] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a +Statement [74] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 ] ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ main::i#2 main::i#1 ] +Statement [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 [ sgn_u16::$0 ] ( main:2::bitmap_line:18::sgn_u16:32 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::$0 ] main:2::bitmap_line:18::sgn_u16:36 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::$0 ] ) always clobbers reg byte a +Statement [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 [ abs_u16::w#2 abs_u16::$0 ] ( main:2::bitmap_line:18::abs_u16:24 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#2 abs_u16::$0 ] main:2::bitmap_line:18::abs_u16:28 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#2 abs_u16::$0 ] ) always clobbers reg byte a +Statement [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 [ abs_u16::return#2 ] ( main:2::bitmap_line:18::abs_u16:24 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#2 ] main:2::bitmap_line:18::abs_u16:28 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#2 ] ) always clobbers reg byte a +Statement [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::bitmap_clear:7::memset:91 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::bitmap_clear:7::memset:93 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:25 [ memset::c#3 ] +Statement [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a +Statement [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#2 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:25 [ memset::c#3 ] +Statement [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:2::bitmap_init:5 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:30 [ bitmap_init::y#2 bitmap_init::y#1 ] +Statement [8] *((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*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) [ main::a#2 main::i#2 main::$6 ] ( main:2 [ main::a#2 main::i#2 main::$6 ] ) always clobbers reg byte a +Statement [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 [ main::a#2 main::i#2 bitmap_line::x1#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 ] ) always clobbers reg byte a +Statement [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 ] ) always clobbers reg byte a +Statement [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 main::$10 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 main::$10 ] ) always clobbers reg byte a +Statement [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 ] ) always clobbers reg byte a +Statement [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 ] ) always clobbers reg byte a +Statement [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 [ main::i#2 main::a#1 ] ( main:2 [ main::i#2 main::a#1 ] ) always clobbers reg byte a reg byte x +Removing always clobbered register reg byte x as potential for zp ZP_BYTE:3 [ main::i#2 main::i#1 ] +Statement [21] if((byte) main::i#1!=(byte) 8) goto main::@1 [ main::a#1 main::i#1 ] ( main:2 [ main::a#1 main::i#1 ] ) always clobbers reg byte a +Statement [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#0 ] ) always clobbers reg byte a +Statement [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#0 ] ) always clobbers reg byte a +Statement [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 ] ) always clobbers reg byte a +Statement [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#1 ] ) always clobbers reg byte a +Statement [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#1 ] ) always clobbers reg byte a +Statement [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 ] ) always clobbers reg byte a +Statement [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::w#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::w#0 ] ) always clobbers reg byte a +Statement [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::return#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::return#0 ] ) always clobbers reg byte a +Statement [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 ] ) always clobbers reg byte a +Statement [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::w#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::w#1 ] ) always clobbers reg byte a +Statement [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::return#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::return#1 ] ) always clobbers reg byte a +Statement [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ) always clobbers reg byte a +Statement [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ) always clobbers reg byte a +Statement [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e#0 ] ) always clobbers reg byte a +Statement [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 ] ) always clobbers reg byte a +Statement [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 bitmap_plot::x#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 bitmap_plot::x#0 ] ) always clobbers reg byte a +Statement [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::e#3 bitmap_line::y#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::e#3 bitmap_line::y#1 ] ) always clobbers reg byte a +Statement [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ) always clobbers reg byte a +Statement [47] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ) always clobbers reg byte a +Statement [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::e#1 bitmap_line::x#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::e#1 bitmap_line::x#1 ] ) always clobbers reg byte a +Statement [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#1 bitmap_line::e#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#1 bitmap_line::e#2 ] ) always clobbers reg byte a +Statement [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#10 bitmap_line::e#6 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#10 bitmap_line::e#6 ] ) always clobbers reg byte a +Statement [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 [ bitmap_line::x#5 bitmap_plot::y#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x#5 bitmap_plot::y#1 ] ) always clobbers reg byte a +Statement [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 [ bitmap_plot::y#1 bitmap_plot::x#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_plot::y#1 bitmap_plot::x#1 ] ) always clobbers reg byte a +Statement [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e1#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e1#0 ] ) always clobbers reg byte a +Statement [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 ] ) always clobbers reg byte a +Statement [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 bitmap_plot::x#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 bitmap_plot::x#2 ] ) always clobbers reg byte a +Statement [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#3 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#3 ] ) always clobbers reg byte a +Statement [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ) always clobbers reg byte a +Statement [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ) always clobbers reg byte a +Statement [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::e1#1 bitmap_line::y#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::e1#1 bitmap_line::y#2 ] ) always clobbers reg byte a +Statement [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#2 bitmap_line::e1#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#2 bitmap_line::e1#2 ] ) always clobbers reg byte a +Statement [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#11 bitmap_line::x#13 bitmap_line::e1#6 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#11 bitmap_line::x#13 bitmap_line::e1#6 ] ) always clobbers reg byte a +Statement [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) [ bitmap_plot::x#3 bitmap_plot::plotter#0 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#0 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#0 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#0 ] ) always clobbers reg byte a +Statement [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 [ bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a +Statement [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#3 bitmap_plot::plotter#1 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#1 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#1 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#1 ] ) always clobbers reg byte a +Statement [73] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a +Statement [74] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 ] ) always clobbers reg byte a reg byte y +Statement [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 [ sgn_u16::$0 ] ( main:2::bitmap_line:18::sgn_u16:32 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::$0 ] main:2::bitmap_line:18::sgn_u16:36 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::$0 ] ) always clobbers reg byte a +Statement [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 [ abs_u16::w#2 abs_u16::$0 ] ( main:2::bitmap_line:18::abs_u16:24 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#2 abs_u16::$0 ] main:2::bitmap_line:18::abs_u16:28 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#2 abs_u16::$0 ] ) always clobbers reg byte a +Statement [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 [ abs_u16::return#2 ] ( main:2::bitmap_line:18::abs_u16:24 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#2 ] main:2::bitmap_line:18::abs_u16:28 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#2 ] ) always clobbers reg byte a +Statement [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::bitmap_clear:7::memset:91 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::bitmap_clear:7::memset:93 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a +Statement [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#2 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y +Statement [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ( main:2::bitmap_init:5 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ) always clobbers reg byte a +Statement [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:2::bitmap_init:5 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ) always clobbers reg byte a +Statement [8] *((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*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) [ main::a#2 main::i#2 main::$6 ] ( main:2 [ main::a#2 main::i#2 main::$6 ] ) always clobbers reg byte a +Statement [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 [ main::a#2 main::i#2 bitmap_line::x1#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 ] ) always clobbers reg byte a +Statement [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 ] ) always clobbers reg byte a +Statement [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 main::$10 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 main::$10 ] ) always clobbers reg byte a +Statement [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 ] ) always clobbers reg byte a +Statement [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 ] ( main:2 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 ] ) always clobbers reg byte a +Statement [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 [ main::i#2 main::a#1 ] ( main:2 [ main::i#2 main::a#1 ] ) always clobbers reg byte a reg byte x +Statement [21] if((byte) main::i#1!=(byte) 8) goto main::@1 [ main::a#1 main::i#1 ] ( main:2 [ main::a#1 main::i#1 ] ) always clobbers reg byte a +Statement [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#0 ] ) always clobbers reg byte a +Statement [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#0 ] ) always clobbers reg byte a +Statement [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 ] ) always clobbers reg byte a +Statement [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#1 ] ) always clobbers reg byte a +Statement [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#1 ] ) always clobbers reg byte a +Statement [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 ] ) always clobbers reg byte a +Statement [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::w#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::w#0 ] ) always clobbers reg byte a +Statement [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::return#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::return#0 ] ) always clobbers reg byte a +Statement [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 ] ) always clobbers reg byte a +Statement [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::w#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::w#1 ] ) always clobbers reg byte a +Statement [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::return#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::return#1 ] ) always clobbers reg byte a +Statement [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ) always clobbers reg byte a +Statement [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 ] ) always clobbers reg byte a +Statement [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e#0 ] ) always clobbers reg byte a +Statement [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 ] ) always clobbers reg byte a +Statement [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 bitmap_plot::x#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::y#0 bitmap_plot::x#0 ] ) always clobbers reg byte a +Statement [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::e#3 bitmap_line::y#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::e#3 bitmap_line::y#1 ] ) always clobbers reg byte a +Statement [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ) always clobbers reg byte a +Statement [47] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#11 bitmap_line::y#1 bitmap_line::e#1 ] ) always clobbers reg byte a +Statement [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::e#1 bitmap_line::x#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::e#1 bitmap_line::x#1 ] ) always clobbers reg byte a +Statement [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#1 bitmap_line::e#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#1 bitmap_line::e#2 ] ) always clobbers reg byte a +Statement [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 [ bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#10 bitmap_line::e#6 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#1 bitmap_line::x#10 bitmap_line::e#6 ] ) always clobbers reg byte a +Statement [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 [ bitmap_line::x#5 bitmap_plot::y#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x#5 bitmap_plot::y#1 ] ) always clobbers reg byte a +Statement [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 [ bitmap_plot::y#1 bitmap_plot::x#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_plot::y#1 bitmap_plot::x#1 ] ) always clobbers reg byte a +Statement [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 [ bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e1#0 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::e1#0 ] ) always clobbers reg byte a +Statement [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 ] ) always clobbers reg byte a +Statement [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 bitmap_plot::x#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::y#2 bitmap_plot::x#2 ] ) always clobbers reg byte a +Statement [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#3 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#3 ] ) always clobbers reg byte a +Statement [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ) always clobbers reg byte a +Statement [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#13 bitmap_line::e1#1 ] ) always clobbers reg byte a +Statement [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::e1#1 bitmap_line::y#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::e1#1 bitmap_line::y#2 ] ) always clobbers reg byte a +Statement [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#2 bitmap_line::e1#2 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::x#13 bitmap_line::y#2 bitmap_line::e1#2 ] ) always clobbers reg byte a +Statement [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 [ bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#11 bitmap_line::x#13 bitmap_line::e1#6 ] ( main:2::bitmap_line:18 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#11 bitmap_line::x#13 bitmap_line::e1#6 ] ) always clobbers reg byte a +Statement [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) [ bitmap_plot::x#3 bitmap_plot::plotter#0 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#0 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#0 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#0 ] ) always clobbers reg byte a +Statement [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 [ bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#0 bitmap_plot::$1 ] ) always clobbers reg byte a +Statement [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 [ bitmap_plot::x#3 bitmap_plot::plotter#1 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::x#3 bitmap_plot::plotter#1 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::x#3 bitmap_plot::plotter#1 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::x#3 bitmap_plot::plotter#1 ] ) always clobbers reg byte a +Statement [73] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a +Statement [74] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:2::bitmap_line:18::bitmap_plot:44 [ main::a#2 main::i#2 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#3 bitmap_line::x#11 bitmap_line::e#3 ] main:2::bitmap_line:18::bitmap_plot:55 [ main::a#2 main::i#2 ] main:2::bitmap_line:18::bitmap_plot:61 [ main::a#2 main::i#2 bitmap_line::x2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 bitmap_line::sy#0 bitmap_line::y#13 bitmap_line::x#6 bitmap_line::e1#3 ] ) always clobbers reg byte a reg byte y +Statement [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 [ sgn_u16::$0 ] ( main:2::bitmap_line:18::sgn_u16:32 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 sgn_u16::$0 ] main:2::bitmap_line:18::sgn_u16:36 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 bitmap_line::dy#0 bitmap_line::sx#0 sgn_u16::$0 ] ) always clobbers reg byte a +Statement [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 [ abs_u16::w#2 abs_u16::$0 ] ( main:2::bitmap_line:18::abs_u16:24 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::w#2 abs_u16::$0 ] main:2::bitmap_line:18::abs_u16:28 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::w#2 abs_u16::$0 ] ) always clobbers reg byte a +Statement [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 [ abs_u16::return#2 ] ( main:2::bitmap_line:18::abs_u16:24 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 abs_u16::return#2 ] main:2::bitmap_line:18::abs_u16:28 [ main::a#2 main::i#2 bitmap_line::x1#0 bitmap_line::y1#0 bitmap_line::x2#0 bitmap_line::y2#0 bitmap_line::dx#0 abs_u16::return#2 ] ) always clobbers reg byte a +Statement [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::bitmap_clear:7::memset:91 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::bitmap_clear:7::memset:93 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a +Statement [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#2 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y +Statement [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::bitmap_clear:7::memset:91 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::bitmap_clear:7::memset:93 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ( main:2::bitmap_init:5 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ) always clobbers reg byte a +Statement [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:2::bitmap_init:5 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ) always clobbers reg byte a +Potential registers zp ZP_BYTE:2 [ main::a#2 main::a#1 ] : zp ZP_BYTE:2 , reg byte x , +Potential registers zp ZP_BYTE:3 [ main::i#2 main::i#1 ] : zp ZP_BYTE:3 , +Potential registers zp ZP_WORD:4 [ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] : zp ZP_WORD:4 , +Potential registers zp ZP_WORD:6 [ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] : zp ZP_WORD:6 , +Potential registers zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 ] : zp ZP_WORD:8 , +Potential registers zp ZP_WORD:10 [ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] : zp ZP_WORD:10 , +Potential registers zp ZP_BYTE:12 [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] : zp ZP_BYTE:12 , reg byte x , reg byte y , +Potential registers zp ZP_WORD:13 [ bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] : zp ZP_WORD:13 , +Potential registers zp ZP_WORD:15 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] : zp ZP_WORD:15 , +Potential registers zp ZP_WORD:17 [ sgn_u16::return#4 ] : zp ZP_WORD:17 , +Potential registers zp ZP_WORD:19 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 ] : zp ZP_WORD:19 , +Potential registers zp ZP_WORD:21 [ memset::str#2 ] : zp ZP_WORD:21 , +Potential registers zp ZP_WORD:23 [ memset::num#2 ] : zp ZP_WORD:23 , +Potential registers zp ZP_BYTE:25 [ memset::c#3 ] : zp ZP_BYTE:25 , reg byte x , +Potential registers zp ZP_WORD:26 [ memset::dst#2 memset::dst#3 memset::dst#1 ] : zp ZP_WORD:26 , +Potential registers zp ZP_BYTE:28 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] : zp ZP_BYTE:28 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:29 [ bitmap_init::x#2 bitmap_init::x#1 ] : zp ZP_BYTE:29 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:30 [ bitmap_init::y#2 bitmap_init::y#1 ] : zp ZP_BYTE:30 , reg byte x , reg byte y , +Potential registers zp ZP_WORD:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] : zp ZP_WORD:31 , +Potential registers zp ZP_WORD:33 [ main::$6 ] : zp ZP_WORD:33 , +Potential registers zp ZP_WORD:35 [ main::$10 ] : zp ZP_WORD:35 , +Potential registers zp ZP_WORD:37 [ bitmap_line::x2#0 ] : zp ZP_WORD:37 , +Potential registers zp ZP_WORD:39 [ bitmap_line::y2#0 ] : zp ZP_WORD:39 , +Potential registers zp ZP_WORD:41 [ abs_u16::return#0 ] : zp ZP_WORD:41 , +Potential registers zp ZP_WORD:43 [ bitmap_line::dx#0 ] : zp ZP_WORD:43 , +Potential registers zp ZP_WORD:45 [ abs_u16::return#1 ] : zp ZP_WORD:45 , +Potential registers zp ZP_WORD:47 [ bitmap_line::dy#0 ] : zp ZP_WORD:47 , +Potential registers zp ZP_WORD:49 [ sgn_u16::return#0 ] : zp ZP_WORD:49 , +Potential registers zp ZP_WORD:51 [ bitmap_line::sx#0 ] : zp ZP_WORD:51 , +Potential registers zp ZP_WORD:53 [ sgn_u16::return#1 ] : zp ZP_WORD:53 , +Potential registers zp ZP_WORD:55 [ bitmap_line::sy#0 ] : zp ZP_WORD:55 , +Potential registers zp ZP_WORD:57 [ bitmap_plot::plotter#0 ] : zp ZP_WORD:57 , +Potential registers zp ZP_WORD:59 [ bitmap_plot::$1 ] : zp ZP_WORD:59 , +Potential registers zp ZP_WORD:61 [ bitmap_plot::plotter#1 ] : zp ZP_WORD:61 , +Potential registers zp ZP_BYTE:63 [ bitmap_plot::$2 ] : zp ZP_BYTE:63 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:64 [ sgn_u16::$0 ] : zp ZP_BYTE:64 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:65 [ sgn_u16::$1 ] : zp ZP_BYTE:65 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:66 [ abs_u16::$0 ] : zp ZP_BYTE:66 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:67 [ abs_u16::$1 ] : zp ZP_BYTE:67 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:68 [ memset::end#0 ] : zp ZP_WORD:68 , +Potential registers zp ZP_BYTE:70 [ bitmap_init::$7 ] : zp ZP_BYTE:70 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:71 [ bitmap_init::$4 ] : zp ZP_BYTE:71 , reg byte a , reg byte x , reg byte y , reg byte alu , +Potential registers zp ZP_BYTE:72 [ bitmap_init::$5 ] : zp ZP_BYTE:72 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:73 [ bitmap_init::$6 ] : zp ZP_BYTE:73 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [bitmap_line] 658.11: zp ZP_WORD:6 [ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] 597.76: zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 ] 532.97: zp ZP_WORD:4 [ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] 532.97: zp ZP_WORD:10 [ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] 9.09: zp ZP_WORD:47 [ bitmap_line::dy#0 ] 8.13: zp ZP_WORD:43 [ bitmap_line::dx#0 ] 7.85: zp ZP_WORD:55 [ bitmap_line::sy#0 ] 6.8: zp ZP_WORD:51 [ bitmap_line::sx#0 ] 3.87: zp ZP_WORD:39 [ bitmap_line::y2#0 ] 3.74: zp ZP_WORD:37 [ bitmap_line::x2#0 ] +Uplift Scope [bitmap_plot] 460: zp ZP_WORD:13 [ bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] 412: zp ZP_BYTE:12 [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] 4: zp ZP_WORD:59 [ bitmap_plot::$1 ] 4: zp ZP_BYTE:63 [ bitmap_plot::$2 ] 3: zp ZP_WORD:61 [ bitmap_plot::plotter#1 ] 1: zp ZP_WORD:57 [ bitmap_plot::plotter#0 ] +Uplift Scope [bitmap_init] 39.88: zp ZP_WORD:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] 34.83: zp ZP_BYTE:28 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] 22: zp ZP_BYTE:29 [ bitmap_init::x#2 bitmap_init::x#1 ] 22: zp ZP_BYTE:30 [ bitmap_init::y#2 bitmap_init::y#1 ] 22: zp ZP_BYTE:71 [ bitmap_init::$4 ] 22: zp ZP_BYTE:72 [ bitmap_init::$5 ] 22: zp ZP_BYTE:73 [ bitmap_init::$6 ] 5.5: zp ZP_BYTE:70 [ bitmap_init::$7 ] +Uplift Scope [main] 22: zp ZP_WORD:33 [ main::$6 ] 22: zp ZP_WORD:35 [ main::$10 ] 18.94: zp ZP_BYTE:3 [ main::i#2 main::i#1 ] 10.08: zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +Uplift Scope [memset] 38: zp ZP_WORD:26 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:68 [ memset::end#0 ] 2: zp ZP_WORD:23 [ memset::num#2 ] 1.57: zp ZP_BYTE:25 [ memset::c#3 ] 0: zp ZP_WORD:21 [ memset::str#2 ] +Uplift Scope [abs_u16] 16.5: zp ZP_WORD:19 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 ] 4: zp ZP_WORD:41 [ abs_u16::return#0 ] 4: zp ZP_WORD:45 [ abs_u16::return#1 ] 4: zp ZP_BYTE:66 [ abs_u16::$0 ] 4: zp ZP_BYTE:67 [ abs_u16::$1 ] +Uplift Scope [sgn_u16] 14: zp ZP_WORD:15 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] 4: zp ZP_WORD:49 [ sgn_u16::return#0 ] 4: zp ZP_WORD:53 [ sgn_u16::return#1 ] 4: zp ZP_BYTE:64 [ sgn_u16::$0 ] 4: zp ZP_BYTE:65 [ sgn_u16::$1 ] 1: zp ZP_WORD:17 [ sgn_u16::return#4 ] +Uplift Scope [bitmap_clear] +Uplift Scope [] + +Uplifting [bitmap_line] best 33582 combination zp ZP_WORD:6 [ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 ] zp ZP_WORD:4 [ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] zp ZP_WORD:10 [ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] zp ZP_WORD:47 [ bitmap_line::dy#0 ] zp ZP_WORD:43 [ bitmap_line::dx#0 ] zp ZP_WORD:55 [ bitmap_line::sy#0 ] zp ZP_WORD:51 [ bitmap_line::sx#0 ] zp ZP_WORD:39 [ bitmap_line::y2#0 ] zp ZP_WORD:37 [ bitmap_line::x2#0 ] +Uplifting [bitmap_plot] best 33374 combination zp ZP_WORD:13 [ bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] reg byte x [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] zp ZP_WORD:59 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:61 [ bitmap_plot::plotter#1 ] zp ZP_WORD:57 [ bitmap_plot::plotter#0 ] +Uplifting [bitmap_init] best 32864 combination zp ZP_WORD:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] reg byte a [ bitmap_init::$4 ] zp ZP_BYTE:72 [ bitmap_init::$5 ] zp ZP_BYTE:73 [ bitmap_init::$6 ] zp ZP_BYTE:70 [ bitmap_init::$7 ] +Limited combination testing to 100 combinations of 15360 possible. +Uplifting [main] best 32864 combination zp ZP_WORD:33 [ main::$6 ] zp ZP_WORD:35 [ main::$10 ] zp ZP_BYTE:3 [ main::i#2 main::i#1 ] zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +Uplifting [memset] best 32848 combination zp ZP_WORD:26 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:68 [ memset::end#0 ] zp ZP_WORD:23 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:21 [ memset::str#2 ] +Uplifting [abs_u16] best 32836 combination zp ZP_WORD:19 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 ] zp ZP_WORD:41 [ abs_u16::return#0 ] zp ZP_WORD:45 [ abs_u16::return#1 ] reg byte a [ abs_u16::$0 ] reg byte a [ abs_u16::$1 ] +Uplifting [sgn_u16] best 32824 combination zp ZP_WORD:15 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] zp ZP_WORD:49 [ sgn_u16::return#0 ] zp ZP_WORD:53 [ sgn_u16::return#1 ] reg byte a [ sgn_u16::$0 ] reg byte a [ sgn_u16::$1 ] zp ZP_WORD:17 [ sgn_u16::return#4 ] +Uplifting [bitmap_clear] best 32824 combination +Uplifting [] best 32824 combination +Attempting to uplift remaining variables inzp ZP_BYTE:72 [ bitmap_init::$5 ] +Uplifting [bitmap_init] best 32764 combination reg byte a [ bitmap_init::$5 ] +Attempting to uplift remaining variables inzp ZP_BYTE:73 [ bitmap_init::$6 ] +Uplifting [bitmap_init] best 32704 combination reg byte a [ bitmap_init::$6 ] +Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::i#2 main::i#1 ] +Uplifting [main] best 32704 combination zp ZP_BYTE:3 [ main::i#2 main::i#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::a#2 main::a#1 ] +Uplifting [main] best 32704 combination zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:70 [ bitmap_init::$7 ] +Uplifting [bitmap_init] best 32704 combination zp ZP_BYTE:70 [ bitmap_init::$7 ] +Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 ] ] with [ zp ZP_WORD:13 [ bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] ] - score: 3 +Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 ] ] with [ zp ZP_WORD:33 [ main::$6 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:17 [ sgn_u16::return#4 ] ] with [ zp ZP_WORD:49 [ sgn_u16::return#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:17 [ sgn_u16::return#4 sgn_u16::return#0 ] ] with [ zp ZP_WORD:53 [ sgn_u16::return#1 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:19 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 ] ] with [ zp ZP_WORD:41 [ abs_u16::return#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:19 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 abs_u16::return#0 ] ] with [ zp ZP_WORD:45 [ abs_u16::return#1 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:21 [ memset::str#2 ] ] with [ zp ZP_WORD:26 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:23 [ memset::num#2 ] ] with [ zp ZP_WORD:68 [ memset::end#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:35 [ main::$10 ] ] with [ zp ZP_WORD:37 [ bitmap_line::x2#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:57 [ bitmap_plot::plotter#0 ] ] with [ zp ZP_WORD:61 [ bitmap_plot::plotter#1 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:17 [ sgn_u16::return#4 sgn_u16::return#0 sgn_u16::return#1 ] ] with [ zp ZP_WORD:55 [ bitmap_line::sy#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:19 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 abs_u16::return#0 abs_u16::return#1 ] ] with [ zp ZP_WORD:47 [ bitmap_line::dy#0 ] ] - score: 1 +Allocated (was zp ZP_WORD:15) zp ZP_WORD:12 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] +Allocated (was zp ZP_WORD:17) zp ZP_WORD:14 [ sgn_u16::return#4 sgn_u16::return#0 sgn_u16::return#1 bitmap_line::sy#0 ] +Allocated (was zp ZP_WORD:19) zp ZP_WORD:16 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 abs_u16::return#0 abs_u16::return#1 bitmap_line::dy#0 ] +Allocated (was zp ZP_WORD:21) zp ZP_WORD:18 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] +Allocated (was zp ZP_WORD:23) zp ZP_WORD:20 [ memset::num#2 memset::end#0 ] +Allocated (was zp ZP_WORD:31) zp ZP_WORD:22 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +Allocated (was zp ZP_WORD:35) zp ZP_WORD:24 [ main::$10 bitmap_line::x2#0 ] +Allocated (was zp ZP_WORD:39) zp ZP_WORD:26 [ bitmap_line::y2#0 ] +Allocated (was zp ZP_WORD:43) zp ZP_WORD:28 [ bitmap_line::dx#0 ] +Allocated (was zp ZP_WORD:51) zp ZP_WORD:30 [ bitmap_line::sx#0 ] +Allocated (was zp ZP_WORD:57) zp ZP_WORD:32 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ] +Allocated (was zp ZP_WORD:59) zp ZP_WORD:34 [ bitmap_plot::$1 ] +Allocated (was zp ZP_BYTE:70) zp ZP_BYTE:36 [ bitmap_init::$7 ] + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +// Tests the simple bitmap plotter +// Plots a few lines using the bresenham line algorithm + // Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" + // Global Constants & labels + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label D018 = $d018 + .const WHITE = 1 + .label BITMAP = $2000 + .label SCREEN = $400 + .label COSTAB = SINTAB+$40 + // @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: { + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label _6 = 8 + .label _10 = $18 + .label a = 2 + .label i = 3 + // [5] call bitmap_init + // [103] phi from main to bitmap_init [phi:main->bitmap_init] + bitmap_init_from_main: + jsr bitmap_init + // [6] phi from main to main::@4 [phi:main->main::@4] + b4_from_main: + jmp b4 + // main::@4 + b4: + // [7] call bitmap_clear + // [90] phi from main::@4 to bitmap_clear [phi:main::@4->bitmap_clear] + bitmap_clear_from_b4: + jsr bitmap_clear + jmp b5 + // main::@5 + b5: + // [8] *((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 + // [9] phi from main::@5 to main::toD0181 [phi:main::@5->main::toD0181] + toD0181_from_b5: + jmp toD0181 + // main::toD0181 + toD0181: + jmp b3 + // main::@3 + b3: + // [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0181_return + sta D018 + // [11] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + b1_from_b3: + // [11] phi (byte) main::i#2 = (byte) 0 [phi:main::@3->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta i + // [11] phi (byte) main::a#2 = (byte) 0 [phi:main::@3->main::@1#1] -- vbuz1=vbuc1 + lda #0 + sta a + jmp b1 + // [11] phi from main::@6 to main::@1 [phi:main::@6->main::@1] + b1_from_b6: + // [11] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@6->main::@1#0] -- register_copy + // [11] phi (byte) main::a#2 = (byte) main::a#1 [phi:main::@6->main::@1#1] -- register_copy + jmp b1 + // main::@1 + b1: + // [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda COSTAB,y + sta _6 + lda #0 + sta _6+1 + // [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 -- vwuz1=vwuz1_plus_vbuc1 + lda #$78 + clc + adc bitmap_line.x1 + sta bitmap_line.x1 + bcc !+ + inc bitmap_line.x1+1 + !: + // [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda SINTAB,y + sta bitmap_line.y1 + lda #0 + sta bitmap_line.y1+1 + // [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda COSTAB+$20,y + sta _10 + lda #0 + sta _10+1 + // [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 -- vwuz1=vwuz1_plus_vbuc1 + lda #$78 + clc + adc bitmap_line.x2 + sta bitmap_line.x2 + bcc !+ + inc bitmap_line.x2+1 + !: + // [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda SINTAB+$20,y + sta bitmap_line.y2 + lda #0 + sta bitmap_line.y2+1 + // [18] call bitmap_line + jsr bitmap_line + jmp b6 + // main::@6 + b6: + // [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 -- vbuz1=vbuz1_plus_vbuc1 + lax a + axs #-[$20] + stx a + // [20] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 + inc i + // [21] if((byte) main::i#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp i + bne b1_from_b6 + jmp b2 + // main::@2 + b2: + // [22] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + inc SCREEN+$3e7 + jmp b2 +} + // bitmap_line +// Draw a line on the bitmap using bresenhams algorithm +// bitmap_line(word zeropage(8) x1, word zeropage(6) y1, word zeropage($18) x2, word zeropage($1a) y2) +bitmap_line: { + .label dx = $1c + .label dy = $10 + .label sx = $1e + .label sy = $e + .label e1 = $a + .label e = 4 + .label y = 6 + .label x = 8 + .label x1 = 8 + .label y1 = 6 + .label x2 = $18 + .label y2 = $1a + // [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda x2 + sec + sbc x1 + sta abs_u16.w + lda x2+1 + sbc x1+1 + sta abs_u16.w+1 + // [24] call abs_u16 + // [83] phi from bitmap_line to abs_u16 [phi:bitmap_line->abs_u16] + abs_u16_from_bitmap_line: + // [83] phi (word) abs_u16::w#2 = (word) abs_u16::w#0 [phi:bitmap_line->abs_u16#0] -- register_copy + jsr abs_u16 + // [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 + jmp b10 + // bitmap_line::@10 + b10: + // [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 -- vwuz1=vwuz2 + lda abs_u16.return + sta dx + lda abs_u16.return+1 + sta dx+1 + // [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda y2 + sec + sbc y1 + sta abs_u16.w + lda y2+1 + sbc y1+1 + sta abs_u16.w+1 + // [28] call abs_u16 + // [83] phi from bitmap_line::@10 to abs_u16 [phi:bitmap_line::@10->abs_u16] + abs_u16_from_b10: + // [83] phi (word) abs_u16::w#2 = (word) abs_u16::w#1 [phi:bitmap_line::@10->abs_u16#0] -- register_copy + jsr abs_u16 + // [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 + jmp b11 + // bitmap_line::@11 + b11: + // [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 + // [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda x2 + sec + sbc x1 + sta sgn_u16.w + lda x2+1 + sbc x1+1 + sta sgn_u16.w+1 + // [32] call sgn_u16 + // [76] phi from bitmap_line::@11 to sgn_u16 [phi:bitmap_line::@11->sgn_u16] + sgn_u16_from_b11: + // [76] phi (word) sgn_u16::w#2 = (word) sgn_u16::w#0 [phi:bitmap_line::@11->sgn_u16#0] -- register_copy + jsr sgn_u16 + // [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 + jmp b12 + // bitmap_line::@12 + b12: + // [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 -- vwuz1=vwuz2 + lda sgn_u16.return + sta sx + lda sgn_u16.return+1 + sta sx+1 + // [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda y2 + sec + sbc y1 + sta sgn_u16.w + lda y2+1 + sbc y1+1 + sta sgn_u16.w+1 + // [36] call sgn_u16 + // [76] phi from bitmap_line::@12 to sgn_u16 [phi:bitmap_line::@12->sgn_u16] + sgn_u16_from_b12: + // [76] phi (word) sgn_u16::w#2 = (word) sgn_u16::w#1 [phi:bitmap_line::@12->sgn_u16#0] -- register_copy + jsr sgn_u16 + // [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 + jmp b13 + // bitmap_line::@13 + b13: + // [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 + // [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 -- vwuz1_gt_vwuz2_then_la1 + lda dy+1 + cmp dx+1 + bcc b1 + bne !+ + lda dy + cmp dx + bcc b1 + !: + jmp b3 + // bitmap_line::@3 + b3: + // [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 -- vwuz1=vwuz2_ror_1 + lda dx+1 + lsr + sta e+1 + lda dx + ror + sta e + // [41] phi from bitmap_line::@3 bitmap_line::@5 to bitmap_line::@4 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4] + b4_from_b3: + b4_from_b5: + // [41] phi (word) bitmap_line::e#3 = (word) bitmap_line::e#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#0] -- register_copy + // [41] phi (word) bitmap_line::x#11 = (word) bitmap_line::x1#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#1] -- register_copy + // [41] phi (word) bitmap_line::y#3 = (word) bitmap_line::y1#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#2] -- register_copy + jmp b4 + // bitmap_line::@4 + b4: + // [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 -- vbuxx=_byte_vwuz1 + lda y + tax + // [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 + // [44] call bitmap_plot + // [69] phi from bitmap_line::@4 to bitmap_plot [phi:bitmap_line::@4->bitmap_plot] + bitmap_plot_from_b4: + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#0 [phi:bitmap_line::@4->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#0 [phi:bitmap_line::@4->bitmap_plot#1] -- register_copy + jsr bitmap_plot + jmp b14 + // bitmap_line::@14 + b14: + // [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + // [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda e + clc + adc dx + sta e + lda e+1 + adc dx+1 + sta e+1 + // [47] if((word) bitmap_line::dy#0>=(word) bitmap_line::e#1) goto bitmap_line::@5 -- vwuz1_ge_vwuz2_then_la1 + lda e+1 + cmp dy+1 + bne !+ + lda e + cmp dy + beq b5_from_b14 + !: + bcc b5_from_b14 + jmp b6 + // bitmap_line::@6 + b6: + // [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + // [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 -- vwuz1=vwuz1_minus_vwuz2 + lda e + sec + sbc dy + sta e + lda e+1 + sbc dy+1 + sta e+1 + // [50] phi from bitmap_line::@14 bitmap_line::@6 to bitmap_line::@5 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5] + b5_from_b14: + b5_from_b6: + // [50] phi (word) bitmap_line::e#6 = (word) bitmap_line::e#1 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5#0] -- register_copy + // [50] phi (word) bitmap_line::x#10 = (word) bitmap_line::x#11 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5#1] -- register_copy + jmp b5 + // bitmap_line::@5 + b5: + // [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 -- vwuz1_neq_vwuz2_then_la1 + lda y+1 + cmp y2+1 + bne b4_from_b5 + lda y + cmp y2 + bne b4_from_b5 + // [52] phi from bitmap_line::@5 bitmap_line::@8 to bitmap_line::@2 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2] + b2_from_b5: + b2_from_b8: + // [52] phi (word) bitmap_line::x#5 = (word) bitmap_line::x#10 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2#0] -- register_copy + // [52] phi (word) bitmap_line::y#6 = (word) bitmap_line::y#1 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2#1] -- register_copy + jmp b2 + // bitmap_line::@2 + b2: + // [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 -- vbuxx=_byte_vwuz1 + lda y + tax + // [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 + // [55] call bitmap_plot + // [69] phi from bitmap_line::@2 to bitmap_plot [phi:bitmap_line::@2->bitmap_plot] + bitmap_plot_from_b2: + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#1 [phi:bitmap_line::@2->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#1 [phi:bitmap_line::@2->bitmap_plot#1] -- register_copy + jsr bitmap_plot + jmp breturn + // bitmap_line::@return + breturn: + // [56] return + rts + // bitmap_line::@1 + b1: + // [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 -- vwuz1=vwuz2_ror_1 + lda dy+1 + lsr + sta e1+1 + lda dy + ror + sta e1 + // [58] phi from bitmap_line::@1 bitmap_line::@8 to bitmap_line::@7 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7] + b7_from_b1: + b7_from_b8: + // [58] phi (word) bitmap_line::e1#3 = (word) bitmap_line::e1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#0] -- register_copy + // [58] phi (word) bitmap_line::x#6 = (word) bitmap_line::x1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#1] -- register_copy + // [58] phi (word) bitmap_line::y#13 = (word) bitmap_line::y1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#2] -- register_copy + jmp b7 + // bitmap_line::@7 + b7: + // [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 -- vbuxx=_byte_vwuz1 + lda y + tax + // [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 + // [61] call bitmap_plot + // [69] phi from bitmap_line::@7 to bitmap_plot [phi:bitmap_line::@7->bitmap_plot] + bitmap_plot_from_b7: + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#2 [phi:bitmap_line::@7->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#2 [phi:bitmap_line::@7->bitmap_plot#1] -- register_copy + jsr bitmap_plot + jmp b15 + // bitmap_line::@15 + b15: + // [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + // [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda e1 + clc + adc dy + sta e1 + lda e1+1 + adc dy+1 + sta e1+1 + // [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 -- vwuz1_ge_vwuz2_then_la1 + lda e1+1 + cmp dx+1 + bne !+ + lda e1 + cmp dx + beq b8_from_b15 + !: + bcc b8_from_b15 + jmp b9 + // bitmap_line::@9 + b9: + // [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + // [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 -- vwuz1=vwuz1_minus_vwuz2 + lda e1 + sec + sbc dx + sta e1 + lda e1+1 + sbc dx+1 + sta e1+1 + // [67] phi from bitmap_line::@15 bitmap_line::@9 to bitmap_line::@8 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8] + b8_from_b15: + b8_from_b9: + // [67] phi (word) bitmap_line::e1#6 = (word) bitmap_line::e1#1 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8#0] -- register_copy + // [67] phi (word) bitmap_line::y#11 = (word) bitmap_line::y#13 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8#1] -- register_copy + jmp b8 + // bitmap_line::@8 + b8: + // [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 -- vwuz1_neq_vwuz2_then_la1 + lda x+1 + cmp x2+1 + bne b7_from_b8 + lda x + cmp x2 + bne b7_from_b8 + jmp b2_from_b8 +} + // bitmap_plot +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage(8) x, byte register(X) y) +bitmap_plot: { + .label _1 = $22 + .label plotter = $20 + .label x = 8 + // [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx + lda bitmap_plot_yhi,x + sta plotter+1 + lda bitmap_plot_ylo,x + sta plotter + // [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 + lda x + and #<$fff8 + sta _1 + lda x+1 + and #>$fff8 + sta _1+1 + // [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2 + lda plotter + clc + adc _1 + sta plotter + lda plotter+1 + adc _1+1 + sta plotter+1 + // [73] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#3 -- vbuaa=_lo_vwuz1 + lda x + // [74] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) -- _deref_pbuz1=_deref_pbuz1_bor_pbuc1_derefidx_vbuaa + tay + lda bitmap_plot_bit,y + ldy #0 + ora (plotter),y + ldy #0 + sta (plotter),y + jmp breturn + // bitmap_plot::@return + breturn: + // [75] return + rts +} + // sgn_u16 +// Get the sign of a 16-bit unsigned number treated as a signed number. +// Returns unsigned -1 if the number is +// sgn_u16(word zeropage($c) w) +sgn_u16: { + .label w = $c + .label return = $e + // [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 -- vbuaa=_hi_vwuz1 + lda w+1 + // [78] (byte~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (byte) $80 -- vbuaa=vbuaa_band_vbuc1 + and #$80 + // [79] if((byte) 0!=(byte~) sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1 + cmp #0 + bne b1_from_sgn_u16 + // [81] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return] + breturn_from_sgn_u16: + // [81] phi (word) sgn_u16::return#4 = (byte) 1 [phi:sgn_u16->sgn_u16::@return#0] -- vwuz1=vbuc1 + lda #1 + sta return + lda #0 + sta return+1 + jmp breturn + // [80] phi from sgn_u16 to sgn_u16::@1 [phi:sgn_u16->sgn_u16::@1] + b1_from_sgn_u16: + jmp b1 + // sgn_u16::@1 + b1: + // [81] phi from sgn_u16::@1 to sgn_u16::@return [phi:sgn_u16::@1->sgn_u16::@return] + breturn_from_b1: + // [81] phi (word) sgn_u16::return#4 = (word) $ffff [phi:sgn_u16::@1->sgn_u16::@return#0] -- vwuz1=vwuc1 + lda #<$ffff + sta return + lda #>$ffff + sta return+1 + jmp breturn + // sgn_u16::@return + breturn: + // [82] return + rts +} + // abs_u16 +// Get the absolute value of a 16-bit unsigned number treated as a signed number. +// abs_u16(word zeropage($10) w) +abs_u16: { + .label w = $10 + .label return = $10 + // [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 -- vbuaa=_hi_vwuz1 + lda w+1 + // [85] (byte~) abs_u16::$1 ← (byte~) abs_u16::$0 & (byte) $80 -- vbuaa=vbuaa_band_vbuc1 + and #$80 + // [86] if((byte) 0!=(byte~) abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1 + cmp #0 + bne b1 + // [88] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return] + breturn_from_abs_u16: + breturn_from_b1: + // [88] phi (word) abs_u16::return#4 = (word) abs_u16::w#2 [phi:abs_u16/abs_u16::@1->abs_u16::@return#0] -- register_copy + jmp breturn + // abs_u16::@1 + b1: + // [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 -- vwuz1=_neg_vwuz1 + sec + lda #0 + sbc return + sta return + lda #0 + sbc return+1 + sta return+1 + jmp breturn_from_b1 + // abs_u16::@return + breturn: + // [89] return + rts +} + // bitmap_clear +// Clear all graphics on the bitmap +// bgcol - the background color to fill the screen with +// fgcol - the foreground color to fill the screen with +bitmap_clear: { + .const col = WHITE*$10 + // [91] call memset + // [95] phi from bitmap_clear to memset [phi:bitmap_clear->memset] + memset_from_bitmap_clear: + // [95] phi (byte) memset::c#3 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 + ldx #col + // [95] phi (word) memset::num#2 = (word) $3e8 [phi:bitmap_clear->memset#1] -- vwuz1=vwuc1 + lda #<$3e8 + sta memset.num + lda #>$3e8 + sta memset.num+1 + // [95] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#2] -- pvoz1=pvoc1 + lda #SCREEN + sta memset.str+1 + jsr memset + // [92] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1] + b1_from_bitmap_clear: + jmp b1 + // bitmap_clear::@1 + b1: + // [93] call memset + // [95] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] + memset_from_b1: + // [95] phi (byte) memset::c#3 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 + ldx #0 + // [95] phi (word) memset::num#2 = (word) $1f40 [phi:bitmap_clear::@1->memset#1] -- vwuz1=vwuc1 + lda #<$1f40 + sta memset.num + lda #>$1f40 + sta memset.num+1 + // [95] phi (void*) memset::str#2 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#2] -- pvoz1=pvoc1 + lda #BITMAP + sta memset.str+1 + jsr memset + jmp breturn + // bitmap_clear::@return + breturn: + // [94] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zeropage($12) str, byte register(X) c, word zeropage($14) num) +memset: { + .label end = $14 + .label dst = $12 + .label str = $12 + .label num = $14 + // [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 + lda end + clc + adc str + sta end + lda end+1 + adc str+1 + sta end+1 + // [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + // [98] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] + b1_from_memset: + b1_from_b1: + // [98] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy + jmp b1 + // memset::@1 + b1: + // [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (dst),y + // [100] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + // [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + lda dst+1 + cmp end+1 + bne b1_from_b1 + lda dst + cmp end + bne b1_from_b1 + jmp breturn + // memset::@return + breturn: + // [102] return + rts +} + // bitmap_init +// Initialize bitmap plotting tables +bitmap_init: { + .label _7 = $24 + .label yoffs = $16 + // [104] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] + b1_from_bitmap_init: + // [104] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 + ldx #0 + // [104] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuaa=vbuc1 + lda #$80 + jmp b1 + // [104] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1] + b1_from_b2: + // [104] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy + // [104] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy + jmp b1 + // bitmap_init::@1 + b1: + // [105] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 -- pbuc1_derefidx_vbuxx=vbuaa + sta bitmap_plot_bit,x + // [106] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuaa=vbuaa_ror_1 + lsr + // [107] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuaa_neq_0_then_la1 + cmp #0 + bne b6_from_b1 + // [109] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2] + b2_from_b1: + // [109] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuaa=vbuc1 + lda #$80 + jmp b2 + // [108] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6] + b6_from_b1: + jmp b6 + // bitmap_init::@6 + b6: + // [109] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2] + b2_from_b6: + // [109] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy + jmp b2 + // bitmap_init::@2 + b2: + // [110] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuxx=_inc_vbuxx + inx + // [111] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuxx_neq_0_then_la1 + cpx #0 + bne b1_from_b2 + // [112] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] + b3_from_b2: + // [112] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + lda #BITMAP + sta yoffs+1 + // [112] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuxx=vbuc1 + ldx #0 + jmp b3 + // [112] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3] + b3_from_b4: + // [112] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy + // [112] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy + jmp b3 + // bitmap_init::@3 + b3: + // [113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 + lda #7 + sax _7 + // [114] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuaa=_lo_pbuz1 + lda yoffs + // [115] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuaa=vbuz1_bor_vbuaa + ora _7 + // [116] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 -- pbuc1_derefidx_vbuxx=vbuaa + sta bitmap_plot_ylo,x + // [117] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuaa=_hi_pbuz1 + lda yoffs+1 + // [118] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 -- pbuc1_derefidx_vbuxx=vbuaa + sta bitmap_plot_yhi,x + // [119] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 -- vbuz1_neq_vbuc1_then_la1 + lda #7 + cmp _7 + bne b4_from_b3 + jmp b5 + // bitmap_init::@5 + b5: + // [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda yoffs + adc #<$28*8 + sta yoffs + lda yoffs+1 + adc #>$28*8 + sta yoffs+1 + // [121] phi from bitmap_init::@3 bitmap_init::@5 to bitmap_init::@4 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4] + b4_from_b3: + b4_from_b5: + // [121] phi (byte*) bitmap_init::yoffs#4 = (byte*) bitmap_init::yoffs#2 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4#0] -- register_copy + jmp b4 + // bitmap_init::@4 + b4: + // [122] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuxx=_inc_vbuxx + inx + // [123] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 -- vbuxx_neq_0_then_la1 + cpx #0 + bne b3_from_b4 + jmp breturn + // bitmap_init::@return + breturn: + // [124] return + rts +} + // File Data + // Tables for the plotter - initialized by calling bitmap_init(); + bitmap_plot_ylo: .fill $100, 0 + bitmap_plot_yhi: .fill $100, 0 + bitmap_plot_bit: .fill $100, 0 + .align $100 +SINTAB: +.fill $180, 99.5+99.5*sin(i*2*PI/256) + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp bend +Removing instruction jmp b4 +Removing instruction jmp b5 +Removing instruction jmp toD0181 +Removing instruction jmp b3 +Removing instruction jmp b1 +Removing instruction jmp b6 +Removing instruction jmp b2 +Removing instruction jmp b10 +Removing instruction jmp b11 +Removing instruction jmp b12 +Removing instruction jmp b13 +Removing instruction jmp b3 +Removing instruction jmp b4 +Removing instruction jmp b14 +Removing instruction jmp b6 +Removing instruction jmp b5 +Removing instruction jmp b2 +Removing instruction jmp breturn +Removing instruction jmp b7 +Removing instruction jmp b15 +Removing instruction jmp b9 +Removing instruction jmp b8 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp b6 +Removing instruction jmp b2 +Removing instruction jmp b3 +Removing instruction jmp b5 +Removing instruction jmp b4 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction lda #0 +Removing instruction ldy a +Removing instruction lda e+1 +Removing instruction lda e1+1 +Removing instruction ldy #0 +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Replacing label b1_from_b6 with b1 +Replacing label b5_from_b14 with b5 +Replacing label b5_from_b14 with b5 +Replacing label b4_from_b5 with b4 +Replacing label b4_from_b5 with b4 +Replacing label b8_from_b15 with b8 +Replacing label b8_from_b15 with b8 +Replacing label b7_from_b8 with b7 +Replacing label b7_from_b8 with b7 +Replacing label b2_from_b8 with b2 +Replacing label b1_from_sgn_u16 with b1 +Replacing label b1_from_b1 with b1 +Replacing label b1_from_b1 with b1 +Replacing label b6_from_b1 with b2 +Replacing label b1_from_b2 with b1 +Replacing label b4_from_b3 with b4 +Replacing label b3_from_b4 with b3 +Removing instruction b1_from_bbegin: +Removing instruction b1: +Removing instruction main_from_b1: +Removing instruction bend_from_b1: +Removing instruction b4_from_main: +Removing instruction bitmap_clear_from_b4: +Removing instruction toD0181_from_b5: +Removing instruction toD0181: +Removing instruction b1_from_b6: +Removing instruction b4_from_b3: +Removing instruction b4_from_b5: +Removing instruction b5_from_b14: +Removing instruction b5_from_b6: +Removing instruction b2_from_b5: +Removing instruction b2_from_b8: +Removing instruction b7_from_b1: +Removing instruction b7_from_b8: +Removing instruction b8_from_b15: +Removing instruction b8_from_b9: +Removing instruction b1_from_sgn_u16: +Removing instruction breturn_from_b1: +Removing instruction breturn_from_abs_u16: +Removing instruction b1_from_bitmap_clear: +Removing instruction memset_from_b1: +Removing instruction b1_from_memset: +Removing instruction b1_from_b1: +Removing instruction b1_from_b2: +Removing instruction b6_from_b1: +Removing instruction b6: +Removing instruction b2_from_b6: +Removing instruction b3_from_b4: +Removing instruction b4_from_b3: +Removing instruction b4_from_b5: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction bend: +Removing instruction bitmap_init_from_main: +Removing instruction b4: +Removing instruction b5: +Removing instruction b3: +Removing instruction b1_from_b3: +Removing instruction b6: +Removing instruction abs_u16_from_bitmap_line: +Removing instruction b10: +Removing instruction abs_u16_from_b10: +Removing instruction b11: +Removing instruction sgn_u16_from_b11: +Removing instruction b12: +Removing instruction sgn_u16_from_b12: +Removing instruction b13: +Removing instruction b3: +Removing instruction bitmap_plot_from_b4: +Removing instruction b14: +Removing instruction b6: +Removing instruction bitmap_plot_from_b2: +Removing instruction breturn: +Removing instruction bitmap_plot_from_b7: +Removing instruction b15: +Removing instruction b9: +Removing instruction breturn: +Removing instruction breturn_from_sgn_u16: +Removing instruction memset_from_bitmap_clear: +Removing instruction b1: +Removing instruction breturn: +Removing instruction breturn: +Removing instruction b1_from_bitmap_init: +Removing instruction b2_from_b1: +Removing instruction b3_from_b2: +Removing instruction b5: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +Updating BasicUpstart to call main directly +Removing instruction jsr main +Succesful ASM optimization Pass5SkipBegin +Replacing jump to rts with rts in jmp breturn +Replacing jump to rts with rts in jmp breturn +Skipping double jump to breturn in jmp breturn_from_b1 +Succesful ASM optimization Pass5DoubleJumpElimination +Relabelling long label breturn_from_b1 to b2 +Succesful ASM optimization Pass5RelabelLongLabels +Removing instruction jmp b1 +Removing instruction jmp breturn +Removing instruction jmp b1 +Removing instruction jmp b2 +Removing instruction jmp b3 +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction bbegin: +Removing instruction breturn: +Removing instruction b2: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination + +FINAL SYMBOL TABLE +(label) @1 +(label) @begin +(label) @end +(byte*) BITMAP +(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(byte) BLACK +(byte*) COSTAB +(const byte*) COSTAB#0 COSTAB = (const byte[$180]) SINTAB#0+(byte) $40 +(byte*) D011 +(const byte*) D011#0 D011 = (byte*) 53265 +(byte*) D018 +(const byte*) D018#0 D018 = (byte*) 53272 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(byte[$180]) SINTAB +(const byte[$180]) SINTAB#0 SINTAB = kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} +(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_RSEL +(const byte) VIC_RSEL#0 VIC_RSEL = (byte) 8 +(byte) WHITE +(const byte) WHITE#0 WHITE = (byte) 1 +(word()) abs_u16((word) abs_u16::w) +(byte~) abs_u16::$0 reg byte a 4.0 +(byte~) abs_u16::$1 reg byte a 4.0 +(label) abs_u16::@1 +(label) abs_u16::@return +(word) abs_u16::return +(word) abs_u16::return#0 return zp ZP_WORD:16 4.0 +(word) abs_u16::return#1 return zp ZP_WORD:16 4.0 +(word) abs_u16::return#2 return zp ZP_WORD:16 4.0 +(word) abs_u16::return#4 return zp ZP_WORD:16 2.0 +(word) abs_u16::w +(word) abs_u16::w#0 w zp ZP_WORD:16 4.0 +(word) abs_u16::w#1 w zp ZP_WORD:16 4.0 +(word) abs_u16::w#2 w zp ZP_WORD:16 2.5 +(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) +(label) bitmap_clear::@1 +(label) bitmap_clear::@return +(byte) bitmap_clear::bgcol +(byte) bitmap_clear::col +(const byte) bitmap_clear::col#0 col = (const byte) WHITE#0*(byte) $10 +(byte) bitmap_clear::fgcol +(byte*) bitmap_gfx +(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen) +(byte~) bitmap_init::$4 reg byte a 22.0 +(byte~) bitmap_init::$5 reg byte a 22.0 +(byte~) bitmap_init::$6 reg byte a 22.0 +(byte~) bitmap_init::$7 $7 zp ZP_BYTE:36 5.5 +(label) bitmap_init::@1 +(label) bitmap_init::@2 +(label) bitmap_init::@3 +(label) bitmap_init::@4 +(label) bitmap_init::@5 +(label) bitmap_init::@6 +(label) bitmap_init::@return +(byte) bitmap_init::bits +(byte) bitmap_init::bits#1 reg byte a 11.0 +(byte) bitmap_init::bits#3 reg byte a 16.5 +(byte) bitmap_init::bits#4 reg byte a 7.333333333333333 +(byte*) bitmap_init::gfx +(byte*) bitmap_init::screen +(byte) bitmap_init::x +(byte) bitmap_init::x#1 reg byte x 16.5 +(byte) bitmap_init::x#2 reg byte x 5.5 +(byte) bitmap_init::y +(byte) bitmap_init::y#1 reg byte x 16.5 +(byte) bitmap_init::y#2 reg byte x 5.5 +(byte*) bitmap_init::yoffs +(byte*) bitmap_init::yoffs#1 yoffs zp ZP_WORD:22 22.0 +(byte*) bitmap_init::yoffs#2 yoffs zp ZP_WORD:22 6.875 +(byte*) bitmap_init::yoffs#4 yoffs zp ZP_WORD:22 11.0 +(void()) bitmap_line((word) bitmap_line::x1 , (word) bitmap_line::y1 , (word) bitmap_line::x2 , (word) bitmap_line::y2) +(label) bitmap_line::@1 +(label) bitmap_line::@10 +(label) bitmap_line::@11 +(label) bitmap_line::@12 +(label) bitmap_line::@13 +(label) bitmap_line::@14 +(label) bitmap_line::@15 +(label) bitmap_line::@2 +(label) bitmap_line::@3 +(label) bitmap_line::@4 +(label) bitmap_line::@5 +(label) bitmap_line::@6 +(label) bitmap_line::@7 +(label) bitmap_line::@8 +(label) bitmap_line::@9 +(label) bitmap_line::@return +(word) bitmap_line::dx +(word) bitmap_line::dx#0 dx zp ZP_WORD:28 8.131578947368421 +(word) bitmap_line::dy +(word) bitmap_line::dy#0 dy zp ZP_WORD:16 9.088235294117647 +(word) bitmap_line::e +(word) bitmap_line::e#0 e zp ZP_WORD:4 4.0 +(word) bitmap_line::e#1 e zp ZP_WORD:4 134.66666666666666 +(word) bitmap_line::e#2 e zp ZP_WORD:4 202.0 +(word) bitmap_line::e#3 e zp ZP_WORD:4 40.8 +(word) bitmap_line::e#6 e zp ZP_WORD:4 151.5 +(word) bitmap_line::e1 +(word) bitmap_line::e1#0 e1 zp ZP_WORD:10 4.0 +(word) bitmap_line::e1#1 e1 zp ZP_WORD:10 134.66666666666666 +(word) bitmap_line::e1#2 e1 zp ZP_WORD:10 202.0 +(word) bitmap_line::e1#3 e1 zp ZP_WORD:10 40.8 +(word) bitmap_line::e1#6 e1 zp ZP_WORD:10 151.5 +(word) bitmap_line::sx +(word) bitmap_line::sx#0 sx zp ZP_WORD:30 6.800000000000001 +(word) bitmap_line::sy +(word) bitmap_line::sy#0 sy zp ZP_WORD:14 7.846153846153847 +(word) bitmap_line::x +(word) bitmap_line::x#1 x zp ZP_WORD:8 101.0 +(word) bitmap_line::x#10 x zp ZP_WORD:8 202.0 +(word) bitmap_line::x#11 x zp ZP_WORD:8 58.00000000000001 +(word) bitmap_line::x#13 x zp ZP_WORD:8 57.714285714285715 +(word) bitmap_line::x#5 x zp ZP_WORD:8 102.0 +(word) bitmap_line::x#6 x zp ZP_WORD:8 76.25 +(word) bitmap_line::x1 +(word) bitmap_line::x1#0 x1 zp ZP_WORD:8 0.7916666666666667 +(word) bitmap_line::x2 +(word) bitmap_line::x2#0 x2 zp ZP_WORD:24 3.741935483870968 +(word) bitmap_line::y +(word) bitmap_line::y#1 y zp ZP_WORD:6 57.714285714285715 +(word) bitmap_line::y#11 y zp ZP_WORD:6 202.0 +(word) bitmap_line::y#13 y zp ZP_WORD:6 43.57142857142858 +(word) bitmap_line::y#2 y zp ZP_WORD:6 101.0 +(word) bitmap_line::y#3 y zp ZP_WORD:6 51.0 +(word) bitmap_line::y#6 y zp ZP_WORD:6 202.0 +(word) bitmap_line::y1 +(word) bitmap_line::y1#0 y1 zp ZP_WORD:6 0.826086956521739 +(word) bitmap_line::y2 +(word) bitmap_line::y2#0 y2 zp ZP_WORD:26 3.8666666666666667 +(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) +(word~) bitmap_plot::$1 $1 zp ZP_WORD:34 4.0 +(byte~) bitmap_plot::$2 reg byte a 4.0 +(label) bitmap_plot::@return +(byte*) bitmap_plot::plotter +(word) bitmap_plot::plotter#0 plotter zp ZP_WORD:32 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:32 3.0 +(word) bitmap_plot::x +(word) bitmap_plot::x#0 x zp ZP_WORD:8 202.0 +(word) bitmap_plot::x#1 x zp ZP_WORD:8 4.0 +(word) bitmap_plot::x#2 x zp ZP_WORD:8 202.0 +(word) bitmap_plot::x#3 x zp ZP_WORD:8 52.0 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 reg byte x 101.0 +(byte) bitmap_plot::y#1 reg byte x 2.0 +(byte) bitmap_plot::y#2 reg byte x 101.0 +(byte) bitmap_plot::y#3 reg byte x 208.0 +(byte[$100]) bitmap_plot_bit +(const byte[$100]) bitmap_plot_bit#0 bitmap_plot_bit = { fill( $100, 0) } +(byte[$100]) bitmap_plot_yhi +(const byte[$100]) bitmap_plot_yhi#0 bitmap_plot_yhi = { fill( $100, 0) } +(byte[$100]) bitmap_plot_ylo +(const byte[$100]) bitmap_plot_ylo#0 bitmap_plot_ylo = { fill( $100, 0) } +(byte*) bitmap_screen +(void()) main() +(word~) main::$10 $10 zp ZP_WORD:24 22.0 +(word~) main::$6 $6 zp ZP_WORD:8 22.0 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(byte) main::a +(byte) main::a#1 a zp ZP_BYTE:2 7.333333333333333 +(byte) main::a#2 a zp ZP_BYTE:2 2.75 +(byte) main::i +(byte) main::i#1 i zp ZP_BYTE:3 16.5 +(byte) main::i#2 i zp ZP_BYTE:3 2.4444444444444446 +(label) main::toD0181 +(word~) main::toD0181_$0 +(number~) main::toD0181_$1 +(number~) main::toD0181_$2 +(number~) main::toD0181_$3 +(word~) main::toD0181_$4 +(byte~) main::toD0181_$5 +(number~) main::toD0181_$6 +(number~) main::toD0181_$7 +(number~) main::toD0181_$8 +(byte*) main::toD0181_gfx +(byte) main::toD0181_return +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(byte*) main::toD0181_screen +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(label) memset::@1 +(label) memset::@return +(byte) memset::c +(byte) memset::c#3 reg byte x 1.5714285714285714 +(byte*) memset::dst +(byte*) memset::dst#1 dst zp ZP_WORD:18 16.5 +(byte*) memset::dst#2 dst zp ZP_WORD:18 17.5 +(byte*~) memset::dst#3 dst zp ZP_WORD:18 4.0 +(byte*) memset::end +(byte*) memset::end#0 end zp ZP_WORD:20 2.1666666666666665 +(word) memset::num +(word) memset::num#2 num zp ZP_WORD:20 2.0 +(void*) memset::return +(void*) memset::str +(void*) memset::str#2 str zp ZP_WORD:18 +(word()) sgn_u16((word) sgn_u16::w) +(byte~) sgn_u16::$0 reg byte a 4.0 +(byte~) sgn_u16::$1 reg byte a 4.0 +(label) sgn_u16::@1 +(label) sgn_u16::@return +(word) sgn_u16::return +(word) sgn_u16::return#0 return zp ZP_WORD:14 4.0 +(word) sgn_u16::return#1 return zp ZP_WORD:14 4.0 +(word) sgn_u16::return#4 return zp ZP_WORD:14 1.0 +(word) sgn_u16::w +(word) sgn_u16::w#0 w zp ZP_WORD:12 4.0 +(word) sgn_u16::w#1 w zp ZP_WORD:12 4.0 +(word) sgn_u16::w#2 w zp ZP_WORD:12 6.0 + +zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +zp ZP_BYTE:3 [ main::i#2 main::i#1 ] +zp ZP_WORD:4 [ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] +zp ZP_WORD:6 [ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] +zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 main::$6 ] +zp ZP_WORD:10 [ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] +reg byte x [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] +zp ZP_WORD:12 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] +zp ZP_WORD:14 [ sgn_u16::return#4 sgn_u16::return#0 sgn_u16::return#1 bitmap_line::sy#0 ] +zp ZP_WORD:16 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 abs_u16::return#0 abs_u16::return#1 bitmap_line::dy#0 ] +zp ZP_WORD:18 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] +zp ZP_WORD:20 [ memset::num#2 memset::end#0 ] +reg byte x [ memset::c#3 ] +reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] +reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] +reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] +zp ZP_WORD:22 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +zp ZP_WORD:24 [ main::$10 bitmap_line::x2#0 ] +zp ZP_WORD:26 [ bitmap_line::y2#0 ] +zp ZP_WORD:28 [ bitmap_line::dx#0 ] +zp ZP_WORD:30 [ bitmap_line::sx#0 ] +zp ZP_WORD:32 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ] +zp ZP_WORD:34 [ bitmap_plot::$1 ] +reg byte a [ bitmap_plot::$2 ] +reg byte a [ sgn_u16::$0 ] +reg byte a [ sgn_u16::$1 ] +reg byte a [ abs_u16::$0 ] +reg byte a [ abs_u16::$1 ] +zp ZP_BYTE:36 [ bitmap_init::$7 ] +reg byte a [ bitmap_init::$4 ] +reg byte a [ bitmap_init::$5 ] +reg byte a [ bitmap_init::$6 ] + + +FINAL ASSEMBLER +Score: 27176 + + // File Comments +// Tests the simple bitmap plotter +// Plots a few lines using the bresenham line algorithm + // Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + // Global Constants & labels + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label D018 = $d018 + .const WHITE = 1 + .label BITMAP = $2000 + .label SCREEN = $400 + .label COSTAB = SINTAB+$40 + // @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: { + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label _6 = 8 + .label _10 = $18 + .label a = 2 + .label i = 3 + // bitmap_init(BITMAP, SCREEN) + // [5] call bitmap_init + // [103] phi from main to bitmap_init [phi:main->bitmap_init] + jsr bitmap_init + // [6] phi from main to main::@4 [phi:main->main::@4] + // main::@4 + // bitmap_clear(BLACK, WHITE) + // [7] call bitmap_clear + // [90] phi from main::@4 to bitmap_clear [phi:main::@4->bitmap_clear] + jsr bitmap_clear + // main::@5 + // *D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3 + // [8] *((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 + // [9] phi from main::@5 to main::toD0181 [phi:main::@5->main::toD0181] + // main::toD0181 + // main::@3 + // *D018 = toD018(SCREEN, BITMAP) + // [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0181_return + sta D018 + // [11] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + // [11] phi (byte) main::i#2 = (byte) 0 [phi:main::@3->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta i + // [11] phi (byte) main::a#2 = (byte) 0 [phi:main::@3->main::@1#1] -- vbuz1=vbuc1 + sta a + // [11] phi from main::@6 to main::@1 [phi:main::@6->main::@1] + // [11] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@6->main::@1#0] -- register_copy + // [11] phi (byte) main::a#2 = (byte) main::a#1 [phi:main::@6->main::@1#1] -- register_copy + // main::@1 + b1: + // (word)COSTAB[a] + // [12] (word~) main::$6 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda COSTAB,y + sta _6 + lda #0 + sta _6+1 + // bitmap_line( (word)COSTAB[a]+120, (word)SINTAB[a], (word)COSTAB[a+32]+120, (word)SINTAB[a+32]) + // [13] (word) bitmap_line::x1#0 ← (word~) main::$6 + (byte) $78 -- vwuz1=vwuz1_plus_vbuc1 + lda #$78 + clc + adc bitmap_line.x1 + sta bitmap_line.x1 + bcc !+ + inc bitmap_line.x1+1 + !: + // [14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda SINTAB,y + sta bitmap_line.y1 + lda #0 + sta bitmap_line.y1+1 + // (word)COSTAB[a+32] + // [15] (word~) main::$10 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + lda COSTAB+$20,y + sta _10 + lda #0 + sta _10+1 + // bitmap_line( (word)COSTAB[a]+120, (word)SINTAB[a], (word)COSTAB[a+32]+120, (word)SINTAB[a+32]) + // [16] (word) bitmap_line::x2#0 ← (word~) main::$10 + (byte) $78 -- vwuz1=vwuz1_plus_vbuc1 + lda #$78 + clc + adc bitmap_line.x2 + sta bitmap_line.x2 + bcc !+ + inc bitmap_line.x2+1 + !: + // [17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2) -- vwuz1=_word_pbuc1_derefidx_vbuz2 + ldy a + lda SINTAB+$20,y + sta bitmap_line.y2 + lda #0 + sta bitmap_line.y2+1 + // [18] call bitmap_line + jsr bitmap_line + // main::@6 + // a+=32 + // [19] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20 -- vbuz1=vbuz1_plus_vbuc1 + lax a + axs #-[$20] + stx a + // for( byte i=0, a=0; i!=8; i++, a+=32) + // [20] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1 + inc i + // [21] if((byte) main::i#1!=(byte) 8) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp i + bne b1 + // main::@2 + b2: + // (*(SCREEN+999))++; + // [22] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7) -- _deref_pbuc1=_inc__deref_pbuc1 + inc SCREEN+$3e7 + jmp b2 +} + // bitmap_line +// Draw a line on the bitmap using bresenhams algorithm +// bitmap_line(word zeropage(8) x1, word zeropage(6) y1, word zeropage($18) x2, word zeropage($1a) y2) +bitmap_line: { + .label dx = $1c + .label dy = $10 + .label sx = $1e + .label sy = $e + .label e1 = $a + .label e = 4 + .label y = 6 + .label x = 8 + .label x1 = 8 + .label y1 = 6 + .label x2 = $18 + .label y2 = $1a + // abs_u16(x2-x1) + // [23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda x2 + sec + sbc x1 + sta abs_u16.w + lda x2+1 + sbc x1+1 + sta abs_u16.w+1 + // [24] call abs_u16 + // [83] phi from bitmap_line to abs_u16 [phi:bitmap_line->abs_u16] + // [83] phi (word) abs_u16::w#2 = (word) abs_u16::w#0 [phi:bitmap_line->abs_u16#0] -- register_copy + jsr abs_u16 + // abs_u16(x2-x1) + // [25] (word) abs_u16::return#0 ← (word) abs_u16::return#4 + // bitmap_line::@10 + // dx = abs_u16(x2-x1) + // [26] (word) bitmap_line::dx#0 ← (word) abs_u16::return#0 -- vwuz1=vwuz2 + lda abs_u16.return + sta dx + lda abs_u16.return+1 + sta dx+1 + // abs_u16(y2-y1) + // [27] (word) abs_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda y2 + sec + sbc y1 + sta abs_u16.w + lda y2+1 + sbc y1+1 + sta abs_u16.w+1 + // [28] call abs_u16 + // [83] phi from bitmap_line::@10 to abs_u16 [phi:bitmap_line::@10->abs_u16] + // [83] phi (word) abs_u16::w#2 = (word) abs_u16::w#1 [phi:bitmap_line::@10->abs_u16#0] -- register_copy + jsr abs_u16 + // abs_u16(y2-y1) + // [29] (word) abs_u16::return#1 ← (word) abs_u16::return#4 + // bitmap_line::@11 + // dy = abs_u16(y2-y1) + // [30] (word) bitmap_line::dy#0 ← (word) abs_u16::return#1 + // sgn_u16(x2-x1) + // [31] (word) sgn_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda x2 + sec + sbc x1 + sta sgn_u16.w + lda x2+1 + sbc x1+1 + sta sgn_u16.w+1 + // [32] call sgn_u16 + // [76] phi from bitmap_line::@11 to sgn_u16 [phi:bitmap_line::@11->sgn_u16] + // [76] phi (word) sgn_u16::w#2 = (word) sgn_u16::w#0 [phi:bitmap_line::@11->sgn_u16#0] -- register_copy + jsr sgn_u16 + // sgn_u16(x2-x1) + // [33] (word) sgn_u16::return#0 ← (word) sgn_u16::return#4 + // bitmap_line::@12 + // sx = sgn_u16(x2-x1) + // [34] (word) bitmap_line::sx#0 ← (word) sgn_u16::return#0 -- vwuz1=vwuz2 + lda sgn_u16.return + sta sx + lda sgn_u16.return+1 + sta sx+1 + // sgn_u16(y2-y1) + // [35] (word) sgn_u16::w#1 ← (word) bitmap_line::y2#0 - (word) bitmap_line::y1#0 -- vwuz1=vwuz2_minus_vwuz3 + lda y2 + sec + sbc y1 + sta sgn_u16.w + lda y2+1 + sbc y1+1 + sta sgn_u16.w+1 + // [36] call sgn_u16 + // [76] phi from bitmap_line::@12 to sgn_u16 [phi:bitmap_line::@12->sgn_u16] + // [76] phi (word) sgn_u16::w#2 = (word) sgn_u16::w#1 [phi:bitmap_line::@12->sgn_u16#0] -- register_copy + jsr sgn_u16 + // sgn_u16(y2-y1) + // [37] (word) sgn_u16::return#1 ← (word) sgn_u16::return#4 + // bitmap_line::@13 + // sy = sgn_u16(y2-y1) + // [38] (word) bitmap_line::sy#0 ← (word) sgn_u16::return#1 + // if(dx > dy) + // [39] if((word) bitmap_line::dx#0>(word) bitmap_line::dy#0) goto bitmap_line::@1 -- vwuz1_gt_vwuz2_then_la1 + lda dy+1 + cmp dx+1 + bcc b1 + bne !+ + lda dy + cmp dx + bcc b1 + !: + // bitmap_line::@3 + // e = dx/2 + // [40] (word) bitmap_line::e#0 ← (word) bitmap_line::dx#0 >> (byte) 1 -- vwuz1=vwuz2_ror_1 + lda dx+1 + lsr + sta e+1 + lda dx + ror + sta e + // [41] phi from bitmap_line::@3 bitmap_line::@5 to bitmap_line::@4 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4] + // [41] phi (word) bitmap_line::e#3 = (word) bitmap_line::e#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#0] -- register_copy + // [41] phi (word) bitmap_line::x#11 = (word) bitmap_line::x1#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#1] -- register_copy + // [41] phi (word) bitmap_line::y#3 = (word) bitmap_line::y1#0 [phi:bitmap_line::@3/bitmap_line::@5->bitmap_line::@4#2] -- register_copy + // bitmap_line::@4 + b4: + // bitmap_plot(x,(byte)y) + // [42] (byte) bitmap_plot::y#0 ← (byte)(word) bitmap_line::y#3 -- vbuxx=_byte_vwuz1 + lda y + tax + // [43] (word) bitmap_plot::x#0 ← (word) bitmap_line::x#11 + // [44] call bitmap_plot + // [69] phi from bitmap_line::@4 to bitmap_plot [phi:bitmap_line::@4->bitmap_plot] + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#0 [phi:bitmap_line::@4->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#0 [phi:bitmap_line::@4->bitmap_plot#1] -- register_copy + jsr bitmap_plot + // bitmap_line::@14 + // y += sy + // [45] (word) bitmap_line::y#1 ← (word) bitmap_line::y#3 + (word) bitmap_line::sy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + // e += dx + // [46] (word) bitmap_line::e#1 ← (word) bitmap_line::e#3 + (word) bitmap_line::dx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda e + clc + adc dx + sta e + lda e+1 + adc dx+1 + sta e+1 + // if(dy=(word) bitmap_line::e#1) goto bitmap_line::@5 -- vwuz1_ge_vwuz2_then_la1 + cmp dy+1 + bne !+ + lda e + cmp dy + beq b5 + !: + bcc b5 + // bitmap_line::@6 + // x += sx + // [48] (word) bitmap_line::x#1 ← (word) bitmap_line::x#11 + (word) bitmap_line::sx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + // e -= dy + // [49] (word) bitmap_line::e#2 ← (word) bitmap_line::e#1 - (word) bitmap_line::dy#0 -- vwuz1=vwuz1_minus_vwuz2 + lda e + sec + sbc dy + sta e + lda e+1 + sbc dy+1 + sta e+1 + // [50] phi from bitmap_line::@14 bitmap_line::@6 to bitmap_line::@5 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5] + // [50] phi (word) bitmap_line::e#6 = (word) bitmap_line::e#1 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5#0] -- register_copy + // [50] phi (word) bitmap_line::x#10 = (word) bitmap_line::x#11 [phi:bitmap_line::@14/bitmap_line::@6->bitmap_line::@5#1] -- register_copy + // bitmap_line::@5 + b5: + // while (y != y2) + // [51] if((word) bitmap_line::y#1!=(word) bitmap_line::y2#0) goto bitmap_line::@4 -- vwuz1_neq_vwuz2_then_la1 + lda y+1 + cmp y2+1 + bne b4 + lda y + cmp y2 + bne b4 + // [52] phi from bitmap_line::@5 bitmap_line::@8 to bitmap_line::@2 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2] + // [52] phi (word) bitmap_line::x#5 = (word) bitmap_line::x#10 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2#0] -- register_copy + // [52] phi (word) bitmap_line::y#6 = (word) bitmap_line::y#1 [phi:bitmap_line::@5/bitmap_line::@8->bitmap_line::@2#1] -- register_copy + // bitmap_line::@2 + b2: + // bitmap_plot(x,(byte)y) + // [53] (byte) bitmap_plot::y#1 ← (byte)(word) bitmap_line::y#6 -- vbuxx=_byte_vwuz1 + lda y + tax + // [54] (word) bitmap_plot::x#1 ← (word) bitmap_line::x#5 + // [55] call bitmap_plot + // [69] phi from bitmap_line::@2 to bitmap_plot [phi:bitmap_line::@2->bitmap_plot] + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#1 [phi:bitmap_line::@2->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#1 [phi:bitmap_line::@2->bitmap_plot#1] -- register_copy + jsr bitmap_plot + // bitmap_line::@return + // } + // [56] return + rts + // bitmap_line::@1 + b1: + // e = dy/2 + // [57] (word) bitmap_line::e1#0 ← (word) bitmap_line::dy#0 >> (byte) 1 -- vwuz1=vwuz2_ror_1 + lda dy+1 + lsr + sta e1+1 + lda dy + ror + sta e1 + // [58] phi from bitmap_line::@1 bitmap_line::@8 to bitmap_line::@7 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7] + // [58] phi (word) bitmap_line::e1#3 = (word) bitmap_line::e1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#0] -- register_copy + // [58] phi (word) bitmap_line::x#6 = (word) bitmap_line::x1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#1] -- register_copy + // [58] phi (word) bitmap_line::y#13 = (word) bitmap_line::y1#0 [phi:bitmap_line::@1/bitmap_line::@8->bitmap_line::@7#2] -- register_copy + // bitmap_line::@7 + b7: + // bitmap_plot(x,(byte)y) + // [59] (byte) bitmap_plot::y#2 ← (byte)(word) bitmap_line::y#13 -- vbuxx=_byte_vwuz1 + lda y + tax + // [60] (word) bitmap_plot::x#2 ← (word) bitmap_line::x#6 + // [61] call bitmap_plot + // [69] phi from bitmap_line::@7 to bitmap_plot [phi:bitmap_line::@7->bitmap_plot] + // [69] phi (word) bitmap_plot::x#3 = (word) bitmap_plot::x#2 [phi:bitmap_line::@7->bitmap_plot#0] -- register_copy + // [69] phi (byte) bitmap_plot::y#3 = (byte) bitmap_plot::y#2 [phi:bitmap_line::@7->bitmap_plot#1] -- register_copy + jsr bitmap_plot + // bitmap_line::@15 + // x += sx + // [62] (word) bitmap_line::x#13 ← (word) bitmap_line::x#6 + (word) bitmap_line::sx#0 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc sx + sta x + lda x+1 + adc sx+1 + sta x+1 + // e += dy + // [63] (word) bitmap_line::e1#1 ← (word) bitmap_line::e1#3 + (word) bitmap_line::dy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda e1 + clc + adc dy + sta e1 + lda e1+1 + adc dy+1 + sta e1+1 + // if(dx < e) + // [64] if((word) bitmap_line::dx#0>=(word) bitmap_line::e1#1) goto bitmap_line::@8 -- vwuz1_ge_vwuz2_then_la1 + cmp dx+1 + bne !+ + lda e1 + cmp dx + beq b8 + !: + bcc b8 + // bitmap_line::@9 + // y += sy + // [65] (word) bitmap_line::y#2 ← (word) bitmap_line::y#13 + (word) bitmap_line::sy#0 -- vwuz1=vwuz1_plus_vwuz2 + lda y + clc + adc sy + sta y + lda y+1 + adc sy+1 + sta y+1 + // e -= dx + // [66] (word) bitmap_line::e1#2 ← (word) bitmap_line::e1#1 - (word) bitmap_line::dx#0 -- vwuz1=vwuz1_minus_vwuz2 + lda e1 + sec + sbc dx + sta e1 + lda e1+1 + sbc dx+1 + sta e1+1 + // [67] phi from bitmap_line::@15 bitmap_line::@9 to bitmap_line::@8 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8] + // [67] phi (word) bitmap_line::e1#6 = (word) bitmap_line::e1#1 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8#0] -- register_copy + // [67] phi (word) bitmap_line::y#11 = (word) bitmap_line::y#13 [phi:bitmap_line::@15/bitmap_line::@9->bitmap_line::@8#1] -- register_copy + // bitmap_line::@8 + b8: + // while (x != x2) + // [68] if((word) bitmap_line::x#13!=(word) bitmap_line::x2#0) goto bitmap_line::@7 -- vwuz1_neq_vwuz2_then_la1 + lda x+1 + cmp x2+1 + bne b7 + lda x + cmp x2 + bne b7 + jmp b2 +} + // bitmap_plot +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage(8) x, byte register(X) y) +bitmap_plot: { + .label _1 = $22 + .label plotter = $20 + .label x = 8 + // (byte*) { bitmap_plot_yhi[y], bitmap_plot_ylo[y] } + // [70] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#3) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#3) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx + lda bitmap_plot_yhi,x + sta plotter+1 + lda bitmap_plot_ylo,x + sta plotter + // x & $fff8 + // [71] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#3 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 + lda x + and #<$fff8 + sta _1 + lda x+1 + and #>$fff8 + sta _1+1 + // plotter += ( x & $fff8 ) + // [72] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plotter#0 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2 + lda plotter + clc + adc _1 + sta plotter + lda plotter+1 + adc _1+1 + sta plotter+1 + // w + // [77] (byte~) sgn_u16::$0 ← > (word) sgn_u16::w#2 -- vbuaa=_hi_vwuz1 + lda w+1 + // >w&0x80 + // [78] (byte~) sgn_u16::$1 ← (byte~) sgn_u16::$0 & (byte) $80 -- vbuaa=vbuaa_band_vbuc1 + and #$80 + // if(>w&0x80) + // [79] if((byte) 0!=(byte~) sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1 + cmp #0 + bne b1 + // [81] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return] + // [81] phi (word) sgn_u16::return#4 = (byte) 1 [phi:sgn_u16->sgn_u16::@return#0] -- vwuz1=vbuc1 + lda #1 + sta return + lda #0 + sta return+1 + rts + // [80] phi from sgn_u16 to sgn_u16::@1 [phi:sgn_u16->sgn_u16::@1] + // sgn_u16::@1 + b1: + // [81] phi from sgn_u16::@1 to sgn_u16::@return [phi:sgn_u16::@1->sgn_u16::@return] + // [81] phi (word) sgn_u16::return#4 = (word) $ffff [phi:sgn_u16::@1->sgn_u16::@return#0] -- vwuz1=vwuc1 + lda #<$ffff + sta return + lda #>$ffff + sta return+1 + // sgn_u16::@return + // } + // [82] return + rts +} + // abs_u16 +// Get the absolute value of a 16-bit unsigned number treated as a signed number. +// abs_u16(word zeropage($10) w) +abs_u16: { + .label w = $10 + .label return = $10 + // >w + // [84] (byte~) abs_u16::$0 ← > (word) abs_u16::w#2 -- vbuaa=_hi_vwuz1 + lda w+1 + // >w&0x80 + // [85] (byte~) abs_u16::$1 ← (byte~) abs_u16::$0 & (byte) $80 -- vbuaa=vbuaa_band_vbuc1 + and #$80 + // if(>w&0x80) + // [86] if((byte) 0!=(byte~) abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1 + cmp #0 + bne b1 + // [88] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return] + // [88] phi (word) abs_u16::return#4 = (word) abs_u16::w#2 [phi:abs_u16/abs_u16::@1->abs_u16::@return#0] -- register_copy + rts + // abs_u16::@1 + b1: + // return -w; + // [87] (word) abs_u16::return#2 ← - (word) abs_u16::w#2 -- vwuz1=_neg_vwuz1 + sec + lda #0 + sbc return + sta return + lda #0 + sbc return+1 + sta return+1 + // abs_u16::@return + // } + // [89] return + rts +} + // bitmap_clear +// Clear all graphics on the bitmap +// bgcol - the background color to fill the screen with +// fgcol - the foreground color to fill the screen with +bitmap_clear: { + .const col = WHITE*$10 + // memset(bitmap_screen, col, 1000uw) + // [91] call memset + // [95] phi from bitmap_clear to memset [phi:bitmap_clear->memset] + // [95] phi (byte) memset::c#3 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 + ldx #col + // [95] phi (word) memset::num#2 = (word) $3e8 [phi:bitmap_clear->memset#1] -- vwuz1=vwuc1 + lda #<$3e8 + sta memset.num + lda #>$3e8 + sta memset.num+1 + // [95] phi (void*) memset::str#2 = (void*)(const byte*) SCREEN#0 [phi:bitmap_clear->memset#2] -- pvoz1=pvoc1 + lda #SCREEN + sta memset.str+1 + jsr memset + // [92] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1] + // bitmap_clear::@1 + // memset(bitmap_gfx, 0, 8000uw) + // [93] call memset + // [95] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] + // [95] phi (byte) memset::c#3 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 + ldx #0 + // [95] phi (word) memset::num#2 = (word) $1f40 [phi:bitmap_clear::@1->memset#1] -- vwuz1=vwuc1 + lda #<$1f40 + sta memset.num + lda #>$1f40 + sta memset.num+1 + // [95] phi (void*) memset::str#2 = (void*)(const byte*) BITMAP#0 [phi:bitmap_clear::@1->memset#2] -- pvoz1=pvoc1 + lda #BITMAP + sta memset.str+1 + jsr memset + // bitmap_clear::@return + // } + // [94] return + rts +} + // memset +// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. +// memset(void* zeropage($12) str, byte register(X) c, word zeropage($14) num) +memset: { + .label end = $14 + .label dst = $12 + .label str = $12 + .label num = $14 + // end = (char*)str + num + // [96] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 + lda end + clc + adc str + sta end + lda end+1 + adc str+1 + sta end+1 + // [97] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + // [98] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] + // [98] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy + // memset::@1 + b1: + // *dst = c + // [99] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (dst),y + // for(char* dst = str; dst!=end; dst++) + // [100] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + // [101] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + lda dst+1 + cmp end+1 + bne b1 + lda dst + cmp end + bne b1 + // memset::@return + // } + // [102] return + rts +} + // bitmap_init +// Initialize bitmap plotting tables +bitmap_init: { + .label _7 = $24 + .label yoffs = $16 + // [104] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] + // [104] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 + ldx #0 + // [104] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuaa=vbuc1 + lda #$80 + // [104] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1] + // [104] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy + // [104] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy + // bitmap_init::@1 + b1: + // bitmap_plot_bit[x] = bits + // [105] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 -- pbuc1_derefidx_vbuxx=vbuaa + sta bitmap_plot_bit,x + // bits >>= 1 + // [106] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuaa=vbuaa_ror_1 + lsr + // if(bits==0) + // [107] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuaa_neq_0_then_la1 + cmp #0 + bne b2 + // [109] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2] + // [109] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuaa=vbuc1 + lda #$80 + // [108] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6] + // bitmap_init::@6 + // [109] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2] + // [109] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy + // bitmap_init::@2 + b2: + // for(byte x : 0..255) + // [110] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuxx=_inc_vbuxx + inx + // [111] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuxx_neq_0_then_la1 + cpx #0 + bne b1 + // [112] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] + // [112] phi (byte*) bitmap_init::yoffs#2 = (const byte*) BITMAP#0 [phi:bitmap_init::@2->bitmap_init::@3#0] -- pbuz1=pbuc1 + lda #BITMAP + sta yoffs+1 + // [112] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuxx=vbuc1 + ldx #0 + // [112] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3] + // [112] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy + // [112] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy + // bitmap_init::@3 + b3: + // y&$7 + // [113] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 + lda #7 + sax _7 + // yoffs + // [117] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuaa=_hi_pbuz1 + lda yoffs+1 + // bitmap_plot_yhi[y] = >yoffs + // [118] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 -- pbuc1_derefidx_vbuxx=vbuaa + sta bitmap_plot_yhi,x + // if((y&$7)==7) + // [119] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 -- vbuz1_neq_vbuc1_then_la1 + lda #7 + cmp _7 + bne b4 + // bitmap_init::@5 + // yoffs = yoffs + 40*8 + // [120] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 -- pbuz1=pbuz1_plus_vwuc1 + clc + lda yoffs + adc #<$28*8 + sta yoffs + lda yoffs+1 + adc #>$28*8 + sta yoffs+1 + // [121] phi from bitmap_init::@3 bitmap_init::@5 to bitmap_init::@4 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4] + // [121] phi (byte*) bitmap_init::yoffs#4 = (byte*) bitmap_init::yoffs#2 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4#0] -- register_copy + // bitmap_init::@4 + b4: + // for(byte y : 0..255) + // [122] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuxx=_inc_vbuxx + inx + // [123] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 -- vbuxx_neq_0_then_la1 + cpx #0 + bne b3 + // bitmap_init::@return + // } + // [124] return + rts +} + // File Data + // Tables for the plotter - initialized by calling bitmap_init(); + bitmap_plot_ylo: .fill $100, 0 + bitmap_plot_yhi: .fill $100, 0 + bitmap_plot_bit: .fill $100, 0 + .align $100 +SINTAB: +.fill $180, 99.5+99.5*sin(i*2*PI/256) + diff --git a/src/test/ref/bitmap-plot-3.sym b/src/test/ref/bitmap-plot-3.sym new file mode 100644 index 000000000..4da8e8734 --- /dev/null +++ b/src/test/ref/bitmap-plot-3.sym @@ -0,0 +1,248 @@ +(label) @1 +(label) @begin +(label) @end +(byte*) BITMAP +(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(byte) BLACK +(byte*) COSTAB +(const byte*) COSTAB#0 COSTAB = (const byte[$180]) SINTAB#0+(byte) $40 +(byte*) D011 +(const byte*) D011#0 D011 = (byte*) 53265 +(byte*) D018 +(const byte*) D018#0 D018 = (byte*) 53272 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(byte[$180]) SINTAB +(const byte[$180]) SINTAB#0 SINTAB = kickasm {{ .fill $180, 99.5+99.5*sin(i*2*PI/256) }} +(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_RSEL +(const byte) VIC_RSEL#0 VIC_RSEL = (byte) 8 +(byte) WHITE +(const byte) WHITE#0 WHITE = (byte) 1 +(word()) abs_u16((word) abs_u16::w) +(byte~) abs_u16::$0 reg byte a 4.0 +(byte~) abs_u16::$1 reg byte a 4.0 +(label) abs_u16::@1 +(label) abs_u16::@return +(word) abs_u16::return +(word) abs_u16::return#0 return zp ZP_WORD:16 4.0 +(word) abs_u16::return#1 return zp ZP_WORD:16 4.0 +(word) abs_u16::return#2 return zp ZP_WORD:16 4.0 +(word) abs_u16::return#4 return zp ZP_WORD:16 2.0 +(word) abs_u16::w +(word) abs_u16::w#0 w zp ZP_WORD:16 4.0 +(word) abs_u16::w#1 w zp ZP_WORD:16 4.0 +(word) abs_u16::w#2 w zp ZP_WORD:16 2.5 +(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol) +(label) bitmap_clear::@1 +(label) bitmap_clear::@return +(byte) bitmap_clear::bgcol +(byte) bitmap_clear::col +(const byte) bitmap_clear::col#0 col = (const byte) WHITE#0*(byte) $10 +(byte) bitmap_clear::fgcol +(byte*) bitmap_gfx +(void()) bitmap_init((byte*) bitmap_init::gfx , (byte*) bitmap_init::screen) +(byte~) bitmap_init::$4 reg byte a 22.0 +(byte~) bitmap_init::$5 reg byte a 22.0 +(byte~) bitmap_init::$6 reg byte a 22.0 +(byte~) bitmap_init::$7 $7 zp ZP_BYTE:36 5.5 +(label) bitmap_init::@1 +(label) bitmap_init::@2 +(label) bitmap_init::@3 +(label) bitmap_init::@4 +(label) bitmap_init::@5 +(label) bitmap_init::@6 +(label) bitmap_init::@return +(byte) bitmap_init::bits +(byte) bitmap_init::bits#1 reg byte a 11.0 +(byte) bitmap_init::bits#3 reg byte a 16.5 +(byte) bitmap_init::bits#4 reg byte a 7.333333333333333 +(byte*) bitmap_init::gfx +(byte*) bitmap_init::screen +(byte) bitmap_init::x +(byte) bitmap_init::x#1 reg byte x 16.5 +(byte) bitmap_init::x#2 reg byte x 5.5 +(byte) bitmap_init::y +(byte) bitmap_init::y#1 reg byte x 16.5 +(byte) bitmap_init::y#2 reg byte x 5.5 +(byte*) bitmap_init::yoffs +(byte*) bitmap_init::yoffs#1 yoffs zp ZP_WORD:22 22.0 +(byte*) bitmap_init::yoffs#2 yoffs zp ZP_WORD:22 6.875 +(byte*) bitmap_init::yoffs#4 yoffs zp ZP_WORD:22 11.0 +(void()) bitmap_line((word) bitmap_line::x1 , (word) bitmap_line::y1 , (word) bitmap_line::x2 , (word) bitmap_line::y2) +(label) bitmap_line::@1 +(label) bitmap_line::@10 +(label) bitmap_line::@11 +(label) bitmap_line::@12 +(label) bitmap_line::@13 +(label) bitmap_line::@14 +(label) bitmap_line::@15 +(label) bitmap_line::@2 +(label) bitmap_line::@3 +(label) bitmap_line::@4 +(label) bitmap_line::@5 +(label) bitmap_line::@6 +(label) bitmap_line::@7 +(label) bitmap_line::@8 +(label) bitmap_line::@9 +(label) bitmap_line::@return +(word) bitmap_line::dx +(word) bitmap_line::dx#0 dx zp ZP_WORD:28 8.131578947368421 +(word) bitmap_line::dy +(word) bitmap_line::dy#0 dy zp ZP_WORD:16 9.088235294117647 +(word) bitmap_line::e +(word) bitmap_line::e#0 e zp ZP_WORD:4 4.0 +(word) bitmap_line::e#1 e zp ZP_WORD:4 134.66666666666666 +(word) bitmap_line::e#2 e zp ZP_WORD:4 202.0 +(word) bitmap_line::e#3 e zp ZP_WORD:4 40.8 +(word) bitmap_line::e#6 e zp ZP_WORD:4 151.5 +(word) bitmap_line::e1 +(word) bitmap_line::e1#0 e1 zp ZP_WORD:10 4.0 +(word) bitmap_line::e1#1 e1 zp ZP_WORD:10 134.66666666666666 +(word) bitmap_line::e1#2 e1 zp ZP_WORD:10 202.0 +(word) bitmap_line::e1#3 e1 zp ZP_WORD:10 40.8 +(word) bitmap_line::e1#6 e1 zp ZP_WORD:10 151.5 +(word) bitmap_line::sx +(word) bitmap_line::sx#0 sx zp ZP_WORD:30 6.800000000000001 +(word) bitmap_line::sy +(word) bitmap_line::sy#0 sy zp ZP_WORD:14 7.846153846153847 +(word) bitmap_line::x +(word) bitmap_line::x#1 x zp ZP_WORD:8 101.0 +(word) bitmap_line::x#10 x zp ZP_WORD:8 202.0 +(word) bitmap_line::x#11 x zp ZP_WORD:8 58.00000000000001 +(word) bitmap_line::x#13 x zp ZP_WORD:8 57.714285714285715 +(word) bitmap_line::x#5 x zp ZP_WORD:8 102.0 +(word) bitmap_line::x#6 x zp ZP_WORD:8 76.25 +(word) bitmap_line::x1 +(word) bitmap_line::x1#0 x1 zp ZP_WORD:8 0.7916666666666667 +(word) bitmap_line::x2 +(word) bitmap_line::x2#0 x2 zp ZP_WORD:24 3.741935483870968 +(word) bitmap_line::y +(word) bitmap_line::y#1 y zp ZP_WORD:6 57.714285714285715 +(word) bitmap_line::y#11 y zp ZP_WORD:6 202.0 +(word) bitmap_line::y#13 y zp ZP_WORD:6 43.57142857142858 +(word) bitmap_line::y#2 y zp ZP_WORD:6 101.0 +(word) bitmap_line::y#3 y zp ZP_WORD:6 51.0 +(word) bitmap_line::y#6 y zp ZP_WORD:6 202.0 +(word) bitmap_line::y1 +(word) bitmap_line::y1#0 y1 zp ZP_WORD:6 0.826086956521739 +(word) bitmap_line::y2 +(word) bitmap_line::y2#0 y2 zp ZP_WORD:26 3.8666666666666667 +(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) +(word~) bitmap_plot::$1 $1 zp ZP_WORD:34 4.0 +(byte~) bitmap_plot::$2 reg byte a 4.0 +(label) bitmap_plot::@return +(byte*) bitmap_plot::plotter +(word) bitmap_plot::plotter#0 plotter zp ZP_WORD:32 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:32 3.0 +(word) bitmap_plot::x +(word) bitmap_plot::x#0 x zp ZP_WORD:8 202.0 +(word) bitmap_plot::x#1 x zp ZP_WORD:8 4.0 +(word) bitmap_plot::x#2 x zp ZP_WORD:8 202.0 +(word) bitmap_plot::x#3 x zp ZP_WORD:8 52.0 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 reg byte x 101.0 +(byte) bitmap_plot::y#1 reg byte x 2.0 +(byte) bitmap_plot::y#2 reg byte x 101.0 +(byte) bitmap_plot::y#3 reg byte x 208.0 +(byte[$100]) bitmap_plot_bit +(const byte[$100]) bitmap_plot_bit#0 bitmap_plot_bit = { fill( $100, 0) } +(byte[$100]) bitmap_plot_yhi +(const byte[$100]) bitmap_plot_yhi#0 bitmap_plot_yhi = { fill( $100, 0) } +(byte[$100]) bitmap_plot_ylo +(const byte[$100]) bitmap_plot_ylo#0 bitmap_plot_ylo = { fill( $100, 0) } +(byte*) bitmap_screen +(void()) main() +(word~) main::$10 $10 zp ZP_WORD:24 22.0 +(word~) main::$6 $6 zp ZP_WORD:8 22.0 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(byte) main::a +(byte) main::a#1 a zp ZP_BYTE:2 7.333333333333333 +(byte) main::a#2 a zp ZP_BYTE:2 2.75 +(byte) main::i +(byte) main::i#1 i zp ZP_BYTE:3 16.5 +(byte) main::i#2 i zp ZP_BYTE:3 2.4444444444444446 +(label) main::toD0181 +(word~) main::toD0181_$0 +(number~) main::toD0181_$1 +(number~) main::toD0181_$2 +(number~) main::toD0181_$3 +(word~) main::toD0181_$4 +(byte~) main::toD0181_$5 +(number~) main::toD0181_$6 +(number~) main::toD0181_$7 +(number~) main::toD0181_$8 +(byte*) main::toD0181_gfx +(byte) main::toD0181_return +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP#0/(byte) 4&(byte) $f +(byte*) main::toD0181_screen +(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) +(label) memset::@1 +(label) memset::@return +(byte) memset::c +(byte) memset::c#3 reg byte x 1.5714285714285714 +(byte*) memset::dst +(byte*) memset::dst#1 dst zp ZP_WORD:18 16.5 +(byte*) memset::dst#2 dst zp ZP_WORD:18 17.5 +(byte*~) memset::dst#3 dst zp ZP_WORD:18 4.0 +(byte*) memset::end +(byte*) memset::end#0 end zp ZP_WORD:20 2.1666666666666665 +(word) memset::num +(word) memset::num#2 num zp ZP_WORD:20 2.0 +(void*) memset::return +(void*) memset::str +(void*) memset::str#2 str zp ZP_WORD:18 +(word()) sgn_u16((word) sgn_u16::w) +(byte~) sgn_u16::$0 reg byte a 4.0 +(byte~) sgn_u16::$1 reg byte a 4.0 +(label) sgn_u16::@1 +(label) sgn_u16::@return +(word) sgn_u16::return +(word) sgn_u16::return#0 return zp ZP_WORD:14 4.0 +(word) sgn_u16::return#1 return zp ZP_WORD:14 4.0 +(word) sgn_u16::return#4 return zp ZP_WORD:14 1.0 +(word) sgn_u16::w +(word) sgn_u16::w#0 w zp ZP_WORD:12 4.0 +(word) sgn_u16::w#1 w zp ZP_WORD:12 4.0 +(word) sgn_u16::w#2 w zp ZP_WORD:12 6.0 + +zp ZP_BYTE:2 [ main::a#2 main::a#1 ] +zp ZP_BYTE:3 [ main::i#2 main::i#1 ] +zp ZP_WORD:4 [ bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ] +zp ZP_WORD:6 [ bitmap_line::y#13 bitmap_line::y#6 bitmap_line::y#11 bitmap_line::y#3 bitmap_line::y1#0 bitmap_line::y#1 bitmap_line::y#2 ] +zp ZP_WORD:8 [ bitmap_line::x#6 bitmap_line::x#5 bitmap_line::x#13 bitmap_line::x#11 bitmap_line::x1#0 bitmap_line::x#10 bitmap_line::x#1 bitmap_plot::x#3 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#2 main::$6 ] +zp ZP_WORD:10 [ bitmap_line::e1#3 bitmap_line::e1#0 bitmap_line::e1#6 bitmap_line::e1#2 bitmap_line::e1#1 ] +reg byte x [ bitmap_plot::y#3 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#2 ] +zp ZP_WORD:12 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 ] +zp ZP_WORD:14 [ sgn_u16::return#4 sgn_u16::return#0 sgn_u16::return#1 bitmap_line::sy#0 ] +zp ZP_WORD:16 [ abs_u16::return#4 abs_u16::return#2 abs_u16::w#2 abs_u16::w#0 abs_u16::w#1 abs_u16::return#0 abs_u16::return#1 bitmap_line::dy#0 ] +zp ZP_WORD:18 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] +zp ZP_WORD:20 [ memset::num#2 memset::end#0 ] +reg byte x [ memset::c#3 ] +reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] +reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] +reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] +zp ZP_WORD:22 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +zp ZP_WORD:24 [ main::$10 bitmap_line::x2#0 ] +zp ZP_WORD:26 [ bitmap_line::y2#0 ] +zp ZP_WORD:28 [ bitmap_line::dx#0 ] +zp ZP_WORD:30 [ bitmap_line::sx#0 ] +zp ZP_WORD:32 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ] +zp ZP_WORD:34 [ bitmap_plot::$1 ] +reg byte a [ bitmap_plot::$2 ] +reg byte a [ sgn_u16::$0 ] +reg byte a [ sgn_u16::$1 ] +reg byte a [ abs_u16::$0 ] +reg byte a [ abs_u16::$1 ] +zp ZP_BYTE:36 [ bitmap_init::$7 ] +reg byte a [ bitmap_init::$4 ] +reg byte a [ bitmap_init::$5 ] +reg byte a [ bitmap_init::$6 ] diff --git a/src/test/ref/examples/sinplotter/sine-plotter.log b/src/test/ref/examples/sinplotter/sine-plotter.log index cf7a38e50..c43869683 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.log +++ b/src/test/ref/examples/sinplotter/sine-plotter.log @@ -3,6 +3,8 @@ Fixing pointer increment (signed word*) sin16s_gen2::sintab ← ++ (signed word* Fixing pointer addition (signed word*~) render_sine::$0 ← (signed word[$200]) sin + (word) render_sine::sin_idx Fixing pointer addition (signed word*~) render_sine::$3 ← (signed word[$200]) sin2 + (word) render_sine::sin_idx Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Warning! Adding boolean cast to non-boolean condition (number~) abs_u16::$1 +Warning! Adding boolean cast to non-boolean condition (number~) sgn_u16::$1 Identified constant variable (byte*) SCREEN Identified constant variable (byte*) BITMAP Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx @@ -47,6 +49,9 @@ Culled Empty Block (label) @27 Culled Empty Block (label) bitmap_init::@8 Culled Empty Block (label) @29 Culled Empty Block (label) @30 +Culled Empty Block (label) @31 +Culled Empty Block (label) @32 +Culled Empty Block (label) @33 Culled Empty Block (label) main::vicSelectGfxBank1_toDd001_@1 Culled Empty Block (label) main::vicSelectGfxBank1_@return Culled Empty Block (label) main::toD0181_@1 @@ -54,9 +59,9 @@ Culled Empty Block (label) main::@4 Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@5 Culled Empty Block (label) main::@6 -Culled Empty Block (label) @32 +Culled Empty Block (label) @35 Culled Empty Block (label) render_sine::@4 -Culled Empty Block (label) @33 +Culled Empty Block (label) @36 Culled Empty Block (label) wrap_y::@4 Culled Empty Block (label) wrap_y::@3 Culled Empty Block (label) wrap_y::@5 @@ -581,7 +586,7 @@ memset::@return: scope:[memset] from memset::@2 (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } - to:@31 + to:@34 bitmap_init: scope:[bitmap_init] from main::@8 (byte*) bitmap_init::screen#1 ← phi( main::@8/(byte*) bitmap_init::screen#0 ) (byte*) bitmap_init::gfx#1 ← phi( main::@8/(byte*) bitmap_init::gfx#0 ) @@ -706,7 +711,7 @@ bitmap_plot: scope:[bitmap_plot] from render_sine::@5 render_sine::@7 bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot return to:@return -@31: scope:[] from @28 +@34: scope:[] from @28 (word) rem16u#30 ← phi( @28/(word) rem16u#32 ) (byte*) bitmap_screen#20 ← phi( @28/(byte*) bitmap_screen#0 ) (byte*) bitmap_gfx#21 ← phi( @28/(byte*) bitmap_gfx#0 ) @@ -718,11 +723,11 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot .word sin(toRadians([i*360]/512))*320 } }} - to:@34 -main: scope:[main] from @34 - (word) rem16u#42 ← phi( @34/(word) rem16u#25 ) - (byte*) bitmap_screen#33 ← phi( @34/(byte*) bitmap_screen#14 ) - (byte*) bitmap_gfx#34 ← phi( @34/(byte*) bitmap_gfx#15 ) + to:@37 +main: scope:[main] from @37 + (word) rem16u#42 ← phi( @37/(word) rem16u#25 ) + (byte*) bitmap_screen#33 ← phi( @37/(byte*) bitmap_screen#14 ) + (byte*) bitmap_gfx#34 ← phi( @37/(byte*) bitmap_gfx#15 ) asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 *((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0 @@ -960,28 +965,28 @@ wrap_y::@return: scope:[wrap_y] from wrap_y::@9 (byte) wrap_y::return#3 ← (byte) wrap_y::return#6 return to:@return -@34: scope:[] from @31 - (word) rem16u#25 ← phi( @31/(word) rem16u#30 ) - (byte*) bitmap_screen#14 ← phi( @31/(byte*) bitmap_screen#20 ) - (byte*) bitmap_gfx#15 ← phi( @31/(byte*) bitmap_gfx#21 ) +@37: scope:[] from @34 + (word) rem16u#25 ← phi( @34/(word) rem16u#30 ) + (byte*) bitmap_screen#14 ← phi( @34/(byte*) bitmap_screen#20 ) + (byte*) bitmap_gfx#15 ← phi( @34/(byte*) bitmap_gfx#21 ) call main - to:@35 -@35: scope:[] from @34 - (word) rem16u#19 ← phi( @34/(word) rem16u#9 ) - (byte*) bitmap_screen#10 ← phi( @34/(byte*) bitmap_screen#4 ) - (byte*) bitmap_gfx#10 ← phi( @34/(byte*) bitmap_gfx#4 ) + to:@38 +@38: scope:[] from @37 + (word) rem16u#19 ← phi( @37/(word) rem16u#9 ) + (byte*) bitmap_screen#10 ← phi( @37/(byte*) bitmap_screen#4 ) + (byte*) bitmap_gfx#10 ← phi( @37/(byte*) bitmap_gfx#4 ) (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 (word) rem16u#10 ← (word) rem16u#19 to:@end -@end: scope:[] from @35 +@end: scope:[] from @38 SYMBOL TABLE SSA (label) @17 (label) @28 -(label) @31 (label) @34 -(label) @35 +(label) @37 +(label) @38 (label) @6 (label) @begin (label) @end @@ -2761,9 +2766,9 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @6 Adding NOP phi() at start of @17 Adding NOP phi() at start of @28 -Adding NOP phi() at start of @31 Adding NOP phi() at start of @34 -Adding NOP phi() at start of @35 +Adding NOP phi() at start of @37 +Adding NOP phi() at start of @38 Adding NOP phi() at start of @end Adding NOP phi() at start of main::vicSelectGfxBank1_toDd001 Adding NOP phi() at start of main::vicSelectGfxBank1_toDd001_@return @@ -2865,8 +2870,8 @@ Coalesced down to 30 phi equivalence classes Culled Empty Block (label) @6 Culled Empty Block (label) @17 Culled Empty Block (label) @28 -Culled Empty Block (label) @31 -Culled Empty Block (label) @35 +Culled Empty Block (label) @34 +Culled Empty Block (label) @38 Culled Empty Block (label) main::vicSelectGfxBank1_toDd001_@return Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@12 @@ -2891,7 +2896,7 @@ Culled Empty Block (label) bitmap_init::@4 Culled Empty Block (label) bitmap_init::@11 Culled Empty Block (label) bitmap_init::@12 Culled Empty Block (label) bitmap_init::@9 -Renumbering block @34 to @1 +Renumbering block @37 to @1 Renumbering block div32u16u::@2 to div32u16u::@1 Renumbering block div32u16u::@3 to div32u16u::@2 Renumbering block mul16u::@4 to mul16u::@3