diff --git a/src/main/fragment/vwsz1=_neg_vwsz1.asm b/src/main/fragment/vwsz1=_neg_vwsz1.asm new file mode 100644 index 000000000..3c7b1061d --- /dev/null +++ b/src/main/fragment/vwsz1=_neg_vwsz1.asm @@ -0,0 +1,7 @@ +sec +lda #0 +sbc {z1} +sta {z1} +lda #0 +sbc {z1}+1 +sta {z1}+1 \ No newline at end of file diff --git a/src/main/fragment/vwsz1=_neg_vwsz2.asm b/src/main/fragment/vwsz1=_neg_vwsz2.asm index 11982adaa..d6c3f41dd 100644 --- a/src/main/fragment/vwsz1=_neg_vwsz2.asm +++ b/src/main/fragment/vwsz1=_neg_vwsz2.asm @@ -1,9 +1,7 @@ sec -lda {z2} -eor #$ff -adc #$0 +lda #0 +sbc {z2} sta {z1} -lda {z2}+1 -eor #$ff -adc #$0 +lda #0 +sbc {z2}+1 sta {z1}+1 \ No newline at end of file diff --git a/src/main/fragment/vwuz1=_neg_vwuz1.asm b/src/main/fragment/vwuz1=_neg_vwuz1.asm new file mode 100644 index 000000000..3c7b1061d --- /dev/null +++ b/src/main/fragment/vwuz1=_neg_vwuz1.asm @@ -0,0 +1,7 @@ +sec +lda #0 +sbc {z1} +sta {z1} +lda #0 +sbc {z1}+1 +sta {z1}+1 \ No newline at end of file diff --git a/src/main/fragment/vwuz1=_neg_vwuz2.asm b/src/main/fragment/vwuz1=_neg_vwuz2.asm new file mode 100644 index 000000000..d6c3f41dd --- /dev/null +++ b/src/main/fragment/vwuz1=_neg_vwuz2.asm @@ -0,0 +1,7 @@ +sec +lda #0 +sbc {z2} +sta {z1} +lda #0 +sbc {z2}+1 +sta {z1}+1 \ No newline at end of file diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1PointerSizeofFix.java b/src/main/java/dk/camelot64/kickc/passes/Pass1PointerSizeofFix.java index cf88d17e7..0ac567d00 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1PointerSizeofFix.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1PointerSizeofFix.java @@ -97,7 +97,9 @@ public class Pass1PointerSizeofFix extends Pass1Base { if(variable.getType() instanceof SymbolTypePointer) { SymbolTypePointer pointerType = (SymbolTypePointer) variable.getType(); if(SymbolType.VOID.equals(pointerType.getElementType())) { - throw new CompileError("Void pointer math not allowed. ", assignment); + if(Operators.PLUS.equals(assignment.getOperator()) || Operators.MINUS.equals(assignment.getOperator())) { + throw new CompileError("Void pointer math not allowed. ", assignment); + } } if(pointerType.getElementType().getSizeBytes() > 1) { // Binary operation on a non-byte pointer - sizeof()-handling is probably needed! @@ -128,7 +130,9 @@ public class Pass1PointerSizeofFix extends Pass1Base { if(variable.getType() instanceof SymbolTypePointer) { SymbolTypePointer pointerType = (SymbolTypePointer) variable.getType(); if(SymbolType.VOID.equals(pointerType.getElementType())) { - throw new CompileError("Void pointer math not allowed. ", assignment); + if(Operators.INCREMENT.equals(assignment.getOperator()) || Operators.DECREMENT.equals(assignment.getOperator())) { + throw new CompileError("Void pointer math not allowed. ", assignment); + } } if(pointerType.getElementType().getSizeBytes() > 1) { // Unary operation on non-byte pointer type - sizeof()-handling is needed! diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java b/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java index eb8182db1..7e3a19a32 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java @@ -146,6 +146,9 @@ public class Pass4CodeGeneration { } } generateScopeEnding(asm, currentScope); + + currentScope = ScopeRef.ROOT; + asm.startSegment(currentScope, null, "File Data"); addData(asm, ScopeRef.ROOT); // Add all absolutely placed inline KickAsm for(ControlFlowBlock block : getGraph().getAllBlocks()) { diff --git a/src/main/kc/stdlib/bitmap2.kc b/src/main/kc/stdlib/bitmap2.kc index d0a53980d..36726a6b8 100644 --- a/src/main/kc/stdlib/bitmap2.kc +++ b/src/main/kc/stdlib/bitmap2.kc @@ -1,11 +1,10 @@ -// Fill the screen with a specific char -void screen_fill(byte* screen, byte ch) { - for( byte y: 0..24) { - for(byte x:0..39) { - *screen++ = ch; - } - } -} +// Simple Singlecolor Bitmap Routines +import "string" + +// The adddress of the bitmap screen (used for colors) +byte* bitmap_screen; +// The adddress of the bitmap graphics (used for pixels) +byte* bitmap_gfx; // Tables for the plotter - initialized by calling bitmap_init(); const byte[256] bitmap_plot_ylo; @@ -13,7 +12,9 @@ const byte[256] bitmap_plot_yhi; const byte[256] bitmap_plot_bit; // Initialize bitmap plotting tables -void bitmap_init(byte* bitmap) { +void bitmap_init(byte* gfx, byte* screen) { + bitmap_gfx = gfx; + bitmap_screen = screen; byte bits = $80; for(byte x : 0..255) { bitmap_plot_bit[x] = bits; @@ -22,7 +23,7 @@ void bitmap_init(byte* bitmap) { bits = $80; } } - byte* yoffs = bitmap; + byte* yoffs = gfx; for(byte y : 0..255) { bitmap_plot_ylo[y] = y&$7 | yoffs; @@ -33,13 +34,12 @@ void bitmap_init(byte* bitmap) { } // Clear all graphics on the bitmap -void bitmap_clear() { - byte* bitmap = (byte*) { bitmap_plot_yhi[0], bitmap_plot_ylo[0] }; - for( byte y: 0..39 ) { - for( byte x: 0..199 ) { - *bitmap++ = 0; - } - } +// bgcol - the background color to fill the screen with +// fgcol - the foreground color to fill the screen with +void bitmap_clear(byte bgcol, byte fgcol) { + byte col = fgcol*0x10 + bgcol; + memset(bitmap_screen, col, 1000uw); + memset(bitmap_gfx, 0, 8000uw); } // Plot a single dot in the bitmap diff --git a/src/main/kc/stdlib/string.kc b/src/main/kc/stdlib/string.kc index 9efd0ffd2..7af38e4d1 100644 --- a/src/main/kc/stdlib/string.kc +++ b/src/main/kc/stdlib/string.kc @@ -18,8 +18,8 @@ void* memmove( void* destination, void* source, size_t num ) { memcpy(destination, source, num); } else { // copy backwards - byte* src = source+num; - byte* dst = destination+num; + byte* src = (byte*)source+num; + byte* dst = (byte*)destination+num; for( size_t i=0; i(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label x = 2 + .label y = 4 + .label vx = 5 + .label vy = 7 + jsr bitmap_init + jsr bitmap_clear + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + lda #toD0181_return + sta D018 + jsr init_irq + lda #1 + sta vy + sta vx + lda #0 + sta vx+1 + sta y + sta x + sta x+1 + b2: + ldx y + jsr bitmap_plot + lda x + clc + adc vx + sta x + lda x+1 + adc vx+1 + sta x+1 + lda y + clc + adc vy + sta y + lda x + cmp #<$13f + bne !+ + lda x+1 + cmp #>$13f + beq b5 + !: + lda x + bne b3 + lda x+1 + bne b3 + b5: + sec + lda #0 + sbc vx + sta vx + lda #0 + sbc vx+1 + sta vx+1 + b3: + lda #$c7 + cmp y + beq b6 + lda y + cmp #0 + bne b4 + b6: + lda vy + eor #$ff + clc + adc #1 + sta vy + b4: + ldx frame_cnt + inc plots_per_frame,x + jmp b2 +} +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage(2) x, byte register(X) y) +bitmap_plot: { + .label _1 = $11 + .label plotter = $f + .label x = 2 + .label _3 = $f + lda bitmap_plot_yhi,x + sta _3+1 + lda bitmap_plot_ylo,x + sta _3 + 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 +} +// Setup the IRQ +init_irq: { + sei + // Disable kernal & basic + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + lda #PROCPORT_RAM_IO + sta PROCPORT + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + // Set raster line to $100 + lda #$80 + ora VIC_CONTROL + sta VIC_CONTROL + lda #0 + sta RASTER + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + // Set the IRQ routine + lda #irq + sta HARDWARE_IRQ+1 + cli + 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(8) str, byte register(X) c, word zeropage($a) num) +memset: { + .label end = $a + .label dst = 8 + .label str = 8 + .label num = $a + 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 = $13 + .label yoffs = $c + 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 +} +// Interrupt Routine counting frames +irq: { + sta rega+1 + lda #WHITE + sta BGCOL + lda #0 + cmp frame_cnt + beq b1 + inc frame_cnt + b1: + lda #BLACK + sta BGCOL + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + rega: + lda #00 + rti +} + // 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 + plots_per_frame: .fill $100, 0 diff --git a/src/test/ref/bitmap-plot.cfg b/src/test/ref/bitmap-plot.cfg new file mode 100644 index 000000000..8a30dee1d --- /dev/null +++ b/src/test/ref/bitmap-plot.cfg @@ -0,0 +1,172 @@ +@begin: scope:[] from + [0] phi() + to:@1 +@1: scope:[] from @begin + [1] (byte) frame_cnt#0 ← (byte) 1 + to:@2 +@2: scope:[] from @1 + [2] phi() + [3] call main + to:@end +@end: scope:[] from @2 + [4] phi() +main: scope:[main] from @2 + [5] phi() + [6] call bitmap_init + to:main::@8 +main::@8: scope:[main] from main + [7] phi() + [8] call bitmap_clear + to:main::@9 +main::@9: scope:[main] from main::@8 + [9] *((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::@9 + [10] phi() + to:main::@7 +main::@7: scope:[main] from main::toD0181 + [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 + [12] call init_irq + to:main::@1 +main::@1: scope:[main] from main::@4 main::@7 + [13] (byte) main::vy#2 ← phi( main::@7/(byte) 1 main::@4/(byte) main::vy#8 ) + [13] (word) main::vx#2 ← phi( main::@7/(byte) 1 main::@4/(word) main::vx#6 ) + [13] (byte) main::y#2 ← phi( main::@7/(byte) 0 main::@4/(byte) main::y#1 ) + [13] (word) main::x#2 ← phi( main::@7/(byte) 0 main::@4/(word) main::x#1 ) + to:main::@2 +main::@2: scope:[main] from main::@1 + [14] (word) bitmap_plot::x#0 ← (word) main::x#2 + [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 + [16] call bitmap_plot + to:main::@10 +main::@10: scope:[main] from main::@2 + [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 + [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 + [19] if((word) main::x#1==(word) $13f) goto main::@5 + to:main::@11 +main::@11: scope:[main] from main::@10 + [20] if((word) main::x#1!=(byte) 0) goto main::@3 + to:main::@5 +main::@5: scope:[main] from main::@10 main::@11 + [21] (word) main::vx#1 ← - (word) main::vx#2 + to:main::@3 +main::@3: scope:[main] from main::@11 main::@5 + [22] (word) main::vx#6 ← phi( main::@11/(word) main::vx#2 main::@5/(word) main::vx#1 ) + [23] if((byte) main::y#1==(byte) $c7) goto main::@6 + to:main::@12 +main::@12: scope:[main] from main::@3 + [24] if((byte) main::y#1!=(byte) 0) goto main::@4 + to:main::@6 +main::@6: scope:[main] from main::@12 main::@3 + [25] (byte) main::vy#1 ← - (byte) main::vy#2 + to:main::@4 +main::@4: scope:[main] from main::@12 main::@6 + [26] (byte) main::vy#8 ← phi( main::@12/(byte) main::vy#2 main::@6/(byte) main::vy#1 ) + [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) + to:main::@1 +bitmap_plot: scope:[bitmap_plot] from main::@2 + [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) + [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 + [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 + [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 + [32] *((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 + [33] return + to:@return +init_irq: scope:[init_irq] from main::@7 + asm { sei } + [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 + [36] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 + [37] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 + [38] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80 + [39] *((const byte*) RASTER#0) ← (byte) 0 + [40] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 + [41] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() + asm { cli } + to:init_irq::@return +init_irq::@return: scope:[init_irq] from init_irq + [43] return + to:@return +bitmap_clear: scope:[bitmap_clear] from main::@8 + [44] phi() + [45] call memset + to:bitmap_clear::@1 +bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear + [46] phi() + [47] call memset + to:bitmap_clear::@return +bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 + [48] return + to:@return +memset: scope:[memset] from bitmap_clear bitmap_clear::@1 + [49] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) + [49] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) + [49] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [50] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 + [51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@1 + [52] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) + [53] *((byte*) memset::dst#2) ← (byte) memset::c#3 + [54] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + [55] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 + to:memset::@return +memset::@return: scope:[memset] from memset::@1 + [56] return + to:@return +bitmap_init: scope:[bitmap_init] from main + [57] phi() + to:bitmap_init::@1 +bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2 + [58] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 ) + [58] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 ) + [59] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 + [60] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 + [61] 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 + [62] phi() + to:bitmap_init::@2 +bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 + [63] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 ) + [64] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 + [65] 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 + [66] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [66] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) + [67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 + [68] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 + [69] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 + [70] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 + [71] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 + [72] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 + [73] 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 + [74] (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 + [75] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 ) + [76] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 + [77] 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 + [78] return + to:@return +irq: scope:[irq] from + [79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0 + [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 + to:irq::@2 +irq::@2: scope:[irq] from irq + [81] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0 + to:irq::@1 +irq::@1: scope:[irq] from irq irq::@2 + [82] (byte) frame_cnt#10 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 ) + [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 + [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 + to:irq::@return +irq::@return: scope:[irq] from irq::@1 + [85] return + to:@return diff --git a/src/test/ref/bitmap-plot.log b/src/test/ref/bitmap-plot.log new file mode 100644 index 000000000..b2f2fdc66 --- /dev/null +++ b/src/test/ref/bitmap-plot.log @@ -0,0 +1,3917 @@ +Resolved forward reference frame_cnt to (byte) frame_cnt +Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq() +Adding pointer type conversion cast (byte*) PROCPORT_DDR in (byte*) PROCPORT_DDR ← (number) 0 +Adding pointer type conversion cast (byte*) PROCPORT in (byte*) PROCPORT ← (number) 1 +Adding pointer type conversion cast (byte*) CHARGEN in (byte*) CHARGEN ← (number) $d000 +Adding pointer type conversion cast (byte*) SPRITES_XPOS in (byte*) SPRITES_XPOS ← (number) $d000 +Adding pointer type conversion cast (byte*) SPRITES_YPOS in (byte*) SPRITES_YPOS ← (number) $d001 +Adding pointer type conversion cast (byte*) SPRITES_XMSB in (byte*) SPRITES_XMSB ← (number) $d010 +Adding pointer type conversion cast (byte*) RASTER in (byte*) RASTER ← (number) $d012 +Adding pointer type conversion cast (byte*) SPRITES_ENABLE in (byte*) SPRITES_ENABLE ← (number) $d015 +Adding pointer type conversion cast (byte*) SPRITES_EXPAND_Y in (byte*) SPRITES_EXPAND_Y ← (number) $d017 +Adding pointer type conversion cast (byte*) SPRITES_PRIORITY in (byte*) SPRITES_PRIORITY ← (number) $d01b +Adding pointer type conversion cast (byte*) SPRITES_MC in (byte*) SPRITES_MC ← (number) $d01c +Adding pointer type conversion cast (byte*) SPRITES_EXPAND_X in (byte*) SPRITES_EXPAND_X ← (number) $d01d +Adding pointer type conversion cast (byte*) BORDERCOL in (byte*) BORDERCOL ← (number) $d020 +Adding pointer type conversion cast (byte*) BGCOL in (byte*) BGCOL ← (number) $d021 +Adding pointer type conversion cast (byte*) BGCOL1 in (byte*) BGCOL1 ← (number) $d021 +Adding pointer type conversion cast (byte*) BGCOL2 in (byte*) BGCOL2 ← (number) $d022 +Adding pointer type conversion cast (byte*) BGCOL3 in (byte*) BGCOL3 ← (number) $d023 +Adding pointer type conversion cast (byte*) BGCOL4 in (byte*) BGCOL4 ← (number) $d024 +Adding pointer type conversion cast (byte*) SPRITES_MC1 in (byte*) SPRITES_MC1 ← (number) $d025 +Adding pointer type conversion cast (byte*) SPRITES_MC2 in (byte*) SPRITES_MC2 ← (number) $d026 +Adding pointer type conversion cast (byte*) SPRITES_COLS in (byte*) SPRITES_COLS ← (number) $d027 +Adding pointer type conversion cast (byte*) VIC_CONTROL in (byte*) VIC_CONTROL ← (number) $d011 +Adding pointer type conversion cast (byte*) D011 in (byte*) D011 ← (number) $d011 +Adding pointer type conversion cast (byte*) VIC_CONTROL2 in (byte*) VIC_CONTROL2 ← (number) $d016 +Adding pointer type conversion cast (byte*) D016 in (byte*) D016 ← (number) $d016 +Adding pointer type conversion cast (byte*) D018 in (byte*) D018 ← (number) $d018 +Adding pointer type conversion cast (byte*) VIC_MEMORY in (byte*) VIC_MEMORY ← (number) $d018 +Adding pointer type conversion cast (byte*) LIGHTPEN_X in (byte*) LIGHTPEN_X ← (number) $d013 +Adding pointer type conversion cast (byte*) LIGHTPEN_Y in (byte*) LIGHTPEN_Y ← (number) $d014 +Adding pointer type conversion cast (byte*) IRQ_STATUS in (byte*) IRQ_STATUS ← (number) $d019 +Adding pointer type conversion cast (byte*) IRQ_ENABLE in (byte*) IRQ_ENABLE ← (number) $d01a +Adding pointer type conversion cast (byte*) COLS in (byte*) COLS ← (number) $d800 +Adding pointer type conversion cast (byte*) CIA1_PORT_A in (byte*) CIA1_PORT_A ← (number) $dc00 +Adding pointer type conversion cast (byte*) CIA1_PORT_B in (byte*) CIA1_PORT_B ← (number) $dc01 +Adding pointer type conversion cast (byte*) CIA1_PORT_A_DDR in (byte*) CIA1_PORT_A_DDR ← (number) $dc02 +Adding pointer type conversion cast (byte*) CIA1_PORT_B_DDR in (byte*) CIA1_PORT_B_DDR ← (number) $dc03 +Adding pointer type conversion cast (byte*) CIA1_INTERRUPT in (byte*) CIA1_INTERRUPT ← (number) $dc0d +Adding pointer type conversion cast (byte*) CIA2_PORT_A in (byte*) CIA2_PORT_A ← (number) $dd00 +Adding pointer type conversion cast (byte*) CIA2_PORT_B in (byte*) CIA2_PORT_B ← (number) $dd01 +Adding pointer type conversion cast (byte*) CIA2_PORT_A_DDR in (byte*) CIA2_PORT_A_DDR ← (number) $dd02 +Adding pointer type conversion cast (byte*) CIA2_PORT_B_DDR in (byte*) CIA2_PORT_B_DDR ← (number) $dd03 +Adding pointer type conversion cast (byte*) CIA2_INTERRUPT in (byte*) CIA2_INTERRUPT ← (number) $dd0d +Adding pointer type conversion cast (void()**) KERNEL_IRQ in (void()**) KERNEL_IRQ ← (number) $314 +Adding pointer type conversion cast (void()**) HARDWARE_IRQ in (void()**) HARDWARE_IRQ ← (number) $fffe +Adding pointer type conversion cast to void pointer (byte*) memcpy::source in (byte*) memcpy::src ← (void*) memcpy::source +Adding pointer type conversion cast to void pointer (byte*) memcpy::destination in (byte*) memcpy::dst ← (void*) memcpy::destination +Adding pointer type conversion cast to void pointer (byte*) memset::str in (byte*) memset::dst ← (void*) memset::str +Adding void pointer type conversion cast (void*) bitmap_screen in (void*~) bitmap_clear::$2 ← call memset (byte*) bitmap_screen (byte) bitmap_clear::col (word) $3e8 +Adding void pointer type conversion cast (void*) bitmap_gfx in (void*~) bitmap_clear::$3 ← call memset (byte*) bitmap_gfx (number) 0 (word) $1f40 +Adding pointer type conversion cast (byte*) BITMAP in (byte*) BITMAP ← (number) $2000 +Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400 +Warning! Adding boolean cast to non-boolean condition *((byte*) strcpy::src) +Warning! Adding boolean cast to non-boolean sub-expression (byte) frame_cnt +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) 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 + +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + (byte*) PROCPORT_DDR#0 ← ((byte*)) (number) 0 + (byte) PROCPORT_DDR_MEMORY_MASK#0 ← (number) 7 + (byte*) PROCPORT#0 ← ((byte*)) (number) 1 + (byte) PROCPORT_RAM_IO#0 ← (number) $35 + (byte*) RASTER#0 ← ((byte*)) (number) $d012 + (byte*) BGCOL#0 ← ((byte*)) (number) $d021 + (byte*) VIC_CONTROL#0 ← ((byte*)) (number) $d011 + (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*) IRQ_STATUS#0 ← ((byte*)) (number) $d019 + (byte*) IRQ_ENABLE#0 ← ((byte*)) (number) $d01a + (byte) IRQ_RASTER#0 ← (number) 1 + (byte*) CIA1_INTERRUPT#0 ← ((byte*)) (number) $dc0d + (byte) CIA_INTERRUPT_CLEAR#0 ← (number) $7f + (void()**) HARDWARE_IRQ#0 ← ((void()**)) (number) $fffe + (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:@11 +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#29 ← phi( bitmap_init/(byte*) bitmap_screen#1 bitmap_init::@2/(byte*) bitmap_screen#25 ) + (byte*) bitmap_gfx#30 ← phi( bitmap_init/(byte*) bitmap_gfx#1 bitmap_init::@2/(byte*) bitmap_gfx#26 ) + (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#25 ← phi( bitmap_init::@1/(byte*) bitmap_screen#29 bitmap_init::@3/(byte*) bitmap_screen#30 ) + (byte*) bitmap_gfx#26 ← phi( bitmap_init::@1/(byte*) bitmap_gfx#30 bitmap_init::@3/(byte*) bitmap_gfx#31 ) + (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#30 ← phi( bitmap_init::@1/(byte*) bitmap_screen#29 ) + (byte*) bitmap_gfx#31 ← phi( bitmap_init::@1/(byte*) bitmap_gfx#30 ) + (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#25 ) + (byte*) bitmap_gfx#21 ← phi( bitmap_init::@2/(byte*) bitmap_gfx#26 ) + (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::@12 + (byte*) bitmap_gfx#12 ← phi( main::@12/(byte*) bitmap_gfx#3 ) + (byte*) bitmap_screen#7 ← phi( main::@12/(byte*) bitmap_screen#3 ) + (byte) bitmap_clear::bgcol#1 ← phi( main::@12/(byte) bitmap_clear::bgcol#0 ) + (byte) bitmap_clear::fgcol#1 ← phi( main::@12/(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 main::@2 + (word) bitmap_plot::x#1 ← phi( main::@2/(word) bitmap_plot::x#0 ) + (byte) bitmap_plot::y#1 ← phi( main::@2/(byte) bitmap_plot::y#0 ) + (byte*~) bitmap_plot::$0 ← ((byte*)) { *((byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#1), *((byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#1) } + (byte*) bitmap_plot::plotter#0 ← (byte*~) bitmap_plot::$0 + (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#1 & (number) $fff8 + (byte*) bitmap_plot::plotter#1 ← (byte*) bitmap_plot::plotter#0 + (number~) bitmap_plot::$1 + (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#1 + *((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 +@11: 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 ) + (byte*) bitmap_init::gfx#0 ← (byte*) BITMAP#0 + (byte*) bitmap_init::screen#0 ← (byte*) SCREEN#0 + call bitmap_init + to:main::@12 +main::@12: scope:[main] from main + (byte) frame_cnt#20 ← phi( main/(byte) frame_cnt#21 ) + (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::@13 +main::@13: scope:[main] from main::@12 + (byte) frame_cnt#19 ← phi( main::@12/(byte) frame_cnt#20 ) + (byte*) bitmap_screen#33 ← phi( main::@12/(byte*) bitmap_screen#3 ) + (byte*) bitmap_gfx#34 ← phi( main::@12/(byte*) bitmap_gfx#3 ) + (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::@13 + (byte) frame_cnt#18 ← phi( main::@13/(byte) frame_cnt#19 ) + (byte*) bitmap_screen#31 ← phi( main::@13/(byte*) bitmap_screen#33 ) + (byte*) bitmap_gfx#32 ← phi( main::@13/(byte*) bitmap_gfx#34 ) + (byte*) main::toD0181_gfx#1 ← phi( main::@13/(byte*) main::toD0181_gfx#0 ) + (byte*) main::toD0181_screen#1 ← phi( main::@13/(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) frame_cnt#17 ← phi( main::toD0181/(byte) frame_cnt#18 ) + (byte*) bitmap_screen#26 ← phi( main::toD0181/(byte*) bitmap_screen#31 ) + (byte*) bitmap_gfx#27 ← phi( main::toD0181/(byte*) bitmap_gfx#32 ) + (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::@11 +main::@11: scope:[main] from main::toD0181_@return + (byte) frame_cnt#16 ← phi( main::toD0181_@return/(byte) frame_cnt#17 ) + (byte*) bitmap_screen#21 ← phi( main::toD0181_@return/(byte*) bitmap_screen#26 ) + (byte*) bitmap_gfx#22 ← phi( main::toD0181_@return/(byte*) bitmap_gfx#27 ) + (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 + call init_irq + to:main::@14 +main::@14: scope:[main] from main::@11 + (byte) frame_cnt#15 ← phi( main::@11/(byte) frame_cnt#16 ) + (byte*) bitmap_screen#17 ← phi( main::@11/(byte*) bitmap_screen#21 ) + (byte*) bitmap_gfx#18 ← phi( main::@11/(byte*) bitmap_gfx#22 ) + (word) main::x#0 ← (number) 0 + (byte) main::y#0 ← (number) 0 + (word) main::vx#0 ← (number) 1 + (byte) main::vy#0 ← (number) 1 + to:main::@1 +main::@1: scope:[main] from main::@14 main::@5 + (byte) frame_cnt#14 ← phi( main::@14/(byte) frame_cnt#15 main::@5/(byte) frame_cnt#3 ) + (byte) main::vy#6 ← phi( main::@14/(byte) main::vy#0 main::@5/(byte) main::vy#8 ) + (word) main::vx#5 ← phi( main::@14/(word) main::vx#0 main::@5/(word) main::vx#6 ) + (byte*) bitmap_screen#13 ← phi( main::@14/(byte*) bitmap_screen#17 main::@5/(byte*) bitmap_screen#18 ) + (byte*) bitmap_gfx#14 ← phi( main::@14/(byte*) bitmap_gfx#18 main::@5/(byte*) bitmap_gfx#19 ) + (byte) main::y#5 ← phi( main::@14/(byte) main::y#0 main::@5/(byte) main::y#7 ) + (word) main::x#4 ← phi( main::@14/(word) main::x#0 main::@5/(word) main::x#5 ) + if(true) goto main::@2 + to:main::@return +main::@2: scope:[main] from main::@1 + (byte*) bitmap_screen#32 ← phi( main::@1/(byte*) bitmap_screen#13 ) + (byte*) bitmap_gfx#33 ← phi( main::@1/(byte*) bitmap_gfx#14 ) + (byte) frame_cnt#13 ← phi( main::@1/(byte) frame_cnt#14 ) + (byte) main::vy#4 ← phi( main::@1/(byte) main::vy#6 ) + (word) main::vx#4 ← phi( main::@1/(word) main::vx#5 ) + (byte) main::y#2 ← phi( main::@1/(byte) main::y#5 ) + (word) main::x#2 ← phi( main::@1/(word) main::x#4 ) + (word) bitmap_plot::x#0 ← (word) main::x#2 + (byte) bitmap_plot::y#0 ← (byte) main::y#2 + call bitmap_plot + to:main::@15 +main::@15: scope:[main] from main::@2 + (byte*) bitmap_screen#27 ← phi( main::@2/(byte*) bitmap_screen#32 ) + (byte*) bitmap_gfx#28 ← phi( main::@2/(byte*) bitmap_gfx#33 ) + (byte) frame_cnt#11 ← phi( main::@2/(byte) frame_cnt#13 ) + (byte) main::vy#2 ← phi( main::@2/(byte) main::vy#4 ) + (byte) main::y#3 ← phi( main::@2/(byte) main::y#2 ) + (word) main::vx#2 ← phi( main::@2/(word) main::vx#4 ) + (word) main::x#3 ← phi( main::@2/(word) main::x#2 ) + (word) main::x#1 ← (word) main::x#3 + (word) main::vx#2 + (byte) main::y#1 ← (byte) main::y#3 + (byte) main::vy#2 + (bool~) main::$8 ← (word) main::x#1 == (number) $13f + (bool~) main::$9 ← (word) main::x#1 == (number) 0 + (bool~) main::$10 ← (bool~) main::$8 || (bool~) main::$9 + (bool~) main::$11 ← ! (bool~) main::$10 + if((bool~) main::$11) goto main::@4 + to:main::@8 +main::@4: scope:[main] from main::@15 main::@8 + (word) main::vx#7 ← phi( main::@15/(word) main::vx#2 main::@8/(word) main::vx#1 ) + (byte*) bitmap_screen#22 ← phi( main::@15/(byte*) bitmap_screen#27 main::@8/(byte*) bitmap_screen#28 ) + (byte*) bitmap_gfx#23 ← phi( main::@15/(byte*) bitmap_gfx#28 main::@8/(byte*) bitmap_gfx#29 ) + (word) main::x#6 ← phi( main::@15/(word) main::x#1 main::@8/(word) main::x#8 ) + (byte) main::vy#5 ← phi( main::@15/(byte) main::vy#2 main::@8/(byte) main::vy#7 ) + (byte) frame_cnt#7 ← phi( main::@15/(byte) frame_cnt#11 main::@8/(byte) frame_cnt#12 ) + (byte) main::y#4 ← phi( main::@15/(byte) main::y#1 main::@8/(byte) main::y#6 ) + (bool~) main::$13 ← (byte) main::y#4 == (number) $c7 + (bool~) main::$14 ← (byte) main::y#4 == (number) 0 + (bool~) main::$15 ← (bool~) main::$13 || (bool~) main::$14 + (bool~) main::$16 ← ! (bool~) main::$15 + if((bool~) main::$16) goto main::@5 + to:main::@9 +main::@8: scope:[main] from main::@15 + (byte*) bitmap_screen#28 ← phi( main::@15/(byte*) bitmap_screen#27 ) + (byte*) bitmap_gfx#29 ← phi( main::@15/(byte*) bitmap_gfx#28 ) + (word) main::x#8 ← phi( main::@15/(word) main::x#1 ) + (byte) main::vy#7 ← phi( main::@15/(byte) main::vy#2 ) + (byte) frame_cnt#12 ← phi( main::@15/(byte) frame_cnt#11 ) + (byte) main::y#6 ← phi( main::@15/(byte) main::y#1 ) + (word) main::vx#3 ← phi( main::@15/(word) main::vx#2 ) + (word~) main::$12 ← - (word) main::vx#3 + (word) main::vx#1 ← (word~) main::$12 + to:main::@4 +main::@5: scope:[main] from main::@4 main::@9 + (byte) main::vy#8 ← phi( main::@4/(byte) main::vy#5 main::@9/(byte) main::vy#1 ) + (word) main::vx#6 ← phi( main::@4/(word) main::vx#7 main::@9/(word) main::vx#8 ) + (byte*) bitmap_screen#18 ← phi( main::@4/(byte*) bitmap_screen#22 main::@9/(byte*) bitmap_screen#23 ) + (byte*) bitmap_gfx#19 ← phi( main::@4/(byte*) bitmap_gfx#23 main::@9/(byte*) bitmap_gfx#24 ) + (byte) main::y#7 ← phi( main::@4/(byte) main::y#4 main::@9/(byte) main::y#8 ) + (word) main::x#5 ← phi( main::@4/(word) main::x#6 main::@9/(word) main::x#7 ) + (byte) frame_cnt#3 ← phi( main::@4/(byte) frame_cnt#7 main::@9/(byte) frame_cnt#8 ) + *((byte[$100]) plots_per_frame#0 + (byte) frame_cnt#3) ← ++ *((byte[$100]) plots_per_frame#0 + (byte) frame_cnt#3) + to:main::@1 +main::@9: scope:[main] from main::@4 + (word) main::vx#8 ← phi( main::@4/(word) main::vx#7 ) + (byte*) bitmap_screen#23 ← phi( main::@4/(byte*) bitmap_screen#22 ) + (byte*) bitmap_gfx#24 ← phi( main::@4/(byte*) bitmap_gfx#23 ) + (byte) main::y#8 ← phi( main::@4/(byte) main::y#4 ) + (word) main::x#7 ← phi( main::@4/(word) main::x#6 ) + (byte) frame_cnt#8 ← phi( main::@4/(byte) frame_cnt#7 ) + (byte) main::vy#3 ← phi( main::@4/(byte) main::vy#5 ) + (byte~) main::$17 ← - (byte) main::vy#3 + (byte) main::vy#1 ← (byte~) main::$17 + to:main::@5 +main::@return: scope:[main] from main::@1 + (byte*) bitmap_screen#9 ← phi( main::@1/(byte*) bitmap_screen#13 ) + (byte*) bitmap_gfx#9 ← phi( main::@1/(byte*) bitmap_gfx#14 ) + (byte*) bitmap_gfx#4 ← (byte*) bitmap_gfx#9 + (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 ) + (byte) frame_cnt#0 ← (number) 1 + to:@14 +init_irq: scope:[init_irq] from main::@11 + asm { sei } + *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 + *((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0 + *((byte*) CIA1_INTERRUPT#0) ← (byte) CIA_INTERRUPT_CLEAR#0 + *((byte*) VIC_CONTROL#0) ← *((byte*) VIC_CONTROL#0) | (number) $80 + *((byte*) RASTER#0) ← (number) 0 + *((byte*) IRQ_ENABLE#0) ← (byte) IRQ_RASTER#0 + (void()*~) init_irq::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) irq() + *((void()**) HARDWARE_IRQ#0) ← (void()*~) init_irq::$0 + asm { cli } + to:init_irq::@return +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*) BGCOL#0) ← (byte) WHITE#0 + (bool~) irq::$1 ← (number) 0 != (byte) frame_cnt#4 + (bool~) irq::$0 ← ! (bool~) irq::$1 + if((bool~) irq::$0) goto irq::@1 + to:irq::@2 +irq::@1: scope:[irq] from irq irq::@2 + (byte) frame_cnt#10 ← phi( irq/(byte) frame_cnt#4 irq::@2/(byte) frame_cnt#1 ) + *((byte*) BGCOL#0) ← (byte) BLACK#0 + *((byte*) IRQ_STATUS#0) ← (byte) IRQ_RASTER#0 + to:irq::@return +irq::@2: scope:[irq] from irq + (byte) frame_cnt#5 ← phi( irq/(byte) frame_cnt#4 ) + (byte) frame_cnt#1 ← ++ (byte) frame_cnt#5 + to:irq::@1 +irq::@return: scope:[irq] from irq::@1 + (byte) frame_cnt#6 ← phi( irq::@1/(byte) frame_cnt#10 ) + (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 ) + 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 ) + (byte*) bitmap_gfx#5 ← (byte*) bitmap_gfx#10 + (byte*) bitmap_screen#5 ← (byte*) bitmap_screen#10 + to:@end +@end: scope:[] from @15 + +SYMBOL TABLE SSA +(label) @11 +(label) @12 +(label) @14 +(label) @15 +(label) @8 +(label) @begin +(label) @end +(byte*) BGCOL +(byte*) BGCOL#0 +(byte*) BITMAP +(byte*) BITMAP#0 +(byte) BLACK +(byte) BLACK#0 +(byte*) CIA1_INTERRUPT +(byte*) CIA1_INTERRUPT#0 +(byte) CIA_INTERRUPT_CLEAR +(byte) CIA_INTERRUPT_CLEAR#0 +(byte*) D011 +(byte*) D011#0 +(byte*) D018 +(byte*) D018#0 +(void()**) HARDWARE_IRQ +(void()**) HARDWARE_IRQ#0 +(byte*) IRQ_ENABLE +(byte*) IRQ_ENABLE#0 +(byte) IRQ_RASTER +(byte) IRQ_RASTER#0 +(byte*) IRQ_STATUS +(byte*) IRQ_STATUS#0 +(byte*) PROCPORT +(byte*) PROCPORT#0 +(byte*) PROCPORT_DDR +(byte*) PROCPORT_DDR#0 +(byte) PROCPORT_DDR_MEMORY_MASK +(byte) PROCPORT_DDR_MEMORY_MASK#0 +(byte) PROCPORT_RAM_IO +(byte) PROCPORT_RAM_IO#0 +(byte*) RASTER +(byte*) RASTER#0 +(byte*) SCREEN +(byte*) SCREEN#0 +(byte) VIC_BMM +(byte) VIC_BMM#0 +(byte*) VIC_CONTROL +(byte*) VIC_CONTROL#0 +(byte) VIC_DEN +(byte) VIC_DEN#0 +(byte) VIC_RSEL +(byte) VIC_RSEL#0 +(byte) WHITE +(byte) WHITE#0 +(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#30 +(byte*) bitmap_gfx#31 +(byte*) bitmap_gfx#32 +(byte*) bitmap_gfx#33 +(byte*) bitmap_gfx#34 +(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_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 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 +(byte) bitmap_plot::y#1 +(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#29 +(byte*) bitmap_screen#3 +(byte*) bitmap_screen#30 +(byte*) bitmap_screen#31 +(byte*) bitmap_screen#32 +(byte*) bitmap_screen#33 +(byte*) bitmap_screen#4 +(byte*) bitmap_screen#5 +(byte*) bitmap_screen#6 +(byte*) bitmap_screen#7 +(byte*) bitmap_screen#8 +(byte*) bitmap_screen#9 +(byte) frame_cnt +(byte) frame_cnt#0 +(byte) frame_cnt#1 +(byte) frame_cnt#10 +(byte) frame_cnt#11 +(byte) frame_cnt#12 +(byte) frame_cnt#13 +(byte) frame_cnt#14 +(byte) frame_cnt#15 +(byte) frame_cnt#16 +(byte) frame_cnt#17 +(byte) frame_cnt#18 +(byte) frame_cnt#19 +(byte) frame_cnt#2 +(byte) frame_cnt#20 +(byte) frame_cnt#21 +(byte) frame_cnt#3 +(byte) frame_cnt#4 +(byte) frame_cnt#5 +(byte) frame_cnt#6 +(byte) frame_cnt#7 +(byte) frame_cnt#8 +(byte) frame_cnt#9 +(void()) init_irq() +(void()*~) init_irq::$0 +(label) init_irq::@return +interrupt(HARDWARE_CLOBBER)(void()) irq() +(bool~) irq::$0 +(bool~) irq::$1 +(label) irq::@1 +(label) irq::@2 +(label) irq::@return +(void()) main() +(bool~) main::$10 +(bool~) main::$11 +(word~) main::$12 +(bool~) main::$13 +(bool~) main::$14 +(bool~) main::$15 +(bool~) main::$16 +(byte~) main::$17 +(byte~) main::$2 +(byte~) main::$3 +(number~) main::$4 +(byte~) main::$5 +(bool~) main::$8 +(bool~) main::$9 +(label) main::@1 +(label) main::@11 +(label) main::@12 +(label) main::@13 +(label) main::@14 +(label) main::@15 +(label) main::@2 +(label) main::@4 +(label) main::@5 +(label) main::@8 +(label) main::@9 +(label) main::@return +(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 +(word) main::vx +(word) main::vx#0 +(word) main::vx#1 +(word) main::vx#2 +(word) main::vx#3 +(word) main::vx#4 +(word) main::vx#5 +(word) main::vx#6 +(word) main::vx#7 +(word) main::vx#8 +(byte) main::vy +(byte) main::vy#0 +(byte) main::vy#1 +(byte) main::vy#2 +(byte) main::vy#3 +(byte) main::vy#4 +(byte) main::vy#5 +(byte) main::vy#6 +(byte) main::vy#7 +(byte) main::vy#8 +(word) main::x +(word) main::x#0 +(word) main::x#1 +(word) main::x#2 +(word) main::x#3 +(word) main::x#4 +(word) main::x#5 +(word) main::x#6 +(word) main::x#7 +(word) main::x#8 +(byte) main::y +(byte) main::y#0 +(byte) main::y#1 +(byte) main::y#2 +(byte) main::y#3 +(byte) main::y#4 +(byte) main::y#5 +(byte) main::y#6 +(byte) main::y#7 +(byte) main::y#8 +(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 +(byte[$100]) plots_per_frame +(byte[$100]) plots_per_frame#0 + +Fixing inline constructor with bitmap_plot::$3 ← (byte)*(bitmap_plot_yhi#0 + bitmap_plot::y#1) w= (byte)*(bitmap_plot_ylo#0 + bitmap_plot::y#1) +Successful SSA optimization Pass2FixInlineConstructorsNew +Adding number conversion cast (unumber) 7 in (byte) PROCPORT_DDR_MEMORY_MASK#0 ← (number) 7 +Adding number conversion cast (unumber) $35 in (byte) PROCPORT_RAM_IO#0 ← (number) $35 +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) 1 in (byte) IRQ_RASTER#0 ← (number) 1 +Adding number conversion cast (unumber) $7f in (byte) CIA_INTERRUPT_CLEAR#0 ← (number) $7f +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#1 & (number) $fff8 +Adding number conversion cast (unumber) bitmap_plot::$1 in (number~) bitmap_plot::$1 ← (word) bitmap_plot::x#1 & (unumber)(number) $fff8 +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 (word) main::x#0 ← (number) 0 +Adding number conversion cast (unumber) 0 in (byte) main::y#0 ← (number) 0 +Adding number conversion cast (unumber) 1 in (word) main::vx#0 ← (number) 1 +Adding number conversion cast (unumber) 1 in (byte) main::vy#0 ← (number) 1 +Adding number conversion cast (unumber) $13f in (bool~) main::$8 ← (word) main::x#1 == (number) $13f +Adding number conversion cast (unumber) 0 in (bool~) main::$9 ← (word) main::x#1 == (number) 0 +Adding number conversion cast (unumber) $c7 in (bool~) main::$13 ← (byte) main::y#4 == (number) $c7 +Adding number conversion cast (unumber) 0 in (bool~) main::$14 ← (byte) main::y#4 == (number) 0 +Adding number conversion cast (unumber) 1 in (byte) frame_cnt#0 ← (number) 1 +Adding number conversion cast (unumber) $80 in *((byte*) VIC_CONTROL#0) ← *((byte*) VIC_CONTROL#0) | (number) $80 +Adding number conversion cast (unumber) 0 in *((byte*) RASTER#0) ← (number) 0 +Adding number conversion cast (unumber) 0 in (bool~) irq::$1 ← (number) 0 != (byte) frame_cnt#4 +Successful SSA optimization PassNAddNumberTypeConversions +Inlining cast (byte*) PROCPORT_DDR#0 ← (byte*)(number) 0 +Inlining cast (byte) PROCPORT_DDR_MEMORY_MASK#0 ← (unumber)(number) 7 +Inlining cast (byte*) PROCPORT#0 ← (byte*)(number) 1 +Inlining cast (byte) PROCPORT_RAM_IO#0 ← (unumber)(number) $35 +Inlining cast (byte*) RASTER#0 ← (byte*)(number) $d012 +Inlining cast (byte*) BGCOL#0 ← (byte*)(number) $d021 +Inlining cast (byte*) VIC_CONTROL#0 ← (byte*)(number) $d011 +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*) IRQ_STATUS#0 ← (byte*)(number) $d019 +Inlining cast (byte*) IRQ_ENABLE#0 ← (byte*)(number) $d01a +Inlining cast (byte) IRQ_RASTER#0 ← (unumber)(number) 1 +Inlining cast (byte*) CIA1_INTERRUPT#0 ← (byte*)(number) $dc0d +Inlining cast (byte) CIA_INTERRUPT_CLEAR#0 ← (unumber)(number) $7f +Inlining cast (void()**) HARDWARE_IRQ#0 ← (void()**)(number) $fffe +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#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 (word) main::x#0 ← (unumber)(number) 0 +Inlining cast (byte) main::y#0 ← (unumber)(number) 0 +Inlining cast (word) main::vx#0 ← (unumber)(number) 1 +Inlining cast (byte) main::vy#0 ← (unumber)(number) 1 +Inlining cast (byte) frame_cnt#0 ← (unumber)(number) 1 +Inlining cast *((byte*) RASTER#0) ← (unumber)(number) 0 +Successful SSA optimization Pass2InlineCast +Simplifying constant pointer cast (byte*) 0 +Simplifying constant integer cast 7 +Simplifying constant pointer cast (byte*) 1 +Simplifying constant integer cast $35 +Simplifying constant pointer cast (byte*) 53266 +Simplifying constant pointer cast (byte*) 53281 +Simplifying constant pointer cast (byte*) 53265 +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 pointer cast (byte*) 53273 +Simplifying constant pointer cast (byte*) 53274 +Simplifying constant integer cast 1 +Simplifying constant pointer cast (byte*) 56333 +Simplifying constant integer cast $7f +Simplifying constant pointer cast (void()**) 65534 +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#1) +Simplifying constant integer cast *((byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#1) +Simplifying constant integer cast $fff8 +Simplifying constant pointer cast (byte*) 8192 +Simplifying constant pointer cast (byte*) 1024 +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 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast $13f +Simplifying constant integer cast 0 +Simplifying constant integer cast $c7 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast $80 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) $35 +Finalized unsigned number type (byte) $20 +Finalized unsigned number type (byte) $10 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $7f +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) 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) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (word) $13f +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $c7 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 +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#1 & (word) $fff8 +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 +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 [49] (bool~) bitmap_init::$1 ← (byte) bitmap_init::bits#1 != (byte) 0 from [48] (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (byte) 0 +Inversing boolean not [69] (bool~) bitmap_init::$9 ← (byte~) bitmap_init::$7 != (byte) 7 from [68] (bool~) bitmap_init::$8 ← (byte~) bitmap_init::$7 == (byte) 7 +Inversing boolean not [198] (bool~) irq::$0 ← (byte) 0 == (byte) frame_cnt#4 from [197] (bool~) irq::$1 ← (byte) 0 != (byte) frame_cnt#4 +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#30 = (byte*) bitmap_gfx#31 +Alias (byte*) bitmap_screen#29 = (byte*) bitmap_screen#30 +Alias (byte*) bitmap_init::gfx#2 = (byte*) bitmap_init::gfx#3 (byte*) bitmap_init::yoffs#0 +Alias (byte*) bitmap_gfx#21 = (byte*) bitmap_gfx#26 +Alias (byte*) bitmap_screen#20 = (byte*) bitmap_screen#25 +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 (byte*) bitmap_gfx#0 = (byte*) bitmap_gfx#25 (byte*) bitmap_gfx#20 (byte*) bitmap_gfx#15 +Alias (byte*) bitmap_screen#0 = (byte*) bitmap_screen#24 (byte*) bitmap_screen#19 (byte*) bitmap_screen#14 +Alias (byte) frame_cnt#15 = (byte) frame_cnt#20 (byte) frame_cnt#21 (byte) frame_cnt#19 (byte) frame_cnt#18 (byte) frame_cnt#17 (byte) frame_cnt#16 +Alias (byte*) bitmap_gfx#18 = (byte*) bitmap_gfx#3 (byte*) bitmap_gfx#8 (byte*) bitmap_gfx#34 (byte*) bitmap_gfx#32 (byte*) bitmap_gfx#27 (byte*) bitmap_gfx#22 +Alias (byte*) bitmap_screen#17 = (byte*) bitmap_screen#3 (byte*) bitmap_screen#8 (byte*) bitmap_screen#33 (byte*) bitmap_screen#31 (byte*) bitmap_screen#26 (byte*) bitmap_screen#21 +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) main::x#2 = (word) main::x#4 (word) main::x#3 +Alias (byte) main::y#2 = (byte) main::y#5 (byte) main::y#3 +Alias (word) main::vx#2 = (word) main::vx#4 (word) main::vx#5 (word) main::vx#3 +Alias (byte) main::vy#2 = (byte) main::vy#4 (byte) main::vy#6 (byte) main::vy#7 +Alias (byte) frame_cnt#11 = (byte) frame_cnt#13 (byte) frame_cnt#14 (byte) frame_cnt#12 +Alias (byte*) bitmap_gfx#14 = (byte*) bitmap_gfx#33 (byte*) bitmap_gfx#28 (byte*) bitmap_gfx#29 (byte*) bitmap_gfx#9 (byte*) bitmap_gfx#4 +Alias (byte*) bitmap_screen#13 = (byte*) bitmap_screen#32 (byte*) bitmap_screen#27 (byte*) bitmap_screen#28 (byte*) bitmap_screen#9 (byte*) bitmap_screen#4 +Alias (byte) main::y#1 = (byte) main::y#6 +Alias (word) main::x#1 = (word) main::x#8 +Alias (word) main::vx#1 = (word~) main::$12 +Alias (byte) main::vy#3 = (byte) main::vy#5 +Alias (byte) frame_cnt#7 = (byte) frame_cnt#8 +Alias (word) main::x#6 = (word) main::x#7 +Alias (byte) main::y#4 = (byte) main::y#8 +Alias (byte*) bitmap_gfx#23 = (byte*) bitmap_gfx#24 +Alias (byte*) bitmap_screen#22 = (byte*) bitmap_screen#23 +Alias (word) main::vx#7 = (word) main::vx#8 +Alias (byte) main::vy#1 = (byte~) main::$17 +Alias (byte) frame_cnt#4 = (byte) frame_cnt#5 +Alias (byte) frame_cnt#10 = (byte) frame_cnt#6 (byte) frame_cnt#2 +Alias (byte) frame_cnt#0 = (byte) frame_cnt#9 +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#30 +Alias (byte*) bitmap_screen#20 = (byte*) bitmap_screen#29 +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 (byte) main::y#1 = (byte) main::y#4 (byte) main::y#7 +Alias (byte) frame_cnt#11 = (byte) frame_cnt#7 (byte) frame_cnt#3 +Alias (byte) main::vy#2 = (byte) main::vy#3 +Alias (word) main::x#1 = (word) main::x#6 (word) main::x#5 +Alias (byte*) bitmap_gfx#14 = (byte*) bitmap_gfx#23 (byte*) bitmap_gfx#19 +Alias (byte*) bitmap_screen#13 = (byte*) bitmap_screen#22 (byte*) bitmap_screen#18 +Alias (word) main::vx#6 = (word) main::vx#7 +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 (byte*) bitmap_gfx#14 +Self Phi Eliminated (byte*) bitmap_screen#13 +Self Phi Eliminated (byte) frame_cnt#11 +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#17 +Identical Phi Values (byte*) bitmap_gfx#12 (byte*) bitmap_gfx#18 +Identical Phi Values (byte) bitmap_plot::y#1 (byte) bitmap_plot::y#0 +Identical Phi Values (word) bitmap_plot::x#1 (word) bitmap_plot::x#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) frame_cnt#15 (byte) frame_cnt#0 +Identical Phi Values (byte*) bitmap_gfx#18 (byte*) bitmap_gfx#11 +Identical Phi Values (byte*) bitmap_screen#17 (byte*) bitmap_screen#11 +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) frame_cnt#11 (byte) frame_cnt#15 +Identical Phi Values (byte) frame_cnt#4 (byte) frame_cnt#0 +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 [67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 +Successful SSA optimization Pass2DuplicateRValueIdentification +Simple Condition (bool~) memset::$2 [29] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 +Simple Condition (bool~) bitmap_init::$1 [50] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@2 +Simple Condition (bool~) bitmap_init::$2 [54] if((byte) bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 +Simple Condition (bool~) bitmap_init::$9 [70] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@6 +Simple Condition (bool~) bitmap_init::$11 [74] if((byte) bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 +Simple Condition (bool~) irq::$0 [199] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 +Successful SSA optimization Pass2ConditionalJumpSimplification +Rewriting ! if()-condition to reversed if() [162] (bool~) main::$11 ← ! (bool~) main::$10 +Successful SSA optimization Pass2ConditionalAndOrRewriting +Rewriting || if()-condition to two if()s [161] (bool~) main::$10 ← (bool~) main::$8 || (bool~) main::$9 +Successful SSA optimization Pass2ConditionalAndOrRewriting +Rewriting ! if()-condition to reversed if() [168] (bool~) main::$16 ← ! (bool~) main::$15 +Successful SSA optimization Pass2ConditionalAndOrRewriting +Rewriting || if()-condition to two if()s [167] (bool~) main::$15 ← (bool~) main::$13 || (bool~) main::$14 +Successful SSA optimization Pass2ConditionalAndOrRewriting +Constant right-side identified [37] (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } +Constant right-side identified [38] (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } +Constant right-side identified [39] (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } +Constant right-side identified [110] (byte[$100]) plots_per_frame#0 ← { fill( $100, 0) } +Constant right-side identified [191] (void()*~) init_irq::$0 ← & interrupt(HARDWARE_CLOBBER)(void()) irq() +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte*) PROCPORT_DDR#0 = (byte*) 0 +Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 +Constant (const byte*) PROCPORT#0 = (byte*) 1 +Constant (const byte) PROCPORT_RAM_IO#0 = $35 +Constant (const byte*) RASTER#0 = (byte*) 53266 +Constant (const byte*) BGCOL#0 = (byte*) 53281 +Constant (const byte*) VIC_CONTROL#0 = (byte*) 53265 +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*) IRQ_STATUS#0 = (byte*) 53273 +Constant (const byte*) IRQ_ENABLE#0 = (byte*) 53274 +Constant (const byte) IRQ_RASTER#0 = 1 +Constant (const byte*) CIA1_INTERRUPT#0 = (byte*) 56333 +Constant (const byte) CIA_INTERRUPT_CLEAR#0 = $7f +Constant (const void()**) HARDWARE_IRQ#0 = (void()**) 65534 +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 byte*) BITMAP#0 = (byte*) 8192 +Constant (const byte*) SCREEN#0 = (byte*) 1024 +Constant (const byte[$100]) plots_per_frame#0 = { fill( $100, 0) } +Constant (const word) main::x#0 = 0 +Constant (const byte) main::y#0 = 0 +Constant (const word) main::vx#0 = 1 +Constant (const byte) main::vy#0 = 1 +Constant (const void()*) init_irq::$0 = &irq +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 [86] (void*) memset::str#0 ← (void*)(const byte*) bitmap_screen#1 +Constant value identified (void*)bitmap_gfx#1 in [92] (void*) memset::str#1 ← (void*)(const byte*) bitmap_gfx#1 +Constant value identified (word)main::toD0181_screen#0 in [129] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0 +Constant value identified (word)main::toD0181_gfx#0 in [133] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0 +Successful SSA optimization Pass2ConstantValues +if() condition always true - replacing block destination [151] if(true) goto main::@2 +Successful SSA optimization Pass2ConstantIfs +Resolved ranged next value [52] bitmap_init::x#1 ← ++ bitmap_init::x#2 to ++ +Resolved ranged comparison value [54] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to (number) 0 +Resolved ranged next value [72] bitmap_init::y#1 ← ++ bitmap_init::y#2 to ++ +Resolved ranged comparison value [74] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to (number) 0 +Simplifying expression containing zero bitmap_clear::$0 in [84] (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 +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 +Simple Condition (bool~) main::$8 [70] if((word) main::x#1==(word) $13f) goto main::@8 +Simple Condition (bool~) main::$13 [74] if((byte) main::y#1==(byte) $c7) goto main::@9 +Simple Condition (bool~) main::$9 [98] if((word) main::x#1==(byte) 0) goto main::@8 +Simple Condition (bool~) main::$14 [99] if((byte) main::y#1==(byte) 0) goto main::@9 +Successful SSA optimization Pass2ConditionalJumpSimplification +Negating conditional jump and destination [98] if((word) main::x#1!=(byte) 0) goto main::@4 +Negating conditional jump and destination [99] if((byte) main::y#1!=(byte) 0) goto main::@5 +Successful SSA optimization Pass2ConditionalJumpSequenceImprovement +Constant right-side identified [30] (byte) bitmap_clear::col#0 ← (const byte) bitmap_clear::fgcol#0 * (byte) $10 +Constant right-side identified [47] (byte~) main::$2 ← (const byte) VIC_BMM#0 | (const byte) VIC_DEN#0 +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) 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 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte) memset::c#0 = bitmap_clear::col#0 +Successful SSA optimization Pass2ConstantIdentification +Constant right-side identified [41] (byte~) main::$3 ← (const byte) main::$2 | (const byte) VIC_RSEL#0 +Constant right-side identified [44] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff +Constant right-side identified [47] (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 [41] (byte~) main::$4 ← (const byte) main::$3 | (byte) 3 +Constant right-side identified [43] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4 +Constant right-side identified [45] (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 [42] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0 +Constant right-side identified [43] (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 [42] (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 +Inlining Noop Cast [33] (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3 keeping bitmap_plot::$3 +Successful SSA optimization Pass2NopCastInlining +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) main::x#0 +Inlining constant with var siblings (const byte) main::y#0 +Inlining constant with var siblings (const word) main::vx#0 +Inlining constant with var siblings (const byte) main::vy#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 init_irq::$0 = &interrupt(HARDWARE_CLOBBER)(void()) irq() +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 main::x#0 = (byte) 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::y#0 = (byte) 0 +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::vy#0 = (byte) 1 +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::vx#0 = (byte) 1 +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 +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 main::@18(between main::@16 and main::@4) +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 @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@12 +Adding NOP phi() at start of main::toD0181 +Adding NOP phi() at start of main::toD0181_@return +Adding NOP phi() at start of main::@14 +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:5 +Calls in [main] to bitmap_init:9 bitmap_clear:11 init_irq:16 bitmap_plot:21 +Calls in [bitmap_clear] to memset:58 memset:60 + +Created 17 initial phi equivalence classes +Coalesced [27] main::vx#11 ← main::vx#1 +Coalesced [32] main::vy#11 ← main::vy#1 +Coalesced [35] main::x#9 ← main::x#1 +Coalesced [36] main::y#9 ← main::y#1 +Coalesced [37] main::vx#9 ← main::vx#6 +Coalesced [38] main::vy#9 ← main::vy#8 +Coalesced (already) [39] main::vy#10 ← main::vy#2 +Coalesced (already) [40] main::vx#10 ← main::vx#2 +Coalesced [72] memset::dst#4 ← memset::dst#1 +Coalesced [92] bitmap_init::yoffs#7 ← bitmap_init::yoffs#1 +Coalesced [97] bitmap_init::y#5 ← bitmap_init::y#1 +Coalesced [98] bitmap_init::yoffs#5 ← bitmap_init::yoffs#4 +Coalesced (already) [99] bitmap_init::yoffs#6 ← bitmap_init::yoffs#2 +Coalesced [100] bitmap_init::bits#5 ← bitmap_init::bits#4 +Coalesced [101] bitmap_init::x#5 ← bitmap_init::x#1 +Coalesced [102] bitmap_init::bits#6 ← bitmap_init::bits#1 +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) main::toD0181_@return +Culled Empty Block (label) main::@14 +Culled Empty Block (label) main::@19 +Culled Empty Block (label) main::@18 +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 +Culled Empty Block (label) irq::@3 +Renumbering block @12 to @1 +Renumbering block @14 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 +Renumbering block bitmap_init::@10 to bitmap_init::@6 +Renumbering block main::@4 to main::@3 +Renumbering block main::@5 to main::@4 +Renumbering block main::@8 to main::@5 +Renumbering block main::@9 to main::@6 +Renumbering block main::@11 to main::@7 +Renumbering block main::@12 to main::@8 +Renumbering block main::@13 to main::@9 +Renumbering block main::@15 to main::@10 +Renumbering block main::@16 to main::@11 +Renumbering block main::@17 to main::@12 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @2 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Adding NOP phi() at start of main::@8 +Adding NOP phi() at start of main::toD0181 +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] (byte) frame_cnt#0 ← (byte) 1 + to:@2 +@2: scope:[] from @1 + [2] phi() + [3] call main + to:@end +@end: scope:[] from @2 + [4] phi() +main: scope:[main] from @2 + [5] phi() + [6] call bitmap_init + to:main::@8 +main::@8: scope:[main] from main + [7] phi() + [8] call bitmap_clear + to:main::@9 +main::@9: scope:[main] from main::@8 + [9] *((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::@9 + [10] phi() + to:main::@7 +main::@7: scope:[main] from main::toD0181 + [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 + [12] call init_irq + to:main::@1 +main::@1: scope:[main] from main::@4 main::@7 + [13] (byte) main::vy#2 ← phi( main::@7/(byte) 1 main::@4/(byte) main::vy#8 ) + [13] (word) main::vx#2 ← phi( main::@7/(byte) 1 main::@4/(word) main::vx#6 ) + [13] (byte) main::y#2 ← phi( main::@7/(byte) 0 main::@4/(byte) main::y#1 ) + [13] (word) main::x#2 ← phi( main::@7/(byte) 0 main::@4/(word) main::x#1 ) + to:main::@2 +main::@2: scope:[main] from main::@1 + [14] (word) bitmap_plot::x#0 ← (word) main::x#2 + [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 + [16] call bitmap_plot + to:main::@10 +main::@10: scope:[main] from main::@2 + [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 + [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 + [19] if((word) main::x#1==(word) $13f) goto main::@5 + to:main::@11 +main::@11: scope:[main] from main::@10 + [20] if((word) main::x#1!=(byte) 0) goto main::@3 + to:main::@5 +main::@5: scope:[main] from main::@10 main::@11 + [21] (word) main::vx#1 ← - (word) main::vx#2 + to:main::@3 +main::@3: scope:[main] from main::@11 main::@5 + [22] (word) main::vx#6 ← phi( main::@11/(word) main::vx#2 main::@5/(word) main::vx#1 ) + [23] if((byte) main::y#1==(byte) $c7) goto main::@6 + to:main::@12 +main::@12: scope:[main] from main::@3 + [24] if((byte) main::y#1!=(byte) 0) goto main::@4 + to:main::@6 +main::@6: scope:[main] from main::@12 main::@3 + [25] (byte) main::vy#1 ← - (byte) main::vy#2 + to:main::@4 +main::@4: scope:[main] from main::@12 main::@6 + [26] (byte) main::vy#8 ← phi( main::@12/(byte) main::vy#2 main::@6/(byte) main::vy#1 ) + [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) + to:main::@1 +bitmap_plot: scope:[bitmap_plot] from main::@2 + [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) + [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 + [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 + [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 + [32] *((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 + [33] return + to:@return +init_irq: scope:[init_irq] from main::@7 + asm { sei } + [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 + [36] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 + [37] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 + [38] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80 + [39] *((const byte*) RASTER#0) ← (byte) 0 + [40] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 + [41] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() + asm { cli } + to:init_irq::@return +init_irq::@return: scope:[init_irq] from init_irq + [43] return + to:@return +bitmap_clear: scope:[bitmap_clear] from main::@8 + [44] phi() + [45] call memset + to:bitmap_clear::@1 +bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear + [46] phi() + [47] call memset + to:bitmap_clear::@return +bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@1 + [48] return + to:@return +memset: scope:[memset] from bitmap_clear bitmap_clear::@1 + [49] (byte) memset::c#3 ← phi( bitmap_clear/(const byte) bitmap_clear::col#0 bitmap_clear::@1/(byte) 0 ) + [49] (word) memset::num#2 ← phi( bitmap_clear/(word) $3e8 bitmap_clear::@1/(word) $1f40 ) + [49] (void*) memset::str#2 ← phi( bitmap_clear/(void*)(const byte*) SCREEN#0 bitmap_clear::@1/(void*)(const byte*) BITMAP#0 ) + [50] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 + [51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + to:memset::@1 +memset::@1: scope:[memset] from memset memset::@1 + [52] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) + [53] *((byte*) memset::dst#2) ← (byte) memset::c#3 + [54] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 + [55] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 + to:memset::@return +memset::@return: scope:[memset] from memset::@1 + [56] return + to:@return +bitmap_init: scope:[bitmap_init] from main + [57] phi() + to:bitmap_init::@1 +bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2 + [58] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte) 0 bitmap_init::@2/(byte) bitmap_init::x#1 ) + [58] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 ) + [59] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 + [60] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 + [61] 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 + [62] phi() + to:bitmap_init::@2 +bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6 + [63] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte) $80 ) + [64] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 + [65] 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 + [66] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 ) + [66] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte) 0 bitmap_init::@4/(byte) bitmap_init::y#1 ) + [67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 + [68] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 + [69] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 + [70] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 + [71] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 + [72] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 + [73] 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 + [74] (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 + [75] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 ) + [76] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 + [77] 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 + [78] return + to:@return +irq: scope:[irq] from + [79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0 + [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 + to:irq::@2 +irq::@2: scope:[irq] from irq + [81] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0 + to:irq::@1 +irq::@1: scope:[irq] from irq irq::@2 + [82] (byte) frame_cnt#10 ← phi( irq/(byte) frame_cnt#0 irq::@2/(byte) frame_cnt#1 ) + [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 + [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 + to:irq::@return +irq::@return: scope:[irq] from irq::@1 + [85] return + to:@return + + +VARIABLE REGISTER WEIGHTS +(byte*) BGCOL +(byte*) BITMAP +(byte) BLACK +(byte*) CIA1_INTERRUPT +(byte) CIA_INTERRUPT_CLEAR +(byte*) D011 +(byte*) D018 +(void()**) HARDWARE_IRQ +(byte*) IRQ_ENABLE +(byte) IRQ_RASTER +(byte*) IRQ_STATUS +(byte*) PROCPORT +(byte*) PROCPORT_DDR +(byte) PROCPORT_DDR_MEMORY_MASK +(byte) PROCPORT_RAM_IO +(byte*) RASTER +(byte*) SCREEN +(byte) VIC_BMM +(byte*) VIC_CONTROL +(byte) VIC_DEN +(byte) VIC_RSEL +(byte) WHITE +(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_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) +(word~) bitmap_plot::$1 4.0 +(byte~) bitmap_plot::$2 4.0 +(word~) bitmap_plot::$3 1.0 +(byte*) bitmap_plot::plotter +(byte*) bitmap_plot::plotter#1 3.0 +(word) bitmap_plot::x +(word) bitmap_plot::x#0 3.0 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 15.0 +(byte[$100]) bitmap_plot_bit +(byte[$100]) bitmap_plot_yhi +(byte[$100]) bitmap_plot_ylo +(byte*) bitmap_screen +(byte) frame_cnt +(byte) frame_cnt#0 1.1111111111111112 +(byte) frame_cnt#1 4.0 +(byte) frame_cnt#10 40.0 +(void()) init_irq() +interrupt(HARDWARE_CLOBBER)(void()) irq() +(void()) main() +(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 +(word) main::vx +(word) main::vx#1 22.0 +(word) main::vx#2 5.5 +(word) main::vx#6 5.5 +(byte) main::vy +(byte) main::vy#1 22.0 +(byte) main::vy#2 3.6666666666666665 +(byte) main::vy#8 16.5 +(word) main::x +(word) main::x#1 4.0 +(word) main::x#2 8.25 +(byte) main::y +(byte) main::y#1 4.4 +(byte) main::y#2 6.6000000000000005 +(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 +(byte[$100]) plots_per_frame + +Initial phi equivalence classes +[ main::x#2 main::x#1 ] +[ main::y#2 main::y#1 ] +[ main::vx#2 main::vx#6 main::vx#1 ] +[ main::vy#2 main::vy#8 main::vy#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 ] +[ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Added variable bitmap_plot::x#0 to zero page equivalence class [ bitmap_plot::x#0 ] +Added variable bitmap_plot::y#0 to zero page equivalence class [ bitmap_plot::y#0 ] +Added variable bitmap_plot::$3 to zero page equivalence class [ bitmap_plot::$3 ] +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 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::x#2 main::x#1 ] +[ main::y#2 main::y#1 ] +[ main::vx#2 main::vx#6 main::vx#1 ] +[ main::vy#2 main::vy#8 main::vy#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 ] +[ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +[ bitmap_plot::x#0 ] +[ bitmap_plot::y#0 ] +[ bitmap_plot::$3 ] +[ bitmap_plot::$1 ] +[ bitmap_plot::plotter#1 ] +[ bitmap_plot::$2 ] +[ memset::end#0 ] +[ bitmap_init::$7 ] +[ bitmap_init::$4 ] +[ bitmap_init::$5 ] +[ bitmap_init::$6 ] +Allocated zp ZP_WORD:2 [ main::x#2 main::x#1 ] +Allocated zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Allocated zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] +Allocated zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +Allocated zp ZP_WORD:8 [ memset::str#2 ] +Allocated zp ZP_WORD:10 [ memset::num#2 ] +Allocated zp ZP_BYTE:12 [ memset::c#3 ] +Allocated zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] +Allocated zp ZP_BYTE:15 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] +Allocated zp ZP_BYTE:16 [ bitmap_init::x#2 bitmap_init::x#1 ] +Allocated zp ZP_BYTE:17 [ bitmap_init::y#2 bitmap_init::y#1 ] +Allocated zp ZP_WORD:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +Allocated zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Allocated zp ZP_WORD:21 [ bitmap_plot::x#0 ] +Allocated zp ZP_BYTE:23 [ bitmap_plot::y#0 ] +Allocated zp ZP_WORD:24 [ bitmap_plot::$3 ] +Allocated zp ZP_WORD:26 [ bitmap_plot::$1 ] +Allocated zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] +Allocated zp ZP_BYTE:30 [ bitmap_plot::$2 ] +Allocated zp ZP_WORD:31 [ memset::end#0 ] +Allocated zp ZP_BYTE:33 [ bitmap_init::$7 ] +Allocated zp ZP_BYTE:34 [ bitmap_init::$4 ] +Allocated zp ZP_BYTE:35 [ bitmap_init::$5 ] +Allocated zp ZP_BYTE:36 [ bitmap_init::$6 ] + +INITIAL ASM +//SEG0 File Comments +// Tests the simple bitmap plotter - and counts plots per frame in an IRQ +//SEG1 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" +//SEG2 Global Constants & labels + // Processor port data direction register + .label PROCPORT_DDR = 0 + // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written + .const PROCPORT_DDR_MEMORY_MASK = 7 + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // RAM in $A000, $E000 I/O in $D000 + .const PROCPORT_RAM_IO = $35 + .label RASTER = $d012 + .label BGCOL = $d021 + .label VIC_CONTROL = $d011 + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label D018 = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // VIC II IRQ Enable Register + .label IRQ_ENABLE = $d01a + // Bits for the IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // CIA#1 Interrupt Status & Control Register + .label CIA1_INTERRUPT = $dc0d + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The vector used when the HARDWARE serves IRQ interrupts + .label HARDWARE_IRQ = $fffe + // The colors of the C64 + .const BLACK = 0 + .const WHITE = 1 + .label BITMAP = $2000 + .label SCREEN = $400 + .label frame_cnt = $14 +//SEG3 @begin +bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [1] (byte) frame_cnt#0 ← (byte) 1 -- vbuz1=vbuc1 + // Counts frames - updated by the IRQ + lda #1 + sta frame_cnt +//SEG6 [2] phi from @1 to @2 [phi:@1->@2] +b2_from_b1: + jmp b2 +//SEG7 @2 +b2: +//SEG8 [3] call main +//SEG9 [5] phi from @2 to main [phi:@2->main] +main_from_b2: + jsr main +//SEG10 [4] phi from @2 to @end [phi:@2->@end] +bend_from_b2: + jmp bend +//SEG11 @end +bend: +//SEG12 main +main: { + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label x = 2 + .label y = 4 + .label vx = 5 + .label vy = 7 + //SEG13 [6] call bitmap_init + //SEG14 [57] phi from main to bitmap_init [phi:main->bitmap_init] + bitmap_init_from_main: + jsr bitmap_init + //SEG15 [7] phi from main to main::@8 [phi:main->main::@8] + b8_from_main: + jmp b8 + //SEG16 main::@8 + b8: + //SEG17 [8] call bitmap_clear + //SEG18 [44] phi from main::@8 to bitmap_clear [phi:main::@8->bitmap_clear] + bitmap_clear_from_b8: + jsr bitmap_clear + jmp b9 + //SEG19 main::@9 + b9: + //SEG20 [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + //SEG21 [10] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181] + toD0181_from_b9: + jmp toD0181 + //SEG22 main::toD0181 + toD0181: + jmp b7 + //SEG23 main::@7 + b7: + //SEG24 [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0181_return + sta D018 + //SEG25 [12] call init_irq + jsr init_irq + //SEG26 [13] phi from main::@7 to main::@1 [phi:main::@7->main::@1] + b1_from_b7: + //SEG27 [13] phi (byte) main::vy#2 = (byte) 1 [phi:main::@7->main::@1#0] -- vbuz1=vbuc1 + lda #1 + sta vy + //SEG28 [13] phi (word) main::vx#2 = (byte) 1 [phi:main::@7->main::@1#1] -- vwuz1=vbuc1 + lda #1 + sta vx + lda #0 + sta vx+1 + //SEG29 [13] phi (byte) main::y#2 = (byte) 0 [phi:main::@7->main::@1#2] -- vbuz1=vbuc1 + lda #0 + sta y + //SEG30 [13] phi (word) main::x#2 = (byte) 0 [phi:main::@7->main::@1#3] -- vwuz1=vbuc1 + lda #0 + sta x + lda #0 + sta x+1 + jmp b1 + //SEG31 main::@1 + b1: + jmp b2 + //SEG32 main::@2 + b2: + //SEG33 [14] (word) bitmap_plot::x#0 ← (word) main::x#2 -- vwuz1=vwuz2 + lda x + sta bitmap_plot.x + lda x+1 + sta bitmap_plot.x+1 + //SEG34 [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 -- vbuz1=vbuz2 + lda y + sta bitmap_plot.y + //SEG35 [16] call bitmap_plot + jsr bitmap_plot + jmp b10 + //SEG36 main::@10 + b10: + //SEG37 [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc vx + sta x + lda x+1 + adc vx+1 + sta x+1 + //SEG38 [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 -- vbuz1=vbuz1_plus_vbuz2 + lda y + clc + adc vy + sta y + //SEG39 [19] if((word) main::x#1==(word) $13f) goto main::@5 -- vwuz1_eq_vwuc1_then_la1 + lda x + cmp #<$13f + bne !+ + lda x+1 + cmp #>$13f + beq b5 + !: + jmp b11 + //SEG40 main::@11 + b11: + //SEG41 [20] if((word) main::x#1!=(byte) 0) goto main::@3 -- vwuz1_neq_0_then_la1 + lda x + bne b3_from_b11 + lda x+1 + bne b3_from_b11 + jmp b5 + //SEG42 main::@5 + b5: + //SEG43 [21] (word) main::vx#1 ← - (word) main::vx#2 -- vwuz1=_neg_vwuz1 + sec + lda #0 + sbc vx + sta vx + lda #0 + sbc vx+1 + sta vx+1 + //SEG44 [22] phi from main::@11 main::@5 to main::@3 [phi:main::@11/main::@5->main::@3] + b3_from_b11: + b3_from_b5: + //SEG45 [22] phi (word) main::vx#6 = (word) main::vx#2 [phi:main::@11/main::@5->main::@3#0] -- register_copy + jmp b3 + //SEG46 main::@3 + b3: + //SEG47 [23] if((byte) main::y#1==(byte) $c7) goto main::@6 -- vbuz1_eq_vbuc1_then_la1 + lda #$c7 + cmp y + beq b6 + jmp b12 + //SEG48 main::@12 + b12: + //SEG49 [24] if((byte) main::y#1!=(byte) 0) goto main::@4 -- vbuz1_neq_0_then_la1 + lda y + cmp #0 + bne b4_from_b12 + jmp b6 + //SEG50 main::@6 + b6: + //SEG51 [25] (byte) main::vy#1 ← - (byte) main::vy#2 -- vbuz1=_neg_vbuz1 + lda vy + eor #$ff + clc + adc #1 + sta vy + //SEG52 [26] phi from main::@12 main::@6 to main::@4 [phi:main::@12/main::@6->main::@4] + b4_from_b12: + b4_from_b6: + //SEG53 [26] phi (byte) main::vy#8 = (byte) main::vy#2 [phi:main::@12/main::@6->main::@4#0] -- register_copy + jmp b4 + //SEG54 main::@4 + b4: + //SEG55 [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) -- pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 + ldx frame_cnt + inc plots_per_frame,x + //SEG56 [13] phi from main::@4 to main::@1 [phi:main::@4->main::@1] + b1_from_b4: + //SEG57 [13] phi (byte) main::vy#2 = (byte) main::vy#8 [phi:main::@4->main::@1#0] -- register_copy + //SEG58 [13] phi (word) main::vx#2 = (word) main::vx#6 [phi:main::@4->main::@1#1] -- register_copy + //SEG59 [13] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@4->main::@1#2] -- register_copy + //SEG60 [13] phi (word) main::x#2 = (word) main::x#1 [phi:main::@4->main::@1#3] -- register_copy + jmp b1 +} +//SEG61 bitmap_plot +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage($15) x, byte zeropage($17) y) +bitmap_plot: { + .label _1 = $1a + .label _2 = $1e + .label plotter = $1c + .label x = $15 + .label y = $17 + .label _3 = $18 + //SEG62 [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuz2_word_pbuc2_derefidx_vbuz2 + ldy y + lda bitmap_plot_yhi,y + sta _3+1 + lda bitmap_plot_ylo,y + sta _3 + //SEG63 [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 + lda x + and #<$fff8 + sta _1 + lda x+1 + and #>$fff8 + sta _1+1 + //SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz2_plus_vwuz3 + lda _3 + clc + adc _1 + sta plotter + lda _3+1 + adc _1+1 + sta plotter+1 + //SEG65 [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuz1=_lo_vwuz2 + lda x + sta _2 + //SEG66 [32] *((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),y + ldy _2 + ora bitmap_plot_bit,y + ldy #0 + sta (plotter),y + jmp breturn + //SEG67 bitmap_plot::@return + breturn: + //SEG68 [33] return + rts +} +//SEG69 init_irq +// Setup the IRQ +init_irq: { + //SEG70 asm { sei } + sei + //SEG71 [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2 + // Disable kernal & basic + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + //SEG72 [36] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_IO + sta PROCPORT + //SEG73 [37] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + //SEG74 [38] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // Set raster line to $100 + lda #$80 + ora VIC_CONTROL + sta VIC_CONTROL + //SEG75 [39] *((const byte*) RASTER#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER + //SEG76 [40] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + //SEG77 [41] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() -- _deref_pptc1=pprc2 + // Set the IRQ routine + lda #irq + sta HARDWARE_IRQ+1 + //SEG78 asm { cli } + cli + jmp breturn + //SEG79 init_irq::@return + breturn: + //SEG80 [43] return + rts +} +//SEG81 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 + //SEG82 [45] call memset + //SEG83 [49] phi from bitmap_clear to memset [phi:bitmap_clear->memset] + memset_from_bitmap_clear: + //SEG84 [49] phi (byte) memset::c#3 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuz1=vbuc1 + lda #col + sta memset.c + //SEG85 [49] 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 + //SEG86 [49] 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 + //SEG87 [46] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1] + b1_from_bitmap_clear: + jmp b1 + //SEG88 bitmap_clear::@1 + b1: + //SEG89 [47] call memset + //SEG90 [49] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] + memset_from_b1: + //SEG91 [49] phi (byte) memset::c#3 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuz1=vbuc1 + lda #0 + sta memset.c + //SEG92 [49] 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 + //SEG93 [49] 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 + //SEG94 bitmap_clear::@return + breturn: + //SEG95 [48] return + rts +} +//SEG96 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(8) str, byte zeropage($c) c, word zeropage($a) num) +memset: { + .label end = $1f + .label dst = $d + .label str = 8 + .label num = $a + .label c = $c + //SEG97 [50] (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 + //SEG98 [51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 -- pbuz1=pbuz2 + lda str + sta dst + lda str+1 + sta dst+1 + //SEG99 [52] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] + b1_from_memset: + b1_from_b1: + //SEG100 [52] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy + jmp b1 + //SEG101 memset::@1 + b1: + //SEG102 [53] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuz2 + lda c + ldy #0 + sta (dst),y + //SEG103 [54] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + //SEG104 [55] 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 + //SEG105 memset::@return + breturn: + //SEG106 [56] return + rts +} +//SEG107 bitmap_init +// Initialize bitmap plotting tables +bitmap_init: { + .label _4 = $22 + .label _5 = $23 + .label _6 = $24 + .label _7 = $21 + .label bits = $f + .label x = $10 + .label y = $11 + .label yoffs = $12 + //SEG108 [58] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] + b1_from_bitmap_init: + //SEG109 [58] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuz1=vbuc1 + lda #0 + sta x + //SEG110 [58] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuz1=vbuc1 + lda #$80 + sta bits + jmp b1 + //SEG111 [58] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1] + b1_from_b2: + //SEG112 [58] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy + //SEG113 [58] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy + jmp b1 + //SEG114 bitmap_init::@1 + b1: + //SEG115 [59] *((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 + //SEG116 [60] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuz1=vbuz1_ror_1 + lsr bits + //SEG117 [61] 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 + //SEG118 [63] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2] + b2_from_b1: + //SEG119 [63] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuz1=vbuc1 + lda #$80 + sta bits + jmp b2 + //SEG120 [62] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6] + b6_from_b1: + jmp b6 + //SEG121 bitmap_init::@6 + b6: + //SEG122 [63] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2] + b2_from_b6: + //SEG123 [63] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy + jmp b2 + //SEG124 bitmap_init::@2 + b2: + //SEG125 [64] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuz1=_inc_vbuz1 + inc x + //SEG126 [65] 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 + //SEG127 [66] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] + b3_from_b2: + //SEG128 [66] 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 + //SEG129 [66] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuz1=vbuc1 + lda #0 + sta y + jmp b3 + //SEG130 [66] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3] + b3_from_b4: + //SEG131 [66] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy + //SEG132 [66] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy + jmp b3 + //SEG133 bitmap_init::@3 + b3: + //SEG134 [67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and y + sta _7 + //SEG135 [68] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuz1=_lo_pbuz2 + lda yoffs + sta _4 + //SEG136 [69] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuz1=vbuz2_bor_vbuz3 + lda _7 + ora _4 + sta _5 + //SEG137 [70] *((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 + //SEG138 [71] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuz1=_hi_pbuz2 + lda yoffs+1 + sta _6 + //SEG139 [72] *((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 + //SEG140 [73] 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 + //SEG141 bitmap_init::@5 + b5: + //SEG142 [74] (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 + //SEG143 [75] 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: + //SEG144 [75] 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 + //SEG145 bitmap_init::@4 + b4: + //SEG146 [76] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuz1=_inc_vbuz1 + inc y + //SEG147 [77] 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 + //SEG148 bitmap_init::@return + breturn: + //SEG149 [78] return + rts +} +//SEG150 irq +// Interrupt Routine counting frames +irq: { + //SEG151 entry interrupt(HARDWARE_CLOBBER) + sta rega+1 + stx regx+1 + sty regy+1 + //SEG152 [79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 + lda #WHITE + sta BGCOL + //SEG153 [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1 + lda #0 + cmp frame_cnt + beq b1_from_irq + jmp b2 + //SEG154 irq::@2 + b2: + //SEG155 [81] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0 -- vbuz1=_inc_vbuz1 + inc frame_cnt + //SEG156 [82] phi from irq irq::@2 to irq::@1 [phi:irq/irq::@2->irq::@1] + b1_from_irq: + b1_from_b2: + //SEG157 [82] phi (byte) frame_cnt#10 = (byte) frame_cnt#0 [phi:irq/irq::@2->irq::@1#0] -- register_copy + jmp b1 + //SEG158 irq::@1 + b1: + //SEG159 [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 + lda #BLACK + sta BGCOL + //SEG160 [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + jmp breturn + //SEG161 irq::@return + breturn: + //SEG162 [85] return - exit interrupt(HARDWARE_CLOBBER) + rega: + lda #00 + regx: + ldx #00 + regy: + ldy #00 + rti +} +//SEG163 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 + plots_per_frame: .fill $100, 0 + +REGISTER UPLIFT POTENTIAL REGISTERS +Equivalence Class zp ZP_BYTE:34 [ bitmap_init::$4 ] has ALU potential. +Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a +Statement [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [14] (word) bitmap_plot::x#0 ← (word) main::x#2 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ( main:3 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +Statement [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 [ frame_cnt#0 main::y#2 main::vx#2 main::vy#2 main::x#1 ] ( main:3 [ frame_cnt#0 main::y#2 main::vx#2 main::vy#2 main::x#1 ] ) always clobbers reg byte a +Statement [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a +Statement [19] if((word) main::x#1==(word) $13f) goto main::@5 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a +Statement [20] if((word) main::x#1!=(byte) 0) goto main::@3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a +Statement [21] (word) main::vx#1 ← - (word) main::vx#2 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#1 ] ( main:3 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#1 ] ) always clobbers reg byte a +Statement [25] (byte) main::vy#1 ← - (byte) main::vy#2 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#1 ] ( main:3 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#1 ] ) always clobbers reg byte a +Statement [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ( main:3 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ) always clobbers reg byte x +Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Removing always clobbered register reg byte x as potential for zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +Statement [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::$3 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 ] ) always clobbers reg byte a +Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ) always clobbers reg byte a +Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a +Statement [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a +Statement [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 ] ) always clobbers reg byte a reg byte y +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +Statement [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [36] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [37] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [38] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [39] *((const byte*) RASTER#0) ← (byte) 0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [40] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [41] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [50] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::str#2 memset::c#3 memset::end#0 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 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:12 [ memset::c#3 ] +Statement [51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#3 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a +Statement [53] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#2 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 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:12 [ memset::c#3 ] +Statement [55] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#1 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [74] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:3::bitmap_init:6 [ frame_cnt#0 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:17 [ bitmap_init::y#2 bitmap_init::y#1 ] +Statement [79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( [ ] ) always clobbers reg byte a +Statement [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 [ ] ( [ ] ) always clobbers reg byte a +Statement [85] return [ ] ( [ ] ) always clobbers reg byte a reg byte x reg byte y +Statement [1] (byte) frame_cnt#0 ← (byte) 1 [ frame_cnt#0 ] ( ) always clobbers reg byte a +Statement [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ frame_cnt#0 ] ( main:3 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [14] (word) bitmap_plot::x#0 ← (word) main::x#2 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ( main:3 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 ] ) always clobbers reg byte a +Statement [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 [ frame_cnt#0 main::y#2 main::vx#2 main::vy#2 main::x#1 ] ( main:3 [ frame_cnt#0 main::y#2 main::vx#2 main::vy#2 main::x#1 ] ) always clobbers reg byte a +Statement [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a +Statement [19] if((word) main::x#1==(word) $13f) goto main::@5 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a +Statement [20] if((word) main::x#1!=(byte) 0) goto main::@3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ( main:3 [ frame_cnt#0 main::vx#2 main::vy#2 main::x#1 main::y#1 ] ) always clobbers reg byte a +Statement [21] (word) main::vx#1 ← - (word) main::vx#2 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#1 ] ( main:3 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#1 ] ) always clobbers reg byte a +Statement [23] if((byte) main::y#1==(byte) $c7) goto main::@6 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#6 ] ( main:3 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#6 ] ) always clobbers reg byte a +Statement [24] if((byte) main::y#1!=(byte) 0) goto main::@4 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#6 ] ( main:3 [ frame_cnt#0 main::vy#2 main::x#1 main::y#1 main::vx#6 ] ) always clobbers reg byte a +Statement [25] (byte) main::vy#1 ← - (byte) main::vy#2 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#1 ] ( main:3 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#1 ] ) always clobbers reg byte a +Statement [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ( main:3 [ frame_cnt#0 main::x#1 main::y#1 main::vx#6 main::vy#8 ] ) always clobbers reg byte x +Statement [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::$3 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 ] ) always clobbers reg byte a +Statement [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 [ bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ) always clobbers reg byte a +Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] ) always clobbers reg byte a +Statement [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] ) always clobbers reg byte a +Statement [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[$100]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:3::bitmap_plot:16 [ frame_cnt#0 main::x#2 main::y#2 main::vx#2 main::vy#2 ] ) always clobbers reg byte a reg byte y +Statement [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [36] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [37] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [38] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [39] *((const byte*) RASTER#0) ← (byte) 0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [40] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [41] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() [ ] ( main:3::init_irq:12 [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [50] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::str#2 memset::c#3 memset::end#0 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#3 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a +Statement [53] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#2 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y +Statement [55] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::bitmap_clear:8::memset:45 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#1 ] main:3::bitmap_clear:8::memset:47 [ frame_cnt#0 memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ( main:3::bitmap_init:6 [ frame_cnt#0 bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ) always clobbers reg byte a +Statement [74] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:3::bitmap_init:6 [ frame_cnt#0 bitmap_init::y#2 bitmap_init::yoffs#1 ] ) always clobbers reg byte a +Statement [79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 [ frame_cnt#0 ] ( [ frame_cnt#0 ] ) always clobbers reg byte a +Statement [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 [ ] ( [ ] ) always clobbers reg byte a +Statement [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 [ ] ( [ ] ) always clobbers reg byte a +Statement [85] return [ ] ( [ ] ) always clobbers reg byte a reg byte x reg byte y +Potential registers zp ZP_WORD:2 [ main::x#2 main::x#1 ] : zp ZP_WORD:2 , +Potential registers zp ZP_BYTE:4 [ main::y#2 main::y#1 ] : zp ZP_BYTE:4 , +Potential registers zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] : zp ZP_WORD:5 , +Potential registers zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] : zp ZP_BYTE:7 , +Potential registers zp ZP_WORD:8 [ memset::str#2 ] : zp ZP_WORD:8 , +Potential registers zp ZP_WORD:10 [ memset::num#2 ] : zp ZP_WORD:10 , +Potential registers zp ZP_BYTE:12 [ memset::c#3 ] : zp ZP_BYTE:12 , reg byte x , +Potential registers zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] : zp ZP_WORD:13 , +Potential registers zp ZP_BYTE:15 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] : zp ZP_BYTE:15 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:16 [ bitmap_init::x#2 bitmap_init::x#1 ] : zp ZP_BYTE:16 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:17 [ bitmap_init::y#2 bitmap_init::y#1 ] : zp ZP_BYTE:17 , reg byte x , reg byte y , +Potential registers zp ZP_WORD:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] : zp ZP_WORD:18 , +Potential registers zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] : zp ZP_BYTE:20 , +Potential registers zp ZP_WORD:21 [ bitmap_plot::x#0 ] : zp ZP_WORD:21 , +Potential registers zp ZP_BYTE:23 [ bitmap_plot::y#0 ] : zp ZP_BYTE:23 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:24 [ bitmap_plot::$3 ] : zp ZP_WORD:24 , +Potential registers zp ZP_WORD:26 [ bitmap_plot::$1 ] : zp ZP_WORD:26 , +Potential registers zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] : zp ZP_WORD:28 , +Potential registers zp ZP_BYTE:30 [ bitmap_plot::$2 ] : zp ZP_BYTE:30 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:31 [ memset::end#0 ] : zp ZP_WORD:31 , +Potential registers zp ZP_BYTE:33 [ bitmap_init::$7 ] : zp ZP_BYTE:33 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:34 [ bitmap_init::$4 ] : zp ZP_BYTE:34 , reg byte a , reg byte x , reg byte y , reg byte alu , +Potential registers zp ZP_BYTE:35 [ bitmap_init::$5 ] : zp ZP_BYTE:35 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:36 [ bitmap_init::$6 ] : zp ZP_BYTE:36 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [bitmap_init] 39.88: zp ZP_WORD:18 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] 34.83: zp ZP_BYTE:15 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] 22: zp ZP_BYTE:16 [ bitmap_init::x#2 bitmap_init::x#1 ] 22: zp ZP_BYTE:17 [ bitmap_init::y#2 bitmap_init::y#1 ] 22: zp ZP_BYTE:34 [ bitmap_init::$4 ] 22: zp ZP_BYTE:35 [ bitmap_init::$5 ] 22: zp ZP_BYTE:36 [ bitmap_init::$6 ] 5.5: zp ZP_BYTE:33 [ bitmap_init::$7 ] +Uplift Scope [main] 42.17: zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] 33: zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] 12.25: zp ZP_WORD:2 [ main::x#2 main::x#1 ] 11: zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Uplift Scope [] 45.11: zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Uplift Scope [memset] 38: zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:31 [ memset::end#0 ] 2: zp ZP_WORD:10 [ memset::num#2 ] 1.57: zp ZP_BYTE:12 [ memset::c#3 ] 0: zp ZP_WORD:8 [ memset::str#2 ] +Uplift Scope [bitmap_plot] 15: zp ZP_BYTE:23 [ bitmap_plot::y#0 ] 4: zp ZP_WORD:26 [ bitmap_plot::$1 ] 4: zp ZP_BYTE:30 [ bitmap_plot::$2 ] 3: zp ZP_WORD:21 [ bitmap_plot::x#0 ] 3: zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] 1: zp ZP_WORD:24 [ bitmap_plot::$3 ] +Uplift Scope [bitmap_clear] +Uplift Scope [init_irq] +Uplift Scope [irq] + +Uplifting [bitmap_init] best 4327 combination zp ZP_WORD:18 [ 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:35 [ bitmap_init::$5 ] zp ZP_BYTE:36 [ bitmap_init::$6 ] zp ZP_BYTE:33 [ bitmap_init::$7 ] +Limited combination testing to 100 combinations of 15360 possible. +Uplifting [main] best 4327 combination zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] zp ZP_WORD:2 [ main::x#2 main::x#1 ] zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Uplifting [] best 4327 combination zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Uplifting [memset] best 4311 combination zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:31 [ memset::end#0 ] zp ZP_WORD:10 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:8 [ memset::str#2 ] +Uplifting [bitmap_plot] best 4274 combination reg byte x [ bitmap_plot::y#0 ] zp ZP_WORD:26 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:21 [ bitmap_plot::x#0 ] zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] zp ZP_WORD:24 [ bitmap_plot::$3 ] +Uplifting [bitmap_clear] best 4274 combination +Uplifting [init_irq] best 4274 combination +Uplifting [irq] best 4274 combination +Attempting to uplift remaining variables inzp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Uplifting [] best 4274 combination zp ZP_BYTE:20 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +Uplifting [main] best 4274 combination zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:35 [ bitmap_init::$5 ] +Uplifting [bitmap_init] best 4214 combination reg byte a [ bitmap_init::$5 ] +Attempting to uplift remaining variables inzp ZP_BYTE:36 [ bitmap_init::$6 ] +Uplifting [bitmap_init] best 4154 combination reg byte a [ bitmap_init::$6 ] +Attempting to uplift remaining variables inzp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Uplifting [main] best 4154 combination zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:33 [ bitmap_init::$7 ] +Uplifting [bitmap_init] best 4154 combination zp ZP_BYTE:33 [ bitmap_init::$7 ] +Coalescing zero page register with common assignment [ zp ZP_WORD:2 [ main::x#2 main::x#1 ] ] with [ zp ZP_WORD:21 [ bitmap_plot::x#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ memset::str#2 ] ] with [ zp ZP_WORD:13 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:10 [ memset::num#2 ] ] with [ zp ZP_WORD:31 [ memset::end#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:24 [ bitmap_plot::$3 ] ] with [ zp ZP_WORD:28 [ bitmap_plot::plotter#1 ] ] - score: 1 +Allocated (was zp ZP_WORD:18) zp ZP_WORD:12 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +Allocated (was zp ZP_BYTE:20) zp ZP_BYTE:14 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Allocated (was zp ZP_WORD:24) zp ZP_WORD:15 [ bitmap_plot::$3 bitmap_plot::plotter#1 ] +Allocated (was zp ZP_WORD:26) zp ZP_WORD:17 [ bitmap_plot::$1 ] +Allocated (was zp ZP_BYTE:33) zp ZP_BYTE:19 [ bitmap_init::$7 ] +Interrupt procedure irq clobbers ACNZ +Removing interrupt register storage stx regx+1 in SEG151 entry interrupt(HARDWARE_CLOBBER) +Removing interrupt register storage sty regy+1 in SEG151 entry interrupt(HARDWARE_CLOBBER) +Removing interrupt register storage regx: in SEG162 [85] return - exit interrupt(HARDWARE_CLOBBER) +Removing interrupt register storage ldx #00 in SEG162 [85] return - exit interrupt(HARDWARE_CLOBBER) +Removing interrupt register storage regy: in SEG162 [85] return - exit interrupt(HARDWARE_CLOBBER) +Removing interrupt register storage ldy #00 in SEG162 [85] return - exit interrupt(HARDWARE_CLOBBER) + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 File Comments +// Tests the simple bitmap plotter - and counts plots per frame in an IRQ +//SEG1 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" +//SEG2 Global Constants & labels + // Processor port data direction register + .label PROCPORT_DDR = 0 + // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written + .const PROCPORT_DDR_MEMORY_MASK = 7 + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // RAM in $A000, $E000 I/O in $D000 + .const PROCPORT_RAM_IO = $35 + .label RASTER = $d012 + .label BGCOL = $d021 + .label VIC_CONTROL = $d011 + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label D018 = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // VIC II IRQ Enable Register + .label IRQ_ENABLE = $d01a + // Bits for the IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // CIA#1 Interrupt Status & Control Register + .label CIA1_INTERRUPT = $dc0d + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The vector used when the HARDWARE serves IRQ interrupts + .label HARDWARE_IRQ = $fffe + // The colors of the C64 + .const BLACK = 0 + .const WHITE = 1 + .label BITMAP = $2000 + .label SCREEN = $400 + .label frame_cnt = $e +//SEG3 @begin +bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [1] (byte) frame_cnt#0 ← (byte) 1 -- vbuz1=vbuc1 + // Counts frames - updated by the IRQ + lda #1 + sta frame_cnt +//SEG6 [2] phi from @1 to @2 [phi:@1->@2] +b2_from_b1: + jmp b2 +//SEG7 @2 +b2: +//SEG8 [3] call main +//SEG9 [5] phi from @2 to main [phi:@2->main] +main_from_b2: + jsr main +//SEG10 [4] phi from @2 to @end [phi:@2->@end] +bend_from_b2: + jmp bend +//SEG11 @end +bend: +//SEG12 main +main: { + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label x = 2 + .label y = 4 + .label vx = 5 + .label vy = 7 + //SEG13 [6] call bitmap_init + //SEG14 [57] phi from main to bitmap_init [phi:main->bitmap_init] + bitmap_init_from_main: + jsr bitmap_init + //SEG15 [7] phi from main to main::@8 [phi:main->main::@8] + b8_from_main: + jmp b8 + //SEG16 main::@8 + b8: + //SEG17 [8] call bitmap_clear + //SEG18 [44] phi from main::@8 to bitmap_clear [phi:main::@8->bitmap_clear] + bitmap_clear_from_b8: + jsr bitmap_clear + jmp b9 + //SEG19 main::@9 + b9: + //SEG20 [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + //SEG21 [10] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181] + toD0181_from_b9: + jmp toD0181 + //SEG22 main::toD0181 + toD0181: + jmp b7 + //SEG23 main::@7 + b7: + //SEG24 [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0181_return + sta D018 + //SEG25 [12] call init_irq + jsr init_irq + //SEG26 [13] phi from main::@7 to main::@1 [phi:main::@7->main::@1] + b1_from_b7: + //SEG27 [13] phi (byte) main::vy#2 = (byte) 1 [phi:main::@7->main::@1#0] -- vbuz1=vbuc1 + lda #1 + sta vy + //SEG28 [13] phi (word) main::vx#2 = (byte) 1 [phi:main::@7->main::@1#1] -- vwuz1=vbuc1 + lda #1 + sta vx + lda #0 + sta vx+1 + //SEG29 [13] phi (byte) main::y#2 = (byte) 0 [phi:main::@7->main::@1#2] -- vbuz1=vbuc1 + lda #0 + sta y + //SEG30 [13] phi (word) main::x#2 = (byte) 0 [phi:main::@7->main::@1#3] -- vwuz1=vbuc1 + lda #0 + sta x + lda #0 + sta x+1 + jmp b1 + //SEG31 main::@1 + b1: + jmp b2 + //SEG32 main::@2 + b2: + //SEG33 [14] (word) bitmap_plot::x#0 ← (word) main::x#2 + //SEG34 [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 -- vbuxx=vbuz1 + ldx y + //SEG35 [16] call bitmap_plot + jsr bitmap_plot + jmp b10 + //SEG36 main::@10 + b10: + //SEG37 [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc vx + sta x + lda x+1 + adc vx+1 + sta x+1 + //SEG38 [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 -- vbuz1=vbuz1_plus_vbuz2 + lda y + clc + adc vy + sta y + //SEG39 [19] if((word) main::x#1==(word) $13f) goto main::@5 -- vwuz1_eq_vwuc1_then_la1 + lda x + cmp #<$13f + bne !+ + lda x+1 + cmp #>$13f + beq b5 + !: + jmp b11 + //SEG40 main::@11 + b11: + //SEG41 [20] if((word) main::x#1!=(byte) 0) goto main::@3 -- vwuz1_neq_0_then_la1 + lda x + bne b3_from_b11 + lda x+1 + bne b3_from_b11 + jmp b5 + //SEG42 main::@5 + b5: + //SEG43 [21] (word) main::vx#1 ← - (word) main::vx#2 -- vwuz1=_neg_vwuz1 + sec + lda #0 + sbc vx + sta vx + lda #0 + sbc vx+1 + sta vx+1 + //SEG44 [22] phi from main::@11 main::@5 to main::@3 [phi:main::@11/main::@5->main::@3] + b3_from_b11: + b3_from_b5: + //SEG45 [22] phi (word) main::vx#6 = (word) main::vx#2 [phi:main::@11/main::@5->main::@3#0] -- register_copy + jmp b3 + //SEG46 main::@3 + b3: + //SEG47 [23] if((byte) main::y#1==(byte) $c7) goto main::@6 -- vbuz1_eq_vbuc1_then_la1 + lda #$c7 + cmp y + beq b6 + jmp b12 + //SEG48 main::@12 + b12: + //SEG49 [24] if((byte) main::y#1!=(byte) 0) goto main::@4 -- vbuz1_neq_0_then_la1 + lda y + cmp #0 + bne b4_from_b12 + jmp b6 + //SEG50 main::@6 + b6: + //SEG51 [25] (byte) main::vy#1 ← - (byte) main::vy#2 -- vbuz1=_neg_vbuz1 + lda vy + eor #$ff + clc + adc #1 + sta vy + //SEG52 [26] phi from main::@12 main::@6 to main::@4 [phi:main::@12/main::@6->main::@4] + b4_from_b12: + b4_from_b6: + //SEG53 [26] phi (byte) main::vy#8 = (byte) main::vy#2 [phi:main::@12/main::@6->main::@4#0] -- register_copy + jmp b4 + //SEG54 main::@4 + b4: + //SEG55 [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) -- pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 + ldx frame_cnt + inc plots_per_frame,x + //SEG56 [13] phi from main::@4 to main::@1 [phi:main::@4->main::@1] + b1_from_b4: + //SEG57 [13] phi (byte) main::vy#2 = (byte) main::vy#8 [phi:main::@4->main::@1#0] -- register_copy + //SEG58 [13] phi (word) main::vx#2 = (word) main::vx#6 [phi:main::@4->main::@1#1] -- register_copy + //SEG59 [13] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@4->main::@1#2] -- register_copy + //SEG60 [13] phi (word) main::x#2 = (word) main::x#1 [phi:main::@4->main::@1#3] -- register_copy + jmp b1 +} +//SEG61 bitmap_plot +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage(2) x, byte register(X) y) +bitmap_plot: { + .label _1 = $11 + .label plotter = $f + .label x = 2 + .label _3 = $f + //SEG62 [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx + lda bitmap_plot_yhi,x + sta _3+1 + lda bitmap_plot_ylo,x + sta _3 + //SEG63 [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 + lda x + and #<$fff8 + sta _1 + lda x+1 + and #>$fff8 + sta _1+1 + //SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2 + lda plotter + clc + adc _1 + sta plotter + lda plotter+1 + adc _1+1 + sta plotter+1 + //SEG65 [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuaa=_lo_vwuz1 + lda x + //SEG66 [32] *((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 + //SEG67 bitmap_plot::@return + breturn: + //SEG68 [33] return + rts +} +//SEG69 init_irq +// Setup the IRQ +init_irq: { + //SEG70 asm { sei } + sei + //SEG71 [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2 + // Disable kernal & basic + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + //SEG72 [36] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_IO + sta PROCPORT + //SEG73 [37] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + //SEG74 [38] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // Set raster line to $100 + lda #$80 + ora VIC_CONTROL + sta VIC_CONTROL + //SEG75 [39] *((const byte*) RASTER#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER + //SEG76 [40] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + //SEG77 [41] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() -- _deref_pptc1=pprc2 + // Set the IRQ routine + lda #irq + sta HARDWARE_IRQ+1 + //SEG78 asm { cli } + cli + jmp breturn + //SEG79 init_irq::@return + breturn: + //SEG80 [43] return + rts +} +//SEG81 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 + //SEG82 [45] call memset + //SEG83 [49] phi from bitmap_clear to memset [phi:bitmap_clear->memset] + memset_from_bitmap_clear: + //SEG84 [49] phi (byte) memset::c#3 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 + ldx #col + //SEG85 [49] 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 + //SEG86 [49] 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 + //SEG87 [46] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1] + b1_from_bitmap_clear: + jmp b1 + //SEG88 bitmap_clear::@1 + b1: + //SEG89 [47] call memset + //SEG90 [49] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] + memset_from_b1: + //SEG91 [49] phi (byte) memset::c#3 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 + ldx #0 + //SEG92 [49] 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 + //SEG93 [49] 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 + //SEG94 bitmap_clear::@return + breturn: + //SEG95 [48] return + rts +} +//SEG96 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(8) str, byte register(X) c, word zeropage($a) num) +memset: { + .label end = $a + .label dst = 8 + .label str = 8 + .label num = $a + //SEG97 [50] (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 + //SEG98 [51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + //SEG99 [52] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] + b1_from_memset: + b1_from_b1: + //SEG100 [52] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy + jmp b1 + //SEG101 memset::@1 + b1: + //SEG102 [53] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (dst),y + //SEG103 [54] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + //SEG104 [55] 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 + //SEG105 memset::@return + breturn: + //SEG106 [56] return + rts +} +//SEG107 bitmap_init +// Initialize bitmap plotting tables +bitmap_init: { + .label _7 = $13 + .label yoffs = $c + //SEG108 [58] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] + b1_from_bitmap_init: + //SEG109 [58] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 + ldx #0 + //SEG110 [58] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuaa=vbuc1 + lda #$80 + jmp b1 + //SEG111 [58] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1] + b1_from_b2: + //SEG112 [58] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy + //SEG113 [58] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy + jmp b1 + //SEG114 bitmap_init::@1 + b1: + //SEG115 [59] *((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 + //SEG116 [60] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuaa=vbuaa_ror_1 + lsr + //SEG117 [61] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuaa_neq_0_then_la1 + cmp #0 + bne b6_from_b1 + //SEG118 [63] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2] + b2_from_b1: + //SEG119 [63] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuaa=vbuc1 + lda #$80 + jmp b2 + //SEG120 [62] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6] + b6_from_b1: + jmp b6 + //SEG121 bitmap_init::@6 + b6: + //SEG122 [63] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2] + b2_from_b6: + //SEG123 [63] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy + jmp b2 + //SEG124 bitmap_init::@2 + b2: + //SEG125 [64] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuxx=_inc_vbuxx + inx + //SEG126 [65] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuxx_neq_0_then_la1 + cpx #0 + bne b1_from_b2 + //SEG127 [66] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] + b3_from_b2: + //SEG128 [66] 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 + //SEG129 [66] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuxx=vbuc1 + ldx #0 + jmp b3 + //SEG130 [66] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3] + b3_from_b4: + //SEG131 [66] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy + //SEG132 [66] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy + jmp b3 + //SEG133 bitmap_init::@3 + b3: + //SEG134 [67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 + lda #7 + sax _7 + //SEG135 [68] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuaa=_lo_pbuz1 + lda yoffs + //SEG136 [69] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuaa=vbuz1_bor_vbuaa + ora _7 + //SEG137 [70] *((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 + //SEG138 [71] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuaa=_hi_pbuz1 + lda yoffs+1 + //SEG139 [72] *((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 + //SEG140 [73] 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 + //SEG141 bitmap_init::@5 + b5: + //SEG142 [74] (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 + //SEG143 [75] 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: + //SEG144 [75] 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 + //SEG145 bitmap_init::@4 + b4: + //SEG146 [76] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuxx=_inc_vbuxx + inx + //SEG147 [77] 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 + //SEG148 bitmap_init::@return + breturn: + //SEG149 [78] return + rts +} +//SEG150 irq +// Interrupt Routine counting frames +irq: { + //SEG151 entry interrupt(HARDWARE_CLOBBER) + sta rega+1 + //SEG152 [79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 + lda #WHITE + sta BGCOL + //SEG153 [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1 + lda #0 + cmp frame_cnt + beq b1_from_irq + jmp b2 + //SEG154 irq::@2 + b2: + //SEG155 [81] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0 -- vbuz1=_inc_vbuz1 + inc frame_cnt + //SEG156 [82] phi from irq irq::@2 to irq::@1 [phi:irq/irq::@2->irq::@1] + b1_from_irq: + b1_from_b2: + //SEG157 [82] phi (byte) frame_cnt#10 = (byte) frame_cnt#0 [phi:irq/irq::@2->irq::@1#0] -- register_copy + jmp b1 + //SEG158 irq::@1 + b1: + //SEG159 [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 + lda #BLACK + sta BGCOL + //SEG160 [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + jmp breturn + //SEG161 irq::@return + breturn: + //SEG162 [85] return - exit interrupt(HARDWARE_CLOBBER) + rega: + lda #00 + rti +} +//SEG163 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 + plots_per_frame: .fill $100, 0 + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp b2 +Removing instruction jmp bend +Removing instruction jmp b8 +Removing instruction jmp b9 +Removing instruction jmp toD0181 +Removing instruction jmp b7 +Removing instruction jmp b1 +Removing instruction jmp b2 +Removing instruction jmp b10 +Removing instruction jmp b11 +Removing instruction jmp b5 +Removing instruction jmp b3 +Removing instruction jmp b12 +Removing instruction jmp b6 +Removing instruction jmp b4 +Removing instruction jmp breturn +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 +Removing instruction jmp b2 +Removing instruction jmp b1 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction lda #1 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction lda #0 +Removing instruction ldy #0 +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Replacing label b3_from_b11 with b3 +Replacing label b3_from_b11 with b3 +Replacing label b4_from_b12 with b4 +Replacing label b1 with b2 +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 +Replacing label b1_from_irq with b1 +Removing instruction b1: +Removing instruction b2_from_b1: +Removing instruction main_from_b2: +Removing instruction bend_from_b2: +Removing instruction b8_from_main: +Removing instruction bitmap_clear_from_b8: +Removing instruction toD0181_from_b9: +Removing instruction toD0181: +Removing instruction b1: +Removing instruction b3_from_b11: +Removing instruction b3_from_b5: +Removing instruction b4_from_b12: +Removing instruction b4_from_b6: +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: +Removing instruction b1_from_irq: +Removing instruction b1_from_b2: +Removing instruction breturn: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction b2: +Removing instruction bend: +Removing instruction bitmap_init_from_main: +Removing instruction b8: +Removing instruction b9: +Removing instruction b7: +Removing instruction b1_from_b7: +Removing instruction b10: +Removing instruction b11: +Removing instruction b12: +Removing instruction b1_from_b4: +Removing instruction breturn: +Removing instruction breturn: +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: +Removing instruction b2: +Succesful ASM optimization Pass5UnusedLabelElimination +Adding RTS to root block +Succesful ASM optimization Pass5AddMainRts +Removing instruction jmp b1 +Removing instruction jmp b2 +Removing instruction jmp b3 +Succesful ASM optimization Pass5NextJumpElimination + +FINAL SYMBOL TABLE +(label) @1 +(label) @2 +(label) @begin +(label) @end +(byte*) BGCOL +(const byte*) BGCOL#0 BGCOL = (byte*) 53281 +(byte*) BITMAP +(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(byte) BLACK +(const byte) BLACK#0 BLACK = (byte) 0 +(byte*) CIA1_INTERRUPT +(const byte*) CIA1_INTERRUPT#0 CIA1_INTERRUPT = (byte*) 56333 +(byte) CIA_INTERRUPT_CLEAR +(const byte) CIA_INTERRUPT_CLEAR#0 CIA_INTERRUPT_CLEAR = (byte) $7f +(byte*) D011 +(const byte*) D011#0 D011 = (byte*) 53265 +(byte*) D018 +(const byte*) D018#0 D018 = (byte*) 53272 +(void()**) HARDWARE_IRQ +(const void()**) HARDWARE_IRQ#0 HARDWARE_IRQ = (void()**) 65534 +(byte*) IRQ_ENABLE +(const byte*) IRQ_ENABLE#0 IRQ_ENABLE = (byte*) 53274 +(byte) IRQ_RASTER +(const byte) IRQ_RASTER#0 IRQ_RASTER = (byte) 1 +(byte*) IRQ_STATUS +(const byte*) IRQ_STATUS#0 IRQ_STATUS = (byte*) 53273 +(byte*) PROCPORT +(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 +(byte*) PROCPORT_DDR +(const byte*) PROCPORT_DDR#0 PROCPORT_DDR = (byte*) 0 +(byte) PROCPORT_DDR_MEMORY_MASK +(const byte) PROCPORT_DDR_MEMORY_MASK#0 PROCPORT_DDR_MEMORY_MASK = (byte) 7 +(byte) PROCPORT_RAM_IO +(const byte) PROCPORT_RAM_IO#0 PROCPORT_RAM_IO = (byte) $35 +(byte*) RASTER +(const byte*) RASTER#0 RASTER = (byte*) 53266 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(byte) VIC_BMM +(const byte) VIC_BMM#0 VIC_BMM = (byte) $20 +(byte*) VIC_CONTROL +(const byte*) VIC_CONTROL#0 VIC_CONTROL = (byte*) 53265 +(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 +(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:19 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:12 22.0 +(byte*) bitmap_init::yoffs#2 yoffs zp ZP_WORD:12 6.875 +(byte*) bitmap_init::yoffs#4 yoffs zp ZP_WORD:12 11.0 +(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) +(word~) bitmap_plot::$1 $1 zp ZP_WORD:17 4.0 +(byte~) bitmap_plot::$2 reg byte a 4.0 +(word~) bitmap_plot::$3 $3 zp ZP_WORD:15 1.0 +(label) bitmap_plot::@return +(byte*) bitmap_plot::plotter +(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:15 3.0 +(word) bitmap_plot::x +(word) bitmap_plot::x#0 x zp ZP_WORD:2 3.0 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 reg byte x 15.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 +(byte) frame_cnt +(byte) frame_cnt#0 frame_cnt zp ZP_BYTE:14 1.1111111111111112 +(byte) frame_cnt#1 frame_cnt zp ZP_BYTE:14 4.0 +(byte) frame_cnt#10 frame_cnt zp ZP_BYTE:14 40.0 +(void()) init_irq() +(label) init_irq::@return +interrupt(HARDWARE_CLOBBER)(void()) irq() +(label) irq::@1 +(label) irq::@2 +(label) irq::@return +(void()) main() +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(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 +(word) main::vx +(word) main::vx#1 vx zp ZP_WORD:5 22.0 +(word) main::vx#2 vx zp ZP_WORD:5 5.5 +(word) main::vx#6 vx zp ZP_WORD:5 5.5 +(byte) main::vy +(byte) main::vy#1 vy zp ZP_BYTE:7 22.0 +(byte) main::vy#2 vy zp ZP_BYTE:7 3.6666666666666665 +(byte) main::vy#8 vy zp ZP_BYTE:7 16.5 +(word) main::x +(word) main::x#1 x zp ZP_WORD:2 4.0 +(word) main::x#2 x zp ZP_WORD:2 8.25 +(byte) main::y +(byte) main::y#1 y zp ZP_BYTE:4 4.4 +(byte) main::y#2 y zp ZP_BYTE:4 6.6000000000000005 +(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:8 16.5 +(byte*) memset::dst#2 dst zp ZP_WORD:8 17.5 +(byte*~) memset::dst#3 dst zp ZP_WORD:8 4.0 +(byte*) memset::end +(byte*) memset::end#0 end zp ZP_WORD:10 2.1666666666666665 +(word) memset::num +(word) memset::num#2 num zp ZP_WORD:10 2.0 +(void*) memset::return +(void*) memset::str +(void*) memset::str#2 str zp ZP_WORD:8 +(byte[$100]) plots_per_frame +(const byte[$100]) plots_per_frame#0 plots_per_frame = { fill( $100, 0) } + +zp ZP_WORD:2 [ main::x#2 main::x#1 bitmap_plot::x#0 ] +zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] +zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +zp ZP_WORD:8 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] +zp ZP_WORD:10 [ 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:12 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +zp ZP_BYTE:14 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +reg byte x [ bitmap_plot::y#0 ] +zp ZP_WORD:15 [ bitmap_plot::$3 bitmap_plot::plotter#1 ] +zp ZP_WORD:17 [ bitmap_plot::$1 ] +reg byte a [ bitmap_plot::$2 ] +zp ZP_BYTE:19 [ bitmap_init::$7 ] +reg byte a [ bitmap_init::$4 ] +reg byte a [ bitmap_init::$5 ] +reg byte a [ bitmap_init::$6 ] + + +FINAL ASSEMBLER +Score: 3136 + +//SEG0 File Comments +// Tests the simple bitmap plotter - and counts plots per frame in an IRQ +//SEG1 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" +//SEG2 Global Constants & labels + // Processor port data direction register + .label PROCPORT_DDR = 0 + // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written + .const PROCPORT_DDR_MEMORY_MASK = 7 + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // RAM in $A000, $E000 I/O in $D000 + .const PROCPORT_RAM_IO = $35 + .label RASTER = $d012 + .label BGCOL = $d021 + .label VIC_CONTROL = $d011 + .label D011 = $d011 + .const VIC_BMM = $20 + .const VIC_DEN = $10 + .const VIC_RSEL = 8 + .label D018 = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // VIC II IRQ Enable Register + .label IRQ_ENABLE = $d01a + // Bits for the IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // CIA#1 Interrupt Status & Control Register + .label CIA1_INTERRUPT = $dc0d + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The vector used when the HARDWARE serves IRQ interrupts + .label HARDWARE_IRQ = $fffe + // The colors of the C64 + .const BLACK = 0 + .const WHITE = 1 + .label BITMAP = $2000 + .label SCREEN = $400 + .label frame_cnt = $e +//SEG3 @begin +bbegin: +//SEG4 @1 +//SEG5 [1] (byte) frame_cnt#0 ← (byte) 1 -- vbuz1=vbuc1 + // Counts frames - updated by the IRQ + lda #1 + sta frame_cnt +//SEG6 [2] phi from @1 to @2 [phi:@1->@2] +//SEG7 @2 +//SEG8 [3] call main +//SEG9 [5] phi from @2 to main [phi:@2->main] + jsr main + rts +//SEG10 [4] phi from @2 to @end [phi:@2->@end] +//SEG11 @end +//SEG12 main +main: { + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f + .label x = 2 + .label y = 4 + .label vx = 5 + .label vy = 7 + //SEG13 [6] call bitmap_init + //SEG14 [57] phi from main to bitmap_init [phi:main->bitmap_init] + jsr bitmap_init + //SEG15 [7] phi from main to main::@8 [phi:main->main::@8] + //SEG16 main::@8 + //SEG17 [8] call bitmap_clear + //SEG18 [44] phi from main::@8 to bitmap_clear [phi:main::@8->bitmap_clear] + jsr bitmap_clear + //SEG19 main::@9 + //SEG20 [9] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3 -- _deref_pbuc1=vbuc2 + lda #VIC_BMM|VIC_DEN|VIC_RSEL|3 + sta D011 + //SEG21 [10] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181] + //SEG22 main::toD0181 + //SEG23 main::@7 + //SEG24 [11] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + lda #toD0181_return + sta D018 + //SEG25 [12] call init_irq + jsr init_irq + //SEG26 [13] phi from main::@7 to main::@1 [phi:main::@7->main::@1] + //SEG27 [13] phi (byte) main::vy#2 = (byte) 1 [phi:main::@7->main::@1#0] -- vbuz1=vbuc1 + lda #1 + sta vy + //SEG28 [13] phi (word) main::vx#2 = (byte) 1 [phi:main::@7->main::@1#1] -- vwuz1=vbuc1 + sta vx + lda #0 + sta vx+1 + //SEG29 [13] phi (byte) main::y#2 = (byte) 0 [phi:main::@7->main::@1#2] -- vbuz1=vbuc1 + sta y + //SEG30 [13] phi (word) main::x#2 = (byte) 0 [phi:main::@7->main::@1#3] -- vwuz1=vbuc1 + sta x + sta x+1 + //SEG31 main::@1 + //SEG32 main::@2 + b2: + //SEG33 [14] (word) bitmap_plot::x#0 ← (word) main::x#2 + //SEG34 [15] (byte) bitmap_plot::y#0 ← (byte) main::y#2 -- vbuxx=vbuz1 + ldx y + //SEG35 [16] call bitmap_plot + jsr bitmap_plot + //SEG36 main::@10 + //SEG37 [17] (word) main::x#1 ← (word) main::x#2 + (word) main::vx#2 -- vwuz1=vwuz1_plus_vwuz2 + lda x + clc + adc vx + sta x + lda x+1 + adc vx+1 + sta x+1 + //SEG38 [18] (byte) main::y#1 ← (byte) main::y#2 + (byte) main::vy#2 -- vbuz1=vbuz1_plus_vbuz2 + lda y + clc + adc vy + sta y + //SEG39 [19] if((word) main::x#1==(word) $13f) goto main::@5 -- vwuz1_eq_vwuc1_then_la1 + lda x + cmp #<$13f + bne !+ + lda x+1 + cmp #>$13f + beq b5 + !: + //SEG40 main::@11 + //SEG41 [20] if((word) main::x#1!=(byte) 0) goto main::@3 -- vwuz1_neq_0_then_la1 + lda x + bne b3 + lda x+1 + bne b3 + //SEG42 main::@5 + b5: + //SEG43 [21] (word) main::vx#1 ← - (word) main::vx#2 -- vwuz1=_neg_vwuz1 + sec + lda #0 + sbc vx + sta vx + lda #0 + sbc vx+1 + sta vx+1 + //SEG44 [22] phi from main::@11 main::@5 to main::@3 [phi:main::@11/main::@5->main::@3] + //SEG45 [22] phi (word) main::vx#6 = (word) main::vx#2 [phi:main::@11/main::@5->main::@3#0] -- register_copy + //SEG46 main::@3 + b3: + //SEG47 [23] if((byte) main::y#1==(byte) $c7) goto main::@6 -- vbuz1_eq_vbuc1_then_la1 + lda #$c7 + cmp y + beq b6 + //SEG48 main::@12 + //SEG49 [24] if((byte) main::y#1!=(byte) 0) goto main::@4 -- vbuz1_neq_0_then_la1 + lda y + cmp #0 + bne b4 + //SEG50 main::@6 + b6: + //SEG51 [25] (byte) main::vy#1 ← - (byte) main::vy#2 -- vbuz1=_neg_vbuz1 + lda vy + eor #$ff + clc + adc #1 + sta vy + //SEG52 [26] phi from main::@12 main::@6 to main::@4 [phi:main::@12/main::@6->main::@4] + //SEG53 [26] phi (byte) main::vy#8 = (byte) main::vy#2 [phi:main::@12/main::@6->main::@4#0] -- register_copy + //SEG54 main::@4 + b4: + //SEG55 [27] *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) ← ++ *((const byte[$100]) plots_per_frame#0 + (byte) frame_cnt#0) -- pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 + ldx frame_cnt + inc plots_per_frame,x + //SEG56 [13] phi from main::@4 to main::@1 [phi:main::@4->main::@1] + //SEG57 [13] phi (byte) main::vy#2 = (byte) main::vy#8 [phi:main::@4->main::@1#0] -- register_copy + //SEG58 [13] phi (word) main::vx#2 = (word) main::vx#6 [phi:main::@4->main::@1#1] -- register_copy + //SEG59 [13] phi (byte) main::y#2 = (byte) main::y#1 [phi:main::@4->main::@1#2] -- register_copy + //SEG60 [13] phi (word) main::x#2 = (word) main::x#1 [phi:main::@4->main::@1#3] -- register_copy + jmp b2 +} +//SEG61 bitmap_plot +// Plot a single dot in the bitmap +// bitmap_plot(word zeropage(2) x, byte register(X) y) +bitmap_plot: { + .label _1 = $11 + .label plotter = $f + .label x = 2 + .label _3 = $f + //SEG62 [28] (word~) bitmap_plot::$3 ← *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx + lda bitmap_plot_yhi,x + sta _3+1 + lda bitmap_plot_ylo,x + sta _3 + //SEG63 [29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word) $fff8 -- vwuz1=vwuz2_band_vwuc1 + lda x + and #<$fff8 + sta _1 + lda x+1 + and #>$fff8 + sta _1+1 + //SEG64 [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 -- pbuz1=pbuz1_plus_vwuz2 + lda plotter + clc + adc _1 + sta plotter + lda plotter+1 + adc _1+1 + sta plotter+1 + //SEG65 [31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 -- vbuaa=_lo_vwuz1 + lda x + //SEG66 [32] *((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 + sta (plotter),y + //SEG67 bitmap_plot::@return + //SEG68 [33] return + rts +} +//SEG69 init_irq +// Setup the IRQ +init_irq: { + //SEG70 asm { sei } + sei + //SEG71 [35] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2 + // Disable kernal & basic + lda #PROCPORT_DDR_MEMORY_MASK + sta PROCPORT_DDR + //SEG72 [36] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_IO + sta PROCPORT + //SEG73 [37] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + //SEG74 [38] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // Set raster line to $100 + lda #$80 + ora VIC_CONTROL + sta VIC_CONTROL + //SEG75 [39] *((const byte*) RASTER#0) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER + //SEG76 [40] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + //SEG77 [41] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) irq() -- _deref_pptc1=pprc2 + // Set the IRQ routine + lda #irq + sta HARDWARE_IRQ+1 + //SEG78 asm { cli } + cli + //SEG79 init_irq::@return + //SEG80 [43] return + rts +} +//SEG81 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 + //SEG82 [45] call memset + //SEG83 [49] phi from bitmap_clear to memset [phi:bitmap_clear->memset] + //SEG84 [49] phi (byte) memset::c#3 = (const byte) bitmap_clear::col#0 [phi:bitmap_clear->memset#0] -- vbuxx=vbuc1 + ldx #col + //SEG85 [49] 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 + //SEG86 [49] 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 + //SEG87 [46] phi from bitmap_clear to bitmap_clear::@1 [phi:bitmap_clear->bitmap_clear::@1] + //SEG88 bitmap_clear::@1 + //SEG89 [47] call memset + //SEG90 [49] phi from bitmap_clear::@1 to memset [phi:bitmap_clear::@1->memset] + //SEG91 [49] phi (byte) memset::c#3 = (byte) 0 [phi:bitmap_clear::@1->memset#0] -- vbuxx=vbuc1 + ldx #0 + //SEG92 [49] 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 + //SEG93 [49] 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 + //SEG94 bitmap_clear::@return + //SEG95 [48] return + rts +} +//SEG96 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(8) str, byte register(X) c, word zeropage($a) num) +memset: { + .label end = $a + .label dst = 8 + .label str = 8 + .label num = $a + //SEG97 [50] (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 + //SEG98 [51] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 + //SEG99 [52] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] + //SEG100 [52] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy + //SEG101 memset::@1 + b1: + //SEG102 [53] *((byte*) memset::dst#2) ← (byte) memset::c#3 -- _deref_pbuz1=vbuxx + txa + ldy #0 + sta (dst),y + //SEG103 [54] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1 + inc dst + bne !+ + inc dst+1 + !: + //SEG104 [55] 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 + //SEG105 memset::@return + //SEG106 [56] return + rts +} +//SEG107 bitmap_init +// Initialize bitmap plotting tables +bitmap_init: { + .label _7 = $13 + .label yoffs = $c + //SEG108 [58] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] + //SEG109 [58] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 + ldx #0 + //SEG110 [58] phi (byte) bitmap_init::bits#3 = (byte) $80 [phi:bitmap_init->bitmap_init::@1#1] -- vbuaa=vbuc1 + lda #$80 + //SEG111 [58] phi from bitmap_init::@2 to bitmap_init::@1 [phi:bitmap_init::@2->bitmap_init::@1] + //SEG112 [58] phi (byte) bitmap_init::x#2 = (byte) bitmap_init::x#1 [phi:bitmap_init::@2->bitmap_init::@1#0] -- register_copy + //SEG113 [58] phi (byte) bitmap_init::bits#3 = (byte) bitmap_init::bits#4 [phi:bitmap_init::@2->bitmap_init::@1#1] -- register_copy + //SEG114 bitmap_init::@1 + b1: + //SEG115 [59] *((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 + //SEG116 [60] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte) 1 -- vbuaa=vbuaa_ror_1 + lsr + //SEG117 [61] if((byte) bitmap_init::bits#1!=(byte) 0) goto bitmap_init::@6 -- vbuaa_neq_0_then_la1 + cmp #0 + bne b2 + //SEG118 [63] phi from bitmap_init::@1 to bitmap_init::@2 [phi:bitmap_init::@1->bitmap_init::@2] + //SEG119 [63] phi (byte) bitmap_init::bits#4 = (byte) $80 [phi:bitmap_init::@1->bitmap_init::@2#0] -- vbuaa=vbuc1 + lda #$80 + //SEG120 [62] phi from bitmap_init::@1 to bitmap_init::@6 [phi:bitmap_init::@1->bitmap_init::@6] + //SEG121 bitmap_init::@6 + //SEG122 [63] phi from bitmap_init::@6 to bitmap_init::@2 [phi:bitmap_init::@6->bitmap_init::@2] + //SEG123 [63] phi (byte) bitmap_init::bits#4 = (byte) bitmap_init::bits#1 [phi:bitmap_init::@6->bitmap_init::@2#0] -- register_copy + //SEG124 bitmap_init::@2 + b2: + //SEG125 [64] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 -- vbuxx=_inc_vbuxx + inx + //SEG126 [65] if((byte) bitmap_init::x#1!=(byte) 0) goto bitmap_init::@1 -- vbuxx_neq_0_then_la1 + cpx #0 + bne b1 + //SEG127 [66] phi from bitmap_init::@2 to bitmap_init::@3 [phi:bitmap_init::@2->bitmap_init::@3] + //SEG128 [66] 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 + //SEG129 [66] phi (byte) bitmap_init::y#2 = (byte) 0 [phi:bitmap_init::@2->bitmap_init::@3#1] -- vbuxx=vbuc1 + ldx #0 + //SEG130 [66] phi from bitmap_init::@4 to bitmap_init::@3 [phi:bitmap_init::@4->bitmap_init::@3] + //SEG131 [66] phi (byte*) bitmap_init::yoffs#2 = (byte*) bitmap_init::yoffs#4 [phi:bitmap_init::@4->bitmap_init::@3#0] -- register_copy + //SEG132 [66] phi (byte) bitmap_init::y#2 = (byte) bitmap_init::y#1 [phi:bitmap_init::@4->bitmap_init::@3#1] -- register_copy + //SEG133 bitmap_init::@3 + b3: + //SEG134 [67] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 + lda #7 + sax _7 + //SEG135 [68] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 -- vbuaa=_lo_pbuz1 + lda yoffs + //SEG136 [69] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$7 | (byte~) bitmap_init::$4 -- vbuaa=vbuz1_bor_vbuaa + ora _7 + //SEG137 [70] *((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 + //SEG138 [71] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 -- vbuaa=_hi_pbuz1 + lda yoffs+1 + //SEG139 [72] *((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 + //SEG140 [73] if((byte~) bitmap_init::$7!=(byte) 7) goto bitmap_init::@4 -- vbuz1_neq_vbuc1_then_la1 + lda #7 + cmp _7 + bne b4 + //SEG141 bitmap_init::@5 + //SEG142 [74] (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 + //SEG143 [75] phi from bitmap_init::@3 bitmap_init::@5 to bitmap_init::@4 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4] + //SEG144 [75] phi (byte*) bitmap_init::yoffs#4 = (byte*) bitmap_init::yoffs#2 [phi:bitmap_init::@3/bitmap_init::@5->bitmap_init::@4#0] -- register_copy + //SEG145 bitmap_init::@4 + b4: + //SEG146 [76] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 -- vbuxx=_inc_vbuxx + inx + //SEG147 [77] if((byte) bitmap_init::y#1!=(byte) 0) goto bitmap_init::@3 -- vbuxx_neq_0_then_la1 + cpx #0 + bne b3 + //SEG148 bitmap_init::@return + //SEG149 [78] return + rts +} +//SEG150 irq +// Interrupt Routine counting frames +irq: { + //SEG151 entry interrupt(HARDWARE_CLOBBER) + sta rega+1 + //SEG152 [79] *((const byte*) BGCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 + lda #WHITE + sta BGCOL + //SEG153 [80] if((byte) 0==(byte) frame_cnt#0) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1 + lda #0 + cmp frame_cnt + beq b1 + //SEG154 irq::@2 + //SEG155 [81] (byte) frame_cnt#1 ← ++ (byte) frame_cnt#0 -- vbuz1=_inc_vbuz1 + inc frame_cnt + //SEG156 [82] phi from irq irq::@2 to irq::@1 [phi:irq/irq::@2->irq::@1] + //SEG157 [82] phi (byte) frame_cnt#10 = (byte) frame_cnt#0 [phi:irq/irq::@2->irq::@1#0] -- register_copy + //SEG158 irq::@1 + b1: + //SEG159 [83] *((const byte*) BGCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 + lda #BLACK + sta BGCOL + //SEG160 [84] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + //SEG161 irq::@return + //SEG162 [85] return - exit interrupt(HARDWARE_CLOBBER) + rega: + lda #00 + rti +} +//SEG163 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 + plots_per_frame: .fill $100, 0 + diff --git a/src/test/ref/bitmap-plot.sym b/src/test/ref/bitmap-plot.sym new file mode 100644 index 000000000..5028954b8 --- /dev/null +++ b/src/test/ref/bitmap-plot.sym @@ -0,0 +1,192 @@ +(label) @1 +(label) @2 +(label) @begin +(label) @end +(byte*) BGCOL +(const byte*) BGCOL#0 BGCOL = (byte*) 53281 +(byte*) BITMAP +(const byte*) BITMAP#0 BITMAP = (byte*) 8192 +(byte) BLACK +(const byte) BLACK#0 BLACK = (byte) 0 +(byte*) CIA1_INTERRUPT +(const byte*) CIA1_INTERRUPT#0 CIA1_INTERRUPT = (byte*) 56333 +(byte) CIA_INTERRUPT_CLEAR +(const byte) CIA_INTERRUPT_CLEAR#0 CIA_INTERRUPT_CLEAR = (byte) $7f +(byte*) D011 +(const byte*) D011#0 D011 = (byte*) 53265 +(byte*) D018 +(const byte*) D018#0 D018 = (byte*) 53272 +(void()**) HARDWARE_IRQ +(const void()**) HARDWARE_IRQ#0 HARDWARE_IRQ = (void()**) 65534 +(byte*) IRQ_ENABLE +(const byte*) IRQ_ENABLE#0 IRQ_ENABLE = (byte*) 53274 +(byte) IRQ_RASTER +(const byte) IRQ_RASTER#0 IRQ_RASTER = (byte) 1 +(byte*) IRQ_STATUS +(const byte*) IRQ_STATUS#0 IRQ_STATUS = (byte*) 53273 +(byte*) PROCPORT +(const byte*) PROCPORT#0 PROCPORT = (byte*) 1 +(byte*) PROCPORT_DDR +(const byte*) PROCPORT_DDR#0 PROCPORT_DDR = (byte*) 0 +(byte) PROCPORT_DDR_MEMORY_MASK +(const byte) PROCPORT_DDR_MEMORY_MASK#0 PROCPORT_DDR_MEMORY_MASK = (byte) 7 +(byte) PROCPORT_RAM_IO +(const byte) PROCPORT_RAM_IO#0 PROCPORT_RAM_IO = (byte) $35 +(byte*) RASTER +(const byte*) RASTER#0 RASTER = (byte*) 53266 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = (byte*) 1024 +(byte) VIC_BMM +(const byte) VIC_BMM#0 VIC_BMM = (byte) $20 +(byte*) VIC_CONTROL +(const byte*) VIC_CONTROL#0 VIC_CONTROL = (byte*) 53265 +(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 +(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:19 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:12 22.0 +(byte*) bitmap_init::yoffs#2 yoffs zp ZP_WORD:12 6.875 +(byte*) bitmap_init::yoffs#4 yoffs zp ZP_WORD:12 11.0 +(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) +(word~) bitmap_plot::$1 $1 zp ZP_WORD:17 4.0 +(byte~) bitmap_plot::$2 reg byte a 4.0 +(word~) bitmap_plot::$3 $3 zp ZP_WORD:15 1.0 +(label) bitmap_plot::@return +(byte*) bitmap_plot::plotter +(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:15 3.0 +(word) bitmap_plot::x +(word) bitmap_plot::x#0 x zp ZP_WORD:2 3.0 +(byte) bitmap_plot::y +(byte) bitmap_plot::y#0 reg byte x 15.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 +(byte) frame_cnt +(byte) frame_cnt#0 frame_cnt zp ZP_BYTE:14 1.1111111111111112 +(byte) frame_cnt#1 frame_cnt zp ZP_BYTE:14 4.0 +(byte) frame_cnt#10 frame_cnt zp ZP_BYTE:14 40.0 +(void()) init_irq() +(label) init_irq::@return +interrupt(HARDWARE_CLOBBER)(void()) irq() +(label) irq::@1 +(label) irq::@2 +(label) irq::@return +(void()) main() +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(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 +(word) main::vx +(word) main::vx#1 vx zp ZP_WORD:5 22.0 +(word) main::vx#2 vx zp ZP_WORD:5 5.5 +(word) main::vx#6 vx zp ZP_WORD:5 5.5 +(byte) main::vy +(byte) main::vy#1 vy zp ZP_BYTE:7 22.0 +(byte) main::vy#2 vy zp ZP_BYTE:7 3.6666666666666665 +(byte) main::vy#8 vy zp ZP_BYTE:7 16.5 +(word) main::x +(word) main::x#1 x zp ZP_WORD:2 4.0 +(word) main::x#2 x zp ZP_WORD:2 8.25 +(byte) main::y +(byte) main::y#1 y zp ZP_BYTE:4 4.4 +(byte) main::y#2 y zp ZP_BYTE:4 6.6000000000000005 +(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:8 16.5 +(byte*) memset::dst#2 dst zp ZP_WORD:8 17.5 +(byte*~) memset::dst#3 dst zp ZP_WORD:8 4.0 +(byte*) memset::end +(byte*) memset::end#0 end zp ZP_WORD:10 2.1666666666666665 +(word) memset::num +(word) memset::num#2 num zp ZP_WORD:10 2.0 +(void*) memset::return +(void*) memset::str +(void*) memset::str#2 str zp ZP_WORD:8 +(byte[$100]) plots_per_frame +(const byte[$100]) plots_per_frame#0 plots_per_frame = { fill( $100, 0) } + +zp ZP_WORD:2 [ main::x#2 main::x#1 bitmap_plot::x#0 ] +zp ZP_BYTE:4 [ main::y#2 main::y#1 ] +zp ZP_WORD:5 [ main::vx#2 main::vx#6 main::vx#1 ] +zp ZP_BYTE:7 [ main::vy#2 main::vy#8 main::vy#1 ] +zp ZP_WORD:8 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] +zp ZP_WORD:10 [ 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:12 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] +zp ZP_BYTE:14 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +reg byte x [ bitmap_plot::y#0 ] +zp ZP_WORD:15 [ bitmap_plot::$3 bitmap_plot::plotter#1 ] +zp ZP_WORD:17 [ bitmap_plot::$1 ] +reg byte a [ bitmap_plot::$2 ] +zp ZP_BYTE:19 [ 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/bitmap-plotter.log b/src/test/ref/bitmap-plotter.log index 3171cb46e..2fff077b2 100644 --- a/src/test/ref/bitmap-plotter.log +++ b/src/test/ref/bitmap-plotter.log @@ -1443,6 +1443,7 @@ init_screen: { //SEG120 [69] return rts } +//SEG121 File Data plots_x: .byte $3c, $50, $6e, $50, $3c, $28, $a, $28 plots_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28 plot_xlo: .fill $100, 0 @@ -1928,6 +1929,7 @@ init_screen: { //SEG120 [69] return rts } +//SEG121 File Data plots_x: .byte $3c, $50, $6e, $50, $3c, $28, $a, $28 plots_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28 plot_xlo: .fill $100, 0 @@ -2452,6 +2454,7 @@ init_screen: { //SEG120 [69] return rts } +//SEG121 File Data plots_x: .byte $3c, $50, $6e, $50, $3c, $28, $a, $28 plots_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28 plot_xlo: .fill $100, 0 diff --git a/src/test/ref/bitwise-not.log b/src/test/ref/bitwise-not.log index c092b9c6c..28e5b1ef6 100644 --- a/src/test/ref/bitwise-not.log +++ b/src/test/ref/bitwise-not.log @@ -185,6 +185,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← ~(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -256,6 +257,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -341,4 +343,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/bool-const.log b/src/test/ref/bool-const.log index 6e33c6fe4..7bba1440e 100644 --- a/src/test/ref/bool-const.log +++ b/src/test/ref/bool-const.log @@ -486,6 +486,7 @@ bool_const_if: { //SEG37 [19] return rts } +//SEG38 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] *((const byte*) SCREEN#0+(byte) 2) ← (byte) 't' [ ] ( main:2::bool_const_inline:9 [ ] ) always clobbers reg byte a @@ -605,6 +606,7 @@ bool_const_if: { //SEG37 [19] return rts } +//SEG38 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -744,4 +746,5 @@ bool_const_if: { //SEG37 [19] return rts } +//SEG38 File Data diff --git a/src/test/ref/bool-function.log b/src/test/ref/bool-function.log index a8627f6cb..3c3e94d1d 100644 --- a/src/test/ref/bool-function.log +++ b/src/test/ref/bool-function.log @@ -408,6 +408,7 @@ isSet: { //SEG38 [21] return rts } +//SEG39 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (bool) isSet::b#0 ← (byte~) main::$0 == (byte) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a @@ -551,6 +552,7 @@ isSet: { //SEG38 [21] return rts } +//SEG39 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -712,4 +714,5 @@ isSet: { //SEG38 [21] return rts } +//SEG39 File Data diff --git a/src/test/ref/bool-ifs.log b/src/test/ref/bool-ifs.log index bd52c1ade..95454b3e1 100644 --- a/src/test/ref/bool-ifs.log +++ b/src/test/ref/bool-ifs.log @@ -981,6 +981,7 @@ bool_and: { sta screen,y jmp b3 } +//SEG107 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [20] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) '*' [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] ) always clobbers reg byte a @@ -1314,6 +1315,7 @@ bool_and: { sta screen,x jmp b3 } +//SEG107 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1687,4 +1689,5 @@ bool_and: { sta screen,x jmp b3 } +//SEG107 File Data diff --git a/src/test/ref/bool-nullpointer-exception.log b/src/test/ref/bool-nullpointer-exception.log index 86b19264a..570e57711 100644 --- a/src/test/ref/bool-nullpointer-exception.log +++ b/src/test/ref/bool-nullpointer-exception.log @@ -190,6 +190,7 @@ main: { bne b1_from_b2 jmp b2 } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BOOL:2 [ framedone#2 ] : zp ZP_BOOL:2 , reg byte a , @@ -247,6 +248,7 @@ main: { bne b1_from_b2 jmp b2 } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -320,4 +322,5 @@ main: { bne b1 jmp b2 } +//SEG18 File Data diff --git a/src/test/ref/bool-pointer.log b/src/test/ref/bool-pointer.log index a0d99cc20..201d56716 100644 --- a/src/test/ref/bool-pointer.log +++ b/src/test/ref/bool-pointer.log @@ -182,6 +182,7 @@ main: { //SEG17 [9] return rts } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((bool*) 1024) ← true [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -246,6 +247,7 @@ main: { //SEG17 [9] return rts } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -320,4 +322,5 @@ main: { //SEG17 [9] return rts } +//SEG18 File Data diff --git a/src/test/ref/bool-vars.log b/src/test/ref/bool-vars.log index 0dd937a86..bc5cc7d4b 100644 --- a/src/test/ref/bool-vars.log +++ b/src/test/ref/bool-vars.log @@ -1051,6 +1051,7 @@ bool_and: { sta screen,y jmp b3 } +//SEG109 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [15] (bool) bool_complex::o1#0 ← (byte) bool_complex::i#2 < (byte) $a [ bool_complex::i#2 bool_complex::o1#0 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::o1#0 ] ) always clobbers reg byte a @@ -1422,6 +1423,7 @@ bool_and: { sta screen,x jmp b3 } +//SEG109 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1832,4 +1834,5 @@ bool_and: { sta screen,x jmp b3 } +//SEG109 File Data diff --git a/src/test/ref/bresenham.log b/src/test/ref/bresenham.log index 4d4e1e4e3..2349a494c 100644 --- a/src/test/ref/bresenham.log +++ b/src/test/ref/bresenham.log @@ -511,6 +511,7 @@ main: { //SEG38 [16] return rts } +//SEG39 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y @@ -661,6 +662,7 @@ main: { //SEG38 [16] return rts } +//SEG39 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -837,4 +839,5 @@ main: { //SEG38 [16] return rts } +//SEG39 File Data diff --git a/src/test/ref/bresenhamarr.log b/src/test/ref/bresenhamarr.log index a3b9103ef..5475ce448 100644 --- a/src/test/ref/bresenhamarr.log +++ b/src/test/ref/bresenhamarr.log @@ -529,6 +529,7 @@ main: { //SEG39 [17] return rts } +//SEG40 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte*~) main::$15 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$15 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$15 ] ) always clobbers reg byte a @@ -691,6 +692,7 @@ main: { //SEG39 [17] return rts } +//SEG40 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -877,4 +879,5 @@ main: { //SEG39 [17] return rts } +//SEG40 File Data diff --git a/src/test/ref/c-types.asm b/src/test/ref/c-types.asm index 26ab43e09..c2211c3d6 100644 --- a/src/test/ref/c-types.asm +++ b/src/test/ref/c-types.asm @@ -234,13 +234,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word diff --git a/src/test/ref/c-types.log b/src/test/ref/c-types.log index eee986c1c..0427587b2 100644 --- a/src/test/ref/c-types.log +++ b/src/test/ref/c-types.log @@ -2676,13 +2676,11 @@ print_sword: { b3: //SEG208 [94] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#5 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG209 [95] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -3023,6 +3021,7 @@ print_cls: { //SEG336 [145] return rts } +//SEG337 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -3107,22 +3106,22 @@ Uplift Scope [testShort] Uplift Scope [testInt] Uplift Scope [testLong] -Uplifting [] best 2675 combination zp ZP_WORD:16 [ print_char_cursor#90 print_char_cursor#143 print_char_cursor#139 print_char_cursor#140 print_char_cursor#24 print_char_cursor#132 print_char_cursor#150 print_char_cursor#155 print_char_cursor#156 print_char_cursor#157 print_char_cursor#1 ] zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ] -Uplifting [print_str] best 2675 combination zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ] -Uplifting [print_cls] best 2675 combination zp ZP_WORD:23 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_byte] best 2655 combination reg byte x [ print_byte::b#4 print_byte::b#6 print_byte::b#1 print_byte::b#2 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] -Uplifting [print_word] best 2655 combination zp ZP_WORD:12 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#9 ] -Uplifting [print_char] best 2610 combination reg byte a [ print_char::ch#14 print_char::ch#4 print_char::ch#5 ] -Uplifting [print_sword] best 2610 combination zp ZP_WORD:20 [ print_sword::w#6 print_sword::w#5 print_sword::w#0 ] -Uplifting [print_sdword] best 2610 combination zp ZP_DWORD:4 [ print_sdword::dw#4 print_sdword::dw#3 print_sdword::dw#0 ] -Uplifting [print_sbyte] best 2598 combination reg byte x [ print_sbyte::b#5 print_sbyte::b#0 print_sbyte::b#3 ] -Uplifting [print_dword] best 2598 combination zp ZP_DWORD:8 [ print_dword::dw#2 print_dword::dw#0 ] -Uplifting [print_ln] best 2598 combination -Uplifting [main] best 2598 combination -Uplifting [testChar] best 2598 combination -Uplifting [testShort] best 2598 combination -Uplifting [testInt] best 2598 combination -Uplifting [testLong] best 2598 combination +Uplifting [] best 2671 combination zp ZP_WORD:16 [ print_char_cursor#90 print_char_cursor#143 print_char_cursor#139 print_char_cursor#140 print_char_cursor#24 print_char_cursor#132 print_char_cursor#150 print_char_cursor#155 print_char_cursor#156 print_char_cursor#157 print_char_cursor#1 ] zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ] +Uplifting [print_str] best 2671 combination zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ] +Uplifting [print_cls] best 2671 combination zp ZP_WORD:23 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_byte] best 2651 combination reg byte x [ print_byte::b#4 print_byte::b#6 print_byte::b#1 print_byte::b#2 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] +Uplifting [print_word] best 2651 combination zp ZP_WORD:12 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#9 ] +Uplifting [print_char] best 2606 combination reg byte a [ print_char::ch#14 print_char::ch#4 print_char::ch#5 ] +Uplifting [print_sword] best 2606 combination zp ZP_WORD:20 [ print_sword::w#6 print_sword::w#5 print_sword::w#0 ] +Uplifting [print_sdword] best 2606 combination zp ZP_DWORD:4 [ print_sdword::dw#4 print_sdword::dw#3 print_sdword::dw#0 ] +Uplifting [print_sbyte] best 2594 combination reg byte x [ print_sbyte::b#5 print_sbyte::b#0 print_sbyte::b#3 ] +Uplifting [print_dword] best 2594 combination zp ZP_DWORD:8 [ print_dword::dw#2 print_dword::dw#0 ] +Uplifting [print_ln] best 2594 combination +Uplifting [main] best 2594 combination +Uplifting [testChar] best 2594 combination +Uplifting [testShort] best 2594 combination +Uplifting [testInt] best 2594 combination +Uplifting [testLong] best 2594 combination Coalescing zero page register with common assignment [ zp ZP_DWORD:4 [ print_sdword::dw#4 print_sdword::dw#3 print_sdword::dw#0 ] ] with [ zp ZP_DWORD:8 [ print_dword::dw#2 print_dword::dw#0 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:12 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#9 ] ] with [ zp ZP_WORD:20 [ print_sword::w#6 print_sword::w#5 print_sword::w#0 ] ] - score: 1 Allocated (was zp ZP_WORD:12) zp ZP_WORD:8 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#9 print_sword::w#6 print_sword::w#5 print_sword::w#0 ] @@ -3704,13 +3703,11 @@ print_sword: { b3: //SEG208 [94] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#5 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG209 [95] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -4035,6 +4032,7 @@ print_cls: { //SEG336 [145] return rts } +//SEG337 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -4444,7 +4442,7 @@ reg byte x [ print_byte::$2 ] FINAL ASSEMBLER -Score: 2161 +Score: 2157 //SEG0 File Comments // Tests the different standard C types @@ -4891,13 +4889,11 @@ print_sword: { //SEG207 print_sword::@3 //SEG208 [94] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#5 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG209 [95] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG210 [95] phi (signed word) print_sword::w#6 = (signed word) print_sword::w#5 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -5141,5 +5137,6 @@ print_cls: { //SEG336 [145] return rts } +//SEG337 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/c64dtv-8bppcharstretch.log b/src/test/ref/c64dtv-8bppcharstretch.log index f9527c78b..4028faa6f 100644 --- a/src/test/ref/c64dtv-8bppcharstretch.log +++ b/src/test/ref/c64dtv-8bppcharstretch.log @@ -2338,6 +2338,7 @@ gfx_init_screen0: { //SEG170 [91] return rts } +//SEG171 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -3078,6 +3079,7 @@ gfx_init_screen0: { //SEG170 [91] return rts } +//SEG171 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -3883,4 +3885,5 @@ gfx_init_screen0: { //SEG170 [91] return rts } +//SEG171 File Data diff --git a/src/test/ref/c64dtv-8bppchunkystretch.log b/src/test/ref/c64dtv-8bppchunkystretch.log index b524a2f83..3866c3ab2 100644 --- a/src/test/ref/c64dtv-8bppchunkystretch.log +++ b/src/test/ref/c64dtv-8bppchunkystretch.log @@ -1693,6 +1693,7 @@ dtvSetCpuBankSegment1: { //SEG111 [61] return rts } +//SEG112 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2221,6 +2222,7 @@ dtvSetCpuBankSegment1: { //SEG111 [61] return rts } +//SEG112 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -2807,4 +2809,5 @@ dtvSetCpuBankSegment1: { //SEG111 [61] return rts } +//SEG112 File Data diff --git a/src/test/ref/c64dtv-blitter-box.log b/src/test/ref/c64dtv-blitter-box.log index 68a2516df..d47b77db7 100644 --- a/src/test/ref/c64dtv-blitter-box.log +++ b/src/test/ref/c64dtv-blitter-box.log @@ -950,6 +950,7 @@ main: { //SEG46 [38] return rts } +//SEG47 File Data SRCA: .text "camelot rules!@" SRCB: .byte $80 @@ -1207,6 +1208,7 @@ main: { //SEG46 [38] return rts } +//SEG47 File Data SRCA: .text "camelot rules!@" SRCB: .byte $80 @@ -1532,6 +1534,7 @@ main: { //SEG46 [38] return rts } +//SEG47 File Data SRCA: .text "camelot rules!@" SRCB: .byte $80 diff --git a/src/test/ref/c64dtv-blittermin.log b/src/test/ref/c64dtv-blittermin.log index cd5b0cded..540a1e1f2 100644 --- a/src/test/ref/c64dtv-blittermin.log +++ b/src/test/ref/c64dtv-blittermin.log @@ -1017,6 +1017,7 @@ main: { //SEG55 [42] return rts } +//SEG56 File Data SRCA: .byte 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' ' SRCB: .byte $80 @@ -1334,6 +1335,7 @@ main: { //SEG55 [42] return rts } +//SEG56 File Data SRCA: .byte 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' ' SRCB: .byte $80 @@ -1697,6 +1699,7 @@ main: { //SEG55 [42] return rts } +//SEG56 File Data SRCA: .byte 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' ' SRCB: .byte $80 diff --git a/src/test/ref/c64dtv-color.log b/src/test/ref/c64dtv-color.log index 4a3e46d50..44e58e20f 100644 --- a/src/test/ref/c64dtv-color.log +++ b/src/test/ref/c64dtv-color.log @@ -558,6 +558,7 @@ main: { jmp b1 palette: .byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, $a, $b, $c, $d, $e, $f } +//SEG35 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -708,6 +709,7 @@ main: { jmp b1 palette: .byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, $a, $b, $c, $d, $e, $f } +//SEG35 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -889,4 +891,5 @@ main: { jmp b1 palette: .byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, $a, $b, $c, $d, $e, $f } +//SEG35 File Data diff --git a/src/test/ref/c64dtv-gfxexplorer.log b/src/test/ref/c64dtv-gfxexplorer.log index e3a8e50d0..43f6ed2c1 100644 --- a/src/test/ref/c64dtv-gfxexplorer.log +++ b/src/test/ref/c64dtv-gfxexplorer.log @@ -20914,6 +20914,7 @@ keyboard_init: { //SEG1753 [855] return rts } +//SEG1754 File Data // Default vallues for the palette DTV_PALETTE_DEFAULT: .byte 0, $f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, 5, 7, $df, $9a, $a print_hextab: .text "0123456789abcdef" @@ -27680,6 +27681,7 @@ keyboard_init: { //SEG1753 [855] return rts } +//SEG1754 File Data // Default vallues for the palette DTV_PALETTE_DEFAULT: .byte 0, $f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, 5, 7, $df, $9a, $a print_hextab: .text "0123456789abcdef" @@ -34659,6 +34661,7 @@ keyboard_init: { //SEG1753 [855] return rts } +//SEG1754 File Data // Default vallues for the palette DTV_PALETTE_DEFAULT: .byte 0, $f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, 5, 7, $df, $9a, $a print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/c64dtv-gfxmodes.log b/src/test/ref/c64dtv-gfxmodes.log index ed82d4a1c..45e7461f0 100644 --- a/src/test/ref/c64dtv-gfxmodes.log +++ b/src/test/ref/c64dtv-gfxmodes.log @@ -19476,6 +19476,7 @@ print_set_screen: { //SEG1660 [891] return rts } +//SEG1661 File Data // Default vallues for the palette DTV_PALETTE_DEFAULT: .byte 0, $f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, 5, 7, $df, $9a, $a // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) @@ -25798,6 +25799,7 @@ print_set_screen: { //SEG1660 [891] return rts } +//SEG1661 File Data // Default vallues for the palette DTV_PALETTE_DEFAULT: .byte 0, $f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, 5, 7, $df, $9a, $a // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) @@ -32133,6 +32135,7 @@ print_set_screen: { //SEG1660 [891] return rts } +//SEG1661 File Data // Default vallues for the palette DTV_PALETTE_DEFAULT: .byte 0, $f, $36, $be, $58, $db, $86, $ff, $29, $26, $3b, 5, 7, $df, $9a, $a // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) diff --git a/src/test/ref/call-parameter-autocast.log b/src/test/ref/call-parameter-autocast.log index 101faed5c..a86568889 100644 --- a/src/test/ref/call-parameter-autocast.log +++ b/src/test/ref/call-parameter-autocast.log @@ -361,6 +361,7 @@ print: { //SEG34 [15] return rts } +//SEG35 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] (byte~) print::$0 ← (byte) idx#12 << (byte) 1 [ idx#12 print::w#3 print::$0 ] ( main:2::print:5 [ idx#12 print::w#3 print::$0 ] main:2::print:7 [ idx#12 print::w#3 print::$0 ] main:2::print:9 [ idx#12 print::w#3 print::$0 ] ) always clobbers reg byte a @@ -478,6 +479,7 @@ print: { //SEG34 [15] return rts } +//SEG35 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -611,4 +613,5 @@ print: { //SEG34 [15] return rts } +//SEG35 File Data diff --git a/src/test/ref/callconstparam.log b/src/test/ref/callconstparam.log index fd6a3c4a8..ccbe83eca 100644 --- a/src/test/ref/callconstparam.log +++ b/src/test/ref/callconstparam.log @@ -353,6 +353,7 @@ line: { //SEG35 [15] return rts } +//SEG36 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [11] *((byte*) screen#10) ← (byte) line::x#2 [ line::x1#3 line::x#2 screen#10 ] ( main:2::line:5 [ line::x1#3 line::x#2 screen#10 ] main:2::line:7 [ line::x1#3 line::x#2 screen#10 ] ) always clobbers reg byte y @@ -471,6 +472,7 @@ line: { //SEG35 [15] return rts } +//SEG36 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -606,4 +608,5 @@ line: { //SEG35 [15] return rts } +//SEG36 File Data diff --git a/src/test/ref/cast-deref.log b/src/test/ref/cast-deref.log index 9865f2f56..7845f2afa 100644 --- a/src/test/ref/cast-deref.log +++ b/src/test/ref/cast-deref.log @@ -193,6 +193,7 @@ main: { rts sbs: .byte -1, -2, -3, -4 } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte)*((const signed byte[]) main::sbs#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -260,6 +261,7 @@ main: { rts sbs: .byte -1, -2, -3, -4 } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -344,4 +346,5 @@ main: { rts sbs: .byte -1, -2, -3, -4 } +//SEG21 File Data diff --git a/src/test/ref/cast-not-needed-2.log b/src/test/ref/cast-not-needed-2.log index cfc777d7d..2416b7323 100644 --- a/src/test/ref/cast-not-needed-2.log +++ b/src/test/ref/cast-not-needed-2.log @@ -285,6 +285,7 @@ main: { //SEG18 [8] return rts } +//SEG19 File Data screens: .word $400, $1400 REGISTER UPLIFT POTENTIAL REGISTERS @@ -362,6 +363,7 @@ main: { //SEG18 [8] return rts } +//SEG19 File Data screens: .word $400, $1400 ASSEMBLER OPTIMIZATIONS @@ -459,5 +461,6 @@ main: { //SEG18 [8] return rts } +//SEG19 File Data screens: .word $400, $1400 diff --git a/src/test/ref/cast-not-needed-3.log b/src/test/ref/cast-not-needed-3.log index a3e5e5b88..d176c33a5 100644 --- a/src/test/ref/cast-not-needed-3.log +++ b/src/test/ref/cast-not-needed-3.log @@ -296,6 +296,7 @@ main: { //SEG19 [9] return rts } +//SEG20 File Data screens: .word $400, $1400 REGISTER UPLIFT POTENTIAL REGISTERS @@ -376,6 +377,7 @@ main: { //SEG19 [9] return rts } +//SEG20 File Data screens: .word $400, $1400 ASSEMBLER OPTIMIZATIONS @@ -478,5 +480,6 @@ main: { //SEG19 [9] return rts } +//SEG20 File Data screens: .word $400, $1400 diff --git a/src/test/ref/cast-not-needed.log b/src/test/ref/cast-not-needed.log index 705d69986..aed1b5e8a 100644 --- a/src/test/ref/cast-not-needed.log +++ b/src/test/ref/cast-not-needed.log @@ -157,6 +157,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::sprite_ptr#0) ← (byte)(const byte*) sprite#0/(byte) $40 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -204,6 +205,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -266,4 +268,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/cast-precedence-problem.log b/src/test/ref/cast-precedence-problem.log index 5c809c739..3dab8df70 100644 --- a/src/test/ref/cast-precedence-problem.log +++ b/src/test/ref/cast-precedence-problem.log @@ -294,6 +294,7 @@ main: { sta BGCOL jmp breturn } +//SEG19 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::midw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -369,6 +370,7 @@ main: { sta BGCOL jmp breturn } +//SEG19 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -469,4 +471,5 @@ main: { sta BGCOL rts } +//SEG19 File Data diff --git a/src/test/ref/casting.log b/src/test/ref/casting.log index 36ba41108..5d61cfc75 100644 --- a/src/test/ref/casting.log +++ b/src/test/ref/casting.log @@ -495,6 +495,7 @@ w: { //SEG40 [22] return rts } +//SEG41 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte) main::b2#0 ← (byte) $c8 - (byte) main::b#2 [ main::b#2 main::b2#0 ] ( main:2 [ main::b#2 main::b2#0 ] ) always clobbers reg byte a @@ -635,6 +636,7 @@ w: { //SEG40 [22] return rts } +//SEG41 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -805,4 +807,5 @@ w: { //SEG40 [22] return rts } +//SEG41 File Data diff --git a/src/test/ref/chargen.log b/src/test/ref/chargen.log index 44d4ff6b0..d8e8e7f6f 100644 --- a/src/test/ref/chargen.log +++ b/src/test/ref/chargen.log @@ -539,6 +539,7 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) PROCPORT#0) ← (byte) $32 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -713,6 +714,7 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -917,4 +919,5 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data diff --git a/src/test/ref/chessboard.log b/src/test/ref/chessboard.log index 95732ecb8..2ca4692be 100644 --- a/src/test/ref/chessboard.log +++ b/src/test/ref/chessboard.log @@ -415,6 +415,7 @@ main: { //SEG41 [17] return rts } +//SEG42 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] *((byte*) main::screen#4 + (byte) main::column#2) ← (byte) $a0 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ( main:2 [ main::screen#4 main::colors#4 main::row#4 main::column#2 main::color#3 ] ) always clobbers reg byte a @@ -566,6 +567,7 @@ main: { //SEG41 [17] return rts } +//SEG42 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -733,4 +735,5 @@ main: { //SEG41 [17] return rts } +//SEG42 File Data diff --git a/src/test/ref/clobber-a-problem.log b/src/test/ref/clobber-a-problem.log index badafe24c..f205f3f91 100644 --- a/src/test/ref/clobber-a-problem.log +++ b/src/test/ref/clobber-a-problem.log @@ -349,6 +349,7 @@ irq: { ldy #00 rti } +//SEG31 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [1] (byte) irq_raster_next#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a @@ -471,6 +472,7 @@ irq: { ldx #00 rti } +//SEG31 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -613,4 +615,5 @@ irq: { ldx #00 rti } +//SEG31 File Data diff --git a/src/test/ref/comma-decl-for.log b/src/test/ref/comma-decl-for.log index bae54551d..b436d44c3 100644 --- a/src/test/ref/comma-decl-for.log +++ b/src/test/ref/comma-decl-for.log @@ -196,6 +196,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::j#2 main::j#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -265,6 +266,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -355,4 +357,5 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data diff --git a/src/test/ref/comma-decl.log b/src/test/ref/comma-decl.log index f824a9c7f..d02824a1f 100644 --- a/src/test/ref/comma-decl.log +++ b/src/test/ref/comma-decl.log @@ -174,6 +174,7 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -230,6 +231,7 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -301,4 +303,5 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data diff --git a/src/test/ref/comma-expr-1.log b/src/test/ref/comma-expr-1.log index 1de22b3bf..336dcb68c 100644 --- a/src/test/ref/comma-expr-1.log +++ b/src/test/ref/comma-expr-1.log @@ -142,6 +142,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::c#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -189,6 +190,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -251,4 +253,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/comma-expr-2.log b/src/test/ref/comma-expr-2.log index e9fb47ac1..58cc85f83 100644 --- a/src/test/ref/comma-expr-2.log +++ b/src/test/ref/comma-expr-2.log @@ -128,6 +128,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::c#1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -174,6 +175,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -233,4 +235,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/comma-expr-for.log b/src/test/ref/comma-expr-for.log index 406981cc4..24904e6b6 100644 --- a/src/test/ref/comma-expr-for.log +++ b/src/test/ref/comma-expr-for.log @@ -200,6 +200,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::j#2 main::j#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -269,6 +270,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -359,4 +361,5 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data diff --git a/src/test/ref/comparison-rewriting-pointer.log b/src/test/ref/comparison-rewriting-pointer.log index ea0e5b7bf..68cca5803 100644 --- a/src/test/ref/comparison-rewriting-pointer.log +++ b/src/test/ref/comparison-rewriting-pointer.log @@ -287,6 +287,7 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::sc#2) ← (byte) 'a' [ main::sc#2 ] ( main:2 [ main::sc#2 ] ) always clobbers reg byte a reg byte y @@ -405,6 +406,7 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -545,4 +547,5 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data diff --git a/src/test/ref/comparison-rewriting.log b/src/test/ref/comparison-rewriting.log index 4fde6bc4b..502ae009b 100644 --- a/src/test/ref/comparison-rewriting.log +++ b/src/test/ref/comparison-rewriting.log @@ -689,6 +689,7 @@ main: { rts header: .text " < <= == >= >@" } +//SEG61 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::sc#2) ← (byte) ' ' [ main::sc#2 ] ( main:2 [ main::sc#2 ] ) always clobbers reg byte a reg byte y @@ -919,6 +920,7 @@ main: { rts header: .text " < <= == >= >@" } +//SEG61 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1164,4 +1166,5 @@ main: { rts header: .text " < <= == >= >@" } +//SEG61 File Data diff --git a/src/test/ref/complex-conditional-problem.log b/src/test/ref/complex-conditional-problem.log index e6dbe9101..367bd1845 100644 --- a/src/test/ref/complex-conditional-problem.log +++ b/src/test/ref/complex-conditional-problem.log @@ -250,6 +250,7 @@ main: { sta SCREEN jmp b1 } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::key#2 main::key#0 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -324,6 +325,7 @@ main: { sta SCREEN jmp b1 } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -423,4 +425,5 @@ main: { sta SCREEN jmp b1 } +//SEG24 File Data diff --git a/src/test/ref/complex/clearscreen/clearscreen.log b/src/test/ref/complex/clearscreen/clearscreen.log index 77a2a5079..e53979ddc 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.log +++ b/src/test/ref/complex/clearscreen/clearscreen.log @@ -6204,6 +6204,7 @@ irqTop: { ldy #00 rti } +//SEG437 File Data // Copy of the screen used for finding chars to process SCREEN_COPY: .fill $3e8, 0 // SQUARES_X[i] = (i-20)*(i-20) @@ -6715,130 +6716,130 @@ Uplift Scope [irqTop] Uplift Scope [irqBottom] Uplift Scope [] -Uplifting [getCharToProcess] best 296666 combination zp ZP_WORD:22 [ getCharToProcess::return_dist#1 getCharToProcess::return_dist#5 getCharToProcess::return_dist#6 getCharToProcess::dist#0 ] zp ZP_WORD:18 [ getCharToProcess::closest_dist#2 getCharToProcess::closest_dist#8 getCharToProcess::closest_dist#10 getCharToProcess::closest_dist#12 ] zp ZP_BYTE:21 [ getCharToProcess::closest_y#7 getCharToProcess::closest_y#9 getCharToProcess::return_y#1 getCharToProcess::return_y#7 ] reg byte a [ getCharToProcess::$14 ] zp ZP_BYTE:20 [ getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ] zp ZP_BYTE:17 [ getCharToProcess::x#2 getCharToProcess::x#1 ] zp ZP_BYTE:109 [ getCharToProcess::$13 ] zp ZP_BYTE:16 [ getCharToProcess::y#7 getCharToProcess::y#1 ] zp ZP_WORD:14 [ getCharToProcess::screen_line#4 getCharToProcess::screen_line#1 ] zp ZP_BYTE:45 [ getCharToProcess::return_x#0 ] zp ZP_BYTE:46 [ getCharToProcess::return_y#0 ] zp ZP_WORD:47 [ getCharToProcess::return_dist#0 ] zp ZP_WORD:113 [ getCharToProcess::$15 ] zp ZP_WORD:115 [ getCharToProcess::$16 ] zp ZP_WORD:117 [ getCharToProcess::$10 ] zp ZP_WORD:119 [ getCharToProcess::$11 ] zp ZP_WORD:111 [ getCharToProcess::$9 ] +Uplifting [getCharToProcess] best 301274 combination zp ZP_WORD:22 [ getCharToProcess::return_dist#1 getCharToProcess::return_dist#5 getCharToProcess::return_dist#6 getCharToProcess::dist#0 ] zp ZP_WORD:18 [ getCharToProcess::closest_dist#2 getCharToProcess::closest_dist#8 getCharToProcess::closest_dist#10 getCharToProcess::closest_dist#12 ] zp ZP_BYTE:21 [ getCharToProcess::closest_y#7 getCharToProcess::closest_y#9 getCharToProcess::return_y#1 getCharToProcess::return_y#7 ] reg byte a [ getCharToProcess::$14 ] zp ZP_BYTE:20 [ getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ] zp ZP_BYTE:17 [ getCharToProcess::x#2 getCharToProcess::x#1 ] zp ZP_BYTE:109 [ getCharToProcess::$13 ] zp ZP_BYTE:16 [ getCharToProcess::y#7 getCharToProcess::y#1 ] zp ZP_WORD:14 [ getCharToProcess::screen_line#4 getCharToProcess::screen_line#1 ] zp ZP_BYTE:45 [ getCharToProcess::return_x#0 ] zp ZP_BYTE:46 [ getCharToProcess::return_y#0 ] zp ZP_WORD:47 [ getCharToProcess::return_dist#0 ] zp ZP_WORD:113 [ getCharToProcess::$15 ] zp ZP_WORD:115 [ getCharToProcess::$16 ] zp ZP_WORD:117 [ getCharToProcess::$10 ] zp ZP_WORD:119 [ getCharToProcess::$11 ] zp ZP_WORD:111 [ getCharToProcess::$9 ] Limited combination testing to 100 combinations of 8748 possible. -Uplifting [mul8u] best 295640 combination zp ZP_WORD:34 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:36 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] reg byte x [ mul8u::a#3 mul8u::a#6 mul8u::a#2 mul8u::a#1 mul8u::a#0 ] reg byte a [ mul8u::$1 ] reg byte a [ mul8u::b#1 ] reg byte a [ mul8u::b#0 ] zp ZP_WORD:121 [ mul8u::return#2 ] zp ZP_WORD:126 [ mul8u::return#3 ] +Uplifting [mul8u] best 300248 combination zp ZP_WORD:34 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:36 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] reg byte x [ mul8u::a#3 mul8u::a#6 mul8u::a#2 mul8u::a#1 mul8u::a#0 ] reg byte a [ mul8u::$1 ] reg byte a [ mul8u::b#1 ] reg byte a [ mul8u::b#0 ] zp ZP_WORD:121 [ mul8u::return#2 ] zp ZP_WORD:126 [ mul8u::return#3 ] Limited combination testing to 100 combinations of 192 possible. -Uplifting [initSquareTables] best 295480 combination reg byte a [ initSquareTables::x_dist#0 initSquareTables::$4 initSquareTables::$2 ] reg byte a [ initSquareTables::y_dist#0 initSquareTables::$12 initSquareTables::$10 ] zp ZP_BYTE:27 [ initSquareTables::x#2 initSquareTables::x#1 ] zp ZP_BYTE:29 [ initSquareTables::y#2 initSquareTables::y#1 ] zp ZP_BYTE:125 [ initSquareTables::$16 ] zp ZP_BYTE:130 [ initSquareTables::$17 ] zp ZP_WORD:123 [ initSquareTables::$6 ] zp ZP_WORD:128 [ initSquareTables::$14 ] +Uplifting [initSquareTables] best 300088 combination reg byte a [ initSquareTables::x_dist#0 initSquareTables::$4 initSquareTables::$2 ] reg byte a [ initSquareTables::y_dist#0 initSquareTables::$12 initSquareTables::$10 ] zp ZP_BYTE:27 [ initSquareTables::x#2 initSquareTables::x#1 ] zp ZP_BYTE:29 [ initSquareTables::y#2 initSquareTables::y#1 ] zp ZP_BYTE:125 [ initSquareTables::$16 ] zp ZP_BYTE:130 [ initSquareTables::$17 ] zp ZP_WORD:123 [ initSquareTables::$6 ] zp ZP_WORD:128 [ initSquareTables::$14 ] Limited combination testing to 100 combinations of 2304 possible. -Uplifting [main] best 295240 combination zp ZP_WORD:2 [ main::src#2 main::src#1 ] zp ZP_WORD:4 [ main::dst#2 main::dst#1 ] reg byte a [ main::$26 ] reg byte a [ main::$27 ] reg byte a [ main::$28 ] reg byte a [ main::$29 ] zp ZP_WORD:51 [ main::center_dist#0 ] zp ZP_BYTE:6 [ main::i#2 main::i#1 ] zp ZP_BYTE:44 [ main::$16 ] zp ZP_BYTE:49 [ main::center_x#0 ] zp ZP_BYTE:50 [ main::center_y#0 ] +Uplifting [main] best 299848 combination zp ZP_WORD:2 [ main::src#2 main::src#1 ] zp ZP_WORD:4 [ main::dst#2 main::dst#1 ] reg byte a [ main::$26 ] reg byte a [ main::$27 ] reg byte a [ main::$28 ] reg byte a [ main::$29 ] zp ZP_WORD:51 [ main::center_dist#0 ] zp ZP_BYTE:6 [ main::i#2 main::i#1 ] zp ZP_BYTE:44 [ main::$16 ] zp ZP_BYTE:49 [ main::center_x#0 ] zp ZP_BYTE:50 [ main::center_y#0 ] Limited combination testing to 100 combinations of 20736 possible. -Uplifting [initSprites] best 295120 combination zp ZP_WORD:24 [ initSprites::sp#2 initSprites::sp#1 ] reg byte x [ initSprites::i#2 initSprites::i#1 ] -Uplifting [ProcessingChar] best 295120 combination -Uplifting [ProcessingSprite] best 295120 combination -Uplifting [ProcessingSprite::$0] best 295120 combination -Uplifting [setupRasterIrq] best 295120 combination -Uplifting [irqTop] best 295120 combination -Uplifting [irqBottom] best 295120 combination -Uplifting [] best 295120 combination +Uplifting [initSprites] best 299728 combination zp ZP_WORD:24 [ initSprites::sp#2 initSprites::sp#1 ] reg byte x [ initSprites::i#2 initSprites::i#1 ] +Uplifting [ProcessingChar] best 299728 combination +Uplifting [ProcessingSprite] best 299728 combination +Uplifting [ProcessingSprite::$0] best 299728 combination +Uplifting [setupRasterIrq] best 299728 combination +Uplifting [irqTop] best 299728 combination +Uplifting [irqBottom] best 299728 combination +Uplifting [] best 299728 combination Attempting to uplift remaining variables inzp ZP_BYTE:21 [ getCharToProcess::closest_y#7 getCharToProcess::closest_y#9 getCharToProcess::return_y#1 getCharToProcess::return_y#7 ] -Uplifting [getCharToProcess] best 295120 combination zp ZP_BYTE:21 [ getCharToProcess::closest_y#7 getCharToProcess::closest_y#9 getCharToProcess::return_y#1 getCharToProcess::return_y#7 ] +Uplifting [getCharToProcess] best 299728 combination zp ZP_BYTE:21 [ getCharToProcess::closest_y#7 getCharToProcess::closest_y#9 getCharToProcess::return_y#1 getCharToProcess::return_y#7 ] Attempting to uplift remaining variables inzp ZP_BYTE:8 [ startProcessing::freeIdx#2 startProcessing::freeIdx#8 startProcessing::i#2 startProcessing::i#1 ] -Uplifting [startProcessing] best 295120 combination zp ZP_BYTE:8 [ startProcessing::freeIdx#2 startProcessing::freeIdx#8 startProcessing::i#2 startProcessing::i#1 ] +Uplifting [startProcessing] best 299728 combination zp ZP_BYTE:8 [ startProcessing::freeIdx#2 startProcessing::freeIdx#8 startProcessing::i#2 startProcessing::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:55 [ startProcessing::$42 ] -Uplifting [startProcessing] best 289120 combination reg byte a [ startProcessing::$42 ] +Uplifting [startProcessing] best 293728 combination reg byte a [ startProcessing::$42 ] Attempting to uplift remaining variables inzp ZP_BYTE:56 [ startProcessing::$43 ] -Uplifting [startProcessing] best 283120 combination reg byte a [ startProcessing::$43 ] +Uplifting [startProcessing] best 287728 combination reg byte a [ startProcessing::$43 ] Attempting to uplift remaining variables inzp ZP_BYTE:57 [ startProcessing::$44 ] -Uplifting [startProcessing] best 277120 combination reg byte a [ startProcessing::$44 ] +Uplifting [startProcessing] best 281728 combination reg byte a [ startProcessing::$44 ] Attempting to uplift remaining variables inzp ZP_BYTE:58 [ startProcessing::$45 ] -Uplifting [startProcessing] best 271120 combination reg byte a [ startProcessing::$45 ] +Uplifting [startProcessing] best 275728 combination reg byte a [ startProcessing::$45 ] Attempting to uplift remaining variables inzp ZP_BYTE:59 [ startProcessing::$30 ] -Uplifting [startProcessing] best 267120 combination reg byte a [ startProcessing::$30 ] +Uplifting [startProcessing] best 271728 combination reg byte a [ startProcessing::$30 ] Attempting to uplift remaining variables inzp ZP_BYTE:20 [ getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ] -Uplifting [getCharToProcess] best 267120 combination zp ZP_BYTE:20 [ getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ] +Uplifting [getCharToProcess] best 271728 combination zp ZP_BYTE:20 [ getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ] Attempting to uplift remaining variables inzp ZP_BYTE:17 [ getCharToProcess::x#2 getCharToProcess::x#1 ] -Uplifting [getCharToProcess] best 267120 combination zp ZP_BYTE:17 [ getCharToProcess::x#2 getCharToProcess::x#1 ] +Uplifting [getCharToProcess] best 271728 combination zp ZP_BYTE:17 [ getCharToProcess::x#2 getCharToProcess::x#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:109 [ getCharToProcess::$13 ] -Uplifting [getCharToProcess] best 263120 combination reg byte x [ getCharToProcess::$13 ] +Uplifting [getCharToProcess] best 267728 combination reg byte x [ getCharToProcess::$13 ] Attempting to uplift remaining variables inzp ZP_BYTE:16 [ getCharToProcess::y#7 getCharToProcess::y#1 ] -Uplifting [getCharToProcess] best 263120 combination zp ZP_BYTE:16 [ getCharToProcess::y#7 getCharToProcess::y#1 ] +Uplifting [getCharToProcess] best 267728 combination zp ZP_BYTE:16 [ getCharToProcess::y#7 getCharToProcess::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:7 [ startProcessing::freeIdx#6 startProcessing::freeIdx#7 ] -Uplifting [startProcessing] best 262220 combination reg byte x [ startProcessing::freeIdx#6 startProcessing::freeIdx#7 ] +Uplifting [startProcessing] best 266828 combination reg byte x [ startProcessing::freeIdx#6 startProcessing::freeIdx#7 ] Attempting to uplift remaining variables inzp ZP_BYTE:13 [ startProcessing::i1#2 startProcessing::i1#1 ] -Uplifting [startProcessing] best 261320 combination reg byte x [ startProcessing::i1#2 startProcessing::i1#1 ] +Uplifting [startProcessing] best 265928 combination reg byte x [ startProcessing::i1#2 startProcessing::i1#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:39 [ processChars::numActive#10 processChars::numActive#3 processChars::numActive#1 ] -Uplifting [processChars] best 261320 combination zp ZP_BYTE:39 [ processChars::numActive#10 processChars::numActive#3 processChars::numActive#1 ] +Uplifting [processChars] best 265928 combination zp ZP_BYTE:39 [ processChars::numActive#10 processChars::numActive#3 processChars::numActive#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:27 [ initSquareTables::x#2 initSquareTables::x#1 ] -Uplifting [initSquareTables] best 261320 combination zp ZP_BYTE:27 [ initSquareTables::x#2 initSquareTables::x#1 ] +Uplifting [initSquareTables] best 265928 combination zp ZP_BYTE:27 [ initSquareTables::x#2 initSquareTables::x#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:29 [ initSquareTables::y#2 initSquareTables::y#1 ] -Uplifting [initSquareTables] best 261320 combination zp ZP_BYTE:29 [ initSquareTables::y#2 initSquareTables::y#1 ] +Uplifting [initSquareTables] best 265928 combination zp ZP_BYTE:29 [ initSquareTables::y#2 initSquareTables::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:125 [ initSquareTables::$16 ] -Uplifting [initSquareTables] best 261280 combination reg byte a [ initSquareTables::$16 ] +Uplifting [initSquareTables] best 265888 combination reg byte a [ initSquareTables::$16 ] Attempting to uplift remaining variables inzp ZP_BYTE:130 [ initSquareTables::$17 ] -Uplifting [initSquareTables] best 261240 combination reg byte a [ initSquareTables::$17 ] +Uplifting [initSquareTables] best 265848 combination reg byte a [ initSquareTables::$17 ] Attempting to uplift remaining variables inzp ZP_BYTE:132 [ processChars::$67 ] -Uplifting [processChars] best 261180 combination reg byte a [ processChars::$67 ] +Uplifting [processChars] best 265788 combination reg byte a [ processChars::$67 ] Attempting to uplift remaining variables inzp ZP_BYTE:133 [ processChars::$68 ] -Uplifting [processChars] best 261120 combination reg byte a [ processChars::$68 ] +Uplifting [processChars] best 265728 combination reg byte a [ processChars::$68 ] Attempting to uplift remaining variables inzp ZP_BYTE:134 [ processChars::$69 ] -Uplifting [processChars] best 261060 combination reg byte a [ processChars::$69 ] +Uplifting [processChars] best 265668 combination reg byte a [ processChars::$69 ] Attempting to uplift remaining variables inzp ZP_BYTE:135 [ processChars::$70 ] -Uplifting [processChars] best 261000 combination reg byte a [ processChars::$70 ] +Uplifting [processChars] best 265608 combination reg byte a [ processChars::$70 ] Attempting to uplift remaining variables inzp ZP_BYTE:136 [ processChars::$37 ] -Uplifting [processChars] best 260940 combination reg byte a [ processChars::$37 ] +Uplifting [processChars] best 265548 combination reg byte a [ processChars::$37 ] Attempting to uplift remaining variables inzp ZP_BYTE:142 [ processChars::$11 ] -Uplifting [processChars] best 260880 combination reg byte a [ processChars::$11 ] +Uplifting [processChars] best 265488 combination reg byte a [ processChars::$11 ] Attempting to uplift remaining variables inzp ZP_BYTE:143 [ processChars::$12 ] -Uplifting [processChars] best 260820 combination reg byte a [ processChars::$12 ] +Uplifting [processChars] best 265428 combination reg byte a [ processChars::$12 ] Attempting to uplift remaining variables inzp ZP_BYTE:145 [ processChars::$14 ] -Uplifting [processChars] best 260760 combination reg byte a [ processChars::$14 ] +Uplifting [processChars] best 265368 combination reg byte a [ processChars::$14 ] Attempting to uplift remaining variables inzp ZP_BYTE:151 [ processChars::$26 ] -Uplifting [processChars] best 260720 combination reg byte a [ processChars::$26 ] +Uplifting [processChars] best 265328 combination reg byte a [ processChars::$26 ] Attempting to uplift remaining variables inzp ZP_BYTE:152 [ processChars::xchar#0 ] -Uplifting [processChars] best 260660 combination reg byte a [ processChars::xchar#0 ] +Uplifting [processChars] best 265268 combination reg byte a [ processChars::xchar#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:153 [ processChars::$38 ] -Uplifting [processChars] best 260620 combination reg byte a [ processChars::$38 ] +Uplifting [processChars] best 265228 combination reg byte a [ processChars::$38 ] Attempting to uplift remaining variables inzp ZP_BYTE:154 [ processChars::$30 ] -Uplifting [processChars] best 260580 combination reg byte a [ processChars::$30 ] +Uplifting [processChars] best 265188 combination reg byte a [ processChars::$30 ] Attempting to uplift remaining variables inzp ZP_BYTE:155 [ processChars::ychar#0 ] -Uplifting [processChars] best 260520 combination reg byte a [ processChars::ychar#0 ] +Uplifting [processChars] best 265128 combination reg byte a [ processChars::ychar#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:156 [ processChars::$39 ] -Uplifting [processChars] best 260480 combination reg byte a [ processChars::$39 ] +Uplifting [processChars] best 265088 combination reg byte a [ processChars::$39 ] Attempting to uplift remaining variables inzp ZP_BYTE:157 [ processChars::$33 ] -Uplifting [processChars] best 260420 combination reg byte a [ processChars::$33 ] +Uplifting [processChars] best 265028 combination reg byte a [ processChars::$33 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ main::i#2 main::i#1 ] -Uplifting [main] best 260420 combination zp ZP_BYTE:6 [ main::i#2 main::i#1 ] +Uplifting [main] best 265028 combination zp ZP_BYTE:6 [ main::i#2 main::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:38 [ processChars::i#10 processChars::i#1 ] -Uplifting [processChars] best 260420 combination zp ZP_BYTE:38 [ processChars::i#10 processChars::i#1 ] +Uplifting [processChars] best 265028 combination zp ZP_BYTE:38 [ processChars::i#10 processChars::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:44 [ main::$16 ] -Uplifting [main] best 260260 combination reg byte x [ main::$16 ] +Uplifting [main] best 264868 combination reg byte x [ main::$16 ] Attempting to uplift remaining variables inzp ZP_BYTE:45 [ getCharToProcess::return_x#0 ] -Uplifting [getCharToProcess] best 260200 combination reg byte x [ getCharToProcess::return_x#0 ] +Uplifting [getCharToProcess] best 264808 combination reg byte x [ getCharToProcess::return_x#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:46 [ getCharToProcess::return_y#0 ] -Uplifting [getCharToProcess] best 260140 combination reg byte y [ getCharToProcess::return_y#0 ] +Uplifting [getCharToProcess] best 264748 combination reg byte y [ getCharToProcess::return_y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:144 [ processChars::$17 ] -Uplifting [processChars] best 260070 combination reg byte x [ processChars::$17 ] +Uplifting [processChars] best 264678 combination reg byte x [ processChars::$17 ] Attempting to uplift remaining variables inzp ZP_BYTE:49 [ main::center_x#0 ] -Uplifting [main] best 260010 combination reg byte x [ main::center_x#0 ] +Uplifting [main] best 264618 combination reg byte x [ main::center_x#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:50 [ main::center_y#0 ] -Uplifting [main] best 259950 combination reg byte y [ main::center_y#0 ] +Uplifting [main] best 264558 combination reg byte y [ main::center_y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:104 [ startProcessing::$50 ] -Uplifting [startProcessing] best 259944 combination reg byte a [ startProcessing::$50 ] +Uplifting [startProcessing] best 264552 combination reg byte a [ startProcessing::$50 ] Attempting to uplift remaining variables inzp ZP_BYTE:105 [ startProcessing::$51 ] -Uplifting [startProcessing] best 259938 combination reg byte a [ startProcessing::$51 ] +Uplifting [startProcessing] best 264546 combination reg byte a [ startProcessing::$51 ] Attempting to uplift remaining variables inzp ZP_BYTE:106 [ startProcessing::$52 ] -Uplifting [startProcessing] best 259932 combination reg byte a [ startProcessing::$52 ] +Uplifting [startProcessing] best 264540 combination reg byte a [ startProcessing::$52 ] Attempting to uplift remaining variables inzp ZP_BYTE:107 [ startProcessing::$53 ] -Uplifting [startProcessing] best 259926 combination reg byte a [ startProcessing::$53 ] +Uplifting [startProcessing] best 264534 combination reg byte a [ startProcessing::$53 ] Attempting to uplift remaining variables inzp ZP_BYTE:148 [ processChars::ypos#0 ] -Uplifting [processChars] best 259926 combination zp ZP_BYTE:148 [ processChars::ypos#0 ] +Uplifting [processChars] best 264534 combination zp ZP_BYTE:148 [ processChars::ypos#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:108 [ startProcessing::$31 ] -Uplifting [startProcessing] best 259901 combination reg byte x [ startProcessing::$31 ] +Uplifting [startProcessing] best 264509 combination reg byte x [ startProcessing::$31 ] Attempting to uplift remaining variables inzp ZP_BYTE:139 [ processChars::bitmask#0 ] -Uplifting [processChars] best 259901 combination zp ZP_BYTE:139 [ processChars::bitmask#0 ] +Uplifting [processChars] best 264509 combination zp ZP_BYTE:139 [ processChars::bitmask#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:79 [ startProcessing::ch#0 ] -Uplifting [startProcessing] best 259895 combination reg byte a [ startProcessing::ch#0 ] +Uplifting [startProcessing] best 264503 combination reg byte a [ startProcessing::ch#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:101 [ startProcessing::$22 ] -Uplifting [startProcessing] best 259889 combination reg byte a [ startProcessing::$22 ] +Uplifting [startProcessing] best 264497 combination reg byte a [ startProcessing::$22 ] Attempting to uplift remaining variables inzp ZP_BYTE:53 [ startProcessing::center_x#0 ] -Uplifting [startProcessing] best 259889 combination zp ZP_BYTE:53 [ startProcessing::center_x#0 ] +Uplifting [startProcessing] best 264497 combination zp ZP_BYTE:53 [ startProcessing::center_x#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:100 [ startProcessing::spritePtr#0 ] -Uplifting [startProcessing] best 259889 combination zp ZP_BYTE:100 [ startProcessing::spritePtr#0 ] +Uplifting [startProcessing] best 264497 combination zp ZP_BYTE:100 [ startProcessing::spritePtr#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:54 [ startProcessing::center_y#0 ] -Uplifting [startProcessing] best 259889 combination zp ZP_BYTE:54 [ startProcessing::center_y#0 ] +Uplifting [startProcessing] best 264497 combination zp ZP_BYTE:54 [ startProcessing::center_y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:72 [ startProcessing::spriteCol#0 ] -Uplifting [startProcessing] best 259889 combination zp ZP_BYTE:72 [ startProcessing::spriteCol#0 ] +Uplifting [startProcessing] best 264497 combination zp ZP_BYTE:72 [ startProcessing::spriteCol#0 ] Coalescing zero page register with common assignment [ zp ZP_WORD:9 [ startProcessing::chargenData#2 startProcessing::chargenData#0 startProcessing::chargenData#1 ] ] with [ zp ZP_WORD:82 [ startProcessing::$9 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:11 [ startProcessing::spriteData#2 startProcessing::spriteData#0 startProcessing::spriteData#1 ] ] with [ zp ZP_WORD:77 [ startProcessing::$6 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:22 [ getCharToProcess::return_dist#1 getCharToProcess::return_dist#5 getCharToProcess::return_dist#6 getCharToProcess::dist#0 ] ] with [ zp ZP_WORD:47 [ getCharToProcess::return_dist#0 ] ] - score: 1 @@ -8597,6 +8598,7 @@ irqTop: { ldy #00 rti } +//SEG437 File Data // Copy of the screen used for finding chars to process SCREEN_COPY: .fill $3e8, 0 // SQUARES_X[i] = (i-20)*(i-20) @@ -9381,7 +9383,7 @@ reg byte a [ processChars::$33 ] FINAL ASSEMBLER -Score: 243658 +Score: 248266 //SEG0 File Comments // Clears start screen throwing around the letters (by turning them into sprites) @@ -10917,6 +10919,7 @@ irqTop: { ldy #00 rti } +//SEG437 File Data // Copy of the screen used for finding chars to process SCREEN_COPY: .fill $3e8, 0 // SQUARES_X[i] = (i-20)*(i-20) diff --git a/src/test/ref/complex/medusa/medusa.log b/src/test/ref/complex/medusa/medusa.log index 962a1f25f..523d33819 100644 --- a/src/test/ref/complex/medusa/medusa.log +++ b/src/test/ref/complex/medusa/medusa.log @@ -44,9 +44,6 @@ Adding pointer type conversion cast (void()**) KERNEL_IRQ in (void()**) KERNEL_I Adding pointer type conversion cast (void()**) HARDWARE_IRQ in (void()**) HARDWARE_IRQ ← (number) $fffe Adding pointer type conversion cast to void pointer (byte*) memcpy::source in (byte*) memcpy::src ← (void*) memcpy::source Adding pointer type conversion cast to void pointer (byte*) memcpy::destination in (byte*) memcpy::dst ← (void*) memcpy::destination -Adding pointer type conversion cast to void pointer (byte*) memmove::$3 in (byte*) memmove::src ← (void*~) memmove::$3 -Adding pointer type conversion cast to void pointer (byte*) memmove::$4 in (byte*) memmove::dst ← (void*~) memmove::$4 -Adding pointer type conversion cast to void pointer (byte*) memset::$0 in (byte*) memset::end ← (void*~) memset::$0 Adding pointer type conversion cast to void pointer (byte*) memset::str in (byte*) memset::dst ← (void*) memset::str Adding pointer type conversion cast (byte*) MEDUSA_SCREEN in (byte*) MEDUSA_SCREEN ← (number) $1000 Adding pointer type conversion cast (byte*) MEDUSA_COLORS in (byte*) MEDUSA_COLORS ← (number) $1400 @@ -600,6 +597,7 @@ memcpy: { //SEG44 [20] return rts } +//SEG45 File Data .pc = MEDUSA_SCREEN "MEDUSA_SCREEN" .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE) .fill fileScreen.getSize(), fileScreen.get(i) @@ -627,9 +625,9 @@ Uplift Scope [memcpy] 27: zp ZP_WORD:8 [ memcpy::dst#2 memcpy::dst#3 memcpy::dst Uplift Scope [main] Uplift Scope [] -Uplifting [memcpy] best 1673 combination zp ZP_WORD:8 [ memcpy::dst#2 memcpy::dst#3 memcpy::dst#1 ] zp ZP_WORD:10 [ memcpy::i#2 memcpy::i#1 ] zp ZP_WORD:6 [ memcpy::src#2 memcpy::src#3 memcpy::src#1 ] zp ZP_WORD:2 [ memcpy::source#2 ] zp ZP_WORD:4 [ memcpy::destination#2 ] -Uplifting [main] best 1673 combination -Uplifting [] best 1673 combination +Uplifting [memcpy] best 6281 combination zp ZP_WORD:8 [ memcpy::dst#2 memcpy::dst#3 memcpy::dst#1 ] zp ZP_WORD:10 [ memcpy::i#2 memcpy::i#1 ] zp ZP_WORD:6 [ memcpy::src#2 memcpy::src#3 memcpy::src#1 ] zp ZP_WORD:2 [ memcpy::source#2 ] zp ZP_WORD:4 [ memcpy::destination#2 ] +Uplifting [main] best 6281 combination +Uplifting [] best 6281 combination Coalescing zero page register with common assignment [ zp ZP_WORD:2 [ memcpy::source#2 ] ] with [ zp ZP_WORD:6 [ memcpy::src#2 memcpy::src#3 memcpy::src#1 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:4 [ memcpy::destination#2 ] ] with [ zp ZP_WORD:8 [ memcpy::dst#2 memcpy::dst#3 memcpy::dst#1 ] ] - score: 1 Allocated (was zp ZP_WORD:10) zp ZP_WORD:6 [ memcpy::i#2 memcpy::i#1 ] @@ -782,6 +780,7 @@ memcpy: { //SEG44 [20] return rts } +//SEG45 File Data .pc = MEDUSA_SCREEN "MEDUSA_SCREEN" .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE) .fill fileScreen.getSize(), fileScreen.get(i) @@ -874,7 +873,7 @@ zp ZP_WORD:6 [ memcpy::i#2 memcpy::i#1 ] FINAL ASSEMBLER -Score: 1471 +Score: 6079 //SEG0 File Comments // Display MEDUSA PETSCII by Buzz_clik @@ -999,6 +998,7 @@ memcpy: { //SEG44 [20] return rts } +//SEG45 File Data .pc = MEDUSA_SCREEN "MEDUSA_SCREEN" .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE) .fill fileScreen.getSize(), fileScreen.get(i) diff --git a/src/test/ref/complex/tetris/test-sprites.log b/src/test/ref/complex/tetris/test-sprites.log index 82032234c..df2fb70e7 100644 --- a/src/test/ref/complex/tetris/test-sprites.log +++ b/src/test/ref/complex/tetris/test-sprites.log @@ -2850,6 +2850,7 @@ sprites_irq: { sta PLAYFIELD_SPRITE_PTRS_1+3 jmp b2 } +//SEG187 File Data .pc = PLAYFIELD_SPRITES "PLAYFIELD_SPRITES" .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory @@ -3029,42 +3030,42 @@ Uplift Scope [sprites_init] 25.3: zp ZP_BYTE:8 [ sprites_init::s#2 sprites_init: Uplift Scope [sprites_irq] 6.5: zp ZP_BYTE:10 [ sprites_irq::raster_sprite_gfx_modify#0 ] 4: zp ZP_BYTE:21 [ sprites_irq::$0 ] 4: zp ZP_BYTE:24 [ sprites_irq::ptr#4 ] 4: zp ZP_BYTE:26 [ sprites_irq::ptr#2 ] 2.67: zp ZP_BYTE:23 [ sprites_irq::ptr#3 ] 2.67: zp ZP_BYTE:25 [ sprites_irq::ptr#1 ] 2.5: zp ZP_BYTE:20 [ sprites_irq::ypos#0 ] 2.5: zp ZP_BYTE:22 [ sprites_irq::ptr#0 ] Uplift Scope [sprites_irq_init] -Uplifting [loop] best 9610 combination zp ZP_BYTE:6 [ loop::s#2 loop::s#1 ] reg byte a [ loop::$1 ] reg byte x [ loop::idx#2 loop::idx#0 loop::idx#1 ] -Uplifting [] best 9610 combination zp ZP_BYTE:14 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] zp ZP_BYTE:13 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] zp ZP_BYTE:15 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] zp ZP_BYTE:5 [ sin_idx#10 sin_idx#3 ] zp ZP_BYTE:12 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] zp ZP_BYTE:11 [ render_screen_showing#0 ] -Uplifting [main] best 9330 combination reg byte y [ main::s#2 main::s#1 ] reg byte a [ main::$6 ] reg byte x [ main::s2#0 ] zp ZP_BYTE:4 [ main::ypos#2 main::ypos#1 ] zp ZP_BYTE:3 [ main::xpos#2 main::xpos#1 ] +Uplifting [loop] best 16522 combination zp ZP_BYTE:6 [ loop::s#2 loop::s#1 ] reg byte a [ loop::$1 ] reg byte x [ loop::idx#2 loop::idx#0 loop::idx#1 ] +Uplifting [] best 16522 combination zp ZP_BYTE:14 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] zp ZP_BYTE:13 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] zp ZP_BYTE:15 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] zp ZP_BYTE:5 [ sin_idx#10 sin_idx#3 ] zp ZP_BYTE:12 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] zp ZP_BYTE:11 [ render_screen_showing#0 ] +Uplifting [main] best 16242 combination reg byte y [ main::s#2 main::s#1 ] reg byte a [ main::$6 ] reg byte x [ main::s2#0 ] zp ZP_BYTE:4 [ main::ypos#2 main::ypos#1 ] zp ZP_BYTE:3 [ main::xpos#2 main::xpos#1 ] Limited combination testing to 100 combinations of 324 possible. -Uplifting [sprites_init] best 9160 combination reg byte y [ sprites_init::s#2 sprites_init::s#1 ] reg byte x [ sprites_init::s2#0 ] zp ZP_BYTE:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] -Uplifting [sprites_irq] best 9136 combination zp ZP_BYTE:10 [ sprites_irq::raster_sprite_gfx_modify#0 ] reg byte x [ sprites_irq::$0 ] reg byte a [ sprites_irq::ptr#4 ] reg byte a [ sprites_irq::ptr#2 ] reg byte a [ sprites_irq::ptr#3 ] zp ZP_BYTE:25 [ sprites_irq::ptr#1 ] zp ZP_BYTE:20 [ sprites_irq::ypos#0 ] zp ZP_BYTE:22 [ sprites_irq::ptr#0 ] +Uplifting [sprites_init] best 16072 combination reg byte y [ sprites_init::s#2 sprites_init::s#1 ] reg byte x [ sprites_init::s2#0 ] zp ZP_BYTE:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] +Uplifting [sprites_irq] best 16048 combination zp ZP_BYTE:10 [ sprites_irq::raster_sprite_gfx_modify#0 ] reg byte x [ sprites_irq::$0 ] reg byte a [ sprites_irq::ptr#4 ] reg byte a [ sprites_irq::ptr#2 ] reg byte a [ sprites_irq::ptr#3 ] zp ZP_BYTE:25 [ sprites_irq::ptr#1 ] zp ZP_BYTE:20 [ sprites_irq::ypos#0 ] zp ZP_BYTE:22 [ sprites_irq::ptr#0 ] Limited combination testing to 100 combinations of 12288 possible. -Uplifting [sprites_irq_init] best 9136 combination +Uplifting [sprites_irq_init] best 16048 combination Attempting to uplift remaining variables inzp ZP_BYTE:6 [ loop::s#2 loop::s#1 ] -Uplifting [loop] best 9136 combination zp ZP_BYTE:6 [ loop::s#2 loop::s#1 ] +Uplifting [loop] best 16048 combination zp ZP_BYTE:6 [ loop::s#2 loop::s#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:14 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] -Uplifting [] best 9136 combination zp ZP_BYTE:14 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] +Uplifting [] best 16048 combination zp ZP_BYTE:14 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:13 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] -Uplifting [] best 9136 combination zp ZP_BYTE:13 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] +Uplifting [] best 16048 combination zp ZP_BYTE:13 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:15 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] -Uplifting [] best 9136 combination zp ZP_BYTE:15 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] +Uplifting [] best 16048 combination zp ZP_BYTE:15 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ sin_idx#10 sin_idx#3 ] -Uplifting [] best 9136 combination zp ZP_BYTE:5 [ sin_idx#10 sin_idx#3 ] +Uplifting [] best 16048 combination zp ZP_BYTE:5 [ sin_idx#10 sin_idx#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] -Uplifting [sprites_init] best 9136 combination zp ZP_BYTE:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] +Uplifting [sprites_init] best 16048 combination zp ZP_BYTE:9 [ sprites_init::xpos#2 sprites_init::xpos#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:12 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] -Uplifting [] best 9136 combination zp ZP_BYTE:12 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] +Uplifting [] best 16048 combination zp ZP_BYTE:12 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:4 [ main::ypos#2 main::ypos#1 ] -Uplifting [main] best 9136 combination zp ZP_BYTE:4 [ main::ypos#2 main::ypos#1 ] +Uplifting [main] best 16048 combination zp ZP_BYTE:4 [ main::ypos#2 main::ypos#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::xpos#2 main::xpos#1 ] -Uplifting [main] best 9136 combination zp ZP_BYTE:3 [ main::xpos#2 main::xpos#1 ] +Uplifting [main] best 16048 combination zp ZP_BYTE:3 [ main::xpos#2 main::xpos#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:10 [ sprites_irq::raster_sprite_gfx_modify#0 ] -Uplifting [sprites_irq] best 9136 combination zp ZP_BYTE:10 [ sprites_irq::raster_sprite_gfx_modify#0 ] +Uplifting [sprites_irq] best 16048 combination zp ZP_BYTE:10 [ sprites_irq::raster_sprite_gfx_modify#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ sprites_irq::ptr#1 ] -Uplifting [sprites_irq] best 9124 combination reg byte x [ sprites_irq::ptr#1 ] +Uplifting [sprites_irq] best 16036 combination reg byte x [ sprites_irq::ptr#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:20 [ sprites_irq::ypos#0 ] -Uplifting [sprites_irq] best 9109 combination reg byte a [ sprites_irq::ypos#0 ] +Uplifting [sprites_irq] best 16021 combination reg byte a [ sprites_irq::ypos#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:22 [ sprites_irq::ptr#0 ] -Uplifting [sprites_irq] best 9094 combination reg byte x [ sprites_irq::ptr#0 ] +Uplifting [sprites_irq] best 16006 combination reg byte x [ sprites_irq::ptr#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:11 [ render_screen_showing#0 ] -Uplifting [] best 9094 combination zp ZP_BYTE:11 [ render_screen_showing#0 ] +Uplifting [] best 16006 combination zp ZP_BYTE:11 [ render_screen_showing#0 ] Allocated (was zp ZP_BYTE:3) zp ZP_BYTE:2 [ main::xpos#2 main::xpos#1 ] Allocated (was zp ZP_BYTE:4) zp ZP_BYTE:3 [ main::ypos#2 main::ypos#1 ] Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:4 [ sin_idx#10 sin_idx#3 ] @@ -3676,6 +3677,7 @@ sprites_irq: { sta PLAYFIELD_SPRITE_PTRS_1+3 jmp b2 } +//SEG187 File Data .pc = PLAYFIELD_SPRITES "PLAYFIELD_SPRITES" .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory @@ -4062,7 +4064,7 @@ reg byte a [ sprites_irq::ptr#2 ] FINAL ASSEMBLER -Score: 7310 +Score: 14222 //SEG0 File Comments //SEG1 Basic Upstart @@ -4565,6 +4567,7 @@ sprites_irq: { sta PLAYFIELD_SPRITE_PTRS_1+3 jmp b2 } +//SEG187 File Data .pc = PLAYFIELD_SPRITES "PLAYFIELD_SPRITES" .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory diff --git a/src/test/ref/complex/tetris/tetris.log b/src/test/ref/complex/tetris/tetris.log index e7f2689c3..5c84d3024 100644 --- a/src/test/ref/complex/tetris/tetris.log +++ b/src/test/ref/complex/tetris/tetris.log @@ -17871,6 +17871,7 @@ sprites_irq: { sta PLAYFIELD_SPRITE_PTRS_1+3 jmp b2 } +//SEG1270 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -18822,243 +18823,243 @@ Uplift Scope [sid_rnd_init] Uplift Scope [render_screen_swap] Uplift Scope [sprites_irq_init] -Uplifting [keyboard_event_scan] best 4699908 combination reg byte a [ keyboard_event_scan::$15 ] reg byte a [ keyboard_event_scan::$16 ] reg byte a [ keyboard_event_scan::event_type#0 ] reg byte a [ keyboard_event_scan::$23 ] zp ZP_BYTE:91 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] zp ZP_BYTE:92 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ] zp ZP_BYTE:90 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] zp ZP_BYTE:199 [ keyboard_event_scan::row_scan#0 ] zp ZP_BYTE:201 [ keyboard_event_scan::$0 ] zp ZP_BYTE:203 [ keyboard_event_scan::$3 ] zp ZP_BYTE:205 [ keyboard_event_scan::$6 ] zp ZP_BYTE:207 [ keyboard_event_scan::$9 ] +Uplifting [keyboard_event_scan] best 4709124 combination reg byte a [ keyboard_event_scan::$15 ] reg byte a [ keyboard_event_scan::$16 ] reg byte a [ keyboard_event_scan::event_type#0 ] reg byte a [ keyboard_event_scan::$23 ] zp ZP_BYTE:91 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] zp ZP_BYTE:92 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ] zp ZP_BYTE:90 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] zp ZP_BYTE:199 [ keyboard_event_scan::row_scan#0 ] zp ZP_BYTE:201 [ keyboard_event_scan::$0 ] zp ZP_BYTE:203 [ keyboard_event_scan::$3 ] zp ZP_BYTE:205 [ keyboard_event_scan::$6 ] zp ZP_BYTE:207 [ keyboard_event_scan::$9 ] Limited combination testing to 100 combinations of 524288 possible. -Uplifting [play_collision] best 4549908 combination zp ZP_BYTE:50 [ play_collision::i#2 play_collision::i#3 play_collision::i#10 play_collision::i#12 ] reg byte a [ play_collision::$5 ] zp ZP_BYTE:51 [ play_collision::xp#2 play_collision::xp#8 play_collision::xp#1 ] reg byte x [ play_collision::c#2 play_collision::c#1 ] zp ZP_BYTE:156 [ play_collision::$14 ] zp ZP_BYTE:159 [ play_collision::i#1 ] zp ZP_BYTE:48 [ play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 ] zp ZP_BYTE:49 [ play_collision::l#6 play_collision::l#1 ] zp ZP_WORD:157 [ play_collision::playfield_line#0 ] zp ZP_WORD:154 [ play_collision::piece_gfx#0 ] zp ZP_BYTE:47 [ play_collision::xpos#6 play_collision::xpos#0 play_collision::xpos#1 play_collision::xpos#2 play_collision::xpos#3 play_collision::xpos#4 ] zp ZP_BYTE:46 [ play_collision::orientation#5 play_collision::orientation#0 play_collision::orientation#1 play_collision::orientation#2 play_collision::orientation#3 ] zp ZP_BYTE:151 [ play_collision::return#14 ] zp ZP_BYTE:161 [ play_collision::return#13 ] zp ZP_BYTE:163 [ play_collision::return#1 ] zp ZP_BYTE:167 [ play_collision::return#0 ] zp ZP_BYTE:174 [ play_collision::return#10 ] zp ZP_BYTE:53 [ play_collision::return#15 ] +Uplifting [play_collision] best 4559124 combination zp ZP_BYTE:50 [ play_collision::i#2 play_collision::i#3 play_collision::i#10 play_collision::i#12 ] reg byte a [ play_collision::$5 ] zp ZP_BYTE:51 [ play_collision::xp#2 play_collision::xp#8 play_collision::xp#1 ] reg byte x [ play_collision::c#2 play_collision::c#1 ] zp ZP_BYTE:156 [ play_collision::$14 ] zp ZP_BYTE:159 [ play_collision::i#1 ] zp ZP_BYTE:48 [ play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 ] zp ZP_BYTE:49 [ play_collision::l#6 play_collision::l#1 ] zp ZP_WORD:157 [ play_collision::playfield_line#0 ] zp ZP_WORD:154 [ play_collision::piece_gfx#0 ] zp ZP_BYTE:47 [ play_collision::xpos#6 play_collision::xpos#0 play_collision::xpos#1 play_collision::xpos#2 play_collision::xpos#3 play_collision::xpos#4 ] zp ZP_BYTE:46 [ play_collision::orientation#5 play_collision::orientation#0 play_collision::orientation#1 play_collision::orientation#2 play_collision::orientation#3 ] zp ZP_BYTE:151 [ play_collision::return#14 ] zp ZP_BYTE:161 [ play_collision::return#13 ] zp ZP_BYTE:163 [ play_collision::return#1 ] zp ZP_BYTE:167 [ play_collision::return#0 ] zp ZP_BYTE:174 [ play_collision::return#10 ] zp ZP_BYTE:53 [ play_collision::return#15 ] Limited combination testing to 100 combinations of 429981696 possible. -Uplifting [play_lock_current] best 4455908 combination zp ZP_BYTE:85 [ play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 ] zp ZP_BYTE:86 [ play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 ] reg byte x [ play_lock_current::c#2 play_lock_current::c#1 ] zp ZP_BYTE:192 [ play_lock_current::i#1 ] reg byte a [ play_lock_current::$4 ] zp ZP_BYTE:84 [ play_lock_current::l#6 play_lock_current::l#1 ] zp ZP_WORD:190 [ play_lock_current::playfield_line#0 ] zp ZP_BYTE:83 [ play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ] +Uplifting [play_lock_current] best 4465124 combination zp ZP_BYTE:85 [ play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 ] zp ZP_BYTE:86 [ play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 ] reg byte x [ play_lock_current::c#2 play_lock_current::c#1 ] zp ZP_BYTE:192 [ play_lock_current::i#1 ] reg byte a [ play_lock_current::$4 ] zp ZP_BYTE:84 [ play_lock_current::l#6 play_lock_current::l#1 ] zp ZP_WORD:190 [ play_lock_current::playfield_line#0 ] zp ZP_BYTE:83 [ play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ] Limited combination testing to 100 combinations of 2916 possible. -Uplifting [play_remove_lines] best 4316908 combination reg byte y [ play_remove_lines::r#2 play_remove_lines::r#3 play_remove_lines::r#1 ] reg byte x [ play_remove_lines::w#6 play_remove_lines::w#3 play_remove_lines::w#4 play_remove_lines::w#12 play_remove_lines::w#11 play_remove_lines::w#1 play_remove_lines::w#2 ] zp ZP_BYTE:80 [ play_remove_lines::x#2 play_remove_lines::x#1 ] zp ZP_BYTE:81 [ play_remove_lines::full#4 play_remove_lines::full#2 ] zp ZP_BYTE:188 [ play_remove_lines::c#0 ] zp ZP_BYTE:78 [ play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 ] zp ZP_BYTE:77 [ play_remove_lines::y#8 play_remove_lines::y#1 ] zp ZP_BYTE:169 [ play_remove_lines::return#0 ] +Uplifting [play_remove_lines] best 4326124 combination reg byte y [ play_remove_lines::r#2 play_remove_lines::r#3 play_remove_lines::r#1 ] reg byte x [ play_remove_lines::w#6 play_remove_lines::w#3 play_remove_lines::w#4 play_remove_lines::w#12 play_remove_lines::w#11 play_remove_lines::w#1 play_remove_lines::w#2 ] zp ZP_BYTE:80 [ play_remove_lines::x#2 play_remove_lines::x#1 ] zp ZP_BYTE:81 [ play_remove_lines::full#4 play_remove_lines::full#2 ] zp ZP_BYTE:188 [ play_remove_lines::c#0 ] zp ZP_BYTE:78 [ play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 ] zp ZP_BYTE:77 [ play_remove_lines::y#8 play_remove_lines::y#1 ] zp ZP_BYTE:169 [ play_remove_lines::return#0 ] Limited combination testing to 100 combinations of 20736 possible. -Uplifting [] best 4316666 combination zp ZP_BYTE:93 [ keyboard_events_size#10 keyboard_events_size#30 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#29 keyboard_events_size#1 keyboard_events_size#2 ] zp ZP_BYTE:74 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ] zp ZP_BYTE:4 [ render_screen_showing#13 render_screen_showing#1 render_screen_showing#0 ] zp ZP_WORD:70 [ current_piece_gfx#35 current_piece_gfx#13 current_piece_gfx#18 current_piece_gfx#124 current_piece_gfx#20 current_piece_gfx#21 current_piece_gfx#7 current_piece_gfx#117 ] zp ZP_BYTE:68 [ current_piece_char#29 current_piece_char#10 current_piece_char#16 current_piece_char#5 ] zp ZP_BYTE:29 [ current_piece_char#68 current_piece_char#100 current_piece_char#101 ] zp ZP_BYTE:120 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] zp ZP_BYTE:119 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] zp ZP_BYTE:121 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] zp ZP_WORD:27 [ current_piece_gfx#64 current_piece_gfx#112 current_piece_gfx#113 ] zp ZP_BYTE:72 [ current_xpos#43 current_xpos#14 current_xpos#19 current_xpos#100 current_xpos#22 current_xpos#26 current_xpos#6 current_xpos#8 ] zp ZP_WORD:44 [ current_piece#17 current_piece#96 current_piece#97 current_piece#98 current_piece#99 current_piece#100 ] reg byte x [ render_screen_render#22 render_screen_render#64 ] reg byte x [ next_piece_idx#12 next_piece_idx#77 next_piece_idx#78 ] reg byte a [ render_screen_render#15 render_screen_render#66 ] reg byte x [ current_ypos#13 current_ypos#98 current_ypos#99 ] zp ZP_BYTE:65 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ] zp ZP_BYTE:69 [ current_orientation#37 current_orientation#13 current_orientation#17 current_orientation#20 current_orientation#25 current_orientation#7 ] zp ZP_BYTE:64 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#66 current_movedown_slow#10 ] zp ZP_BYTE:56 [ current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 ] zp ZP_WORD:66 [ current_piece#28 current_piece#10 current_piece#15 current_piece#102 current_piece#93 ] zp ZP_BYTE:75 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ] zp ZP_BYTE:26 [ current_xpos#59 current_xpos#119 current_xpos#120 ] zp ZP_DWORD:59 [ score_bcd#26 score_bcd#18 score_bcd#14 score_bcd#0 score_bcd#16 score_bcd#29 ] zp ZP_BYTE:63 [ level#33 level#10 level#17 level#19 level#21 ] zp ZP_WORD:57 [ lines_bcd#26 lines_bcd#19 lines_bcd#15 lines_bcd#17 lines_bcd#29 ] zp ZP_BYTE:5 [ current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ] zp ZP_BYTE:118 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] zp ZP_BYTE:25 [ render_screen_render#33 render_screen_render#65 ] zp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 ] zp ZP_BYTE:3 [ render_screen_render#18 render_screen_render#11 ] +Uplifting [] best 4325882 combination zp ZP_BYTE:93 [ keyboard_events_size#10 keyboard_events_size#30 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#29 keyboard_events_size#1 keyboard_events_size#2 ] zp ZP_BYTE:74 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ] zp ZP_BYTE:4 [ render_screen_showing#13 render_screen_showing#1 render_screen_showing#0 ] zp ZP_WORD:70 [ current_piece_gfx#35 current_piece_gfx#13 current_piece_gfx#18 current_piece_gfx#124 current_piece_gfx#20 current_piece_gfx#21 current_piece_gfx#7 current_piece_gfx#117 ] zp ZP_BYTE:68 [ current_piece_char#29 current_piece_char#10 current_piece_char#16 current_piece_char#5 ] zp ZP_BYTE:29 [ current_piece_char#68 current_piece_char#100 current_piece_char#101 ] zp ZP_BYTE:120 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] zp ZP_BYTE:119 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] zp ZP_BYTE:121 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] zp ZP_WORD:27 [ current_piece_gfx#64 current_piece_gfx#112 current_piece_gfx#113 ] zp ZP_BYTE:72 [ current_xpos#43 current_xpos#14 current_xpos#19 current_xpos#100 current_xpos#22 current_xpos#26 current_xpos#6 current_xpos#8 ] zp ZP_WORD:44 [ current_piece#17 current_piece#96 current_piece#97 current_piece#98 current_piece#99 current_piece#100 ] reg byte x [ render_screen_render#22 render_screen_render#64 ] reg byte x [ next_piece_idx#12 next_piece_idx#77 next_piece_idx#78 ] reg byte a [ render_screen_render#15 render_screen_render#66 ] reg byte x [ current_ypos#13 current_ypos#98 current_ypos#99 ] zp ZP_BYTE:65 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ] zp ZP_BYTE:69 [ current_orientation#37 current_orientation#13 current_orientation#17 current_orientation#20 current_orientation#25 current_orientation#7 ] zp ZP_BYTE:64 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#66 current_movedown_slow#10 ] zp ZP_BYTE:56 [ current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 ] zp ZP_WORD:66 [ current_piece#28 current_piece#10 current_piece#15 current_piece#102 current_piece#93 ] zp ZP_BYTE:75 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ] zp ZP_BYTE:26 [ current_xpos#59 current_xpos#119 current_xpos#120 ] zp ZP_DWORD:59 [ score_bcd#26 score_bcd#18 score_bcd#14 score_bcd#0 score_bcd#16 score_bcd#29 ] zp ZP_BYTE:63 [ level#33 level#10 level#17 level#19 level#21 ] zp ZP_WORD:57 [ lines_bcd#26 lines_bcd#19 lines_bcd#15 lines_bcd#17 lines_bcd#29 ] zp ZP_BYTE:5 [ current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ] zp ZP_BYTE:118 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] zp ZP_BYTE:25 [ render_screen_render#33 render_screen_render#65 ] zp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 ] zp ZP_BYTE:3 [ render_screen_render#18 render_screen_render#11 ] Limited combination testing to 100 combinations of 1944 possible. -Uplifting [render_moving] best 4301666 combination zp ZP_BYTE:32 [ render_moving::i#4 render_moving::i#3 render_moving::i#8 render_moving::i#2 render_moving::i#1 ] reg byte x [ render_moving::c#2 render_moving::c#1 ] zp ZP_BYTE:33 [ render_moving::xpos#2 render_moving::xpos#0 render_moving::xpos#1 ] reg byte a [ render_moving::current_cell#0 ] zp ZP_BYTE:134 [ render_moving::$1 ] zp ZP_BYTE:135 [ render_moving::$6 ] zp ZP_BYTE:31 [ render_moving::l#4 render_moving::l#1 ] zp ZP_WORD:136 [ render_moving::screen_line#0 ] zp ZP_BYTE:30 [ render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 ] +Uplifting [render_moving] best 4310882 combination zp ZP_BYTE:32 [ render_moving::i#4 render_moving::i#3 render_moving::i#8 render_moving::i#2 render_moving::i#1 ] reg byte x [ render_moving::c#2 render_moving::c#1 ] zp ZP_BYTE:33 [ render_moving::xpos#2 render_moving::xpos#0 render_moving::xpos#1 ] reg byte a [ render_moving::current_cell#0 ] zp ZP_BYTE:134 [ render_moving::$1 ] zp ZP_BYTE:135 [ render_moving::$6 ] zp ZP_BYTE:31 [ render_moving::l#4 render_moving::l#1 ] zp ZP_WORD:136 [ render_moving::screen_line#0 ] zp ZP_BYTE:30 [ render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 ] Limited combination testing to 100 combinations of 15552 possible. -Uplifting [render_next] best 4286662 combination zp ZP_WORD:19 [ render_next::next_piece_gfx#2 render_next::next_piece_gfx#3 render_next::next_piece_gfx#1 render_next::next_piece_gfx#9 ] reg byte x [ render_next::c#2 render_next::c#1 ] zp ZP_WORD:21 [ render_next::screen_next_area#5 render_next::screen_next_area#10 render_next::screen_next_area#4 render_next::screen_next_area#11 render_next::screen_next_area#3 ] reg byte a [ render_next::cell#0 ] zp ZP_BYTE:18 [ render_next::l#7 render_next::l#1 ] zp ZP_BYTE:132 [ render_next::next_piece_char#0 ] reg byte y [ render_next::$6 ] +Uplifting [render_next] best 4295878 combination zp ZP_WORD:19 [ render_next::next_piece_gfx#2 render_next::next_piece_gfx#3 render_next::next_piece_gfx#1 render_next::next_piece_gfx#9 ] reg byte x [ render_next::c#2 render_next::c#1 ] zp ZP_WORD:21 [ render_next::screen_next_area#5 render_next::screen_next_area#10 render_next::screen_next_area#4 render_next::screen_next_area#11 render_next::screen_next_area#3 ] reg byte a [ render_next::cell#0 ] zp ZP_BYTE:18 [ render_next::l#7 render_next::l#1 ] zp ZP_BYTE:132 [ render_next::next_piece_char#0 ] reg byte y [ render_next::$6 ] Limited combination testing to 100 combinations of 128 possible. -Uplifting [play_increase_level] best 4272656 combination reg byte a [ play_increase_level::$5 ] reg byte x [ play_increase_level::b#2 play_increase_level::b#1 ] reg byte a [ play_increase_level::$1 ] -Uplifting [render_playfield] best 4271656 combination zp ZP_WORD:38 [ render_playfield::screen_line#2 render_playfield::screen_line#0 render_playfield::screen_line#1 ] zp ZP_BYTE:40 [ render_playfield::c#2 render_playfield::c#1 ] zp ZP_BYTE:37 [ render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 ] reg byte a [ render_playfield::$2 ] reg byte a [ render_playfield::$6 ] zp ZP_BYTE:36 [ render_playfield::l#2 render_playfield::l#1 ] +Uplifting [play_increase_level] best 4281872 combination reg byte a [ play_increase_level::$5 ] reg byte x [ play_increase_level::b#2 play_increase_level::b#1 ] reg byte a [ play_increase_level::$1 ] +Uplifting [render_playfield] best 4280872 combination zp ZP_WORD:38 [ render_playfield::screen_line#2 render_playfield::screen_line#0 render_playfield::screen_line#1 ] zp ZP_BYTE:40 [ render_playfield::c#2 render_playfield::c#1 ] zp ZP_BYTE:37 [ render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 ] reg byte a [ render_playfield::$2 ] reg byte a [ render_playfield::$6 ] zp ZP_BYTE:36 [ render_playfield::l#2 render_playfield::l#1 ] Limited combination testing to 100 combinations of 128 possible. -Uplifting [keyboard_matrix_read] best 4259650 combination reg byte a [ keyboard_matrix_read::return#2 ] reg byte x [ keyboard_matrix_read::rowid#0 ] reg byte a [ keyboard_matrix_read::return#0 ] -Uplifting [render_screen_original] best 4257550 combination zp ZP_WORD:112 [ render_screen_original::screen#7 render_screen_original::screen#6 render_screen_original::screen#5 render_screen_original::screen#8 render_screen_original::screen#9 render_screen_original::screen#10 render_screen_original::screen#2 render_screen_original::screen#3 ] reg byte x [ render_screen_original::x#6 render_screen_original::x#5 render_screen_original::x#4 render_screen_original::x#1 render_screen_original::x#2 render_screen_original::x#3 ] zp ZP_WORD:114 [ render_screen_original::cols#6 render_screen_original::cols#5 render_screen_original::cols#4 render_screen_original::cols#7 render_screen_original::cols#3 render_screen_original::cols#1 render_screen_original::cols#2 ] zp ZP_WORD:108 [ render_screen_original::oscr#2 render_screen_original::oscr#4 render_screen_original::oscr#1 ] zp ZP_WORD:110 [ render_screen_original::ocols#2 render_screen_original::ocols#4 render_screen_original::ocols#1 ] zp ZP_BYTE:107 [ render_screen_original::y#6 render_screen_original::y#1 ] -Uplifting [play_spawn_current] best 4251531 combination reg byte a [ play_spawn_current::sid_rnd1_return#0 ] reg byte a [ play_spawn_current::$1 ] reg byte x [ play_spawn_current::current_piece_idx#0 ] zp ZP_BYTE:173 [ play_spawn_current::$7 ] -Uplifting [main] best 4250331 combination reg byte a [ main::render#1 ] reg byte x [ main::key_event#0 ] -Uplifting [play_movement] best 4249719 combination reg byte a [ play_movement::return#3 ] zp ZP_BYTE:41 [ play_movement::return#2 play_movement::render#1 play_movement::return#0 ] zp ZP_BYTE:124 [ play_movement::key_event#0 ] reg byte a [ play_movement::$3 ] reg byte a [ play_movement::$4 ] zp ZP_BYTE:146 [ play_movement::render#2 ] +Uplifting [keyboard_matrix_read] best 4268866 combination reg byte a [ keyboard_matrix_read::return#2 ] reg byte x [ keyboard_matrix_read::rowid#0 ] reg byte a [ keyboard_matrix_read::return#0 ] +Uplifting [render_screen_original] best 4266766 combination zp ZP_WORD:112 [ render_screen_original::screen#7 render_screen_original::screen#6 render_screen_original::screen#5 render_screen_original::screen#8 render_screen_original::screen#9 render_screen_original::screen#10 render_screen_original::screen#2 render_screen_original::screen#3 ] reg byte x [ render_screen_original::x#6 render_screen_original::x#5 render_screen_original::x#4 render_screen_original::x#1 render_screen_original::x#2 render_screen_original::x#3 ] zp ZP_WORD:114 [ render_screen_original::cols#6 render_screen_original::cols#5 render_screen_original::cols#4 render_screen_original::cols#7 render_screen_original::cols#3 render_screen_original::cols#1 render_screen_original::cols#2 ] zp ZP_WORD:108 [ render_screen_original::oscr#2 render_screen_original::oscr#4 render_screen_original::oscr#1 ] zp ZP_WORD:110 [ render_screen_original::ocols#2 render_screen_original::ocols#4 render_screen_original::ocols#1 ] zp ZP_BYTE:107 [ render_screen_original::y#6 render_screen_original::y#1 ] +Uplifting [play_spawn_current] best 4260747 combination reg byte a [ play_spawn_current::sid_rnd1_return#0 ] reg byte a [ play_spawn_current::$1 ] reg byte x [ play_spawn_current::current_piece_idx#0 ] zp ZP_BYTE:173 [ play_spawn_current::$7 ] +Uplifting [main] best 4259547 combination reg byte a [ main::render#1 ] reg byte x [ main::key_event#0 ] +Uplifting [play_movement] best 4258935 combination reg byte a [ play_movement::return#3 ] zp ZP_BYTE:41 [ play_movement::return#2 play_movement::render#1 play_movement::return#0 ] zp ZP_BYTE:124 [ play_movement::key_event#0 ] reg byte a [ play_movement::$3 ] reg byte a [ play_movement::$4 ] zp ZP_BYTE:146 [ play_movement::render#2 ] Limited combination testing to 100 combinations of 576 possible. -Uplifting [keyboard_event_get] best 4248813 combination reg byte x [ keyboard_event_get::return#3 ] reg byte x [ keyboard_event_get::return#2 keyboard_event_get::return#1 ] -Uplifting [play_init] best 4248603 combination reg byte a [ play_init::$5 ] zp ZP_BYTE:99 [ play_init::b#2 play_init::b#1 ] reg byte y [ play_init::j#2 play_init::j#1 ] reg byte x [ play_init::$4 ] zp ZP_BYTE:98 [ play_init::idx#2 play_init::idx#1 ] zp ZP_WORD:96 [ play_init::pli#2 play_init::pli#1 ] +Uplifting [keyboard_event_get] best 4258029 combination reg byte x [ keyboard_event_get::return#3 ] reg byte x [ keyboard_event_get::return#2 keyboard_event_get::return#1 ] +Uplifting [play_init] best 4257819 combination reg byte a [ play_init::$5 ] zp ZP_BYTE:99 [ play_init::b#2 play_init::b#1 ] reg byte y [ play_init::j#2 play_init::j#1 ] reg byte x [ play_init::$4 ] zp ZP_BYTE:98 [ play_init::idx#2 play_init::idx#1 ] zp ZP_WORD:96 [ play_init::pli#2 play_init::pli#1 ] Limited combination testing to 100 combinations of 432 possible. -Uplifting [render_bcd] best 4248573 combination zp ZP_WORD:8 [ render_bcd::screen#6 render_bcd::screen#0 render_bcd::screen#1 render_bcd::screen#2 render_bcd::screen#3 render_bcd::screen#4 render_bcd::screen#5 ] reg byte x [ render_bcd::bcd#6 render_bcd::bcd#0 render_bcd::bcd#1 render_bcd::bcd#2 render_bcd::bcd#3 render_bcd::bcd#4 render_bcd::bcd#5 ] zp ZP_WORD:14 [ render_bcd::screen_pos#3 render_bcd::screen_pos#0 render_bcd::screen_pos#2 ] reg byte a [ render_bcd::$5 ] reg byte a [ render_bcd::$6 ] reg byte a [ render_bcd::$3 ] zp ZP_BYTE:130 [ render_bcd::$4 ] zp ZP_WORD:10 [ render_bcd::offset#6 ] zp ZP_BYTE:12 [ render_bcd::only_low#6 ] +Uplifting [render_bcd] best 4257789 combination zp ZP_WORD:8 [ render_bcd::screen#6 render_bcd::screen#0 render_bcd::screen#1 render_bcd::screen#2 render_bcd::screen#3 render_bcd::screen#4 render_bcd::screen#5 ] reg byte x [ render_bcd::bcd#6 render_bcd::bcd#0 render_bcd::bcd#1 render_bcd::bcd#2 render_bcd::bcd#3 render_bcd::bcd#4 render_bcd::bcd#5 ] zp ZP_WORD:14 [ render_bcd::screen_pos#3 render_bcd::screen_pos#0 render_bcd::screen_pos#2 ] reg byte a [ render_bcd::$5 ] reg byte a [ render_bcd::$6 ] reg byte a [ render_bcd::$3 ] zp ZP_BYTE:130 [ render_bcd::$4 ] zp ZP_WORD:10 [ render_bcd::offset#6 ] zp ZP_BYTE:12 [ render_bcd::only_low#6 ] Limited combination testing to 100 combinations of 1536 possible. -Uplifting [render_init] best 4248403 combination reg byte y [ render_init::i#2 render_init::i#1 ] reg byte x [ render_init::$13 ] zp ZP_WORD:105 [ render_init::li_2#2 render_init::li_2#1 ] zp ZP_WORD:103 [ render_init::li_1#2 render_init::li_1#1 ] -Uplifting [sprites_init] best 4248233 combination reg byte y [ sprites_init::s#2 sprites_init::s#1 ] reg byte x [ sprites_init::s2#0 ] zp ZP_BYTE:101 [ sprites_init::xpos#2 sprites_init::xpos#1 ] -Uplifting [play_move_down] best 4248200 combination reg byte x [ play_move_down::movedown#6 play_move_down::movedown#7 play_move_down::movedown#10 play_move_down::movedown#2 play_move_down::movedown#3 ] reg byte a [ play_move_down::return#0 ] reg byte a [ play_move_down::$2 ] reg byte a [ play_move_down::$12 ] zp ZP_BYTE:170 [ play_move_down::removed#0 ] zp ZP_BYTE:141 [ play_move_down::key_event#0 ] zp ZP_BYTE:73 [ play_move_down::return#3 ] +Uplifting [render_init] best 4257619 combination reg byte y [ render_init::i#2 render_init::i#1 ] reg byte x [ render_init::$13 ] zp ZP_WORD:105 [ render_init::li_2#2 render_init::li_2#1 ] zp ZP_WORD:103 [ render_init::li_1#2 render_init::li_1#1 ] +Uplifting [sprites_init] best 4257449 combination reg byte y [ sprites_init::s#2 sprites_init::s#1 ] reg byte x [ sprites_init::s2#0 ] zp ZP_BYTE:101 [ sprites_init::xpos#2 sprites_init::xpos#1 ] +Uplifting [play_move_down] best 4257416 combination reg byte x [ play_move_down::movedown#6 play_move_down::movedown#7 play_move_down::movedown#10 play_move_down::movedown#2 play_move_down::movedown#3 ] reg byte a [ play_move_down::return#0 ] reg byte a [ play_move_down::$2 ] reg byte a [ play_move_down::$12 ] zp ZP_BYTE:170 [ play_move_down::removed#0 ] zp ZP_BYTE:141 [ play_move_down::key_event#0 ] zp ZP_BYTE:73 [ play_move_down::return#3 ] Limited combination testing to 100 combinations of 12288 possible. -Uplifting [keyboard_event_pressed] best 4248180 combination reg byte a [ keyboard_event_pressed::return#12 ] reg byte a [ keyboard_event_pressed::$0 ] reg byte a [ keyboard_event_pressed::$1 ] reg byte a [ keyboard_event_pressed::return#0 ] zp ZP_BYTE:202 [ keyboard_event_pressed::return#1 ] zp ZP_BYTE:204 [ keyboard_event_pressed::return#2 ] zp ZP_BYTE:206 [ keyboard_event_pressed::return#10 ] zp ZP_BYTE:194 [ keyboard_event_pressed::row_bits#0 ] zp ZP_BYTE:196 [ keyboard_event_pressed::return#11 ] zp ZP_BYTE:88 [ keyboard_event_pressed::keycode#5 ] +Uplifting [keyboard_event_pressed] best 4257396 combination reg byte a [ keyboard_event_pressed::return#12 ] reg byte a [ keyboard_event_pressed::$0 ] reg byte a [ keyboard_event_pressed::$1 ] reg byte a [ keyboard_event_pressed::return#0 ] zp ZP_BYTE:202 [ keyboard_event_pressed::return#1 ] zp ZP_BYTE:204 [ keyboard_event_pressed::return#2 ] zp ZP_BYTE:206 [ keyboard_event_pressed::return#10 ] zp ZP_BYTE:194 [ keyboard_event_pressed::row_bits#0 ] zp ZP_BYTE:196 [ keyboard_event_pressed::return#11 ] zp ZP_BYTE:88 [ keyboard_event_pressed::keycode#5 ] Limited combination testing to 100 combinations of 589824 possible. -Uplifting [sprites_irq] best 4248156 combination zp ZP_BYTE:117 [ sprites_irq::raster_sprite_gfx_modify#0 ] reg byte x [ sprites_irq::$0 ] reg byte a [ sprites_irq::ptr#4 ] reg byte a [ sprites_irq::ptr#2 ] reg byte a [ sprites_irq::ptr#3 ] zp ZP_BYTE:222 [ sprites_irq::ptr#1 ] zp ZP_BYTE:217 [ sprites_irq::ypos#0 ] zp ZP_BYTE:219 [ sprites_irq::ptr#0 ] +Uplifting [sprites_irq] best 4257372 combination zp ZP_BYTE:117 [ sprites_irq::raster_sprite_gfx_modify#0 ] reg byte x [ sprites_irq::$0 ] reg byte a [ sprites_irq::ptr#4 ] reg byte a [ sprites_irq::ptr#2 ] reg byte a [ sprites_irq::ptr#3 ] zp ZP_BYTE:222 [ sprites_irq::ptr#1 ] zp ZP_BYTE:217 [ sprites_irq::ypos#0 ] zp ZP_BYTE:219 [ sprites_irq::ptr#0 ] Limited combination testing to 100 combinations of 12288 possible. -Uplifting [play_move_rotate] best 4248138 combination zp ZP_BYTE:43 [ play_move_rotate::orientation#3 play_move_rotate::orientation#1 play_move_rotate::orientation#2 ] reg byte a [ play_move_rotate::return#0 ] reg byte x [ play_move_rotate::$5 ] reg byte a [ play_move_rotate::$2 ] zp ZP_BYTE:153 [ play_move_rotate::$7 ] zp ZP_BYTE:147 [ play_move_rotate::key_event#0 ] zp ZP_BYTE:42 [ play_move_rotate::return#2 ] +Uplifting [play_move_rotate] best 4257354 combination zp ZP_BYTE:43 [ play_move_rotate::orientation#3 play_move_rotate::orientation#1 play_move_rotate::orientation#2 ] reg byte a [ play_move_rotate::return#0 ] reg byte x [ play_move_rotate::$5 ] reg byte a [ play_move_rotate::$2 ] zp ZP_BYTE:153 [ play_move_rotate::$7 ] zp ZP_BYTE:147 [ play_move_rotate::key_event#0 ] zp ZP_BYTE:42 [ play_move_rotate::return#2 ] Limited combination testing to 100 combinations of 12288 possible. -Uplifting [play_update_score] best 4248116 combination reg byte a [ play_update_score::$2 ] reg byte a [ play_update_score::$9 ] reg byte a [ play_update_score::$4 ] reg byte a [ play_update_score::lines_after#0 ] zp ZP_DWORD:180 [ play_update_score::add_bcd#0 ] zp ZP_BYTE:171 [ play_update_score::removed#0 ] zp ZP_BYTE:178 [ play_update_score::lines_before#0 ] +Uplifting [play_update_score] best 4257332 combination reg byte a [ play_update_score::$2 ] reg byte a [ play_update_score::$9 ] reg byte a [ play_update_score::$4 ] reg byte a [ play_update_score::lines_after#0 ] zp ZP_DWORD:180 [ play_update_score::add_bcd#0 ] zp ZP_BYTE:171 [ play_update_score::removed#0 ] zp ZP_BYTE:178 [ play_update_score::lines_before#0 ] Limited combination testing to 100 combinations of 2304 possible. -Uplifting [play_move_leftright] best 4248089 combination reg byte a [ play_move_leftright::return#0 ] reg byte a [ play_move_leftright::$4 ] reg byte a [ play_move_leftright::$8 ] reg byte a [ play_move_leftright::key_event#0 ] zp ZP_BYTE:54 [ play_move_leftright::return#2 ] +Uplifting [play_move_leftright] best 4257305 combination reg byte a [ play_move_leftright::return#0 ] reg byte a [ play_move_leftright::$4 ] reg byte a [ play_move_leftright::$8 ] reg byte a [ play_move_leftright::key_event#0 ] zp ZP_BYTE:54 [ play_move_leftright::return#2 ] Limited combination testing to 100 combinations of 1024 possible. -Uplifting [render_show] best 4248080 combination reg byte a [ render_show::d018val#3 ] -Uplifting [render_score] best 4248080 combination zp ZP_WORD:6 [ render_score::screen#3 ] -Uplifting [sid_rnd_init] best 4248080 combination -Uplifting [render_screen_swap] best 4248080 combination -Uplifting [sprites_irq_init] best 4248080 combination +Uplifting [render_show] best 4257296 combination reg byte a [ render_show::d018val#3 ] +Uplifting [render_score] best 4257296 combination zp ZP_WORD:6 [ render_score::screen#3 ] +Uplifting [sid_rnd_init] best 4257296 combination +Uplifting [render_screen_swap] best 4257296 combination +Uplifting [sprites_irq_init] best 4257296 combination Attempting to uplift remaining variables inzp ZP_BYTE:93 [ keyboard_events_size#10 keyboard_events_size#30 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#29 keyboard_events_size#1 keyboard_events_size#2 ] -Uplifting [] best 4248080 combination zp ZP_BYTE:93 [ keyboard_events_size#10 keyboard_events_size#30 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#29 keyboard_events_size#1 keyboard_events_size#2 ] +Uplifting [] best 4257296 combination zp ZP_BYTE:93 [ keyboard_events_size#10 keyboard_events_size#30 keyboard_events_size#19 keyboard_events_size#16 keyboard_events_size#13 keyboard_events_size#4 keyboard_events_size#29 keyboard_events_size#1 keyboard_events_size#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:50 [ play_collision::i#2 play_collision::i#3 play_collision::i#10 play_collision::i#12 ] -Uplifting [play_collision] best 4248080 combination zp ZP_BYTE:50 [ play_collision::i#2 play_collision::i#3 play_collision::i#10 play_collision::i#12 ] +Uplifting [play_collision] best 4257296 combination zp ZP_BYTE:50 [ play_collision::i#2 play_collision::i#3 play_collision::i#10 play_collision::i#12 ] Attempting to uplift remaining variables inzp ZP_BYTE:85 [ play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 ] -Uplifting [play_lock_current] best 4248080 combination zp ZP_BYTE:85 [ play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 ] +Uplifting [play_lock_current] best 4257296 combination zp ZP_BYTE:85 [ play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 ] Attempting to uplift remaining variables inzp ZP_BYTE:91 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] -Uplifting [keyboard_event_scan] best 4098080 combination reg byte x [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] +Uplifting [keyboard_event_scan] best 4107296 combination reg byte x [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:80 [ play_remove_lines::x#2 play_remove_lines::x#1 ] -Uplifting [play_remove_lines] best 4098080 combination zp ZP_BYTE:80 [ play_remove_lines::x#2 play_remove_lines::x#1 ] +Uplifting [play_remove_lines] best 4107296 combination zp ZP_BYTE:80 [ play_remove_lines::x#2 play_remove_lines::x#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:86 [ play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 ] -Uplifting [play_lock_current] best 4098080 combination zp ZP_BYTE:86 [ play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 ] +Uplifting [play_lock_current] best 4107296 combination zp ZP_BYTE:86 [ play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:51 [ play_collision::xp#2 play_collision::xp#8 play_collision::xp#1 ] -Uplifting [play_collision] best 4098080 combination zp ZP_BYTE:51 [ play_collision::xp#2 play_collision::xp#8 play_collision::xp#1 ] +Uplifting [play_collision] best 4107296 combination zp ZP_BYTE:51 [ play_collision::xp#2 play_collision::xp#8 play_collision::xp#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:92 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ] -Uplifting [keyboard_event_scan] best 4098080 combination zp ZP_BYTE:92 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ] +Uplifting [keyboard_event_scan] best 4107296 combination zp ZP_BYTE:92 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:81 [ play_remove_lines::full#4 play_remove_lines::full#2 ] -Uplifting [play_remove_lines] best 4098080 combination zp ZP_BYTE:81 [ play_remove_lines::full#4 play_remove_lines::full#2 ] +Uplifting [play_remove_lines] best 4107296 combination zp ZP_BYTE:81 [ play_remove_lines::full#4 play_remove_lines::full#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:188 [ play_remove_lines::c#0 ] -Uplifting [play_remove_lines] best 4098080 combination zp ZP_BYTE:188 [ play_remove_lines::c#0 ] +Uplifting [play_remove_lines] best 4107296 combination zp ZP_BYTE:188 [ play_remove_lines::c#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:32 [ render_moving::i#4 render_moving::i#3 render_moving::i#8 render_moving::i#2 render_moving::i#1 ] -Uplifting [render_moving] best 4098080 combination zp ZP_BYTE:32 [ render_moving::i#4 render_moving::i#3 render_moving::i#8 render_moving::i#2 render_moving::i#1 ] +Uplifting [render_moving] best 4107296 combination zp ZP_BYTE:32 [ render_moving::i#4 render_moving::i#3 render_moving::i#8 render_moving::i#2 render_moving::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:78 [ play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 ] -Uplifting [play_remove_lines] best 4098080 combination zp ZP_BYTE:78 [ play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 ] +Uplifting [play_remove_lines] best 4107296 combination zp ZP_BYTE:78 [ play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:192 [ play_lock_current::i#1 ] -Uplifting [play_lock_current] best 4098080 combination zp ZP_BYTE:192 [ play_lock_current::i#1 ] +Uplifting [play_lock_current] best 4107296 combination zp ZP_BYTE:192 [ play_lock_current::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:74 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ] -Uplifting [] best 4098080 combination zp ZP_BYTE:74 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ] +Uplifting [] best 4107296 combination zp ZP_BYTE:74 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:90 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] -Uplifting [keyboard_event_scan] best 4098080 combination zp ZP_BYTE:90 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] +Uplifting [keyboard_event_scan] best 4107296 combination zp ZP_BYTE:90 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:40 [ render_playfield::c#2 render_playfield::c#1 ] -Uplifting [render_playfield] best 4098080 combination zp ZP_BYTE:40 [ render_playfield::c#2 render_playfield::c#1 ] +Uplifting [render_playfield] best 4107296 combination zp ZP_BYTE:40 [ render_playfield::c#2 render_playfield::c#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:156 [ play_collision::$14 ] -Uplifting [play_collision] best 4094080 combination reg byte a [ play_collision::$14 ] +Uplifting [play_collision] best 4103296 combination reg byte a [ play_collision::$14 ] Attempting to uplift remaining variables inzp ZP_BYTE:77 [ play_remove_lines::y#8 play_remove_lines::y#1 ] -Uplifting [play_remove_lines] best 4094080 combination zp ZP_BYTE:77 [ play_remove_lines::y#8 play_remove_lines::y#1 ] +Uplifting [play_remove_lines] best 4103296 combination zp ZP_BYTE:77 [ play_remove_lines::y#8 play_remove_lines::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:159 [ play_collision::i#1 ] -Uplifting [play_collision] best 4094080 combination zp ZP_BYTE:159 [ play_collision::i#1 ] +Uplifting [play_collision] best 4103296 combination zp ZP_BYTE:159 [ play_collision::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:37 [ render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 ] -Uplifting [render_playfield] best 4094080 combination zp ZP_BYTE:37 [ render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 ] +Uplifting [render_playfield] best 4103296 combination zp ZP_BYTE:37 [ render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ render_moving::xpos#2 render_moving::xpos#0 render_moving::xpos#1 ] -Uplifting [render_moving] best 4094080 combination zp ZP_BYTE:33 [ render_moving::xpos#2 render_moving::xpos#0 render_moving::xpos#1 ] +Uplifting [render_moving] best 4103296 combination zp ZP_BYTE:33 [ render_moving::xpos#2 render_moving::xpos#0 render_moving::xpos#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:48 [ play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 ] -Uplifting [play_collision] best 4094080 combination zp ZP_BYTE:48 [ play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 ] +Uplifting [play_collision] best 4103296 combination zp ZP_BYTE:48 [ play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:199 [ keyboard_event_scan::row_scan#0 ] -Uplifting [keyboard_event_scan] best 4094080 combination zp ZP_BYTE:199 [ keyboard_event_scan::row_scan#0 ] +Uplifting [keyboard_event_scan] best 4103296 combination zp ZP_BYTE:199 [ keyboard_event_scan::row_scan#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:84 [ play_lock_current::l#6 play_lock_current::l#1 ] -Uplifting [play_lock_current] best 4094080 combination zp ZP_BYTE:84 [ play_lock_current::l#6 play_lock_current::l#1 ] +Uplifting [play_lock_current] best 4103296 combination zp ZP_BYTE:84 [ play_lock_current::l#6 play_lock_current::l#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:4 [ render_screen_showing#13 render_screen_showing#1 render_screen_showing#0 ] -Uplifting [] best 4094080 combination zp ZP_BYTE:4 [ render_screen_showing#13 render_screen_showing#1 render_screen_showing#0 ] +Uplifting [] best 4103296 combination zp ZP_BYTE:4 [ render_screen_showing#13 render_screen_showing#1 render_screen_showing#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:49 [ play_collision::l#6 play_collision::l#1 ] -Uplifting [play_collision] best 4094080 combination zp ZP_BYTE:49 [ play_collision::l#6 play_collision::l#1 ] +Uplifting [play_collision] best 4103296 combination zp ZP_BYTE:49 [ play_collision::l#6 play_collision::l#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:83 [ play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ] -Uplifting [play_lock_current] best 4094080 combination zp ZP_BYTE:83 [ play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ] +Uplifting [play_lock_current] best 4103296 combination zp ZP_BYTE:83 [ play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:134 [ render_moving::$1 ] -Uplifting [render_moving] best 4093480 combination reg byte a [ render_moving::$1 ] +Uplifting [render_moving] best 4102696 combination reg byte a [ render_moving::$1 ] Attempting to uplift remaining variables inzp ZP_BYTE:135 [ render_moving::$6 ] -Uplifting [render_moving] best 4093080 combination reg byte a [ render_moving::$6 ] +Uplifting [render_moving] best 4102296 combination reg byte a [ render_moving::$6 ] Attempting to uplift remaining variables inzp ZP_BYTE:68 [ current_piece_char#29 current_piece_char#10 current_piece_char#16 current_piece_char#5 ] -Uplifting [] best 4093080 combination zp ZP_BYTE:68 [ current_piece_char#29 current_piece_char#10 current_piece_char#16 current_piece_char#5 ] +Uplifting [] best 4102296 combination zp ZP_BYTE:68 [ current_piece_char#29 current_piece_char#10 current_piece_char#16 current_piece_char#5 ] Attempting to uplift remaining variables inzp ZP_BYTE:36 [ render_playfield::l#2 render_playfield::l#1 ] -Uplifting [render_playfield] best 4093080 combination zp ZP_BYTE:36 [ render_playfield::l#2 render_playfield::l#1 ] +Uplifting [render_playfield] best 4102296 combination zp ZP_BYTE:36 [ render_playfield::l#2 render_playfield::l#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:18 [ render_next::l#7 render_next::l#1 ] -Uplifting [render_next] best 4093080 combination zp ZP_BYTE:18 [ render_next::l#7 render_next::l#1 ] +Uplifting [render_next] best 4102296 combination zp ZP_BYTE:18 [ render_next::l#7 render_next::l#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:31 [ render_moving::l#4 render_moving::l#1 ] -Uplifting [render_moving] best 4093080 combination zp ZP_BYTE:31 [ render_moving::l#4 render_moving::l#1 ] +Uplifting [render_moving] best 4102296 combination zp ZP_BYTE:31 [ render_moving::l#4 render_moving::l#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:30 [ render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 ] -Uplifting [render_moving] best 4093080 combination zp ZP_BYTE:30 [ render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 ] +Uplifting [render_moving] best 4102296 combination zp ZP_BYTE:30 [ render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:29 [ current_piece_char#68 current_piece_char#100 current_piece_char#101 ] -Uplifting [] best 4093080 combination zp ZP_BYTE:29 [ current_piece_char#68 current_piece_char#100 current_piece_char#101 ] +Uplifting [] best 4102296 combination zp ZP_BYTE:29 [ current_piece_char#68 current_piece_char#100 current_piece_char#101 ] Attempting to uplift remaining variables inzp ZP_BYTE:120 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] -Uplifting [] best 4093080 combination zp ZP_BYTE:120 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] +Uplifting [] best 4102296 combination zp ZP_BYTE:120 [ irq_sprite_ptr#0 irq_sprite_ptr#11 irq_sprite_ptr#1 irq_sprite_ptr#2 irq_sprite_ptr#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:132 [ render_next::next_piece_char#0 ] -Uplifting [render_next] best 4093080 combination zp ZP_BYTE:132 [ render_next::next_piece_char#0 ] +Uplifting [render_next] best 4102296 combination zp ZP_BYTE:132 [ render_next::next_piece_char#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:119 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] -Uplifting [] best 4093080 combination zp ZP_BYTE:119 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] +Uplifting [] best 4102296 combination zp ZP_BYTE:119 [ irq_sprite_ypos#0 irq_sprite_ypos#11 irq_sprite_ypos#1 irq_sprite_ypos#2 irq_sprite_ypos#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:121 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] -Uplifting [] best 4093080 combination zp ZP_BYTE:121 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] +Uplifting [] best 4102296 combination zp ZP_BYTE:121 [ irq_cnt#0 irq_cnt#3 irq_cnt#1 irq_cnt#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:47 [ play_collision::xpos#6 play_collision::xpos#0 play_collision::xpos#1 play_collision::xpos#2 play_collision::xpos#3 play_collision::xpos#4 ] -Uplifting [play_collision] best 4093080 combination zp ZP_BYTE:47 [ play_collision::xpos#6 play_collision::xpos#0 play_collision::xpos#1 play_collision::xpos#2 play_collision::xpos#3 play_collision::xpos#4 ] +Uplifting [play_collision] best 4102296 combination zp ZP_BYTE:47 [ play_collision::xpos#6 play_collision::xpos#0 play_collision::xpos#1 play_collision::xpos#2 play_collision::xpos#3 play_collision::xpos#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:72 [ current_xpos#43 current_xpos#14 current_xpos#19 current_xpos#100 current_xpos#22 current_xpos#26 current_xpos#6 current_xpos#8 ] -Uplifting [] best 4093080 combination zp ZP_BYTE:72 [ current_xpos#43 current_xpos#14 current_xpos#19 current_xpos#100 current_xpos#22 current_xpos#26 current_xpos#6 current_xpos#8 ] +Uplifting [] best 4102296 combination zp ZP_BYTE:72 [ current_xpos#43 current_xpos#14 current_xpos#19 current_xpos#100 current_xpos#22 current_xpos#26 current_xpos#6 current_xpos#8 ] Attempting to uplift remaining variables inzp ZP_BYTE:41 [ play_movement::return#2 play_movement::render#1 play_movement::return#0 ] -Uplifting [play_movement] best 4093080 combination zp ZP_BYTE:41 [ play_movement::return#2 play_movement::render#1 play_movement::return#0 ] +Uplifting [play_movement] best 4102296 combination zp ZP_BYTE:41 [ play_movement::return#2 play_movement::render#1 play_movement::return#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:99 [ play_init::b#2 play_init::b#1 ] -Uplifting [play_init] best 4092980 combination reg byte x [ play_init::b#2 play_init::b#1 ] +Uplifting [play_init] best 4102196 combination reg byte x [ play_init::b#2 play_init::b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:65 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ] -Uplifting [] best 4092980 combination zp ZP_BYTE:65 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ] +Uplifting [] best 4102196 combination zp ZP_BYTE:65 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ] Attempting to uplift remaining variables inzp ZP_BYTE:46 [ play_collision::orientation#5 play_collision::orientation#0 play_collision::orientation#1 play_collision::orientation#2 play_collision::orientation#3 ] -Uplifting [play_collision] best 4092964 combination reg byte x [ play_collision::orientation#5 play_collision::orientation#0 play_collision::orientation#1 play_collision::orientation#2 play_collision::orientation#3 ] +Uplifting [play_collision] best 4102180 combination reg byte x [ play_collision::orientation#5 play_collision::orientation#0 play_collision::orientation#1 play_collision::orientation#2 play_collision::orientation#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:107 [ render_screen_original::y#6 render_screen_original::y#1 ] -Uplifting [render_screen_original] best 4092964 combination zp ZP_BYTE:107 [ render_screen_original::y#6 render_screen_original::y#1 ] +Uplifting [render_screen_original] best 4102180 combination zp ZP_BYTE:107 [ render_screen_original::y#6 render_screen_original::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:69 [ current_orientation#37 current_orientation#13 current_orientation#17 current_orientation#20 current_orientation#25 current_orientation#7 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:69 [ current_orientation#37 current_orientation#13 current_orientation#17 current_orientation#20 current_orientation#25 current_orientation#7 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:69 [ current_orientation#37 current_orientation#13 current_orientation#17 current_orientation#20 current_orientation#25 current_orientation#7 ] Attempting to uplift remaining variables inzp ZP_BYTE:64 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#66 current_movedown_slow#10 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:64 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#66 current_movedown_slow#10 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:64 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#66 current_movedown_slow#10 ] Attempting to uplift remaining variables inzp ZP_BYTE:101 [ sprites_init::xpos#2 sprites_init::xpos#1 ] -Uplifting [sprites_init] best 4092964 combination zp ZP_BYTE:101 [ sprites_init::xpos#2 sprites_init::xpos#1 ] +Uplifting [sprites_init] best 4102180 combination zp ZP_BYTE:101 [ sprites_init::xpos#2 sprites_init::xpos#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:56 [ current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:56 [ current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:56 [ current_ypos#38 current_ypos#3 current_ypos#11 current_ypos#19 current_ypos#6 ] Attempting to uplift remaining variables inzp ZP_BYTE:75 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:75 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:75 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ] Attempting to uplift remaining variables inzp ZP_BYTE:26 [ current_xpos#59 current_xpos#119 current_xpos#120 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:26 [ current_xpos#59 current_xpos#119 current_xpos#120 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:26 [ current_xpos#59 current_xpos#119 current_xpos#120 ] Attempting to uplift remaining variables inzp ZP_BYTE:98 [ play_init::idx#2 play_init::idx#1 ] -Uplifting [play_init] best 4092964 combination zp ZP_BYTE:98 [ play_init::idx#2 play_init::idx#1 ] +Uplifting [play_init] best 4102180 combination zp ZP_BYTE:98 [ play_init::idx#2 play_init::idx#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:63 [ level#33 level#10 level#17 level#19 level#21 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:63 [ level#33 level#10 level#17 level#19 level#21 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:63 [ level#33 level#10 level#17 level#19 level#21 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:5 [ current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:5 [ current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ] Attempting to uplift remaining variables inzp ZP_BYTE:118 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:118 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:118 [ irq_raster_next#0 irq_raster_next#4 irq_raster_next#1 irq_raster_next#2 irq_raster_next#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ render_screen_render#33 render_screen_render#65 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:25 [ render_screen_render#33 render_screen_render#65 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:25 [ render_screen_render#33 render_screen_render#65 ] Attempting to uplift remaining variables inzp ZP_BYTE:124 [ play_movement::key_event#0 ] -Uplifting [play_movement] best 4092964 combination zp ZP_BYTE:124 [ play_movement::key_event#0 ] +Uplifting [play_movement] best 4102180 combination zp ZP_BYTE:124 [ play_movement::key_event#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:43 [ play_move_rotate::orientation#3 play_move_rotate::orientation#1 play_move_rotate::orientation#2 ] -Uplifting [play_move_rotate] best 4092964 combination zp ZP_BYTE:43 [ play_move_rotate::orientation#3 play_move_rotate::orientation#1 play_move_rotate::orientation#2 ] +Uplifting [play_move_rotate] best 4102180 combination zp ZP_BYTE:43 [ play_move_rotate::orientation#3 play_move_rotate::orientation#1 play_move_rotate::orientation#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:117 [ sprites_irq::raster_sprite_gfx_modify#0 ] -Uplifting [sprites_irq] best 4092964 combination zp ZP_BYTE:117 [ sprites_irq::raster_sprite_gfx_modify#0 ] +Uplifting [sprites_irq] best 4102180 combination zp ZP_BYTE:117 [ sprites_irq::raster_sprite_gfx_modify#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 ] Attempting to uplift remaining variables inzp ZP_BYTE:3 [ render_screen_render#18 render_screen_render#11 ] -Uplifting [] best 4092964 combination zp ZP_BYTE:3 [ render_screen_render#18 render_screen_render#11 ] +Uplifting [] best 4102180 combination zp ZP_BYTE:3 [ render_screen_render#18 render_screen_render#11 ] Attempting to uplift remaining variables inzp ZP_BYTE:130 [ render_bcd::$4 ] -Uplifting [render_bcd] best 4092958 combination reg byte a [ render_bcd::$4 ] +Uplifting [render_bcd] best 4102174 combination reg byte a [ render_bcd::$4 ] Attempting to uplift remaining variables inzp ZP_BYTE:151 [ play_collision::return#14 ] -Uplifting [play_collision] best 4092952 combination reg byte a [ play_collision::return#14 ] +Uplifting [play_collision] best 4102168 combination reg byte a [ play_collision::return#14 ] Attempting to uplift remaining variables inzp ZP_BYTE:153 [ play_move_rotate::$7 ] -Uplifting [play_move_rotate] best 4092946 combination reg byte x [ play_move_rotate::$7 ] +Uplifting [play_move_rotate] best 4102162 combination reg byte x [ play_move_rotate::$7 ] Attempting to uplift remaining variables inzp ZP_BYTE:161 [ play_collision::return#13 ] -Uplifting [play_collision] best 4092940 combination reg byte a [ play_collision::return#13 ] +Uplifting [play_collision] best 4102156 combination reg byte a [ play_collision::return#13 ] Attempting to uplift remaining variables inzp ZP_BYTE:163 [ play_collision::return#1 ] -Uplifting [play_collision] best 4092934 combination reg byte a [ play_collision::return#1 ] +Uplifting [play_collision] best 4102150 combination reg byte a [ play_collision::return#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:167 [ play_collision::return#0 ] -Uplifting [play_collision] best 4092928 combination reg byte a [ play_collision::return#0 ] +Uplifting [play_collision] best 4102144 combination reg byte a [ play_collision::return#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:169 [ play_remove_lines::return#0 ] -Uplifting [play_remove_lines] best 4092922 combination reg byte a [ play_remove_lines::return#0 ] +Uplifting [play_remove_lines] best 4102138 combination reg byte a [ play_remove_lines::return#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:170 [ play_move_down::removed#0 ] -Uplifting [play_move_down] best 4092916 combination reg byte a [ play_move_down::removed#0 ] +Uplifting [play_move_down] best 4102132 combination reg byte a [ play_move_down::removed#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:174 [ play_collision::return#10 ] -Uplifting [play_collision] best 4092910 combination reg byte a [ play_collision::return#10 ] +Uplifting [play_collision] best 4102126 combination reg byte a [ play_collision::return#10 ] Attempting to uplift remaining variables inzp ZP_BYTE:201 [ keyboard_event_scan::$0 ] -Uplifting [keyboard_event_scan] best 4092904 combination reg byte a [ keyboard_event_scan::$0 ] +Uplifting [keyboard_event_scan] best 4102120 combination reg byte a [ keyboard_event_scan::$0 ] Attempting to uplift remaining variables inzp ZP_BYTE:202 [ keyboard_event_pressed::return#1 ] -Uplifting [keyboard_event_pressed] best 4092898 combination reg byte a [ keyboard_event_pressed::return#1 ] +Uplifting [keyboard_event_pressed] best 4102114 combination reg byte a [ keyboard_event_pressed::return#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:203 [ keyboard_event_scan::$3 ] -Uplifting [keyboard_event_scan] best 4092892 combination reg byte a [ keyboard_event_scan::$3 ] +Uplifting [keyboard_event_scan] best 4102108 combination reg byte a [ keyboard_event_scan::$3 ] Attempting to uplift remaining variables inzp ZP_BYTE:204 [ keyboard_event_pressed::return#2 ] -Uplifting [keyboard_event_pressed] best 4092886 combination reg byte a [ keyboard_event_pressed::return#2 ] +Uplifting [keyboard_event_pressed] best 4102102 combination reg byte a [ keyboard_event_pressed::return#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:205 [ keyboard_event_scan::$6 ] -Uplifting [keyboard_event_scan] best 4092880 combination reg byte a [ keyboard_event_scan::$6 ] +Uplifting [keyboard_event_scan] best 4102096 combination reg byte a [ keyboard_event_scan::$6 ] Attempting to uplift remaining variables inzp ZP_BYTE:206 [ keyboard_event_pressed::return#10 ] -Uplifting [keyboard_event_pressed] best 4092874 combination reg byte a [ keyboard_event_pressed::return#10 ] +Uplifting [keyboard_event_pressed] best 4102090 combination reg byte a [ keyboard_event_pressed::return#10 ] Attempting to uplift remaining variables inzp ZP_BYTE:207 [ keyboard_event_scan::$9 ] -Uplifting [keyboard_event_scan] best 4092868 combination reg byte a [ keyboard_event_scan::$9 ] +Uplifting [keyboard_event_scan] best 4102084 combination reg byte a [ keyboard_event_scan::$9 ] Attempting to uplift remaining variables inzp ZP_BYTE:147 [ play_move_rotate::key_event#0 ] -Uplifting [play_move_rotate] best 4092859 combination reg byte a [ play_move_rotate::key_event#0 ] +Uplifting [play_move_rotate] best 4102075 combination reg byte a [ play_move_rotate::key_event#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:222 [ sprites_irq::ptr#1 ] -Uplifting [sprites_irq] best 4092847 combination reg byte x [ sprites_irq::ptr#1 ] +Uplifting [sprites_irq] best 4102063 combination reg byte x [ sprites_irq::ptr#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:217 [ sprites_irq::ypos#0 ] -Uplifting [sprites_irq] best 4092832 combination reg byte a [ sprites_irq::ypos#0 ] +Uplifting [sprites_irq] best 4102048 combination reg byte a [ sprites_irq::ypos#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:219 [ sprites_irq::ptr#0 ] -Uplifting [sprites_irq] best 4092817 combination reg byte x [ sprites_irq::ptr#0 ] +Uplifting [sprites_irq] best 4102033 combination reg byte x [ sprites_irq::ptr#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:141 [ play_move_down::key_event#0 ] -Uplifting [play_move_down] best 4092811 combination reg byte a [ play_move_down::key_event#0 ] +Uplifting [play_move_down] best 4102027 combination reg byte a [ play_move_down::key_event#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:194 [ keyboard_event_pressed::row_bits#0 ] -Uplifting [keyboard_event_pressed] best 4092811 combination zp ZP_BYTE:194 [ keyboard_event_pressed::row_bits#0 ] +Uplifting [keyboard_event_pressed] best 4102027 combination zp ZP_BYTE:194 [ keyboard_event_pressed::row_bits#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:196 [ keyboard_event_pressed::return#11 ] -Uplifting [keyboard_event_pressed] best 4092793 combination reg byte a [ keyboard_event_pressed::return#11 ] +Uplifting [keyboard_event_pressed] best 4102009 combination reg byte a [ keyboard_event_pressed::return#11 ] Attempting to uplift remaining variables inzp ZP_BYTE:53 [ play_collision::return#15 ] -Uplifting [play_collision] best 4092763 combination reg byte a [ play_collision::return#15 ] +Uplifting [play_collision] best 4101979 combination reg byte a [ play_collision::return#15 ] Attempting to uplift remaining variables inzp ZP_BYTE:88 [ keyboard_event_pressed::keycode#5 ] -Uplifting [keyboard_event_pressed] best 4092763 combination zp ZP_BYTE:88 [ keyboard_event_pressed::keycode#5 ] +Uplifting [keyboard_event_pressed] best 4101979 combination zp ZP_BYTE:88 [ keyboard_event_pressed::keycode#5 ] Attempting to uplift remaining variables inzp ZP_BYTE:171 [ play_update_score::removed#0 ] -Uplifting [play_update_score] best 4092757 combination reg byte x [ play_update_score::removed#0 ] +Uplifting [play_update_score] best 4101973 combination reg byte x [ play_update_score::removed#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:12 [ render_bcd::only_low#6 ] -Uplifting [render_bcd] best 4092736 combination reg byte y [ render_bcd::only_low#6 ] +Uplifting [render_bcd] best 4101952 combination reg byte y [ render_bcd::only_low#6 ] Attempting to uplift remaining variables inzp ZP_BYTE:146 [ play_movement::render#2 ] -Uplifting [play_movement] best 4092736 combination zp ZP_BYTE:146 [ play_movement::render#2 ] +Uplifting [play_movement] best 4101952 combination zp ZP_BYTE:146 [ play_movement::render#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:42 [ play_move_rotate::return#2 ] -Uplifting [play_move_rotate] best 4092727 combination reg byte a [ play_move_rotate::return#2 ] +Uplifting [play_move_rotate] best 4101943 combination reg byte a [ play_move_rotate::return#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:54 [ play_move_leftright::return#2 ] -Uplifting [play_move_leftright] best 4092718 combination reg byte a [ play_move_leftright::return#2 ] +Uplifting [play_move_leftright] best 4101934 combination reg byte a [ play_move_leftright::return#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:73 [ play_move_down::return#3 ] -Uplifting [play_move_down] best 4092711 combination reg byte x [ play_move_down::return#3 ] +Uplifting [play_move_down] best 4101927 combination reg byte x [ play_move_down::return#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:178 [ play_update_score::lines_before#0 ] -Uplifting [play_update_score] best 4092711 combination zp ZP_BYTE:178 [ play_update_score::lines_before#0 ] +Uplifting [play_update_score] best 4101927 combination zp ZP_BYTE:178 [ play_update_score::lines_before#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:173 [ play_spawn_current::$7 ] -Uplifting [play_spawn_current] best 4092711 combination zp ZP_BYTE:173 [ play_spawn_current::$7 ] +Uplifting [play_spawn_current] best 4101927 combination zp ZP_BYTE:173 [ play_spawn_current::$7 ] Coalescing zero page register with common assignment [ zp ZP_WORD:6 [ render_score::screen#3 ] ] with [ zp ZP_WORD:8 [ render_bcd::screen#6 render_bcd::screen#0 render_bcd::screen#1 render_bcd::screen#2 render_bcd::screen#3 render_bcd::screen#4 render_bcd::screen#5 ] ] - score: 6 Coalescing zero page register with common assignment [ zp ZP_BYTE:41 [ play_movement::return#2 play_movement::render#1 play_movement::return#0 ] ] with [ zp ZP_BYTE:146 [ play_movement::render#2 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:10 [ render_bcd::offset#6 ] ] with [ zp ZP_WORD:14 [ render_bcd::screen_pos#3 render_bcd::screen_pos#0 render_bcd::screen_pos#2 ] ] - score: 1 @@ -22630,6 +22631,7 @@ sprites_irq: { sta PLAYFIELD_SPRITE_PTRS_1+3 jmp b2 } +//SEG1270 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -24640,7 +24642,7 @@ reg byte a [ sprites_irq::ptr#2 ] FINAL ASSEMBLER -Score: 3344906 +Score: 3354122 //SEG0 File Comments // Tetris Game for the Commodore 64 @@ -27569,6 +27571,7 @@ sprites_irq: { sta PLAYFIELD_SPRITE_PTRS_1+3 jmp b2 } +//SEG1270 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) diff --git a/src/test/ref/condition-integer-0.log b/src/test/ref/condition-integer-0.log index a0916a4db..2626a782b 100644 --- a/src/test/ref/condition-integer-0.log +++ b/src/test/ref/condition-integer-0.log @@ -543,6 +543,7 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) SCREEN#0) ← (byte) '+' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -720,6 +721,7 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -921,4 +923,5 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data diff --git a/src/test/ref/condition-integer-1.log b/src/test/ref/condition-integer-1.log index bc66e522a..4fb19d345 100644 --- a/src/test/ref/condition-integer-1.log +++ b/src/test/ref/condition-integer-1.log @@ -544,6 +544,7 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) SCREEN#0) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -720,6 +721,7 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -921,4 +923,5 @@ main: { //SEG51 [23] return rts } +//SEG52 File Data diff --git a/src/test/ref/condition-integer-2.log b/src/test/ref/condition-integer-2.log index 2f22cb3ca..f8d28a5a8 100644 --- a/src/test/ref/condition-integer-2.log +++ b/src/test/ref/condition-integer-2.log @@ -458,6 +458,7 @@ main: { //SEG52 [12] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@4->main::@3#1] -- register_copy jmp b3 } +//SEG53 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' ' [ idx#1 ] ( main:2 [ idx#1 ] ) always clobbers reg byte a @@ -603,6 +604,7 @@ main: { //SEG52 [12] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@4->main::@3#1] -- register_copy jmp b3 } +//SEG53 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -781,4 +783,5 @@ main: { //SEG52 [12] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@4->main::@3#1] -- register_copy jmp b3 } +//SEG53 File Data diff --git a/src/test/ref/condition-integer-3.log b/src/test/ref/condition-integer-3.log index 77b7f8d04..20ccc4c18 100644 --- a/src/test/ref/condition-integer-3.log +++ b/src/test/ref/condition-integer-3.log @@ -298,6 +298,7 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -388,6 +389,7 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -504,4 +506,5 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data diff --git a/src/test/ref/condition-integer-4.log b/src/test/ref/condition-integer-4.log index a8065030e..61251dd81 100644 --- a/src/test/ref/condition-integer-4.log +++ b/src/test/ref/condition-integer-4.log @@ -571,6 +571,7 @@ main: { //SEG48 [25] return rts } +//SEG49 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [8] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' [ main::i#10 main::idx#10 ] ( main:2 [ main::i#10 main::idx#10 ] ) always clobbers reg byte a @@ -770,6 +771,7 @@ main: { //SEG48 [25] return rts } +//SEG49 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -971,4 +973,5 @@ main: { //SEG48 [25] return rts } +//SEG49 File Data diff --git a/src/test/ref/condition-type-mismatch.log b/src/test/ref/condition-type-mismatch.log index 63c13fa33..da76c2c67 100644 --- a/src/test/ref/condition-type-mismatch.log +++ b/src/test/ref/condition-type-mismatch.log @@ -151,6 +151,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) main::screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -201,6 +202,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -264,4 +266,5 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data diff --git a/src/test/ref/consolidate-array-index-problem.log b/src/test/ref/consolidate-array-index-problem.log index a538bef81..f9857bb66 100644 --- a/src/test/ref/consolidate-array-index-problem.log +++ b/src/test/ref/consolidate-array-index-problem.log @@ -225,6 +225,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] *((const byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' [ main::x#2 main::y#0 ] ( main:2 [ main::x#2 main::y#0 ] ) always clobbers reg byte a @@ -304,6 +305,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -400,4 +402,5 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data diff --git a/src/test/ref/consolidate-constant-problem.log b/src/test/ref/consolidate-constant-problem.log index a832389a6..40327a08c 100644 --- a/src/test/ref/consolidate-constant-problem.log +++ b/src/test/ref/consolidate-constant-problem.log @@ -276,6 +276,7 @@ main: { //SEG18 [9] return rts } +//SEG19 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) screen#0+(byte) $27) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -340,6 +341,7 @@ main: { //SEG18 [9] return rts } +//SEG19 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -417,4 +419,5 @@ main: { //SEG18 [9] return rts } +//SEG19 File Data diff --git a/src/test/ref/const-condition.log b/src/test/ref/const-condition.log index e27c174a9..ad68fa451 100644 --- a/src/test/ref/const-condition.log +++ b/src/test/ref/const-condition.log @@ -142,6 +142,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) main::SCREEN#0) ← (byte) '!' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -192,6 +193,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -254,4 +256,5 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data diff --git a/src/test/ref/const-early-identification.log b/src/test/ref/const-early-identification.log index fcc6f3c2d..fbb8db9f0 100644 --- a/src/test/ref/const-early-identification.log +++ b/src/test/ref/const-early-identification.log @@ -253,6 +253,7 @@ sub: { //SEG22 [12] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) A#0 ← (byte) 'a' [ A#0 ] ( ) always clobbers reg byte a @@ -340,6 +341,7 @@ sub: { //SEG22 [12] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -442,4 +444,5 @@ sub: { //SEG22 [12] return rts } +//SEG23 File Data diff --git a/src/test/ref/const-identification.log b/src/test/ref/const-identification.log index 5cc80482d..0aaa707bb 100644 --- a/src/test/ref/const-identification.log +++ b/src/test/ref/const-identification.log @@ -467,6 +467,7 @@ plot: { //SEG42 [22] return rts } +//SEG43 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -602,6 +603,7 @@ plot: { //SEG42 [22] return rts } +//SEG43 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -767,4 +769,5 @@ plot: { //SEG42 [22] return rts } +//SEG43 File Data diff --git a/src/test/ref/const-if-problem.log b/src/test/ref/const-if-problem.log index 2bd7b05d1..f4d1fed9c 100644 --- a/src/test/ref/const-if-problem.log +++ b/src/test/ref/const-if-problem.log @@ -190,6 +190,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) SCREEN#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -240,6 +241,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -303,4 +305,5 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data diff --git a/src/test/ref/const-int-cast-problem.log b/src/test/ref/const-int-cast-problem.log index a7a88e145..fd72a7de8 100644 --- a/src/test/ref/const-int-cast-problem.log +++ b/src/test/ref/const-int-cast-problem.log @@ -193,6 +193,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$0 ← (byte) main::i#2 >> (byte) 4 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a @@ -265,6 +266,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -353,4 +355,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/const-mult-div.log b/src/test/ref/const-mult-div.log index fbe455cdd..e84b07d2c 100644 --- a/src/test/ref/const-mult-div.log +++ b/src/test/ref/const-mult-div.log @@ -125,6 +125,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -171,6 +172,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -230,4 +232,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/const-param.log b/src/test/ref/const-param.log index ca6ed4734..395c448b3 100644 --- a/src/test/ref/const-param.log +++ b/src/test/ref/const-param.log @@ -370,6 +370,7 @@ sum: { //SEG37 [20] return rts } +//SEG38 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ sum::b#3 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -478,6 +479,7 @@ sum: { //SEG37 [20] return rts } +//SEG38 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -611,4 +613,5 @@ sum: { //SEG37 [20] return rts } +//SEG38 File Data diff --git a/src/test/ref/const-pointer.log b/src/test/ref/const-pointer.log index beca68e9a..ba731b95c 100644 --- a/src/test/ref/const-pointer.log +++ b/src/test/ref/const-pointer.log @@ -167,6 +167,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) main::screen#0) ← (byte) '*' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -217,6 +218,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -281,4 +283,5 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data diff --git a/src/test/ref/const-signed-promotion.log b/src/test/ref/const-signed-promotion.log index 5bbd473eb..402351329 100644 --- a/src/test/ref/const-signed-promotion.log +++ b/src/test/ref/const-signed-promotion.log @@ -237,6 +237,7 @@ main: { //SEG23 [11] return rts } +//SEG24 File Data world: .fill 2*3, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -323,6 +324,7 @@ main: { //SEG23 [11] return rts } +//SEG24 File Data world: .fill 2*3, 0 ASSEMBLER OPTIMIZATIONS @@ -424,5 +426,6 @@ main: { //SEG23 [11] return rts } +//SEG24 File Data world: .fill 2*3, 0 diff --git a/src/test/ref/const-word-pointer.log b/src/test/ref/const-word-pointer.log index e83ae6934..f8e12392e 100644 --- a/src/test/ref/const-word-pointer.log +++ b/src/test/ref/const-word-pointer.log @@ -229,6 +229,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (word) main::w#0 ← (word) $d03 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -307,6 +308,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -402,4 +404,5 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data diff --git a/src/test/ref/constabsmin.log b/src/test/ref/constabsmin.log index 4e8f6ba71..7b635f1aa 100644 --- a/src/test/ref/constabsmin.log +++ b/src/test/ref/constabsmin.log @@ -111,6 +111,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -155,6 +156,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -210,4 +212,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/constant-string-concat-0.log b/src/test/ref/constant-string-concat-0.log index e3951e559..355582d98 100644 --- a/src/test/ref/constant-string-concat-0.log +++ b/src/test/ref/constant-string-concat-0.log @@ -184,6 +184,7 @@ main: { rts msg: .text "camelot@" } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::msg#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -254,6 +255,7 @@ main: { rts msg: .text "camelot@" } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -339,4 +341,5 @@ main: { rts msg: .text "camelot@" } +//SEG21 File Data diff --git a/src/test/ref/constant-string-concat.log b/src/test/ref/constant-string-concat.log index 018575df3..4ab46ed98 100644 --- a/src/test/ref/constant-string-concat.log +++ b/src/test/ref/constant-string-concat.log @@ -182,6 +182,7 @@ main: { rts s: .text "camelot@" } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::s#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -249,6 +250,7 @@ main: { rts s: .text "camelot@" } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -333,4 +335,5 @@ main: { rts s: .text "camelot@" } +//SEG21 File Data diff --git a/src/test/ref/constantmin.log b/src/test/ref/constantmin.log index 5cee85b10..d3ca744cd 100644 --- a/src/test/ref/constantmin.log +++ b/src/test/ref/constantmin.log @@ -251,6 +251,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (const byte) STAR#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -327,6 +328,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -421,4 +423,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/constants.log b/src/test/ref/constants.log index efbb983c7..983b63cd4 100644 --- a/src/test/ref/constants.log +++ b/src/test/ref/constants.log @@ -2015,6 +2015,7 @@ print_cls: { //SEG184 [73] return rts } +//SEG185 File Data msg: .text "0=0@" msg1: .text "0+2=2@" str: .text " @" @@ -2634,6 +2635,7 @@ print_cls: { //SEG184 [73] return rts } +//SEG185 File Data msg: .text "0=0@" msg1: .text "0+2=2@" str: .text " @" @@ -3311,6 +3313,7 @@ print_cls: { //SEG184 [73] return rts } +//SEG185 File Data msg: .text "0=0@" msg1: .text "0+2=2@" str: .text " @" diff --git a/src/test/ref/deep-nesting.log b/src/test/ref/deep-nesting.log index c58eedcf6..8e6137b9d 100644 --- a/src/test/ref/deep-nesting.log +++ b/src/test/ref/deep-nesting.log @@ -8517,6 +8517,7 @@ f100: { //SEG514 [306] return rts } +//SEG515 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::screen#0) ← (const byte) f1::return#1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -10066,6 +10067,7 @@ f100: { //SEG514 [306] return rts } +//SEG515 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -11926,4 +11928,5 @@ f100: { //SEG514 [306] return rts } +//SEG515 File Data diff --git a/src/test/ref/deref-to-derefidx-2.log b/src/test/ref/deref-to-derefidx-2.log index aabfd9d37..1364fcaae 100644 --- a/src/test/ref/deref-to-derefidx-2.log +++ b/src/test/ref/deref-to-derefidx-2.log @@ -318,6 +318,7 @@ print: { //SEG28 [13] return rts } +//SEG29 File Data msg1: .byte 'a', 'b', 'c', 'd' msg2: .byte '1', '2', '3', '4' @@ -427,6 +428,7 @@ print: { //SEG28 [13] return rts } +//SEG29 File Data msg1: .byte 'a', 'b', 'c', 'd' msg2: .byte '1', '2', '3', '4' @@ -551,6 +553,7 @@ print: { //SEG28 [13] return rts } +//SEG29 File Data msg1: .byte 'a', 'b', 'c', 'd' msg2: .byte '1', '2', '3', '4' diff --git a/src/test/ref/deref-to-derefidx.log b/src/test/ref/deref-to-derefidx.log index 6481373bb..a3780de1d 100644 --- a/src/test/ref/deref-to-derefidx.log +++ b/src/test/ref/deref-to-derefidx.log @@ -292,6 +292,7 @@ print: { //SEG27 [12] return rts } +//SEG28 File Data msg1: .byte 'a', 'b', 'c', 'd' msg2: .byte '1', '2', '3', '4' @@ -387,6 +388,7 @@ print: { //SEG27 [12] return rts } +//SEG28 File Data msg1: .byte 'a', 'b', 'c', 'd' msg2: .byte '1', '2', '3', '4' @@ -500,6 +502,7 @@ print: { //SEG27 [12] return rts } +//SEG28 File Data msg1: .byte 'a', 'b', 'c', 'd' msg2: .byte '1', '2', '3', '4' diff --git a/src/test/ref/derefidx-word-0.log b/src/test/ref/derefidx-word-0.log index 3609d164c..7026c3317 100644 --- a/src/test/ref/derefidx-word-0.log +++ b/src/test/ref/derefidx-word-0.log @@ -206,6 +206,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#2 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) always clobbers reg byte a @@ -300,6 +301,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -411,4 +413,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/derefidx-word-1.log b/src/test/ref/derefidx-word-1.log index 13bd7c749..4f8bd49be 100644 --- a/src/test/ref/derefidx-word-1.log +++ b/src/test/ref/derefidx-word-1.log @@ -116,6 +116,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0+(word)(number) $28*(number) $a) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -161,6 +162,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -217,4 +219,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/derefidx-word-2.log b/src/test/ref/derefidx-word-2.log index 99816df84..2aefb8edc 100644 --- a/src/test/ref/derefidx-word-2.log +++ b/src/test/ref/derefidx-word-2.log @@ -189,6 +189,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::screen#0+(word)(number) $28*(number) $a + (byte) main::i#2) ← (byte) 'a' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -255,6 +256,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -336,4 +338,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/divide-2s.log b/src/test/ref/divide-2s.log index 11cf955ff..42f5fc5ff 100644 --- a/src/test/ref/divide-2s.log +++ b/src/test/ref/divide-2s.log @@ -350,6 +350,7 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte~) main::$3 ← (byte) main::i#2 >> (byte) 1 [ main::i#2 main::$3 ] ( main:2 [ main::i#2 main::$3 ] ) always clobbers reg byte a @@ -463,6 +464,7 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -583,4 +585,5 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data diff --git a/src/test/ref/double-assignment.log b/src/test/ref/double-assignment.log index 558d1cd02..e51c1ead0 100644 --- a/src/test/ref/double-assignment.log +++ b/src/test/ref/double-assignment.log @@ -149,6 +149,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0) ← (const byte) main::a#1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -199,6 +200,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -263,4 +265,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/double-import.log b/src/test/ref/double-import.log index 1e8307326..2597ceaf0 100644 --- a/src/test/ref/double-import.log +++ b/src/test/ref/double-import.log @@ -117,6 +117,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) BGCOL#0) ← (const byte) RED#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -162,6 +163,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -220,4 +222,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/double-indexing-arrays.log b/src/test/ref/double-indexing-arrays.log index 17aba7f3c..86e162927 100644 --- a/src/test/ref/double-indexing-arrays.log +++ b/src/test/ref/double-indexing-arrays.log @@ -420,6 +420,7 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data MAPDATA: .fill $3e8, 0 COLORMAP1: .fill $100, 0 COLORMAP2: .fill $100, 0 @@ -530,6 +531,7 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data MAPDATA: .fill $3e8, 0 COLORMAP1: .fill $100, 0 COLORMAP2: .fill $100, 0 @@ -655,6 +657,7 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data MAPDATA: .fill $3e8, 0 COLORMAP1: .fill $100, 0 COLORMAP2: .fill $100, 0 diff --git a/src/test/ref/duplicate-loop-problem.log b/src/test/ref/duplicate-loop-problem.log index ef76012fe..7d78f7a89 100644 --- a/src/test/ref/duplicate-loop-problem.log +++ b/src/test/ref/duplicate-loop-problem.log @@ -222,6 +222,7 @@ main: { b2: jmp b1 } +//SEG19 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ key#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -287,6 +288,7 @@ main: { b2: jmp b1 } +//SEG19 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -372,4 +374,5 @@ main: { //SEG18 main::@2 jmp b1 } +//SEG19 File Data diff --git a/src/test/ref/dword.log b/src/test/ref/dword.log index e788d6565..0dbf6ba22 100644 --- a/src/test/ref/dword.log +++ b/src/test/ref/dword.log @@ -230,6 +230,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (dword) main::b#0 ← (const dword) main::a#0 + (byte) main::i#2 [ main::i#2 main::b#0 ] ( main:2 [ main::i#2 main::b#0 ] ) always clobbers reg byte a @@ -317,6 +318,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -422,4 +424,5 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data diff --git a/src/test/ref/emptyblock-error.log b/src/test/ref/emptyblock-error.log index fd6fa205f..f9e623a89 100644 --- a/src/test/ref/emptyblock-error.log +++ b/src/test/ref/emptyblock-error.log @@ -282,6 +282,7 @@ mode: { b2: jmp b1 } +//SEG27 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] if(*((const byte*) B#0)!=(byte) 0) goto mode::@1 [ ] ( main:2::menu:6::mode:9 [ ] ) always clobbers reg byte a @@ -369,6 +370,7 @@ mode: { b2: jmp b1 } +//SEG27 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -470,4 +472,5 @@ mode: { //SEG26 mode::@2 jmp b1 } +//SEG27 File Data diff --git a/src/test/ref/enum-0.log b/src/test/ref/enum-0.log index 2a56d6194..13a869fae 100644 --- a/src/test/ref/enum-0.log +++ b/src/test/ref/enum-0.log @@ -118,6 +118,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) ON [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -166,6 +167,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -227,4 +229,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/enum-1.log b/src/test/ref/enum-1.log index f3fbc9919..ac0cdcc7c 100644 --- a/src/test/ref/enum-1.log +++ b/src/test/ref/enum-1.log @@ -119,6 +119,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) BROKEN [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -167,6 +168,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -229,4 +231,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/enum-2.log b/src/test/ref/enum-2.log index 4880a1905..4c871cb46 100644 --- a/src/test/ref/enum-2.log +++ b/src/test/ref/enum-2.log @@ -119,6 +119,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) B [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -167,6 +168,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -229,4 +231,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/enum-3.log b/src/test/ref/enum-3.log index 5e9121240..dde9c1018 100644 --- a/src/test/ref/enum-3.log +++ b/src/test/ref/enum-3.log @@ -121,6 +121,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) BROKEN [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -169,6 +170,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -231,4 +233,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/enum-4.log b/src/test/ref/enum-4.log index 0703580ee..f0af5b014 100644 --- a/src/test/ref/enum-4.log +++ b/src/test/ref/enum-4.log @@ -116,6 +116,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::ON [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -162,6 +163,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -221,4 +223,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/enum-5.log b/src/test/ref/enum-5.log index 9be05a1b7..104f1e992 100644 --- a/src/test/ref/enum-5.log +++ b/src/test/ref/enum-5.log @@ -172,6 +172,7 @@ test: { //SEG17 [8] return rts } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::ON [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -236,6 +237,7 @@ test: { //SEG17 [8] return rts } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -316,4 +318,5 @@ test: { //SEG17 [8] return rts } +//SEG18 File Data diff --git a/src/test/ref/enum-6.log b/src/test/ref/enum-6.log index 0d5cec9e2..292e7027a 100644 --- a/src/test/ref/enum-6.log +++ b/src/test/ref/enum-6.log @@ -138,6 +138,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::ON [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -189,6 +190,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -253,4 +255,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/enum-7.log b/src/test/ref/enum-7.log index 93f0ee7c4..0b22f54df 100644 --- a/src/test/ref/enum-7.log +++ b/src/test/ref/enum-7.log @@ -157,6 +157,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) RED [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -212,6 +213,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -281,4 +283,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/enum-8.log b/src/test/ref/enum-8.log index 8832037a7..933f4c19b 100644 --- a/src/test/ref/enum-8.log +++ b/src/test/ref/enum-8.log @@ -159,6 +159,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) RED [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -214,6 +215,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -281,4 +283,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/examples/3d/3d.log b/src/test/ref/examples/3d/3d.log index 2f550e7be..26e4073b6 100644 --- a/src/test/ref/examples/3d/3d.log +++ b/src/test/ref/examples/3d/3d.log @@ -6757,6 +6757,7 @@ sprites_init: { //SEG505 [270] return rts } +//SEG506 File Data print_hextab: .text "0123456789abcdef" // Positions to rotate xs: .byte -$34, -$34, -$34, 0, 0, $34, $34, $34 @@ -7329,130 +7330,130 @@ Uplift Scope [print_byte_at] 4: zp ZP_BYTE:44 [ print_byte_at::$0 ] 2: zp ZP_BYT Uplift Scope [main] Uplift Scope [store_matrix] -Uplifting [print_sbyte_at] best 79709 combination reg byte x [ print_sbyte_at::b#24 print_sbyte_at::b#0 print_sbyte_at::b#22 print_sbyte_at::b#16 print_sbyte_at::b#17 print_sbyte_at::b#18 print_sbyte_at::b#19 print_sbyte_at::b#20 print_sbyte_at::b#21 print_sbyte_at::b#4 print_sbyte_at::b#13 print_sbyte_at::b#14 print_sbyte_at::b#15 print_sbyte_at::b#5 print_sbyte_at::b#7 print_sbyte_at::b#8 print_sbyte_at::b#9 print_sbyte_at::b#10 print_sbyte_at::b#11 print_sbyte_at::b#12 print_sbyte_at::b#1 print_sbyte_at::b#2 print_sbyte_at::b#3 ] zp ZP_WORD:7 [ print_sbyte_at::at#21 print_sbyte_at::at#15 print_sbyte_at::at#16 print_sbyte_at::at#17 print_sbyte_at::at#18 print_sbyte_at::at#19 print_sbyte_at::at#20 print_sbyte_at::at#0 print_sbyte_at::at#1 print_sbyte_at::at#2 ] -Uplifting [debug_print_init] best 74909 combination reg byte y [ debug_print_init::j#2 debug_print_init::j#1 ] zp ZP_WORD:82 [ debug_print_init::$41 ] zp ZP_WORD:84 [ debug_print_init::$44 ] zp ZP_WORD:86 [ debug_print_init::$47 ] zp ZP_WORD:88 [ debug_print_init::$50 ] zp ZP_WORD:90 [ debug_print_init::$53 ] zp ZP_WORD:92 [ debug_print_init::$56 ] zp ZP_WORD:94 [ debug_print_init::$59 ] zp ZP_WORD:96 [ debug_print_init::$62 ] zp ZP_WORD:98 [ debug_print_init::$65 ] reg byte x [ debug_print_init::col#0 ] zp ZP_BYTE:13 [ debug_print_init::c#2 debug_print_init::c#1 ] zp ZP_BYTE:14 [ debug_print_init::i#2 debug_print_init::i#1 ] -Uplifting [anim] best 73009 combination zp ZP_BYTE:4 [ anim::i#2 anim::i#1 ] reg byte a [ anim::$8 ] reg byte a [ anim::$10 ] reg byte x [ anim::i2#0 ] -Uplifting [debug_print] best 72991 combination zp ZP_BYTE:6 [ debug_print::i#2 debug_print::i#1 ] zp ZP_BYTE:5 [ debug_print::c#2 debug_print::c#1 ] reg byte x [ debug_print::print_sbyte_pos1_sb#0 ] reg byte x [ debug_print::print_sbyte_pos2_sb#0 ] reg byte x [ debug_print::print_sbyte_pos4_sb#0 ] zp ZP_BYTE:34 [ debug_print::print_sbyte_pos5_sb#0 ] zp ZP_BYTE:35 [ debug_print::print_sbyte_pos6_sb#0 ] zp ZP_BYTE:36 [ debug_print::print_sbyte_pos7_sb#0 ] zp ZP_BYTE:37 [ debug_print::print_sbyte_pos8_sb#0 ] zp ZP_BYTE:38 [ debug_print::print_sbyte_pos9_sb#0 ] zp ZP_BYTE:39 [ debug_print::print_sbyte_pos10_sb#0 ] zp ZP_BYTE:40 [ debug_print::print_sbyte_pos11_sb#0 ] zp ZP_BYTE:41 [ debug_print::print_sbyte_pos12_sb#0 ] +Uplifting [print_sbyte_at] best 102749 combination reg byte x [ print_sbyte_at::b#24 print_sbyte_at::b#0 print_sbyte_at::b#22 print_sbyte_at::b#16 print_sbyte_at::b#17 print_sbyte_at::b#18 print_sbyte_at::b#19 print_sbyte_at::b#20 print_sbyte_at::b#21 print_sbyte_at::b#4 print_sbyte_at::b#13 print_sbyte_at::b#14 print_sbyte_at::b#15 print_sbyte_at::b#5 print_sbyte_at::b#7 print_sbyte_at::b#8 print_sbyte_at::b#9 print_sbyte_at::b#10 print_sbyte_at::b#11 print_sbyte_at::b#12 print_sbyte_at::b#1 print_sbyte_at::b#2 print_sbyte_at::b#3 ] zp ZP_WORD:7 [ print_sbyte_at::at#21 print_sbyte_at::at#15 print_sbyte_at::at#16 print_sbyte_at::at#17 print_sbyte_at::at#18 print_sbyte_at::at#19 print_sbyte_at::at#20 print_sbyte_at::at#0 print_sbyte_at::at#1 print_sbyte_at::at#2 ] +Uplifting [debug_print_init] best 97949 combination reg byte y [ debug_print_init::j#2 debug_print_init::j#1 ] zp ZP_WORD:82 [ debug_print_init::$41 ] zp ZP_WORD:84 [ debug_print_init::$44 ] zp ZP_WORD:86 [ debug_print_init::$47 ] zp ZP_WORD:88 [ debug_print_init::$50 ] zp ZP_WORD:90 [ debug_print_init::$53 ] zp ZP_WORD:92 [ debug_print_init::$56 ] zp ZP_WORD:94 [ debug_print_init::$59 ] zp ZP_WORD:96 [ debug_print_init::$62 ] zp ZP_WORD:98 [ debug_print_init::$65 ] reg byte x [ debug_print_init::col#0 ] zp ZP_BYTE:13 [ debug_print_init::c#2 debug_print_init::c#1 ] zp ZP_BYTE:14 [ debug_print_init::i#2 debug_print_init::i#1 ] +Uplifting [anim] best 96049 combination zp ZP_BYTE:4 [ anim::i#2 anim::i#1 ] reg byte a [ anim::$8 ] reg byte a [ anim::$10 ] reg byte x [ anim::i2#0 ] +Uplifting [debug_print] best 96031 combination zp ZP_BYTE:6 [ debug_print::i#2 debug_print::i#1 ] zp ZP_BYTE:5 [ debug_print::c#2 debug_print::c#1 ] reg byte x [ debug_print::print_sbyte_pos1_sb#0 ] reg byte x [ debug_print::print_sbyte_pos2_sb#0 ] reg byte x [ debug_print::print_sbyte_pos4_sb#0 ] zp ZP_BYTE:34 [ debug_print::print_sbyte_pos5_sb#0 ] zp ZP_BYTE:35 [ debug_print::print_sbyte_pos6_sb#0 ] zp ZP_BYTE:36 [ debug_print::print_sbyte_pos7_sb#0 ] zp ZP_BYTE:37 [ debug_print::print_sbyte_pos8_sb#0 ] zp ZP_BYTE:38 [ debug_print::print_sbyte_pos9_sb#0 ] zp ZP_BYTE:39 [ debug_print::print_sbyte_pos10_sb#0 ] zp ZP_BYTE:40 [ debug_print::print_sbyte_pos11_sb#0 ] zp ZP_BYTE:41 [ debug_print::print_sbyte_pos12_sb#0 ] Limited combination testing to 100 combinations of 8388608 possible. -Uplifting [rotate_matrix] best 72690 combination reg byte x [ rotate_matrix::x#0 ] zp ZP_BYTE:26 [ rotate_matrix::y#0 ] zp ZP_BYTE:27 [ rotate_matrix::z#0 ] -Uplifting [print_str_at] best 72690 combination zp ZP_WORD:16 [ print_str_at::str#13 print_str_at::str#15 print_str_at::str#0 ] zp ZP_WORD:18 [ print_str_at::at#13 print_str_at::at#15 print_str_at::at#0 ] -Uplifting [print_char_at] best 72690 combination zp ZP_WORD:11 [ print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] zp ZP_BYTE:10 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] -Uplifting [] best 72690 combination zp ZP_BYTE:3 [ sy#10 sy#3 ] zp ZP_BYTE:2 [ sx#10 sx#3 ] -Uplifting [print_cls] best 72690 combination zp ZP_WORD:20 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [sprites_init] best 72540 combination reg byte x [ sprites_init::i#2 sprites_init::i#1 ] -Uplifting [print_byte_at] best 72532 combination reg byte a [ print_byte_at::$0 ] reg byte x [ print_byte_at::$2 ] zp ZP_WORD:42 [ print_byte_at::at#0 ] -Uplifting [main] best 72532 combination -Uplifting [store_matrix] best 72532 combination +Uplifting [rotate_matrix] best 95730 combination reg byte x [ rotate_matrix::x#0 ] zp ZP_BYTE:26 [ rotate_matrix::y#0 ] zp ZP_BYTE:27 [ rotate_matrix::z#0 ] +Uplifting [print_str_at] best 95730 combination zp ZP_WORD:16 [ print_str_at::str#13 print_str_at::str#15 print_str_at::str#0 ] zp ZP_WORD:18 [ print_str_at::at#13 print_str_at::at#15 print_str_at::at#0 ] +Uplifting [print_char_at] best 95730 combination zp ZP_WORD:11 [ print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] zp ZP_BYTE:10 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] +Uplifting [] best 95730 combination zp ZP_BYTE:3 [ sy#10 sy#3 ] zp ZP_BYTE:2 [ sx#10 sx#3 ] +Uplifting [print_cls] best 95730 combination zp ZP_WORD:20 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [sprites_init] best 95580 combination reg byte x [ sprites_init::i#2 sprites_init::i#1 ] +Uplifting [print_byte_at] best 95572 combination reg byte a [ print_byte_at::$0 ] reg byte x [ print_byte_at::$2 ] zp ZP_WORD:42 [ print_byte_at::at#0 ] +Uplifting [main] best 95572 combination +Uplifting [store_matrix] best 95572 combination Attempting to uplift remaining variables inzp ZP_BYTE:4 [ anim::i#2 anim::i#1 ] -Uplifting [anim] best 72532 combination zp ZP_BYTE:4 [ anim::i#2 anim::i#1 ] +Uplifting [anim] best 95572 combination zp ZP_BYTE:4 [ anim::i#2 anim::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ debug_print::i#2 debug_print::i#1 ] -Uplifting [debug_print] best 72532 combination zp ZP_BYTE:6 [ debug_print::i#2 debug_print::i#1 ] +Uplifting [debug_print] best 95572 combination zp ZP_BYTE:6 [ debug_print::i#2 debug_print::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ debug_print::c#2 debug_print::c#1 ] -Uplifting [debug_print] best 72532 combination zp ZP_BYTE:5 [ debug_print::c#2 debug_print::c#1 ] +Uplifting [debug_print] best 95572 combination zp ZP_BYTE:5 [ debug_print::c#2 debug_print::c#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:13 [ debug_print_init::c#2 debug_print_init::c#1 ] -Uplifting [debug_print_init] best 72532 combination zp ZP_BYTE:13 [ debug_print_init::c#2 debug_print_init::c#1 ] +Uplifting [debug_print_init] best 95572 combination zp ZP_BYTE:13 [ debug_print_init::c#2 debug_print_init::c#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:26 [ rotate_matrix::y#0 ] -Uplifting [rotate_matrix] best 72532 combination zp ZP_BYTE:26 [ rotate_matrix::y#0 ] +Uplifting [rotate_matrix] best 95572 combination zp ZP_BYTE:26 [ rotate_matrix::y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:27 [ rotate_matrix::z#0 ] -Uplifting [rotate_matrix] best 72532 combination zp ZP_BYTE:27 [ rotate_matrix::z#0 ] +Uplifting [rotate_matrix] best 95572 combination zp ZP_BYTE:27 [ rotate_matrix::z#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:3 [ sy#10 sy#3 ] -Uplifting [] best 72532 combination zp ZP_BYTE:3 [ sy#10 sy#3 ] +Uplifting [] best 95572 combination zp ZP_BYTE:3 [ sy#10 sy#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:14 [ debug_print_init::i#2 debug_print_init::i#1 ] -Uplifting [debug_print_init] best 72532 combination zp ZP_BYTE:14 [ debug_print_init::i#2 debug_print_init::i#1 ] +Uplifting [debug_print_init] best 95572 combination zp ZP_BYTE:14 [ debug_print_init::i#2 debug_print_init::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:10 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] -Uplifting [print_char_at] best 72532 combination zp ZP_BYTE:10 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] +Uplifting [print_char_at] best 95572 combination zp ZP_BYTE:10 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ sx#10 sx#3 ] -Uplifting [] best 72532 combination zp ZP_BYTE:2 [ sx#10 sx#3 ] +Uplifting [] best 95572 combination zp ZP_BYTE:2 [ sx#10 sx#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:34 [ debug_print::print_sbyte_pos5_sb#0 ] -Uplifting [debug_print] best 72526 combination reg byte x [ debug_print::print_sbyte_pos5_sb#0 ] +Uplifting [debug_print] best 95566 combination reg byte x [ debug_print::print_sbyte_pos5_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:35 [ debug_print::print_sbyte_pos6_sb#0 ] -Uplifting [debug_print] best 72520 combination reg byte x [ debug_print::print_sbyte_pos6_sb#0 ] +Uplifting [debug_print] best 95560 combination reg byte x [ debug_print::print_sbyte_pos6_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:36 [ debug_print::print_sbyte_pos7_sb#0 ] -Uplifting [debug_print] best 72514 combination reg byte x [ debug_print::print_sbyte_pos7_sb#0 ] +Uplifting [debug_print] best 95554 combination reg byte x [ debug_print::print_sbyte_pos7_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:37 [ debug_print::print_sbyte_pos8_sb#0 ] -Uplifting [debug_print] best 72508 combination reg byte x [ debug_print::print_sbyte_pos8_sb#0 ] +Uplifting [debug_print] best 95548 combination reg byte x [ debug_print::print_sbyte_pos8_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:38 [ debug_print::print_sbyte_pos9_sb#0 ] -Uplifting [debug_print] best 72502 combination reg byte x [ debug_print::print_sbyte_pos9_sb#0 ] +Uplifting [debug_print] best 95542 combination reg byte x [ debug_print::print_sbyte_pos9_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:39 [ debug_print::print_sbyte_pos10_sb#0 ] -Uplifting [debug_print] best 72496 combination reg byte x [ debug_print::print_sbyte_pos10_sb#0 ] +Uplifting [debug_print] best 95536 combination reg byte x [ debug_print::print_sbyte_pos10_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:40 [ debug_print::print_sbyte_pos11_sb#0 ] -Uplifting [debug_print] best 72490 combination reg byte x [ debug_print::print_sbyte_pos11_sb#0 ] +Uplifting [debug_print] best 95530 combination reg byte x [ debug_print::print_sbyte_pos11_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:41 [ debug_print::print_sbyte_pos12_sb#0 ] -Uplifting [debug_print] best 72484 combination reg byte x [ debug_print::print_sbyte_pos12_sb#0 ] +Uplifting [debug_print] best 95524 combination reg byte x [ debug_print::print_sbyte_pos12_sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:56 [ calculate_matrix::$10 ] -Uplifting [calculate_matrix] best 72478 combination reg byte a [ calculate_matrix::$10 ] +Uplifting [calculate_matrix] best 95518 combination reg byte a [ calculate_matrix::$10 ] Attempting to uplift remaining variables inzp ZP_BYTE:57 [ calculate_matrix::$11 ] -Uplifting [calculate_matrix] best 72472 combination reg byte a [ calculate_matrix::$11 ] +Uplifting [calculate_matrix] best 95512 combination reg byte a [ calculate_matrix::$11 ] Attempting to uplift remaining variables inzp ZP_BYTE:58 [ calculate_matrix::$12 ] -Uplifting [calculate_matrix] best 72466 combination reg byte a [ calculate_matrix::$12 ] +Uplifting [calculate_matrix] best 95506 combination reg byte a [ calculate_matrix::$12 ] Attempting to uplift remaining variables inzp ZP_BYTE:59 [ calculate_matrix::$13 ] -Uplifting [calculate_matrix] best 72460 combination reg byte a [ calculate_matrix::$13 ] +Uplifting [calculate_matrix] best 95500 combination reg byte a [ calculate_matrix::$13 ] Attempting to uplift remaining variables inzp ZP_BYTE:60 [ calculate_matrix::$14 ] -Uplifting [calculate_matrix] best 72454 combination reg byte a [ calculate_matrix::$14 ] +Uplifting [calculate_matrix] best 95494 combination reg byte a [ calculate_matrix::$14 ] Attempting to uplift remaining variables inzp ZP_BYTE:61 [ calculate_matrix::$15 ] -Uplifting [calculate_matrix] best 72448 combination reg byte a [ calculate_matrix::$15 ] +Uplifting [calculate_matrix] best 95488 combination reg byte a [ calculate_matrix::$15 ] Attempting to uplift remaining variables inzp ZP_BYTE:62 [ calculate_matrix::$16 ] -Uplifting [calculate_matrix] best 72442 combination reg byte a [ calculate_matrix::$16 ] +Uplifting [calculate_matrix] best 95482 combination reg byte a [ calculate_matrix::$16 ] Attempting to uplift remaining variables inzp ZP_BYTE:63 [ calculate_matrix::$17 ] -Uplifting [calculate_matrix] best 72436 combination reg byte a [ calculate_matrix::$17 ] +Uplifting [calculate_matrix] best 95476 combination reg byte a [ calculate_matrix::$17 ] Attempting to uplift remaining variables inzp ZP_BYTE:64 [ calculate_matrix::$18 ] -Uplifting [calculate_matrix] best 72430 combination reg byte a [ calculate_matrix::$18 ] +Uplifting [calculate_matrix] best 95470 combination reg byte a [ calculate_matrix::$18 ] Attempting to uplift remaining variables inzp ZP_BYTE:65 [ calculate_matrix::$19 ] -Uplifting [calculate_matrix] best 72424 combination reg byte a [ calculate_matrix::$19 ] +Uplifting [calculate_matrix] best 95464 combination reg byte a [ calculate_matrix::$19 ] Attempting to uplift remaining variables inzp ZP_BYTE:66 [ calculate_matrix::$20 ] -Uplifting [calculate_matrix] best 72418 combination reg byte a [ calculate_matrix::$20 ] +Uplifting [calculate_matrix] best 95458 combination reg byte a [ calculate_matrix::$20 ] Attempting to uplift remaining variables inzp ZP_BYTE:67 [ calculate_matrix::$21 ] -Uplifting [calculate_matrix] best 72412 combination reg byte a [ calculate_matrix::$21 ] +Uplifting [calculate_matrix] best 95452 combination reg byte a [ calculate_matrix::$21 ] Attempting to uplift remaining variables inzp ZP_BYTE:68 [ calculate_matrix::$22 ] -Uplifting [calculate_matrix] best 72406 combination reg byte a [ calculate_matrix::$22 ] +Uplifting [calculate_matrix] best 95446 combination reg byte a [ calculate_matrix::$22 ] Attempting to uplift remaining variables inzp ZP_BYTE:69 [ calculate_matrix::$23 ] -Uplifting [calculate_matrix] best 72400 combination reg byte a [ calculate_matrix::$23 ] +Uplifting [calculate_matrix] best 95440 combination reg byte a [ calculate_matrix::$23 ] Attempting to uplift remaining variables inzp ZP_BYTE:70 [ calculate_matrix::$24 ] -Uplifting [calculate_matrix] best 72394 combination reg byte a [ calculate_matrix::$24 ] +Uplifting [calculate_matrix] best 95434 combination reg byte a [ calculate_matrix::$24 ] Attempting to uplift remaining variables inzp ZP_BYTE:71 [ calculate_matrix::$25 ] -Uplifting [calculate_matrix] best 72388 combination reg byte a [ calculate_matrix::$25 ] +Uplifting [calculate_matrix] best 95428 combination reg byte a [ calculate_matrix::$25 ] Attempting to uplift remaining variables inzp ZP_BYTE:72 [ calculate_matrix::$26 ] -Uplifting [calculate_matrix] best 72382 combination reg byte a [ calculate_matrix::$26 ] +Uplifting [calculate_matrix] best 95422 combination reg byte a [ calculate_matrix::$26 ] Attempting to uplift remaining variables inzp ZP_BYTE:73 [ calculate_matrix::$27 ] -Uplifting [calculate_matrix] best 72376 combination reg byte a [ calculate_matrix::$27 ] +Uplifting [calculate_matrix] best 95416 combination reg byte a [ calculate_matrix::$27 ] Attempting to uplift remaining variables inzp ZP_BYTE:74 [ calculate_matrix::$28 ] -Uplifting [calculate_matrix] best 72370 combination reg byte a [ calculate_matrix::$28 ] +Uplifting [calculate_matrix] best 95410 combination reg byte a [ calculate_matrix::$28 ] Attempting to uplift remaining variables inzp ZP_BYTE:75 [ calculate_matrix::$29 ] -Uplifting [calculate_matrix] best 72364 combination reg byte a [ calculate_matrix::$29 ] +Uplifting [calculate_matrix] best 95404 combination reg byte a [ calculate_matrix::$29 ] Attempting to uplift remaining variables inzp ZP_BYTE:76 [ calculate_matrix::$30 ] -Uplifting [calculate_matrix] best 72358 combination reg byte a [ calculate_matrix::$30 ] +Uplifting [calculate_matrix] best 95398 combination reg byte a [ calculate_matrix::$30 ] Attempting to uplift remaining variables inzp ZP_BYTE:77 [ calculate_matrix::$31 ] -Uplifting [calculate_matrix] best 72352 combination reg byte a [ calculate_matrix::$31 ] +Uplifting [calculate_matrix] best 95392 combination reg byte a [ calculate_matrix::$31 ] Attempting to uplift remaining variables inzp ZP_BYTE:78 [ calculate_matrix::$32 ] -Uplifting [calculate_matrix] best 72346 combination reg byte a [ calculate_matrix::$32 ] +Uplifting [calculate_matrix] best 95386 combination reg byte a [ calculate_matrix::$32 ] Attempting to uplift remaining variables inzp ZP_BYTE:79 [ calculate_matrix::$33 ] -Uplifting [calculate_matrix] best 72340 combination reg byte a [ calculate_matrix::$33 ] +Uplifting [calculate_matrix] best 95380 combination reg byte a [ calculate_matrix::$33 ] Attempting to uplift remaining variables inzp ZP_BYTE:80 [ calculate_matrix::$34 ] -Uplifting [calculate_matrix] best 72334 combination reg byte a [ calculate_matrix::$34 ] +Uplifting [calculate_matrix] best 95374 combination reg byte a [ calculate_matrix::$34 ] Attempting to uplift remaining variables inzp ZP_BYTE:23 [ calculate_matrix::sx#0 ] -Uplifting [calculate_matrix] best 72296 combination reg byte x [ calculate_matrix::sx#0 ] +Uplifting [calculate_matrix] best 95336 combination reg byte x [ calculate_matrix::sx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:24 [ calculate_matrix::sy#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:24 [ calculate_matrix::sy#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:24 [ calculate_matrix::sy#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:47 [ calculate_matrix::t2#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:47 [ calculate_matrix::t2#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:47 [ calculate_matrix::t2#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:46 [ calculate_matrix::t1#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:46 [ calculate_matrix::t1#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:46 [ calculate_matrix::t1#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:51 [ calculate_matrix::t6#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:51 [ calculate_matrix::t6#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:51 [ calculate_matrix::t6#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:49 [ calculate_matrix::t4#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:49 [ calculate_matrix::t4#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:49 [ calculate_matrix::t4#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:52 [ calculate_matrix::t7#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:52 [ calculate_matrix::t7#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:52 [ calculate_matrix::t7#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:53 [ calculate_matrix::t8#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:53 [ calculate_matrix::t8#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:53 [ calculate_matrix::t8#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:48 [ calculate_matrix::t3#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:48 [ calculate_matrix::t3#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:48 [ calculate_matrix::t3#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:50 [ calculate_matrix::t5#0 ] -Uplifting [calculate_matrix] best 72296 combination zp ZP_BYTE:50 [ calculate_matrix::t5#0 ] +Uplifting [calculate_matrix] best 95336 combination zp ZP_BYTE:50 [ calculate_matrix::t5#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:55 [ calculate_matrix::t10#0 ] -Uplifting [calculate_matrix] best 72289 combination reg byte x [ calculate_matrix::t10#0 ] +Uplifting [calculate_matrix] best 95329 combination reg byte x [ calculate_matrix::t10#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:54 [ calculate_matrix::t9#0 ] -Uplifting [calculate_matrix] best 72289 combination zp ZP_BYTE:54 [ calculate_matrix::t9#0 ] +Uplifting [calculate_matrix] best 95329 combination zp ZP_BYTE:54 [ calculate_matrix::t9#0 ] Coalescing zero page register with common assignment [ zp ZP_WORD:7 [ print_sbyte_at::at#21 print_sbyte_at::at#15 print_sbyte_at::at#16 print_sbyte_at::at#17 print_sbyte_at::at#18 print_sbyte_at::at#19 print_sbyte_at::at#20 print_sbyte_at::at#0 print_sbyte_at::at#1 print_sbyte_at::at#2 ] ] with [ zp ZP_WORD:11 [ print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_BYTE:3 [ sy#10 sy#3 ] ] with [ zp ZP_BYTE:24 [ calculate_matrix::sy#0 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:7 [ print_sbyte_at::at#21 print_sbyte_at::at#15 print_sbyte_at::at#16 print_sbyte_at::at#17 print_sbyte_at::at#18 print_sbyte_at::at#19 print_sbyte_at::at#20 print_sbyte_at::at#0 print_sbyte_at::at#1 print_sbyte_at::at#2 print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] ] with [ zp ZP_WORD:42 [ print_byte_at::at#0 ] ] - score: 1 @@ -9243,6 +9244,7 @@ sprites_init: { //SEG505 [270] return rts } +//SEG506 File Data print_hextab: .text "0123456789abcdef" // Positions to rotate xs: .byte -$34, -$34, -$34, 0, 0, $34, $34, $34 @@ -10178,7 +10180,7 @@ zp ZP_WORD:45 [ debug_print_init::$65 ] FINAL ASSEMBLER -Score: 66015 +Score: 89055 //SEG0 File Comments // 3D Rotation using a Rotation Matrix @@ -11707,6 +11709,7 @@ sprites_init: { //SEG505 [270] return rts } +//SEG506 File Data print_hextab: .text "0123456789abcdef" // Positions to rotate xs: .byte -$34, -$34, -$34, 0, 0, $34, $34, $34 diff --git a/src/test/ref/examples/3d/perspective.log b/src/test/ref/examples/3d/perspective.log index 714f530f1..bc06d3e57 100644 --- a/src/test/ref/examples/3d/perspective.log +++ b/src/test/ref/examples/3d/perspective.log @@ -2269,6 +2269,7 @@ mulf_init: { //SEG209 [103] return rts } +//SEG210 File Data print_hextab: .text "0123456789abcdef" // Multiplication tables for seriously fast multiplication. // This version is optimized for speed over accuracy @@ -2394,20 +2395,20 @@ Uplift Scope [main] Uplift Scope [do_perspective] Uplift Scope [perspective] -Uplifting [mulf_init] best 4298 combination reg byte y [ mulf_init::i#2 mulf_init::i#1 ] reg byte x [ mulf_init::$8 ] reg byte x [ mulf_init::$10 ] reg byte x [ mulf_init::$4 ] zp ZP_WORD:16 [ mulf_init::add#2 mulf_init::add#1 ] zp ZP_BYTE:20 [ mulf_init::val#0 ] zp ZP_WORD:13 [ mulf_init::sqr#2 mulf_init::sqr#1 ] +Uplifting [mulf_init] best 6602 combination reg byte y [ mulf_init::i#2 mulf_init::i#1 ] reg byte x [ mulf_init::$8 ] reg byte x [ mulf_init::$10 ] reg byte x [ mulf_init::$4 ] zp ZP_WORD:16 [ mulf_init::add#2 mulf_init::add#1 ] zp ZP_BYTE:20 [ mulf_init::val#0 ] zp ZP_WORD:13 [ mulf_init::sqr#2 mulf_init::sqr#1 ] Limited combination testing to 100 combinations of 432 possible. -Uplifting [] best 4298 combination zp ZP_WORD:2 [ print_line_cursor#11 print_line_cursor#1 ] zp ZP_WORD:8 [ print_char_cursor#44 print_char_cursor#69 print_char_cursor#2 print_char_cursor#74 print_char_cursor#12 print_char_cursor#1 ] -Uplifting [print_str] best 4298 combination zp ZP_WORD:4 [ print_str::str#7 print_str::str#9 print_str::str#0 ] -Uplifting [print_cls] best 4298 combination zp ZP_WORD:11 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_byte] best 4277 combination reg byte x [ print_byte::b#3 print_byte::b#5 print_byte::b#6 print_byte::b#7 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] -Uplifting [print_char] best 4262 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] -Uplifting [print_sbyte] best 4247 combination reg byte x [ print_sbyte::b#6 print_sbyte::b#0 print_sbyte::b#4 ] -Uplifting [print_ln] best 4247 combination -Uplifting [main] best 4247 combination -Uplifting [do_perspective] best 4247 combination -Uplifting [perspective] best 4247 combination +Uplifting [] best 6602 combination zp ZP_WORD:2 [ print_line_cursor#11 print_line_cursor#1 ] zp ZP_WORD:8 [ print_char_cursor#44 print_char_cursor#69 print_char_cursor#2 print_char_cursor#74 print_char_cursor#12 print_char_cursor#1 ] +Uplifting [print_str] best 6602 combination zp ZP_WORD:4 [ print_str::str#7 print_str::str#9 print_str::str#0 ] +Uplifting [print_cls] best 6602 combination zp ZP_WORD:11 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_byte] best 6581 combination reg byte x [ print_byte::b#3 print_byte::b#5 print_byte::b#6 print_byte::b#7 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] +Uplifting [print_char] best 6566 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] +Uplifting [print_sbyte] best 6551 combination reg byte x [ print_sbyte::b#6 print_sbyte::b#0 print_sbyte::b#4 ] +Uplifting [print_ln] best 6551 combination +Uplifting [main] best 6551 combination +Uplifting [do_perspective] best 6551 combination +Uplifting [perspective] best 6551 combination Attempting to uplift remaining variables inzp ZP_BYTE:20 [ mulf_init::val#0 ] -Uplifting [mulf_init] best 4247 combination zp ZP_BYTE:20 [ mulf_init::val#0 ] +Uplifting [mulf_init] best 6551 combination zp ZP_BYTE:20 [ mulf_init::val#0 ] Allocated (was zp ZP_WORD:8) zp ZP_WORD:6 [ print_char_cursor#44 print_char_cursor#69 print_char_cursor#2 print_char_cursor#74 print_char_cursor#12 print_char_cursor#1 ] Allocated (was zp ZP_WORD:11) zp ZP_WORD:8 [ print_cls::sc#2 print_cls::sc#1 ] Allocated (was zp ZP_WORD:13) zp ZP_WORD:10 [ mulf_init::sqr#2 mulf_init::sqr#1 ] @@ -3041,6 +3042,7 @@ mulf_init: { //SEG209 [103] return rts } +//SEG210 File Data print_hextab: .text "0123456789abcdef" // Multiplication tables for seriously fast multiplication. // This version is optimized for speed over accuracy @@ -3358,7 +3360,7 @@ reg byte x [ mulf_init::$10 ] FINAL ASSEMBLER -Score: 3589 +Score: 5893 //SEG0 File Comments // 3D Rotation using a Rotation Matrix @@ -3864,6 +3866,7 @@ mulf_init: { //SEG209 [103] return rts } +//SEG210 File Data print_hextab: .text "0123456789abcdef" // Multiplication tables for seriously fast multiplication. // This version is optimized for speed over accuracy diff --git a/src/test/ref/examples/bresenham/bitmap-bresenham.log b/src/test/ref/examples/bresenham/bitmap-bresenham.log index 1bfa5aaa2..d50612349 100644 --- a/src/test/ref/examples/bresenham/bitmap-bresenham.log +++ b/src/test/ref/examples/bresenham/bitmap-bresenham.log @@ -3873,6 +3873,7 @@ bitmap_init: { //SEG371 [195] return rts } +//SEG372 File Data // Tables for the plotter - initialized by calling bitmap_draw_init(); bitmap_plot_xlo: .fill $100, 0 bitmap_plot_xhi: .fill $100, 0 @@ -5170,6 +5171,7 @@ bitmap_init: { //SEG371 [195] return rts } +//SEG372 File Data // Tables for the plotter - initialized by calling bitmap_draw_init(); bitmap_plot_xlo: .fill $100, 0 bitmap_plot_xhi: .fill $100, 0 @@ -6513,6 +6515,7 @@ bitmap_init: { //SEG371 [195] return rts } +//SEG372 File Data // Tables for the plotter - initialized by calling bitmap_draw_init(); bitmap_plot_xlo: .fill $100, 0 bitmap_plot_xhi: .fill $100, 0 diff --git a/src/test/ref/examples/chargen/chargen-analysis.log b/src/test/ref/examples/chargen/chargen-analysis.log index f0f45b827..ef59f1b63 100644 --- a/src/test/ref/examples/chargen/chargen-analysis.log +++ b/src/test/ref/examples/chargen/chargen-analysis.log @@ -3563,6 +3563,7 @@ print_str_at: { !: jmp b1_from_b2 } +//SEG283 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -4605,6 +4606,7 @@ print_str_at: { !: jmp b1_from_b2 } +//SEG283 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -5846,6 +5848,7 @@ print_str_at: { !: jmp b1 } +//SEG283 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) diff --git a/src/test/ref/examples/fastmultiply/fastmultiply8.log b/src/test/ref/examples/fastmultiply/fastmultiply8.log index 5f325eb2a..d87084c46 100644 --- a/src/test/ref/examples/fastmultiply/fastmultiply8.log +++ b/src/test/ref/examples/fastmultiply/fastmultiply8.log @@ -1684,6 +1684,7 @@ print_cls: { //SEG164 [83] return rts } +//SEG165 File Data print_hextab: .text "0123456789abcdef" vals: .byte -$5f, -$40, -$20, -$10, 0, $10, $20, $40, $5f .pc = mulf_sqr1 "mulf_sqr1" @@ -1836,23 +1837,23 @@ Uplift Scope [print_cls] 33: zp ZP_WORD:21 [ print_cls::sc#2 print_cls::sc#1 ] Uplift Scope [print_byte_at] 4: zp ZP_BYTE:29 [ print_byte_at::$0 ] 2: zp ZP_BYTE:30 [ print_byte_at::$2 ] 1: zp ZP_WORD:27 [ print_byte_at::at#0 ] Uplift Scope [] -Uplifting [main] best 14035 combination zp ZP_WORD:8 [ main::at#6 main::at#3 main::at#12 ] reg byte a [ main::r#0 ] zp ZP_BYTE:10 [ main::j#2 main::j#1 ] zp ZP_WORD:5 [ main::at_line#2 main::at#2 ] zp ZP_BYTE:7 [ main::i#2 main::i#1 ] reg byte x [ main::k#2 main::k#1 ] zp ZP_WORD:3 [ main::at#4 main::at#1 ] -Uplifting [print_sbyte_at] best 14035 combination zp ZP_WORD:11 [ print_sbyte_at::at#3 print_sbyte_at::at#0 print_sbyte_at::at#2 print_sbyte_at::at#1 ] zp ZP_BYTE:13 [ print_sbyte_at::b#6 print_sbyte_at::b#0 print_sbyte_at::b#4 print_sbyte_at::b#1 print_sbyte_at::b#3 print_sbyte_at::b#2 ] -Uplifting [fmul8] best 12528 combination reg byte a [ fmul8::return#0 ] reg byte a [ fmul8::a#0 ] reg byte x [ fmul8::b#0 ] reg byte a [ fmul8::return#1 ] +Uplifting [main] best 18643 combination zp ZP_WORD:8 [ main::at#6 main::at#3 main::at#12 ] reg byte a [ main::r#0 ] zp ZP_BYTE:10 [ main::j#2 main::j#1 ] zp ZP_WORD:5 [ main::at_line#2 main::at#2 ] zp ZP_BYTE:7 [ main::i#2 main::i#1 ] reg byte x [ main::k#2 main::k#1 ] zp ZP_WORD:3 [ main::at#4 main::at#1 ] +Uplifting [print_sbyte_at] best 18643 combination zp ZP_WORD:11 [ print_sbyte_at::at#3 print_sbyte_at::at#0 print_sbyte_at::at#2 print_sbyte_at::at#1 ] zp ZP_BYTE:13 [ print_sbyte_at::b#6 print_sbyte_at::b#0 print_sbyte_at::b#4 print_sbyte_at::b#1 print_sbyte_at::b#3 print_sbyte_at::b#2 ] +Uplifting [fmul8] best 17136 combination reg byte a [ fmul8::return#0 ] reg byte a [ fmul8::a#0 ] reg byte x [ fmul8::b#0 ] reg byte a [ fmul8::return#1 ] Limited combination testing to 100 combinations of 192 possible. -Uplifting [init_screen] best 12318 combination reg byte x [ init_screen::l#2 init_screen::l#1 ] zp ZP_WORD:18 [ init_screen::COLS#3 init_screen::COLS#1 ] reg byte x [ init_screen::m#2 init_screen::m#1 ] -Uplifting [print_char_at] best 12318 combination zp ZP_WORD:15 [ print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] zp ZP_BYTE:14 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] -Uplifting [print_cls] best 12318 combination zp ZP_WORD:21 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_byte_at] best 12310 combination reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] zp ZP_WORD:27 [ print_byte_at::at#0 ] -Uplifting [] best 12310 combination +Uplifting [init_screen] best 16926 combination reg byte x [ init_screen::l#2 init_screen::l#1 ] zp ZP_WORD:18 [ init_screen::COLS#3 init_screen::COLS#1 ] reg byte x [ init_screen::m#2 init_screen::m#1 ] +Uplifting [print_char_at] best 16926 combination zp ZP_WORD:15 [ print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] zp ZP_BYTE:14 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] +Uplifting [print_cls] best 16926 combination zp ZP_WORD:21 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_byte_at] best 16918 combination reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ] zp ZP_WORD:27 [ print_byte_at::at#0 ] +Uplifting [] best 16918 combination Attempting to uplift remaining variables inzp ZP_BYTE:10 [ main::j#2 main::j#1 ] -Uplifting [main] best 12310 combination zp ZP_BYTE:10 [ main::j#2 main::j#1 ] +Uplifting [main] best 16918 combination zp ZP_BYTE:10 [ main::j#2 main::j#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:13 [ print_sbyte_at::b#6 print_sbyte_at::b#0 print_sbyte_at::b#4 print_sbyte_at::b#1 print_sbyte_at::b#3 print_sbyte_at::b#2 ] -Uplifting [print_sbyte_at] best 12310 combination zp ZP_BYTE:13 [ print_sbyte_at::b#6 print_sbyte_at::b#0 print_sbyte_at::b#4 print_sbyte_at::b#1 print_sbyte_at::b#3 print_sbyte_at::b#2 ] +Uplifting [print_sbyte_at] best 16918 combination zp ZP_BYTE:13 [ print_sbyte_at::b#6 print_sbyte_at::b#0 print_sbyte_at::b#4 print_sbyte_at::b#1 print_sbyte_at::b#3 print_sbyte_at::b#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::i#2 main::i#1 ] -Uplifting [main] best 12310 combination zp ZP_BYTE:7 [ main::i#2 main::i#1 ] +Uplifting [main] best 16918 combination zp ZP_BYTE:7 [ main::i#2 main::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:14 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] -Uplifting [print_char_at] best 12310 combination zp ZP_BYTE:14 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] +Uplifting [print_char_at] best 16918 combination zp ZP_BYTE:14 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] Coalescing zero page register with common assignment [ zp ZP_WORD:11 [ print_sbyte_at::at#3 print_sbyte_at::at#0 print_sbyte_at::at#2 print_sbyte_at::at#1 ] ] with [ zp ZP_WORD:15 [ print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:11 [ print_sbyte_at::at#3 print_sbyte_at::at#0 print_sbyte_at::at#2 print_sbyte_at::at#1 print_char_at::at#4 print_char_at::at#2 print_char_at::at#3 print_char_at::at#0 print_char_at::at#1 ] ] with [ zp ZP_WORD:27 [ print_byte_at::at#0 ] ] - score: 1 Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ main::at#4 main::at#1 ] @@ -2362,6 +2363,7 @@ print_cls: { //SEG164 [83] return rts } +//SEG165 File Data print_hextab: .text "0123456789abcdef" vals: .byte -$5f, -$40, -$20, -$10, 0, $10, $20, $40, $5f .pc = mulf_sqr1 "mulf_sqr1" @@ -2619,7 +2621,7 @@ reg byte a [ fmul8::return#1 ] FINAL ASSEMBLER -Score: 10516 +Score: 15124 //SEG0 File Comments // Seriously fast multiply 8-bit version (8bit*8bit=8bit) @@ -3037,6 +3039,7 @@ print_cls: { //SEG164 [83] return rts } +//SEG165 File Data print_hextab: .text "0123456789abcdef" vals: .byte -$5f, -$40, -$20, -$10, 0, $10, $20, $40, $5f .pc = mulf_sqr1 "mulf_sqr1" diff --git a/src/test/ref/examples/fire/fire.log b/src/test/ref/examples/fire/fire.log index 3e494b713..5afe41843 100644 --- a/src/test/ref/examples/fire/fire.log +++ b/src/test/ref/examples/fire/fire.log @@ -2419,6 +2419,7 @@ fillscreen: { //SEG192 [96] return rts } +//SEG193 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -3262,6 +3263,7 @@ fillscreen: { //SEG192 [96] return rts } +//SEG193 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -4126,4 +4128,5 @@ fillscreen: { //SEG192 [96] return rts } +//SEG193 File Data diff --git a/src/test/ref/examples/helloworld/helloworld.log b/src/test/ref/examples/helloworld/helloworld.log index 2f3e66b91..5dd33abb9 100644 --- a/src/test/ref/examples/helloworld/helloworld.log +++ b/src/test/ref/examples/helloworld/helloworld.log @@ -478,6 +478,7 @@ print_str: { //SEG43 [15] phi (byte*) print_str::str#2 = (byte*) print_str::str#0 [phi:print_str::@2->print_str::@1#1] -- register_copy jmp b1 } +//SEG44 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [11] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#6 + (byte) $28 [ print_line_cursor#1 print_char_cursor#10 ] ( main:2::print_ln:7 [ print_line_cursor#1 print_char_cursor#10 ] ) always clobbers reg byte a @@ -639,6 +640,7 @@ print_str: { //SEG43 [15] phi (byte*) print_str::str#2 = (byte*) print_str::str#0 [phi:print_str::@2->print_str::@1#1] -- register_copy jmp b1 } +//SEG44 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -825,4 +827,5 @@ print_str: { //SEG43 [15] phi (byte*) print_str::str#2 = (byte*) print_str::str#0 [phi:print_str::@2->print_str::@1#1] -- register_copy jmp b1 } +//SEG44 File Data diff --git a/src/test/ref/examples/irq/irq-hyperscreen.log b/src/test/ref/examples/irq/irq-hyperscreen.log index 2e291a7f0..3a1c5f9ce 100644 --- a/src/test/ref/examples/irq/irq-hyperscreen.log +++ b/src/test/ref/examples/irq/irq-hyperscreen.log @@ -484,6 +484,7 @@ irq_bottom_1: { //SEG39 [26] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG40 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) GHOST_BYTE#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -662,6 +663,7 @@ irq_bottom_1: { //SEG39 [26] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG40 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -858,4 +860,5 @@ irq_bottom_1: { //SEG39 [26] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG40 File Data diff --git a/src/test/ref/examples/multiplexer/simple-multiplexer.log b/src/test/ref/examples/multiplexer/simple-multiplexer.log index 663f5b92f..e55b5e59d 100644 --- a/src/test/ref/examples/multiplexer/simple-multiplexer.log +++ b/src/test/ref/examples/multiplexer/simple-multiplexer.log @@ -2980,6 +2980,7 @@ plexInit: { //SEG193 [103] return rts } +//SEG194 File Data // Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again. PLEX_FREE_YPOS: .fill 8, 0 // The x-positions of the multiplexer sprites ($000-$1ff) @@ -3116,62 +3117,62 @@ Uplift Scope [plexInit] 38.5: zp ZP_BYTE:17 [ plexInit::i#2 plexInit::i#1 ] Uplift Scope [plexShowSprite] 4: zp ZP_BYTE:22 [ plexShowSprite::plexFreeAdd1_$0#0 ] 4: zp ZP_BYTE:23 [ plexShowSprite::plexFreeAdd1_$1#0 ] 4: zp ZP_BYTE:24 [ plexShowSprite::xpos_idx#0 ] 4: zp ZP_BYTE:26 [ plexShowSprite::$2 ] 4: zp ZP_BYTE:27 [ plexShowSprite::$3 ] 4: zp ZP_BYTE:28 [ plexShowSprite::$9 ] 4: zp ZP_BYTE:29 [ plexShowSprite::$5 ] 3: zp ZP_BYTE:21 [ plexShowSprite::plexFreeAdd1_ypos#0 ] 2: zp ZP_BYTE:25 [ plexShowSprite::$11 ] 0.55: zp ZP_BYTE:20 [ plexShowSprite::plex_sprite_idx2#0 ] Uplift Scope [main] -Uplifting [plexSort] best 82384 combination reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] zp ZP_BYTE:32 [ plexSort::s#2 ] zp ZP_BYTE:10 [ plexSort::m#2 plexSort::m#1 ] zp ZP_BYTE:31 [ plexSort::nxt_y#0 ] zp ZP_BYTE:30 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 86992 combination reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] zp ZP_BYTE:32 [ plexSort::s#2 ] zp ZP_BYTE:10 [ plexSort::m#2 plexSort::m#1 ] zp ZP_BYTE:31 [ plexSort::nxt_y#0 ] zp ZP_BYTE:30 [ plexSort::nxt_idx#0 ] Limited combination testing to 10 combinations of 972 possible. -Uplifting [loop] best 81184 combination zp ZP_BYTE:19 [ loop::plexFreeNextYpos1_return#0 ] reg byte y [ loop::sy#2 loop::sy#1 ] zp ZP_BYTE:3 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] zp ZP_BYTE:18 [ loop::$4 ] zp ZP_BYTE:9 [ loop::ss#5 loop::ss#1 ] zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplifting [loop] best 85792 combination zp ZP_BYTE:19 [ loop::plexFreeNextYpos1_return#0 ] reg byte y [ loop::sy#2 loop::sy#1 ] zp ZP_BYTE:3 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] zp ZP_BYTE:18 [ loop::$4 ] zp ZP_BYTE:9 [ loop::ss#5 loop::ss#1 ] zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] Limited combination testing to 10 combinations of 1296 possible. -Uplifting [init] best 80934 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp ZP_BYTE:33 [ init::$8 ] zp ZP_WORD:14 [ init::xp#2 init::xp#1 ] +Uplifting [init] best 85542 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp ZP_BYTE:33 [ init::$8 ] zp ZP_WORD:14 [ init::xp#2 init::xp#1 ] Limited combination testing to 10 combinations of 36 possible. -Uplifting [] best 80934 combination zp ZP_BYTE:8 [ plex_sprite_msb#42 plex_sprite_msb#16 plex_sprite_msb#3 ] zp ZP_BYTE:5 [ plex_free_next#17 plex_free_next#13 ] zp ZP_BYTE:7 [ plex_show_idx#42 plex_show_idx#15 ] zp ZP_BYTE:6 [ plex_sprite_idx#42 plex_sprite_idx#15 ] +Uplifting [] best 85542 combination zp ZP_BYTE:8 [ plex_sprite_msb#42 plex_sprite_msb#16 plex_sprite_msb#3 ] zp ZP_BYTE:5 [ plex_free_next#17 plex_free_next#13 ] zp ZP_BYTE:7 [ plex_show_idx#42 plex_show_idx#15 ] zp ZP_BYTE:6 [ plex_sprite_idx#42 plex_sprite_idx#15 ] Limited combination testing to 10 combinations of 81 possible. -Uplifting [plexInit] best 80814 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] -Uplifting [plexShowSprite] best 80804 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ] zp ZP_BYTE:24 [ plexShowSprite::xpos_idx#0 ] zp ZP_BYTE:26 [ plexShowSprite::$2 ] zp ZP_BYTE:27 [ plexShowSprite::$3 ] zp ZP_BYTE:28 [ plexShowSprite::$9 ] zp ZP_BYTE:29 [ plexShowSprite::$5 ] zp ZP_BYTE:21 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp ZP_BYTE:25 [ plexShowSprite::$11 ] zp ZP_BYTE:20 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexInit] best 85422 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] +Uplifting [plexShowSprite] best 85412 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ] zp ZP_BYTE:24 [ plexShowSprite::xpos_idx#0 ] zp ZP_BYTE:26 [ plexShowSprite::$2 ] zp ZP_BYTE:27 [ plexShowSprite::$3 ] zp ZP_BYTE:28 [ plexShowSprite::$9 ] zp ZP_BYTE:29 [ plexShowSprite::$5 ] zp ZP_BYTE:21 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp ZP_BYTE:25 [ plexShowSprite::$11 ] zp ZP_BYTE:20 [ plexShowSprite::plex_sprite_idx2#0 ] Limited combination testing to 10 combinations of 589824 possible. -Uplifting [main] best 80804 combination +Uplifting [main] best 85412 combination Attempting to uplift remaining variables inzp ZP_BYTE:19 [ loop::plexFreeNextYpos1_return#0 ] -Uplifting [loop] best 80804 combination zp ZP_BYTE:19 [ loop::plexFreeNextYpos1_return#0 ] +Uplifting [loop] best 85412 combination zp ZP_BYTE:19 [ loop::plexFreeNextYpos1_return#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:3 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] -Uplifting [loop] best 80074 combination reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] +Uplifting [loop] best 84682 combination reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:18 [ loop::$4 ] -Uplifting [loop] best 79474 combination reg byte a [ loop::$4 ] +Uplifting [loop] best 84082 combination reg byte a [ loop::$4 ] Attempting to uplift remaining variables inzp ZP_BYTE:32 [ plexSort::s#2 ] -Uplifting [plexSort] best 78874 combination reg byte x [ plexSort::s#2 ] +Uplifting [plexSort] best 83482 combination reg byte x [ plexSort::s#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:10 [ plexSort::m#2 plexSort::m#1 ] -Uplifting [plexSort] best 78874 combination zp ZP_BYTE:10 [ plexSort::m#2 plexSort::m#1 ] +Uplifting [plexSort] best 83482 combination zp ZP_BYTE:10 [ plexSort::m#2 plexSort::m#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:9 [ loop::ss#5 loop::ss#1 ] -Uplifting [loop] best 78874 combination zp ZP_BYTE:9 [ loop::ss#5 loop::ss#1 ] +Uplifting [loop] best 83482 combination zp ZP_BYTE:9 [ loop::ss#5 loop::ss#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:31 [ plexSort::nxt_y#0 ] -Uplifting [plexSort] best 78874 combination zp ZP_BYTE:31 [ plexSort::nxt_y#0 ] +Uplifting [plexSort] best 83482 combination zp ZP_BYTE:31 [ plexSort::nxt_y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:30 [ plexSort::nxt_idx#0 ] -Uplifting [plexSort] best 78874 combination zp ZP_BYTE:30 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 83482 combination zp ZP_BYTE:30 [ plexSort::nxt_idx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:8 [ plex_sprite_msb#42 plex_sprite_msb#16 plex_sprite_msb#3 ] -Uplifting [] best 78874 combination zp ZP_BYTE:8 [ plex_sprite_msb#42 plex_sprite_msb#16 plex_sprite_msb#3 ] +Uplifting [] best 83482 combination zp ZP_BYTE:8 [ plex_sprite_msb#42 plex_sprite_msb#16 plex_sprite_msb#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ plex_free_next#17 plex_free_next#13 ] -Uplifting [] best 78874 combination zp ZP_BYTE:5 [ plex_free_next#17 plex_free_next#13 ] +Uplifting [] best 83482 combination zp ZP_BYTE:5 [ plex_free_next#17 plex_free_next#13 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ init::$8 ] -Uplifting [init] best 78834 combination reg byte a [ init::$8 ] +Uplifting [init] best 83442 combination reg byte a [ init::$8 ] Attempting to uplift remaining variables inzp ZP_BYTE:7 [ plex_show_idx#42 plex_show_idx#15 ] -Uplifting [] best 78834 combination zp ZP_BYTE:7 [ plex_show_idx#42 plex_show_idx#15 ] +Uplifting [] best 83442 combination zp ZP_BYTE:7 [ plex_show_idx#42 plex_show_idx#15 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ plex_sprite_idx#42 plex_sprite_idx#15 ] -Uplifting [] best 78834 combination zp ZP_BYTE:6 [ plex_sprite_idx#42 plex_sprite_idx#15 ] +Uplifting [] best 83442 combination zp ZP_BYTE:6 [ plex_sprite_idx#42 plex_sprite_idx#15 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] -Uplifting [loop] best 78834 combination zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplifting [loop] best 83442 combination zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:24 [ plexShowSprite::xpos_idx#0 ] -Uplifting [plexShowSprite] best 78828 combination reg byte a [ plexShowSprite::xpos_idx#0 ] +Uplifting [plexShowSprite] best 83436 combination reg byte a [ plexShowSprite::xpos_idx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:26 [ plexShowSprite::$2 ] -Uplifting [plexShowSprite] best 78822 combination reg byte a [ plexShowSprite::$2 ] +Uplifting [plexShowSprite] best 83430 combination reg byte a [ plexShowSprite::$2 ] Attempting to uplift remaining variables inzp ZP_BYTE:27 [ plexShowSprite::$3 ] -Uplifting [plexShowSprite] best 78816 combination reg byte a [ plexShowSprite::$3 ] +Uplifting [plexShowSprite] best 83424 combination reg byte a [ plexShowSprite::$3 ] Attempting to uplift remaining variables inzp ZP_BYTE:28 [ plexShowSprite::$9 ] -Uplifting [plexShowSprite] best 78810 combination reg byte a [ plexShowSprite::$9 ] +Uplifting [plexShowSprite] best 83418 combination reg byte a [ plexShowSprite::$9 ] Attempting to uplift remaining variables inzp ZP_BYTE:29 [ plexShowSprite::$5 ] -Uplifting [plexShowSprite] best 78804 combination reg byte x [ plexShowSprite::$5 ] +Uplifting [plexShowSprite] best 83412 combination reg byte x [ plexShowSprite::$5 ] Attempting to uplift remaining variables inzp ZP_BYTE:21 [ plexShowSprite::plexFreeAdd1_ypos#0 ] -Uplifting [plexShowSprite] best 78795 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Uplifting [plexShowSprite] best 83403 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ plexShowSprite::$11 ] -Uplifting [plexShowSprite] best 78788 combination reg byte x [ plexShowSprite::$11 ] +Uplifting [plexShowSprite] best 83396 combination reg byte x [ plexShowSprite::$11 ] Attempting to uplift remaining variables inzp ZP_BYTE:20 [ plexShowSprite::plex_sprite_idx2#0 ] -Uplifting [plexShowSprite] best 78788 combination zp ZP_BYTE:20 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexShowSprite] best 83396 combination zp ZP_BYTE:20 [ plexShowSprite::plex_sprite_idx2#0 ] Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:3 [ plex_free_next#17 plex_free_next#13 ] Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:4 [ plex_sprite_idx#42 plex_sprite_idx#15 ] Allocated (was zp ZP_BYTE:7) zp ZP_BYTE:5 [ plex_show_idx#42 plex_show_idx#15 ] @@ -3750,6 +3751,7 @@ plexInit: { //SEG193 [103] return rts } +//SEG194 File Data // Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again. PLEX_FREE_YPOS: .fill 8, 0 // The x-positions of the multiplexer sprites ($000-$1ff) @@ -4116,7 +4118,7 @@ reg byte a [ init::$8 ] FINAL ASSEMBLER -Score: 60156 +Score: 64764 //SEG0 File Comments // A simple usage of the flexible sprite multiplexer routine @@ -4576,6 +4578,7 @@ plexInit: { //SEG193 [103] return rts } +//SEG194 File Data // Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again. PLEX_FREE_YPOS: .fill 8, 0 // The x-positions of the multiplexer sprites ($000-$1ff) diff --git a/src/test/ref/examples/music/music.log b/src/test/ref/examples/music/music.log index 70c66dda6..1a67e8986 100644 --- a/src/test/ref/examples/music/music.log +++ b/src/test/ref/examples/music/music.log @@ -242,6 +242,7 @@ main: { dec BORDERCOL jmp b1 } +//SEG20 File Data .pc = MUSIC "MUSIC" .fill music.size, music.getData(i) @@ -318,6 +319,7 @@ main: { dec BORDERCOL jmp b1 } +//SEG20 File Data .pc = MUSIC "MUSIC" .fill music.size, music.getData(i) @@ -409,6 +411,7 @@ main: { dec BORDERCOL jmp b1 } +//SEG20 File Data .pc = MUSIC "MUSIC" .fill music.size, music.getData(i) diff --git a/src/test/ref/examples/music/music_irq.log b/src/test/ref/examples/music/music_irq.log index 37500e1eb..4d7374841 100644 --- a/src/test/ref/examples/music/music_irq.log +++ b/src/test/ref/examples/music/music_irq.log @@ -357,6 +357,7 @@ irq_play: { //SEG29 [18] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG30 File Data .pc = MUSIC "MUSIC" .fill music.size, music.getData(i) @@ -376,9 +377,9 @@ Uplift Scope [main] Uplift Scope [irq_play] Uplift Scope [] -Uplifting [main] best 643 combination -Uplifting [irq_play] best 643 combination -Uplifting [] best 643 combination +Uplifting [main] best 2947 combination +Uplifting [irq_play] best 2947 combination +Uplifting [] best 2947 combination ASSEMBLER BEFORE OPTIMIZATION //SEG0 File Comments @@ -484,6 +485,7 @@ irq_play: { //SEG29 [18] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG30 File Data .pc = MUSIC "MUSIC" .fill music.size, music.getData(i) @@ -543,7 +545,7 @@ interrupt(KERNEL_KEYBOARD)(void()) irq_play() FINAL ASSEMBLER -Score: 595 +Score: 2899 //SEG0 File Comments // A simple SID music player using RASTER IRQ @@ -634,6 +636,7 @@ irq_play: { //SEG29 [18] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG30 File Data .pc = MUSIC "MUSIC" .fill music.size, music.getData(i) diff --git a/src/test/ref/examples/plasma/plasma-unroll.log b/src/test/ref/examples/plasma/plasma-unroll.log index c3ebb74cc..f9df133e5 100644 --- a/src/test/ref/examples/plasma/plasma-unroll.log +++ b/src/test/ref/examples/plasma/plasma-unroll.log @@ -4064,6 +4064,7 @@ sid_rnd_init: { //SEG261 [143] return rts } +//SEG262 File Data .pc = SINTABLE "SINTABLE" .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(toRadians(360*i/256))) @@ -4264,106 +4265,106 @@ Uplift Scope [] 16.42: zp ZP_WORD:18 [ print_char_cursor#44 print_char_cursor#18 Uplift Scope [print_char] Uplift Scope [sid_rnd_init] -Uplifting [makecharset] best 165355 combination reg byte y [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ] reg byte a [ makecharset::$3 ] zp ZP_BYTE:58 [ makecharset::$4 ] reg byte x [ makecharset::ii#2 makecharset::ii#1 ] zp ZP_WORD:59 [ makecharset::$8 ] zp ZP_WORD:61 [ makecharset::$9 ] zp ZP_WORD:63 [ makecharset::$16 ] zp ZP_BYTE:20 [ makecharset::i#7 makecharset::i#1 ] zp ZP_BYTE:55 [ makecharset::s#0 ] zp ZP_WORD:16 [ makecharset::c#2 makecharset::c#1 ] zp ZP_BYTE:54 [ makecharset::$2 ] zp ZP_BYTE:65 [ makecharset::$11 ] +Uplifting [makecharset] best 167659 combination reg byte y [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ] reg byte a [ makecharset::$3 ] zp ZP_BYTE:58 [ makecharset::$4 ] reg byte x [ makecharset::ii#2 makecharset::ii#1 ] zp ZP_WORD:59 [ makecharset::$8 ] zp ZP_WORD:61 [ makecharset::$9 ] zp ZP_WORD:63 [ makecharset::$16 ] zp ZP_BYTE:20 [ makecharset::i#7 makecharset::i#1 ] zp ZP_BYTE:55 [ makecharset::s#0 ] zp ZP_WORD:16 [ makecharset::c#2 makecharset::c#1 ] zp ZP_BYTE:54 [ makecharset::$2 ] zp ZP_BYTE:65 [ makecharset::$11 ] Limited combination testing to 100 combinations of 9216 possible. -Uplifting [sid_rnd] best 156352 combination reg byte a [ sid_rnd::return#2 ] reg byte a [ sid_rnd::return#0 ] -Uplifting [print_cls] best 156352 combination zp ZP_WORD:23 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [main] best 156352 combination zp ZP_WORD:2 [ main::col#2 main::col#1 ] -Uplifting [] best 156352 combination zp ZP_WORD:18 [ print_char_cursor#44 print_char_cursor#18 print_char_cursor#1 ] zp ZP_BYTE:4 [ c1A#1 c1A#3 ] zp ZP_BYTE:5 [ c1B#1 c1B#3 ] zp ZP_BYTE:6 [ c2A#1 c2A#3 ] zp ZP_BYTE:7 [ c2B#1 c2B#3 ] -Uplifting [print_char] best 156352 combination -Uplifting [sid_rnd_init] best 156352 combination +Uplifting [sid_rnd] best 158656 combination reg byte a [ sid_rnd::return#2 ] reg byte a [ sid_rnd::return#0 ] +Uplifting [print_cls] best 158656 combination zp ZP_WORD:23 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [main] best 158656 combination zp ZP_WORD:2 [ main::col#2 main::col#1 ] +Uplifting [] best 158656 combination zp ZP_WORD:18 [ print_char_cursor#44 print_char_cursor#18 print_char_cursor#1 ] zp ZP_BYTE:4 [ c1A#1 c1A#3 ] zp ZP_BYTE:5 [ c1B#1 c1B#3 ] zp ZP_BYTE:6 [ c2A#1 c2A#3 ] zp ZP_BYTE:7 [ c2B#1 c2B#3 ] +Uplifting [print_char] best 158656 combination +Uplifting [sid_rnd_init] best 158656 combination Attempting to uplift remaining variables inzp ZP_BYTE:58 [ makecharset::$4 ] -Uplifting [makecharset] best 156352 combination zp ZP_BYTE:58 [ makecharset::$4 ] +Uplifting [makecharset] best 158656 combination zp ZP_BYTE:58 [ makecharset::$4 ] Attempting to uplift remaining variables inzp ZP_BYTE:10 [ doplasma::yprev#2 doplasma::yprev#3 ] -Uplifting [doplasma] best 155852 combination reg byte x [ doplasma::yprev#2 doplasma::yprev#3 ] +Uplifting [doplasma] best 158156 combination reg byte x [ doplasma::yprev#2 doplasma::yprev#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:14 [ doplasma::i1#2 doplasma::i1#1 ] -Uplifting [doplasma] best 155852 combination zp ZP_BYTE:14 [ doplasma::i1#2 doplasma::i1#1 ] +Uplifting [doplasma] best 158156 combination zp ZP_BYTE:14 [ doplasma::i1#2 doplasma::i1#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:15 [ doplasma::i2#2 doplasma::i2#1 ] -Uplifting [doplasma] best 147152 combination reg byte x [ doplasma::i2#2 doplasma::i2#1 ] +Uplifting [doplasma] best 149456 combination reg byte x [ doplasma::i2#2 doplasma::i2#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:26 [ doplasma::$1 ] -Uplifting [doplasma] best 146552 combination reg byte a [ doplasma::$1 ] +Uplifting [doplasma] best 148856 combination reg byte a [ doplasma::$1 ] Attempting to uplift remaining variables inzp ZP_BYTE:27 [ doplasma::$3 ] -Uplifting [doplasma] best 145952 combination reg byte a [ doplasma::$3 ] +Uplifting [doplasma] best 148256 combination reg byte a [ doplasma::$3 ] Attempting to uplift remaining variables inzp ZP_BYTE:28 [ doplasma::val#0 ] -Uplifting [doplasma] best 145352 combination reg byte a [ doplasma::val#0 ] +Uplifting [doplasma] best 147656 combination reg byte a [ doplasma::val#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:53 [ doplasma::val#50 ] -Uplifting [doplasma] best 144752 combination reg byte a [ doplasma::val#50 ] +Uplifting [doplasma] best 147056 combination reg byte a [ doplasma::val#50 ] Attempting to uplift remaining variables inzp ZP_BYTE:20 [ makecharset::i#7 makecharset::i#1 ] -Uplifting [makecharset] best 144752 combination zp ZP_BYTE:20 [ makecharset::i#7 makecharset::i#1 ] +Uplifting [makecharset] best 147056 combination zp ZP_BYTE:20 [ makecharset::i#7 makecharset::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:12 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] -Uplifting [doplasma] best 144752 combination zp ZP_BYTE:12 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] +Uplifting [doplasma] best 147056 combination zp ZP_BYTE:12 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:11 [ doplasma::i#2 doplasma::i#1 ] -Uplifting [doplasma] best 144752 combination zp ZP_BYTE:11 [ doplasma::i#2 doplasma::i#1 ] +Uplifting [doplasma] best 147056 combination zp ZP_BYTE:11 [ doplasma::i#2 doplasma::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:29 [ doplasma::val#1 ] -Uplifting [doplasma] best 143852 combination reg byte a [ doplasma::val#1 ] +Uplifting [doplasma] best 146156 combination reg byte a [ doplasma::val#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:30 [ doplasma::val#4 ] -Uplifting [doplasma] best 142952 combination reg byte a [ doplasma::val#4 ] +Uplifting [doplasma] best 145256 combination reg byte a [ doplasma::val#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:31 [ doplasma::val#6 ] -Uplifting [doplasma] best 142052 combination reg byte a [ doplasma::val#6 ] +Uplifting [doplasma] best 144356 combination reg byte a [ doplasma::val#6 ] Attempting to uplift remaining variables inzp ZP_BYTE:32 [ doplasma::val#8 ] -Uplifting [doplasma] best 141152 combination reg byte a [ doplasma::val#8 ] +Uplifting [doplasma] best 143456 combination reg byte a [ doplasma::val#8 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ doplasma::val#10 ] -Uplifting [doplasma] best 140252 combination reg byte a [ doplasma::val#10 ] +Uplifting [doplasma] best 142556 combination reg byte a [ doplasma::val#10 ] Attempting to uplift remaining variables inzp ZP_BYTE:34 [ doplasma::val#12 ] -Uplifting [doplasma] best 139352 combination reg byte a [ doplasma::val#12 ] +Uplifting [doplasma] best 141656 combination reg byte a [ doplasma::val#12 ] Attempting to uplift remaining variables inzp ZP_BYTE:35 [ doplasma::val#14 ] -Uplifting [doplasma] best 138452 combination reg byte a [ doplasma::val#14 ] +Uplifting [doplasma] best 140756 combination reg byte a [ doplasma::val#14 ] Attempting to uplift remaining variables inzp ZP_BYTE:36 [ doplasma::val#16 ] -Uplifting [doplasma] best 137552 combination reg byte a [ doplasma::val#16 ] +Uplifting [doplasma] best 139856 combination reg byte a [ doplasma::val#16 ] Attempting to uplift remaining variables inzp ZP_BYTE:37 [ doplasma::val#18 ] -Uplifting [doplasma] best 136652 combination reg byte a [ doplasma::val#18 ] +Uplifting [doplasma] best 138956 combination reg byte a [ doplasma::val#18 ] Attempting to uplift remaining variables inzp ZP_BYTE:38 [ doplasma::val#20 ] -Uplifting [doplasma] best 135752 combination reg byte a [ doplasma::val#20 ] +Uplifting [doplasma] best 138056 combination reg byte a [ doplasma::val#20 ] Attempting to uplift remaining variables inzp ZP_BYTE:39 [ doplasma::val#22 ] -Uplifting [doplasma] best 134852 combination reg byte a [ doplasma::val#22 ] +Uplifting [doplasma] best 137156 combination reg byte a [ doplasma::val#22 ] Attempting to uplift remaining variables inzp ZP_BYTE:40 [ doplasma::val#24 ] -Uplifting [doplasma] best 133952 combination reg byte a [ doplasma::val#24 ] +Uplifting [doplasma] best 136256 combination reg byte a [ doplasma::val#24 ] Attempting to uplift remaining variables inzp ZP_BYTE:41 [ doplasma::val#26 ] -Uplifting [doplasma] best 133052 combination reg byte a [ doplasma::val#26 ] +Uplifting [doplasma] best 135356 combination reg byte a [ doplasma::val#26 ] Attempting to uplift remaining variables inzp ZP_BYTE:42 [ doplasma::val#28 ] -Uplifting [doplasma] best 132152 combination reg byte a [ doplasma::val#28 ] +Uplifting [doplasma] best 134456 combination reg byte a [ doplasma::val#28 ] Attempting to uplift remaining variables inzp ZP_BYTE:43 [ doplasma::val#30 ] -Uplifting [doplasma] best 131252 combination reg byte a [ doplasma::val#30 ] +Uplifting [doplasma] best 133556 combination reg byte a [ doplasma::val#30 ] Attempting to uplift remaining variables inzp ZP_BYTE:44 [ doplasma::val#32 ] -Uplifting [doplasma] best 130352 combination reg byte a [ doplasma::val#32 ] +Uplifting [doplasma] best 132656 combination reg byte a [ doplasma::val#32 ] Attempting to uplift remaining variables inzp ZP_BYTE:45 [ doplasma::val#34 ] -Uplifting [doplasma] best 129452 combination reg byte a [ doplasma::val#34 ] +Uplifting [doplasma] best 131756 combination reg byte a [ doplasma::val#34 ] Attempting to uplift remaining variables inzp ZP_BYTE:46 [ doplasma::val#36 ] -Uplifting [doplasma] best 128552 combination reg byte a [ doplasma::val#36 ] +Uplifting [doplasma] best 130856 combination reg byte a [ doplasma::val#36 ] Attempting to uplift remaining variables inzp ZP_BYTE:47 [ doplasma::val#38 ] -Uplifting [doplasma] best 127652 combination reg byte a [ doplasma::val#38 ] +Uplifting [doplasma] best 129956 combination reg byte a [ doplasma::val#38 ] Attempting to uplift remaining variables inzp ZP_BYTE:48 [ doplasma::val#40 ] -Uplifting [doplasma] best 126752 combination reg byte a [ doplasma::val#40 ] +Uplifting [doplasma] best 129056 combination reg byte a [ doplasma::val#40 ] Attempting to uplift remaining variables inzp ZP_BYTE:49 [ doplasma::val#42 ] -Uplifting [doplasma] best 125852 combination reg byte a [ doplasma::val#42 ] +Uplifting [doplasma] best 128156 combination reg byte a [ doplasma::val#42 ] Attempting to uplift remaining variables inzp ZP_BYTE:50 [ doplasma::val#44 ] -Uplifting [doplasma] best 124952 combination reg byte a [ doplasma::val#44 ] +Uplifting [doplasma] best 127256 combination reg byte a [ doplasma::val#44 ] Attempting to uplift remaining variables inzp ZP_BYTE:51 [ doplasma::val#46 ] -Uplifting [doplasma] best 124052 combination reg byte a [ doplasma::val#46 ] +Uplifting [doplasma] best 126356 combination reg byte a [ doplasma::val#46 ] Attempting to uplift remaining variables inzp ZP_BYTE:52 [ doplasma::val#48 ] -Uplifting [doplasma] best 123152 combination reg byte a [ doplasma::val#48 ] +Uplifting [doplasma] best 125456 combination reg byte a [ doplasma::val#48 ] Attempting to uplift remaining variables inzp ZP_BYTE:13 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] -Uplifting [doplasma] best 123152 combination zp ZP_BYTE:13 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] +Uplifting [doplasma] best 125456 combination zp ZP_BYTE:13 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] -Uplifting [doplasma] best 123152 combination zp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] +Uplifting [doplasma] best 125456 combination zp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] -Uplifting [doplasma] best 123152 combination zp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] +Uplifting [doplasma] best 125456 combination zp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:55 [ makecharset::s#0 ] -Uplifting [makecharset] best 123152 combination zp ZP_BYTE:55 [ makecharset::s#0 ] +Uplifting [makecharset] best 125456 combination zp ZP_BYTE:55 [ makecharset::s#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ doplasma::yval#0 ] -Uplifting [doplasma] best 123152 combination zp ZP_BYTE:25 [ doplasma::yval#0 ] +Uplifting [doplasma] best 125456 combination zp ZP_BYTE:25 [ doplasma::yval#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:54 [ makecharset::$2 ] -Uplifting [makecharset] best 123112 combination reg byte a [ makecharset::$2 ] +Uplifting [makecharset] best 125416 combination reg byte a [ makecharset::$2 ] Attempting to uplift remaining variables inzp ZP_BYTE:65 [ makecharset::$11 ] -Uplifting [makecharset] best 123052 combination reg byte a [ makecharset::$11 ] +Uplifting [makecharset] best 125356 combination reg byte a [ makecharset::$11 ] Attempting to uplift remaining variables inzp ZP_BYTE:4 [ c1A#1 c1A#3 ] -Uplifting [] best 123052 combination zp ZP_BYTE:4 [ c1A#1 c1A#3 ] +Uplifting [] best 125356 combination zp ZP_BYTE:4 [ c1A#1 c1A#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ c1B#1 c1B#3 ] -Uplifting [] best 123052 combination zp ZP_BYTE:5 [ c1B#1 c1B#3 ] +Uplifting [] best 125356 combination zp ZP_BYTE:5 [ c1B#1 c1B#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ c2A#1 c2A#3 ] -Uplifting [] best 123052 combination zp ZP_BYTE:6 [ c2A#1 c2A#3 ] +Uplifting [] best 125356 combination zp ZP_BYTE:6 [ c2A#1 c2A#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:7 [ c2B#1 c2B#3 ] -Uplifting [] best 123052 combination zp ZP_BYTE:7 [ c2B#1 c2B#3 ] +Uplifting [] best 125356 combination zp ZP_BYTE:7 [ c2B#1 c2B#3 ] Coalescing zero page register with common assignment [ zp ZP_WORD:59 [ makecharset::$8 ] ] with [ zp ZP_WORD:61 [ makecharset::$9 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:59 [ makecharset::$8 makecharset::$9 ] ] with [ zp ZP_WORD:63 [ makecharset::$16 ] ] - score: 1 Allocated (was zp ZP_BYTE:11) zp ZP_BYTE:10 [ doplasma::i#2 doplasma::i#1 ] @@ -5174,6 +5175,7 @@ sid_rnd_init: { //SEG261 [143] return rts } +//SEG262 File Data .pc = SINTABLE "SINTABLE" .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(toRadians(360*i/256))) @@ -5642,7 +5644,7 @@ reg byte a [ sid_rnd::return#0 ] FINAL ASSEMBLER -Score: 93970 +Score: 96274 //SEG0 File Comments // A KickC version of the plasma routine from the CC65 samples @@ -6292,6 +6294,7 @@ sid_rnd_init: { //SEG261 [143] return rts } +//SEG262 File Data .pc = SINTABLE "SINTABLE" .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(toRadians(360*i/256))) diff --git a/src/test/ref/examples/plasma/plasma.log b/src/test/ref/examples/plasma/plasma.log index 059b80c6d..d9b124b13 100644 --- a/src/test/ref/examples/plasma/plasma.log +++ b/src/test/ref/examples/plasma/plasma.log @@ -3095,6 +3095,7 @@ sid_rnd_init: { //SEG209 [100] return rts } +//SEG210 File Data .pc = SINTABLE "SINTABLE" .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(toRadians(360*i/256))) @@ -3223,50 +3224,50 @@ Uplift Scope [main] 33: zp ZP_WORD:2 [ main::col#2 main::col#1 ] Uplift Scope [print_char] Uplift Scope [sid_rnd_init] -Uplifting [makecharset] best 157228 combination reg byte y [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ] reg byte a [ makecharset::$3 ] zp ZP_BYTE:34 [ makecharset::$4 ] reg byte x [ makecharset::ii#2 makecharset::ii#1 ] zp ZP_WORD:35 [ makecharset::$8 ] zp ZP_WORD:37 [ makecharset::$9 ] zp ZP_WORD:39 [ makecharset::$16 ] zp ZP_BYTE:22 [ makecharset::i#7 makecharset::i#1 ] zp ZP_BYTE:31 [ makecharset::s#0 ] zp ZP_WORD:18 [ makecharset::c#2 makecharset::c#1 ] zp ZP_BYTE:30 [ makecharset::$2 ] zp ZP_BYTE:41 [ makecharset::$11 ] +Uplifting [makecharset] best 159532 combination reg byte y [ makecharset::b#2 makecharset::b#3 makecharset::b#1 ] reg byte a [ makecharset::$3 ] zp ZP_BYTE:34 [ makecharset::$4 ] reg byte x [ makecharset::ii#2 makecharset::ii#1 ] zp ZP_WORD:35 [ makecharset::$8 ] zp ZP_WORD:37 [ makecharset::$9 ] zp ZP_WORD:39 [ makecharset::$16 ] zp ZP_BYTE:22 [ makecharset::i#7 makecharset::i#1 ] zp ZP_BYTE:31 [ makecharset::s#0 ] zp ZP_WORD:18 [ makecharset::c#2 makecharset::c#1 ] zp ZP_BYTE:30 [ makecharset::$2 ] zp ZP_BYTE:41 [ makecharset::$11 ] Limited combination testing to 100 combinations of 9216 possible. -Uplifting [doplasma] best 132328 combination reg byte y [ doplasma::i2#2 doplasma::i2#1 ] reg byte a [ doplasma::$4 ] reg byte x [ doplasma::ii#4 doplasma::ii#1 ] zp ZP_WORD:15 [ doplasma::screen#5 doplasma::screen#10 doplasma::screen#2 ] zp ZP_BYTE:10 [ doplasma::i#2 doplasma::i#1 ] zp ZP_BYTE:13 [ doplasma::i1#2 doplasma::i1#1 ] zp ZP_BYTE:27 [ doplasma::$0 ] zp ZP_BYTE:28 [ doplasma::$2 ] zp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] zp ZP_BYTE:11 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] zp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] zp ZP_BYTE:12 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] +Uplifting [doplasma] best 134632 combination reg byte y [ doplasma::i2#2 doplasma::i2#1 ] reg byte a [ doplasma::$4 ] reg byte x [ doplasma::ii#4 doplasma::ii#1 ] zp ZP_WORD:15 [ doplasma::screen#5 doplasma::screen#10 doplasma::screen#2 ] zp ZP_BYTE:10 [ doplasma::i#2 doplasma::i#1 ] zp ZP_BYTE:13 [ doplasma::i1#2 doplasma::i1#1 ] zp ZP_BYTE:27 [ doplasma::$0 ] zp ZP_BYTE:28 [ doplasma::$2 ] zp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] zp ZP_BYTE:11 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] zp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] zp ZP_BYTE:12 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] Limited combination testing to 100 combinations of 419904 possible. -Uplifting [sid_rnd] best 123325 combination reg byte a [ sid_rnd::return#2 ] reg byte a [ sid_rnd::return#0 ] -Uplifting [] best 123325 combination zp ZP_WORD:20 [ print_char_cursor#46 print_char_cursor#18 print_char_cursor#1 ] zp ZP_BYTE:4 [ c1A#10 c1A#14 c1A#4 ] zp ZP_BYTE:5 [ c1B#10 c1B#14 c1B#4 ] zp ZP_BYTE:7 [ c2B#24 c2B#14 c2B#4 ] zp ZP_BYTE:6 [ c2A#24 c2A#14 c2A#4 ] -Uplifting [print_cls] best 123325 combination zp ZP_WORD:25 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [main] best 123325 combination zp ZP_WORD:2 [ main::col#2 main::col#1 ] -Uplifting [print_char] best 123325 combination -Uplifting [sid_rnd_init] best 123325 combination +Uplifting [sid_rnd] best 125629 combination reg byte a [ sid_rnd::return#2 ] reg byte a [ sid_rnd::return#0 ] +Uplifting [] best 125629 combination zp ZP_WORD:20 [ print_char_cursor#46 print_char_cursor#18 print_char_cursor#1 ] zp ZP_BYTE:4 [ c1A#10 c1A#14 c1A#4 ] zp ZP_BYTE:5 [ c1B#10 c1B#14 c1B#4 ] zp ZP_BYTE:7 [ c2B#24 c2B#14 c2B#4 ] zp ZP_BYTE:6 [ c2A#24 c2A#14 c2A#4 ] +Uplifting [print_cls] best 125629 combination zp ZP_WORD:25 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [main] best 125629 combination zp ZP_WORD:2 [ main::col#2 main::col#1 ] +Uplifting [print_char] best 125629 combination +Uplifting [sid_rnd_init] best 125629 combination Attempting to uplift remaining variables inzp ZP_BYTE:34 [ makecharset::$4 ] -Uplifting [makecharset] best 123325 combination zp ZP_BYTE:34 [ makecharset::$4 ] +Uplifting [makecharset] best 125629 combination zp ZP_BYTE:34 [ makecharset::$4 ] Attempting to uplift remaining variables inzp ZP_BYTE:10 [ doplasma::i#2 doplasma::i#1 ] -Uplifting [doplasma] best 123325 combination zp ZP_BYTE:10 [ doplasma::i#2 doplasma::i#1 ] +Uplifting [doplasma] best 125629 combination zp ZP_BYTE:10 [ doplasma::i#2 doplasma::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:13 [ doplasma::i1#2 doplasma::i1#1 ] -Uplifting [doplasma] best 123325 combination zp ZP_BYTE:13 [ doplasma::i1#2 doplasma::i1#1 ] +Uplifting [doplasma] best 125629 combination zp ZP_BYTE:13 [ doplasma::i1#2 doplasma::i1#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:27 [ doplasma::$0 ] -Uplifting [doplasma] best 122725 combination reg byte a [ doplasma::$0 ] +Uplifting [doplasma] best 125029 combination reg byte a [ doplasma::$0 ] Attempting to uplift remaining variables inzp ZP_BYTE:28 [ doplasma::$2 ] -Uplifting [doplasma] best 122125 combination reg byte a [ doplasma::$2 ] +Uplifting [doplasma] best 124429 combination reg byte a [ doplasma::$2 ] Attempting to uplift remaining variables inzp ZP_BYTE:22 [ makecharset::i#7 makecharset::i#1 ] -Uplifting [makecharset] best 122125 combination zp ZP_BYTE:22 [ makecharset::i#7 makecharset::i#1 ] +Uplifting [makecharset] best 124429 combination zp ZP_BYTE:22 [ makecharset::i#7 makecharset::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] -Uplifting [doplasma] best 122125 combination zp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] +Uplifting [doplasma] best 124429 combination zp ZP_BYTE:8 [ doplasma::c1a#2 doplasma::c1a#0 doplasma::c1a#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:11 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] -Uplifting [doplasma] best 122125 combination zp ZP_BYTE:11 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] +Uplifting [doplasma] best 124429 combination zp ZP_BYTE:11 [ doplasma::c2a#2 doplasma::c2a#0 doplasma::c2a#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] -Uplifting [doplasma] best 122125 combination zp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] +Uplifting [doplasma] best 124429 combination zp ZP_BYTE:9 [ doplasma::c1b#2 doplasma::c1b#0 doplasma::c1b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:12 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] -Uplifting [doplasma] best 122125 combination zp ZP_BYTE:12 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] +Uplifting [doplasma] best 124429 combination zp ZP_BYTE:12 [ doplasma::c2b#2 doplasma::c2b#0 doplasma::c2b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:31 [ makecharset::s#0 ] -Uplifting [makecharset] best 122125 combination zp ZP_BYTE:31 [ makecharset::s#0 ] +Uplifting [makecharset] best 124429 combination zp ZP_BYTE:31 [ makecharset::s#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:30 [ makecharset::$2 ] -Uplifting [makecharset] best 122085 combination reg byte a [ makecharset::$2 ] +Uplifting [makecharset] best 124389 combination reg byte a [ makecharset::$2 ] Attempting to uplift remaining variables inzp ZP_BYTE:41 [ makecharset::$11 ] -Uplifting [makecharset] best 122025 combination reg byte a [ makecharset::$11 ] +Uplifting [makecharset] best 124329 combination reg byte a [ makecharset::$11 ] Attempting to uplift remaining variables inzp ZP_BYTE:4 [ c1A#10 c1A#14 c1A#4 ] -Uplifting [] best 122025 combination zp ZP_BYTE:4 [ c1A#10 c1A#14 c1A#4 ] +Uplifting [] best 124329 combination zp ZP_BYTE:4 [ c1A#10 c1A#14 c1A#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ c1B#10 c1B#14 c1B#4 ] -Uplifting [] best 122025 combination zp ZP_BYTE:5 [ c1B#10 c1B#14 c1B#4 ] +Uplifting [] best 124329 combination zp ZP_BYTE:5 [ c1B#10 c1B#14 c1B#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:7 [ c2B#24 c2B#14 c2B#4 ] -Uplifting [] best 122025 combination zp ZP_BYTE:7 [ c2B#24 c2B#14 c2B#4 ] +Uplifting [] best 124329 combination zp ZP_BYTE:7 [ c2B#24 c2B#14 c2B#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ c2A#24 c2A#14 c2A#4 ] -Uplifting [] best 122025 combination zp ZP_BYTE:6 [ c2A#24 c2A#14 c2A#4 ] +Uplifting [] best 124329 combination zp ZP_BYTE:6 [ c2A#24 c2A#14 c2A#4 ] Coalescing zero page register with common assignment [ zp ZP_WORD:35 [ makecharset::$8 ] ] with [ zp ZP_WORD:37 [ makecharset::$9 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:35 [ makecharset::$8 makecharset::$9 ] ] with [ zp ZP_WORD:39 [ makecharset::$16 ] ] - score: 1 Allocated (was zp ZP_WORD:15) zp ZP_WORD:14 [ doplasma::screen#5 doplasma::screen#10 doplasma::screen#2 ] @@ -3923,6 +3924,7 @@ sid_rnd_init: { //SEG209 [100] return rts } +//SEG210 File Data .pc = SINTABLE "SINTABLE" .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(toRadians(360*i/256))) @@ -4297,7 +4299,7 @@ reg byte a [ sid_rnd::return#0 ] FINAL ASSEMBLER -Score: 90756 +Score: 93060 //SEG0 File Comments // A KickC version of the plasma routine from the CC65 samples @@ -4831,6 +4833,7 @@ sid_rnd_init: { //SEG209 [100] return rts } +//SEG210 File Data .pc = SINTABLE "SINTABLE" .for(var i=0;i<$100;i++) .byte round(127.5+127.5*sin(toRadians(360*i/256))) diff --git a/src/test/ref/examples/rasterbars/raster-bars.log b/src/test/ref/examples/rasterbars/raster-bars.log index 9a1e65101..b2fbda637 100644 --- a/src/test/ref/examples/rasterbars/raster-bars.log +++ b/src/test/ref/examples/rasterbars/raster-bars.log @@ -453,6 +453,7 @@ raster: { //SEG35 [18] return rts } +//SEG36 File Data rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff REGISTER UPLIFT POTENTIAL REGISTERS @@ -598,6 +599,7 @@ raster: { //SEG35 [18] return rts } +//SEG36 File Data rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff ASSEMBLER OPTIMIZATIONS @@ -771,5 +773,6 @@ raster: { //SEG35 [18] return rts } +//SEG36 File Data rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff diff --git a/src/test/ref/examples/rotate/rotate.log b/src/test/ref/examples/rotate/rotate.log index 820b70656..ffcae3ca4 100644 --- a/src/test/ref/examples/rotate/rotate.log +++ b/src/test/ref/examples/rotate/rotate.log @@ -2827,6 +2827,7 @@ mulf_init: { //SEG211 [113] return rts } +//SEG212 File Data // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // $3e8 - sta _0+1 + sta end+1 b1: txa ldy #0 @@ -744,10 +742,10 @@ memset: { inc dst+1 !: lda dst+1 - cmp _0+1 + cmp end+1 bne b1 lda dst - cmp _0 + cmp end bne b1 rts } diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.cfg b/src/test/ref/examples/scrolllogo/scrolllogo.cfg index c14a498c8..9eb7aec13 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.cfg +++ b/src/test/ref/examples/scrolllogo/scrolllogo.cfg @@ -436,14 +436,14 @@ divr16u::@return: scope:[divr16u] from divr16u::@6 memset: scope:[memset] from main::@3 main::@4 [214] (byte) memset::c#3 ← phi( main::@3/(const byte) BLACK#0 main::@4/(const byte) WHITE#0|(byte) 8 ) [214] (void*) memset::str#2 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS#0 ) - [215] (void*~) memset::$0 ← (void*) memset::str#2 + (word) $3e8 + [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 to:memset::@1 memset::@1: scope:[memset] from memset memset::@1 [217] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [219] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 - [220] if((byte*) memset::dst#1!=(byte*)(void*~) memset::$0) goto memset::@1 + [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 to:memset::@return memset::@return: scope:[memset] from memset::@1 [221] return diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.log b/src/test/ref/examples/scrolllogo/scrolllogo.log index 71fe9b0f3..ce7dbdbfe 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.log +++ b/src/test/ref/examples/scrolllogo/scrolllogo.log @@ -45,9 +45,6 @@ Adding pointer type conversion cast (void()**) HARDWARE_IRQ in (void()**) HARDWA Identified literal word (dword) { div32u16u::quotient_hi, div32u16u::quotient_lo } in (dword) div32u16u::quotient ← { (word) div32u16u::quotient_hi, (word) div32u16u::quotient_lo } Adding pointer type conversion cast to void pointer (byte*) memcpy::source in (byte*) memcpy::src ← (void*) memcpy::source Adding pointer type conversion cast to void pointer (byte*) memcpy::destination in (byte*) memcpy::dst ← (void*) memcpy::destination -Adding pointer type conversion cast to void pointer (byte*) memmove::$3 in (byte*) memmove::src ← (void*~) memmove::$3 -Adding pointer type conversion cast to void pointer (byte*) memmove::$4 in (byte*) memmove::dst ← (void*~) memmove::$4 -Adding pointer type conversion cast to void pointer (byte*) memset::$0 in (byte*) memset::end ← (void*~) memset::$0 Adding pointer type conversion cast to void pointer (byte*) memset::str in (byte*) memset::dst ← (void*) memset::str Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400 Adding pointer type conversion cast (byte*) LOGO in (byte*) LOGO ← (number) $2000 @@ -606,8 +603,9 @@ memset: scope:[memset] from main::@3 main::@4 (byte) memset::c#3 ← phi( main::@3/(byte) memset::c#0 main::@4/(byte) memset::c#1 ) (word) memset::num#2 ← phi( main::@3/(word) memset::num#0 main::@4/(word) memset::num#1 ) (void*) memset::str#2 ← phi( main::@3/(void*) memset::str#0 main::@4/(void*) memset::str#1 ) - (void*~) memset::$0 ← (void*) memset::str#2 + (word) memset::num#2 - (byte*) memset::end#0 ← ((byte*)) (void*~) memset::$0 + (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 @@ -617,8 +615,8 @@ memset::@1: scope:[memset] from memset memset::@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::$1 ← (byte*) memset::dst#1 != (byte*) memset::end#1 - if((bool~) memset::$1) goto memset::@1 + (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 ) @@ -1157,8 +1155,9 @@ SYMBOL TABLE SSA (byte*) main::toD0181_screen#0 (byte*) main::toD0181_screen#1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) -(void*~) memset::$0 -(bool~) memset::$1 +(byte*~) memset::$0 +(byte*~) memset::$1 +(bool~) memset::$2 (label) memset::@1 (label) memset::@2 (label) memset::@return @@ -1808,7 +1807,7 @@ Inlining cast (byte) mulu16_sel::select#3 ← (unumber)(number) 0 Inlining cast (byte) mulu16_sel::select#4 ← (unumber)(number) 0 Inlining cast (signed word~) sin16s::$14 ← (signed word)(word) sin16s::usinx#1 Inlining cast (signed word~) sin16s::$19 ← (signed word)(word) sin16s::usinx#3 -Inlining cast (byte*) memset::end#0 ← (byte*)(void*~) memset::$0 +Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 Inlining cast (byte*) LOGO#0 ← (byte*)(number) $2000 @@ -2023,7 +2022,7 @@ Inversing boolean not [117] (bool~) mul16s::$6 ← (signed word) mul16s::b#2 >= Inversing boolean not [185] (bool~) sin16s::$1 ← (dword) sin16s::x#3 < (dword) PI_u4f28#0 from [184] (bool~) sin16s::$0 ← (dword) sin16s::x#3 >= (dword) PI_u4f28#0 Inversing boolean not [189] (bool~) sin16s::$3 ← (dword) sin16s::x#4 < (dword) PI_HALF_u4f28#0 from [188] (bool~) sin16s::$2 ← (dword) sin16s::x#4 >= (dword) PI_HALF_u4f28#0 Inversing boolean not [248] (bool~) sin16s::$16 ← (byte) sin16s::isUpper#2 == (byte) 0 from [247] (bool~) sin16s::$15 ← (byte) sin16s::isUpper#2 != (byte) 0 -Inversing boolean not [372] (bool~) loop::$4 ← (word) xsin_idx#3 != (word) XSIN_SIZE#0 from [371] (bool~) loop::$3 ← (word) xsin_idx#3 == (word) XSIN_SIZE#0 +Inversing boolean not [373] (bool~) loop::$4 ← (word) xsin_idx#3 != (word) XSIN_SIZE#0 from [372] (bool~) loop::$3 ← (word) xsin_idx#3 == (word) XSIN_SIZE#0 Successful SSA optimization Pass2UnaryNotSimplification Alias (word) divr16u::rem#0 = (word~) divr16u::$0 (word) divr16u::rem#7 Alias (word) divr16u::dividend#0 = (word~) divr16u::$6 (word) divr16u::dividend#8 @@ -2115,6 +2114,7 @@ Alias (signed word) sin16s::sinx#1 = (signed word~) sin16s::$20 Alias (dword) mul16u::return#3 = (dword) mul16u::return#6 Alias (byte) mulu16_sel::select#5 = (byte) mulu16_sel::select#6 Alias (word) mulu16_sel::return#12 = (word) mulu16_sel::return#5 (word~) mulu16_sel::$2 (word) mulu16_sel::return#6 +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*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 @@ -2222,8 +2222,8 @@ Identical Phi Values (byte) render_logo::screen_idx#16 (byte) render_logo::scree Identical Phi Values (word) rem16u#10 (word) rem16u#17 Identical Phi Values (word) xsin_idx#12 (word) xsin_idx#0 Successful SSA optimization Pass2IdenticalPhiElimination -Identified duplicate assignment right side [426] (byte~) render_logo::$14 ← (byte) $28 * (byte) render_logo::line#10 -Identified duplicate assignment right side [443] (byte~) render_logo::$22 ← (byte) $28 * (byte) render_logo::line#11 +Identified duplicate assignment right side [427] (byte~) render_logo::$14 ← (byte) $28 * (byte) render_logo::line#10 +Identified duplicate assignment right side [444] (byte~) render_logo::$22 ← (byte) $28 * (byte) render_logo::line#11 Successful SSA optimization Pass2DuplicateRValueIdentification Simple Condition (bool~) divr16u::$4 [23] if((byte~) divr16u::$2==(byte) 0) goto divr16u::@2 Simple Condition (bool~) divr16u::$9 [31] if((word) divr16u::rem#6<(word) divr16u::divisor#6) goto divr16u::@3 @@ -2236,19 +2236,19 @@ Simple Condition (bool~) sin16s_gen2::$10 [178] if((word) sin16s_gen2::i#1<(word Simple Condition (bool~) sin16s::$1 [186] if((dword) sin16s::x#0<(dword) PI_u4f28#0) goto sin16s::@1 Simple Condition (bool~) sin16s::$3 [190] if((dword) sin16s::x#4<(dword) PI_HALF_u4f28#0) goto sin16s::@2 Simple Condition (bool~) sin16s::$16 [249] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@3 -Simple Condition (bool~) memset::$1 [283] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -Simple Condition (bool~) main::$6 [338] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1 -Simple Condition (bool~) loop::$0 [361] if(*((byte*) RASTER#0)!=(byte) $ff) goto loop::@4 -Simple Condition (bool~) loop::$4 [373] if((word) xsin_idx#3!=(word) XSIN_SIZE#0) goto loop::@11 -Simple Condition (bool~) render_logo::$5 [392] if((signed word) render_logo::xpos#0<(signed byte) 0) goto render_logo::@1 -Simple Condition (bool~) render_logo::$7 [404] if((byte) render_logo::screen_idx#18!=(byte) render_logo::logo_start#1) goto render_logo::@5 -Simple Condition (bool~) render_logo::$10 [415] unroll if((byte) render_logo::line#2!=rangelast(0,5)) goto render_logo::@7 -Simple Condition (bool~) render_logo::$11 [420] if((byte) render_logo::screen_idx#10!=(byte) $28) goto render_logo::@13 -Simple Condition (bool~) render_logo::$16 [431] unroll if((byte) render_logo::line#4!=rangelast(0,5)) goto render_logo::@15 -Simple Condition (bool~) render_logo::$19 [437] if((byte) render_logo::logo_idx#11!=(byte) $28) goto render_logo::@22 -Simple Condition (bool~) render_logo::$24 [448] unroll if((byte) render_logo::line#6!=rangelast(0,5)) goto render_logo::@24 -Simple Condition (bool~) render_logo::$25 [454] if((byte) render_logo::screen_idx#15!=(byte) $28) goto render_logo::@30 -Simple Condition (bool~) render_logo::$28 [463] unroll if((byte) render_logo::line#8!=rangelast(0,5)) goto render_logo::@32 +Simple Condition (bool~) memset::$2 [284] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 +Simple Condition (bool~) main::$6 [339] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1 +Simple Condition (bool~) loop::$0 [362] if(*((byte*) RASTER#0)!=(byte) $ff) goto loop::@4 +Simple Condition (bool~) loop::$4 [374] if((word) xsin_idx#3!=(word) XSIN_SIZE#0) goto loop::@11 +Simple Condition (bool~) render_logo::$5 [393] if((signed word) render_logo::xpos#0<(signed byte) 0) goto render_logo::@1 +Simple Condition (bool~) render_logo::$7 [405] if((byte) render_logo::screen_idx#18!=(byte) render_logo::logo_start#1) goto render_logo::@5 +Simple Condition (bool~) render_logo::$10 [416] unroll if((byte) render_logo::line#2!=rangelast(0,5)) goto render_logo::@7 +Simple Condition (bool~) render_logo::$11 [421] if((byte) render_logo::screen_idx#10!=(byte) $28) goto render_logo::@13 +Simple Condition (bool~) render_logo::$16 [432] unroll if((byte) render_logo::line#4!=rangelast(0,5)) goto render_logo::@15 +Simple Condition (bool~) render_logo::$19 [438] if((byte) render_logo::logo_idx#11!=(byte) $28) goto render_logo::@22 +Simple Condition (bool~) render_logo::$24 [449] unroll if((byte) render_logo::line#6!=rangelast(0,5)) goto render_logo::@24 +Simple Condition (bool~) render_logo::$25 [455] if((byte) render_logo::screen_idx#15!=(byte) $28) goto render_logo::@30 +Simple Condition (bool~) render_logo::$28 [464] unroll if((byte) render_logo::line#8!=rangelast(0,5)) goto render_logo::@32 Successful SSA optimization Pass2ConditionalJumpSimplification Constant right-side identified [216] (word) mulu16_sel::v2#2 ← (unumber)(number) $10000/(number) 6 Successful SSA optimization Pass2ConstantRValueConsolidation @@ -2314,26 +2314,26 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const word) divr16u::divisor#0 = div32u16u::divisor#0 Constant (const word) divr16u::divisor#1 = div32u16u::divisor#0 Successful SSA optimization Pass2ConstantIdentification -Constant value identified { fill( XSIN_SIZE#0, 0) } in [294] (signed word[XSIN_SIZE#0]) xsin#0 ← { fill( XSIN_SIZE#0, 0) } -Constant value identified (word)main::toD0181_screen#0 in [304] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0 -Constant value identified (word)main::toD0181_gfx#0 in [308] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0 -Constant value identified (void*)SCREEN#0 in [320] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 -Constant value identified (void*)COLS#0 in [327] (void*) memset::str#1 ← (void*)(const byte*) COLS#0 +Constant value identified { fill( XSIN_SIZE#0, 0) } in [295] (signed word[XSIN_SIZE#0]) xsin#0 ← { fill( XSIN_SIZE#0, 0) } +Constant value identified (word)main::toD0181_screen#0 in [305] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0 +Constant value identified (word)main::toD0181_gfx#0 in [309] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0 +Constant value identified (void*)SCREEN#0 in [321] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 +Constant value identified (void*)COLS#0 in [328] (void*) memset::str#1 ← (void*)(const byte*) COLS#0 Successful SSA optimization Pass2ConstantValues -if() condition always true - replacing block destination [358] if(true) goto loop::@4 +if() condition always true - replacing block destination [359] if(true) goto loop::@4 Successful SSA optimization Pass2ConstantIfs Resolved ranged next value [36] divr16u::i#1 ← ++ divr16u::i#2 to ++ Resolved ranged comparison value [38] if(divr16u::i#1!=rangelast(0,$f)) goto divr16u::@1 to (number) $10 -Resolved ranged next value [336] main::ch#1 ← ++ main::ch#2 to ++ -Resolved ranged comparison value [338] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0 -Resolved ranged next value [413] render_logo::line#2 ← ++ render_logo::line#9 to ++ -Resolved ranged comparison value [415] unroll if(render_logo::line#2!=rangelast(0,5)) goto render_logo::@7 to (number) 6 -Resolved ranged next value [429] render_logo::line#4 ← ++ render_logo::line#10 to ++ -Resolved ranged comparison value [431] unroll if(render_logo::line#4!=rangelast(0,5)) goto render_logo::@15 to (number) 6 -Resolved ranged next value [446] render_logo::line#6 ← ++ render_logo::line#11 to ++ -Resolved ranged comparison value [448] unroll if(render_logo::line#6!=rangelast(0,5)) goto render_logo::@24 to (number) 6 -Resolved ranged next value [461] render_logo::line#8 ← ++ render_logo::line#12 to ++ -Resolved ranged comparison value [463] unroll if(render_logo::line#8!=rangelast(0,5)) goto render_logo::@32 to (number) 6 +Resolved ranged next value [337] main::ch#1 ← ++ main::ch#2 to ++ +Resolved ranged comparison value [339] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0 +Resolved ranged next value [414] render_logo::line#2 ← ++ render_logo::line#9 to ++ +Resolved ranged comparison value [416] unroll if(render_logo::line#2!=rangelast(0,5)) goto render_logo::@7 to (number) 6 +Resolved ranged next value [430] render_logo::line#4 ← ++ render_logo::line#10 to ++ +Resolved ranged comparison value [432] unroll if(render_logo::line#4!=rangelast(0,5)) goto render_logo::@15 to (number) 6 +Resolved ranged next value [447] render_logo::line#6 ← ++ render_logo::line#11 to ++ +Resolved ranged comparison value [449] unroll if(render_logo::line#6!=rangelast(0,5)) goto render_logo::@24 to (number) 6 +Resolved ranged next value [462] render_logo::line#8 ← ++ render_logo::line#12 to ++ +Resolved ranged comparison value [464] unroll if(render_logo::line#8!=rangelast(0,5)) goto render_logo::@32 to (number) 6 Eliminating unused variable (void*) memset::return#2 and assignment [161] (void*) memset::return#2 ← (void*) memset::str#2 Eliminating unused variable (void*) memset::return#3 and assignment [165] (void*) memset::return#3 ← (void*) memset::str#2 Eliminating unused constant (const byte) render_logo::logo_idx#0 @@ -2938,7 +2938,7 @@ Inlining Noop Cast [101] (signed word~) sin16s_gen2::$8 ← (signed word)(word~) Inlining Noop Cast [108] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#0 keeping mul16s::a#0 Inlining Noop Cast [164] (signed word) sin16s::sinx#0 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1 Inlining Noop Cast [166] (signed word~) sin16s::$19 ← (signed word)(word) sin16s::usinx#1 keeping sin16s::usinx#1 -Inlining Noop Cast [208] (byte*) memset::end#0 ← (byte*)(void*~) memset::$0 keeping memset::$0 +Inlining Noop Cast [207] (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 keeping memset::str#2 Inlining Noop Cast [209] (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 keeping memset::str#2 Successful SSA optimization Pass2NopCastInlining Rewriting multiplication to use shift [21] (word~) loop::$5 ← (word) xsin_idx#11 * (const byte) SIZEOF_SIGNED_WORD @@ -3774,14 +3774,14 @@ divr16u::@return: scope:[divr16u] from divr16u::@6 memset: scope:[memset] from main::@3 main::@4 [214] (byte) memset::c#3 ← phi( main::@3/(const byte) BLACK#0 main::@4/(const byte) WHITE#0|(byte) 8 ) [214] (void*) memset::str#2 ← phi( main::@3/(void*)(const byte*) SCREEN#0 main::@4/(void*)(const byte*) COLS#0 ) - [215] (void*~) memset::$0 ← (void*) memset::str#2 + (word) $3e8 + [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 to:memset::@1 memset::@1: scope:[memset] from memset memset::@1 [217] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [219] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 - [220] if((byte*) memset::dst#1!=(byte*)(void*~) memset::$0) goto memset::@1 + [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 to:memset::@return memset::@return: scope:[memset] from memset::@1 [221] return @@ -3868,7 +3868,6 @@ VARIABLE REGISTER WEIGHTS (byte) main::toD0181_return (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) -(void*~) memset::$0 0.3333333333333333 (byte) memset::c (byte) memset::c#3 1.5714285714285714 (byte*) memset::dst @@ -3876,10 +3875,11 @@ VARIABLE REGISTER WEIGHTS (byte*) memset::dst#2 17.5 (byte*~) memset::dst#3 4.0 (byte*) memset::end +(byte*) memset::end#0 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#2 1.0 +(void*) memset::str#2 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 4.0 (word~) mul16s::$9 4.0 @@ -4124,7 +4124,7 @@ Added variable div32u16u::return#0 to zero page equivalence class [ div32u16u::r Added variable divr16u::$1 to zero page equivalence class [ divr16u::$1 ] Added variable divr16u::$2 to zero page equivalence class [ divr16u::$2 ] Added variable rem16u#1 to zero page equivalence class [ rem16u#1 ] -Added variable memset::$0 to zero page equivalence class [ memset::$0 ] +Added variable memset::end#0 to zero page equivalence class [ memset::end#0 ] Complete equivalence classes [ main::ch#2 main::ch#1 ] [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] @@ -4212,7 +4212,7 @@ Complete equivalence classes [ divr16u::$1 ] [ divr16u::$2 ] [ rem16u#1 ] -[ memset::$0 ] +[ memset::end#0 ] Allocated zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] Allocated zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] Allocated zp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] @@ -4299,7 +4299,7 @@ Allocated zp ZP_DWORD:171 [ div32u16u::return#0 ] Allocated zp ZP_BYTE:175 [ divr16u::$1 ] Allocated zp ZP_BYTE:176 [ divr16u::$2 ] Allocated zp ZP_WORD:177 [ rem16u#1 ] -Allocated zp ZP_WORD:179 [ memset::$0 ] +Allocated zp ZP_WORD:179 [ memset::end#0 ] INITIAL ASM //SEG0 File Comments @@ -5616,13 +5616,11 @@ sin16s: { b6: //SEG332 [173] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz2 sec - lda usinx_1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1 sta sinx - lda usinx_1+1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1+1 sta sinx+1 //SEG333 [174] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -5942,18 +5940,18 @@ divr16u: { // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. // memset(void* zeropage($34) str, byte zeropage($36) c) memset: { - .label _0 = $b3 + .label end = $b3 .label dst = $37 .label str = $34 .label c = $36 - //SEG411 [215] (void*~) memset::$0 ← (void*) memset::str#2 + (word) $3e8 -- pvoz1=pvoz2_plus_vwuc1 + //SEG411 [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1 lda str clc adc #<$3e8 - sta _0 + sta end lda str+1 adc #>$3e8 - sta _0+1 + sta end+1 //SEG412 [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 -- pbuz1=pbuz2 lda str sta dst @@ -5975,12 +5973,12 @@ memset: { bne !+ inc dst+1 !: - //SEG418 [220] if((byte*) memset::dst#1!=(byte*)(void*~) memset::$0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG418 [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 lda dst+1 - cmp _0+1 + cmp end+1 bne b1_from_b1 lda dst - cmp _0 + cmp end bne b1_from_b1 jmp breturn //SEG419 memset::@return @@ -5988,6 +5986,7 @@ memset: { //SEG420 [221] return rts } +//SEG421 File Data .align $100 xsin: .fill 2*XSIN_SIZE, 0 .pc = LOGO "LOGO" @@ -6106,12 +6105,12 @@ Statement [202] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ div Statement [206] if((word) divr16u::rem#6<(const word) XSIN_SIZE#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a Statement [208] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) XSIN_SIZE#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [212] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::return#0 rem16u#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a -Statement [215] (void*~) memset::$0 ← (void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::$0 ] ( main:3::memset:13 [ memset::str#2 memset::c#3 memset::$0 ] main:3::memset:15 [ memset::str#2 memset::c#3 memset::$0 ] ) always clobbers reg byte a +Statement [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:13 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:15 [ 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:54 [ memset::c#3 ] -Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::$0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::$0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::$0 memset::dst#3 ] ) always clobbers reg byte a -Statement [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::$0 memset::dst#2 ] ( main:3::memset:13 [ memset::c#3 memset::$0 memset::dst#2 ] main:3::memset:15 [ memset::c#3 memset::$0 memset::dst#2 ] ) always clobbers reg byte a reg byte y +Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a +Statement [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:15 [ 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:54 [ memset::c#3 ] -Statement [220] if((byte*) memset::dst#1!=(byte*)(void*~) memset::$0) goto memset::@1 [ memset::c#3 memset::$0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::$0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::$0 memset::dst#1 ] ) always clobbers reg byte a +Statement [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a Statement [6] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [8] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main:3 [ ] ) always clobbers reg byte a @@ -6212,10 +6211,10 @@ Statement [202] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte) 1 [ div Statement [206] if((word) divr16u::rem#6<(const word) XSIN_SIZE#0) goto divr16u::@3 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::rem#6 divr16u::quotient#1 ] ) always clobbers reg byte a Statement [208] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (const word) XSIN_SIZE#0 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::i#2 divr16u::dividend#0 divr16u::quotient#2 divr16u::rem#2 ] ) always clobbers reg byte a Statement [212] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 rem16u#1 ] ( main:3::sin16s_gen2:21::div32u16u:98::divr16u:187 [ divr16u::return#0 rem16u#1 ] main:3::sin16s_gen2:21::div32u16u:98::divr16u:191 [ div32u16u::quotient_hi#0 divr16u::return#0 rem16u#1 ] ) always clobbers reg byte a -Statement [215] (void*~) memset::$0 ← (void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::$0 ] ( main:3::memset:13 [ memset::str#2 memset::c#3 memset::$0 ] main:3::memset:15 [ memset::str#2 memset::c#3 memset::$0 ] ) always clobbers reg byte a -Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::$0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::$0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::$0 memset::dst#3 ] ) always clobbers reg byte a -Statement [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::$0 memset::dst#2 ] ( main:3::memset:13 [ memset::c#3 memset::$0 memset::dst#2 ] main:3::memset:15 [ memset::c#3 memset::$0 memset::dst#2 ] ) always clobbers reg byte a reg byte y -Statement [220] if((byte*) memset::dst#1!=(byte*)(void*~) memset::$0) goto memset::@1 [ memset::c#3 memset::$0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::$0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::$0 memset::dst#1 ] ) always clobbers reg byte a +Statement [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:13 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:15 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a +Statement [218] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y +Statement [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:13 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:15 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] : zp ZP_WORD:3 , Potential registers zp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] : zp ZP_BYTE:5 , reg byte x , reg byte y , @@ -6302,7 +6301,7 @@ Potential registers zp ZP_DWORD:171 [ div32u16u::return#0 ] : zp ZP_DWORD:171 , Potential registers zp ZP_BYTE:175 [ divr16u::$1 ] : zp ZP_BYTE:175 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_BYTE:176 [ divr16u::$2 ] : zp ZP_BYTE:176 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_WORD:177 [ rem16u#1 ] : zp ZP_WORD:177 , -Potential registers zp ZP_WORD:179 [ memset::$0 ] : zp ZP_WORD:179 , +Potential registers zp ZP_WORD:179 [ memset::end#0 ] : zp ZP_WORD:179 , REGISTER UPLIFT SCOPES Uplift Scope [render_logo] 506.94: zp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] 499.17: zp ZP_BYTE:8 [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] 271.07: zp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] 259.71: zp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] 202: zp ZP_BYTE:71 [ render_logo::$33 ] 202: zp ZP_BYTE:72 [ render_logo::$36 ] 202: zp ZP_BYTE:73 [ render_logo::$39 ] 202: zp ZP_BYTE:74 [ render_logo::$42 ] 202: zp ZP_BYTE:75 [ render_logo::$45 ] 202: zp ZP_BYTE:77 [ render_logo::$73 ] 202: zp ZP_BYTE:78 [ render_logo::$76 ] 202: zp ZP_BYTE:79 [ render_logo::$79 ] 202: zp ZP_BYTE:80 [ render_logo::$82 ] 202: zp ZP_BYTE:81 [ render_logo::$85 ] 4: zp ZP_BYTE:65 [ render_logo::$0 ] 4: zp ZP_BYTE:66 [ render_logo::$1 ] 4: zp ZP_BYTE:67 [ render_logo::$2 ] 2.14: zp ZP_WORD:63 [ render_logo::xpos#0 ] 2: zp ZP_WORD:68 [ render_logo::$3 ] 2: zp ZP_BYTE:76 [ render_logo::$17 ] 0.36: zp ZP_BYTE:70 [ render_logo::x_char#0 ] @@ -6313,62 +6312,62 @@ Uplift Scope [mulu16_sel] 24: zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 Uplift Scope [sin16s_gen2] 22: zp ZP_DWORD:98 [ sin16s_gen2::$5 ] 18.33: zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] 11: zp ZP_WORD:102 [ sin16s_gen2::$6 ] 10.33: zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] 8.8: zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] 0.87: zp ZP_DWORD:86 [ sin16s_gen2::step#0 ] Uplift Scope [loop] 22: zp ZP_WORD:57 [ loop::$5 ] 22: zp ZP_WORD:59 [ loop::$1 ] 22: zp ZP_WORD:61 [ loop::xpos#0 ] Uplift Scope [mul16s] 22: zp ZP_DWORD:94 [ mul16s::return#2 ] 10: zp ZP_DWORD:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] 4.33: zp ZP_DWORD:112 [ mul16s::return#0 ] 4: zp ZP_WORD:108 [ mul16s::$9 ] 4: zp ZP_WORD:110 [ mul16s::$16 ] 2.6: zp ZP_WORD:92 [ mul16s::a#0 ] -Uplift Scope [memset] 38: zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 1.57: zp ZP_BYTE:54 [ memset::c#3 ] 1: zp ZP_WORD:52 [ memset::str#2 ] 0.33: zp ZP_WORD:179 [ memset::$0 ] +Uplift Scope [memset] 38: zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:179 [ memset::end#0 ] 1.57: zp ZP_BYTE:54 [ memset::c#3 ] 0: zp ZP_WORD:52 [ memset::str#2 ] Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] Uplift Scope [] 26.12: zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] 0.8: zp ZP_WORD:177 [ rem16u#1 ] Uplift Scope [div32u16u] 4: zp ZP_DWORD:82 [ div32u16u::return#2 ] 4: zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] 1.33: zp ZP_DWORD:171 [ div32u16u::return#0 ] 0.8: zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ] -Uplifting [mul16u] best 72674 combination zp ZP_DWORD:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#8 mul16u::a#2 mul16u::a#0 ] zp ZP_WORD:21 [ mul16u::b#1 ] zp ZP_DWORD:104 [ mul16u::return#2 ] zp ZP_DWORD:149 [ mul16u::return#3 ] -Uplifting [divr16u] best 72464 combination zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:163 [ divr16u::return#2 ] zp ZP_WORD:167 [ divr16u::return#3 ] -Uplifting [sin16s] best 72464 combination zp ZP_DWORD:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:90 [ sin16s::return#0 ] zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:117 [ sin16s::$4 ] zp ZP_WORD:125 [ sin16s::x2#0 ] zp ZP_WORD:133 [ sin16s::x3_6#0 ] zp ZP_WORD:139 [ sin16s::x4#0 ] zp ZP_WORD:143 [ sin16s::x5#0 ] zp ZP_WORD:145 [ sin16s::x5_128#0 ] zp ZP_WORD:129 [ sin16s::x3#0 ] zp ZP_WORD:147 [ sin16s::usinx#1 ] zp ZP_WORD:121 [ sin16s::x1#0 ] zp ZP_WORD:135 [ sin16s::usinx#0 ] zp ZP_BYTE:33 [ sin16s::isUpper#2 ] -Uplifting [mulu16_sel] best 72448 combination zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:123 [ mulu16_sel::return#0 ] zp ZP_WORD:127 [ mulu16_sel::return#1 ] zp ZP_WORD:131 [ mulu16_sel::return#2 ] zp ZP_WORD:137 [ mulu16_sel::return#10 ] zp ZP_WORD:141 [ mulu16_sel::return#11 ] zp ZP_DWORD:153 [ mulu16_sel::$0 ] zp ZP_DWORD:157 [ mulu16_sel::$1 ] zp ZP_WORD:161 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [sin16s_gen2] best 72448 combination zp ZP_DWORD:98 [ sin16s_gen2::$5 ] zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:102 [ sin16s_gen2::$6 ] zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:86 [ sin16s_gen2::step#0 ] -Uplifting [loop] best 72448 combination zp ZP_WORD:57 [ loop::$5 ] zp ZP_WORD:59 [ loop::$1 ] zp ZP_WORD:61 [ loop::xpos#0 ] -Uplifting [mul16s] best 72448 combination zp ZP_DWORD:94 [ mul16s::return#2 ] zp ZP_DWORD:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp ZP_DWORD:112 [ mul16s::return#0 ] zp ZP_WORD:108 [ mul16s::$9 ] zp ZP_WORD:110 [ mul16s::$16 ] zp ZP_WORD:92 [ mul16s::a#0 ] -Uplifting [memset] best 72432 combination zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] reg byte x [ memset::c#3 ] zp ZP_WORD:52 [ memset::str#2 ] zp ZP_WORD:179 [ memset::$0 ] -Uplifting [main] best 72312 combination reg byte x [ main::ch#2 main::ch#1 ] -Uplifting [] best 72312 combination zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp ZP_WORD:177 [ rem16u#1 ] -Uplifting [div32u16u] best 72312 combination zp ZP_DWORD:82 [ div32u16u::return#2 ] zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:171 [ div32u16u::return#0 ] zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ] +Uplifting [mul16u] best 74974 combination zp ZP_DWORD:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#8 mul16u::a#2 mul16u::a#0 ] zp ZP_WORD:21 [ mul16u::b#1 ] zp ZP_DWORD:104 [ mul16u::return#2 ] zp ZP_DWORD:149 [ mul16u::return#3 ] +Uplifting [divr16u] best 74764 combination zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:163 [ divr16u::return#2 ] zp ZP_WORD:167 [ divr16u::return#3 ] +Uplifting [sin16s] best 74764 combination zp ZP_DWORD:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:90 [ sin16s::return#0 ] zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:117 [ sin16s::$4 ] zp ZP_WORD:125 [ sin16s::x2#0 ] zp ZP_WORD:133 [ sin16s::x3_6#0 ] zp ZP_WORD:139 [ sin16s::x4#0 ] zp ZP_WORD:143 [ sin16s::x5#0 ] zp ZP_WORD:145 [ sin16s::x5_128#0 ] zp ZP_WORD:129 [ sin16s::x3#0 ] zp ZP_WORD:147 [ sin16s::usinx#1 ] zp ZP_WORD:121 [ sin16s::x1#0 ] zp ZP_WORD:135 [ sin16s::usinx#0 ] zp ZP_BYTE:33 [ sin16s::isUpper#2 ] +Uplifting [mulu16_sel] best 74748 combination zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:123 [ mulu16_sel::return#0 ] zp ZP_WORD:127 [ mulu16_sel::return#1 ] zp ZP_WORD:131 [ mulu16_sel::return#2 ] zp ZP_WORD:137 [ mulu16_sel::return#10 ] zp ZP_WORD:141 [ mulu16_sel::return#11 ] zp ZP_DWORD:153 [ mulu16_sel::$0 ] zp ZP_DWORD:157 [ mulu16_sel::$1 ] zp ZP_WORD:161 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [sin16s_gen2] best 74748 combination zp ZP_DWORD:98 [ sin16s_gen2::$5 ] zp ZP_WORD:15 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp ZP_WORD:102 [ sin16s_gen2::$6 ] zp ZP_DWORD:9 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp ZP_WORD:13 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp ZP_DWORD:86 [ sin16s_gen2::step#0 ] +Uplifting [loop] best 74748 combination zp ZP_WORD:57 [ loop::$5 ] zp ZP_WORD:59 [ loop::$1 ] zp ZP_WORD:61 [ loop::xpos#0 ] +Uplifting [mul16s] best 74748 combination zp ZP_DWORD:94 [ mul16s::return#2 ] zp ZP_DWORD:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp ZP_DWORD:112 [ mul16s::return#0 ] zp ZP_WORD:108 [ mul16s::$9 ] zp ZP_WORD:110 [ mul16s::$16 ] zp ZP_WORD:92 [ mul16s::a#0 ] +Uplifting [memset] best 74732 combination zp ZP_WORD:55 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:179 [ memset::end#0 ] reg byte x [ memset::c#3 ] zp ZP_WORD:52 [ memset::str#2 ] +Uplifting [main] best 74612 combination reg byte x [ main::ch#2 main::ch#1 ] +Uplifting [] best 74612 combination zp ZP_WORD:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp ZP_WORD:177 [ rem16u#1 ] +Uplifting [div32u16u] best 74612 combination zp ZP_DWORD:82 [ div32u16u::return#2 ] zp ZP_WORD:169 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:171 [ div32u16u::return#0 ] zp ZP_WORD:165 [ div32u16u::quotient_hi#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] -Uplifting [render_logo] best 67212 combination reg byte y [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] +Uplifting [render_logo] best 69512 combination reg byte y [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:8 [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] -Uplifting [render_logo] best 62412 combination reg byte y [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] +Uplifting [render_logo] best 64712 combination reg byte y [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] Attempting to uplift remaining variables inzp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] -Uplifting [render_logo] best 62412 combination zp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] +Uplifting [render_logo] best 64712 combination zp ZP_BYTE:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] -Uplifting [render_logo] best 62412 combination zp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] +Uplifting [render_logo] best 64712 combination zp ZP_BYTE:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:71 [ render_logo::$33 ] -Uplifting [render_logo] best 62012 combination reg byte a [ render_logo::$33 ] +Uplifting [render_logo] best 64312 combination reg byte a [ render_logo::$33 ] Attempting to uplift remaining variables inzp ZP_BYTE:72 [ render_logo::$36 ] -Uplifting [render_logo] best 61612 combination reg byte a [ render_logo::$36 ] +Uplifting [render_logo] best 63912 combination reg byte a [ render_logo::$36 ] Attempting to uplift remaining variables inzp ZP_BYTE:73 [ render_logo::$39 ] -Uplifting [render_logo] best 61212 combination reg byte a [ render_logo::$39 ] +Uplifting [render_logo] best 63512 combination reg byte a [ render_logo::$39 ] Attempting to uplift remaining variables inzp ZP_BYTE:74 [ render_logo::$42 ] -Uplifting [render_logo] best 60812 combination reg byte a [ render_logo::$42 ] +Uplifting [render_logo] best 63112 combination reg byte a [ render_logo::$42 ] Attempting to uplift remaining variables inzp ZP_BYTE:75 [ render_logo::$45 ] -Uplifting [render_logo] best 60412 combination reg byte a [ render_logo::$45 ] +Uplifting [render_logo] best 62712 combination reg byte a [ render_logo::$45 ] Attempting to uplift remaining variables inzp ZP_BYTE:77 [ render_logo::$73 ] -Uplifting [render_logo] best 60012 combination reg byte a [ render_logo::$73 ] +Uplifting [render_logo] best 62312 combination reg byte a [ render_logo::$73 ] Attempting to uplift remaining variables inzp ZP_BYTE:78 [ render_logo::$76 ] -Uplifting [render_logo] best 59612 combination reg byte a [ render_logo::$76 ] +Uplifting [render_logo] best 61912 combination reg byte a [ render_logo::$76 ] Attempting to uplift remaining variables inzp ZP_BYTE:79 [ render_logo::$79 ] -Uplifting [render_logo] best 59212 combination reg byte a [ render_logo::$79 ] +Uplifting [render_logo] best 61512 combination reg byte a [ render_logo::$79 ] Attempting to uplift remaining variables inzp ZP_BYTE:80 [ render_logo::$82 ] -Uplifting [render_logo] best 58812 combination reg byte a [ render_logo::$82 ] +Uplifting [render_logo] best 61112 combination reg byte a [ render_logo::$82 ] Attempting to uplift remaining variables inzp ZP_BYTE:81 [ render_logo::$85 ] -Uplifting [render_logo] best 58412 combination reg byte a [ render_logo::$85 ] +Uplifting [render_logo] best 60712 combination reg byte a [ render_logo::$85 ] Attempting to uplift remaining variables inzp ZP_BYTE:65 [ render_logo::$0 ] -Uplifting [render_logo] best 58406 combination reg byte a [ render_logo::$0 ] +Uplifting [render_logo] best 60706 combination reg byte a [ render_logo::$0 ] Attempting to uplift remaining variables inzp ZP_BYTE:66 [ render_logo::$1 ] -Uplifting [render_logo] best 58400 combination reg byte a [ render_logo::$1 ] +Uplifting [render_logo] best 60700 combination reg byte a [ render_logo::$1 ] Attempting to uplift remaining variables inzp ZP_BYTE:67 [ render_logo::$2 ] -Uplifting [render_logo] best 58394 combination reg byte a [ render_logo::$2 ] +Uplifting [render_logo] best 60694 combination reg byte a [ render_logo::$2 ] Attempting to uplift remaining variables inzp ZP_BYTE:76 [ render_logo::$17 ] -Uplifting [render_logo] best 58388 combination reg byte a [ render_logo::$17 ] +Uplifting [render_logo] best 60688 combination reg byte a [ render_logo::$17 ] Attempting to uplift remaining variables inzp ZP_BYTE:70 [ render_logo::x_char#0 ] -Uplifting [render_logo] best 58388 combination zp ZP_BYTE:70 [ render_logo::x_char#0 ] +Uplifting [render_logo] best 60688 combination zp ZP_BYTE:70 [ render_logo::x_char#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 58388 combination zp ZP_BYTE:33 [ sin16s::isUpper#2 ] +Uplifting [sin16s] best 60688 combination zp ZP_BYTE:33 [ sin16s::isUpper#2 ] Coalescing zero page register with common assignment [ zp ZP_WORD:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp ZP_WORD:147 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:40 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] ] with [ zp ZP_WORD:129 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:45 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] ] with [ zp ZP_WORD:177 [ rem16u#1 ] ] - score: 2 @@ -6432,7 +6431,7 @@ Allocated (was zp ZP_WORD:108) zp ZP_WORD:54 [ mul16s::$9 mul16s::$16 ] Allocated (was zp ZP_WORD:121) zp ZP_WORD:56 [ sin16s::x1#0 ] Allocated (was zp ZP_WORD:123) zp ZP_WORD:58 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 sin16s::x5_128#0 ] Allocated (was zp ZP_WORD:165) zp ZP_WORD:60 [ div32u16u::quotient_hi#0 ] -Allocated (was zp ZP_WORD:179) zp ZP_WORD:62 [ memset::$0 ] +Allocated (was zp ZP_WORD:179) zp ZP_WORD:62 [ memset::end#0 ] ASSEMBLER BEFORE OPTIMIZATION //SEG0 File Comments @@ -7543,13 +7542,11 @@ sin16s: { b6: //SEG332 [173] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG333 [174] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -7801,17 +7798,17 @@ divr16u: { // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. // memset(void* zeropage($29) str, byte register(X) c) memset: { - .label _0 = $3e + .label end = $3e .label dst = $29 .label str = $29 - //SEG411 [215] (void*~) memset::$0 ← (void*) memset::str#2 + (word) $3e8 -- pvoz1=pvoz2_plus_vwuc1 + //SEG411 [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1 lda str clc adc #<$3e8 - sta _0 + sta end lda str+1 adc #>$3e8 - sta _0+1 + sta end+1 //SEG412 [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 //SEG413 [217] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] b1_from_memset: @@ -7829,12 +7826,12 @@ memset: { bne !+ inc dst+1 !: - //SEG418 [220] if((byte*) memset::dst#1!=(byte*)(void*~) memset::$0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG418 [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 lda dst+1 - cmp _0+1 + cmp end+1 bne b1_from_b1 lda dst - cmp _0 + cmp end bne b1_from_b1 jmp breturn //SEG419 memset::@return @@ -7842,6 +7839,7 @@ memset: { //SEG420 [221] return rts } +//SEG421 File Data .align $100 xsin: .fill 2*XSIN_SIZE, 0 .pc = LOGO "LOGO" @@ -8250,7 +8248,6 @@ FINAL SYMBOL TABLE (const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO#0/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) -(void*~) memset::$0 $0 zp ZP_WORD:62 0.3333333333333333 (label) memset::@1 (label) memset::@return (byte) memset::c @@ -8260,10 +8257,11 @@ FINAL SYMBOL TABLE (byte*) memset::dst#2 dst zp ZP_WORD:41 17.5 (byte*~) memset::dst#3 dst zp ZP_WORD:41 4.0 (byte*) memset::end +(byte*) memset::end#0 end zp ZP_WORD:62 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#2 str zp ZP_WORD:41 1.0 +(void*) memset::str#2 str zp ZP_WORD:41 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 $16 zp ZP_WORD:54 4.0 (word~) mul16s::$9 $9 zp ZP_WORD:54 4.0 @@ -8538,11 +8536,11 @@ zp ZP_WORD:58 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 zp ZP_WORD:60 [ div32u16u::quotient_hi#0 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] -zp ZP_WORD:62 [ memset::$0 ] +zp ZP_WORD:62 [ memset::end#0 ] FINAL ASSEMBLER -Score: 44054 +Score: 46354 //SEG0 File Comments //SEG1 Basic Upstart @@ -9464,13 +9462,11 @@ sin16s: { //SEG331 sin16s::@6 //SEG332 [173] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG333 [174] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] //SEG334 [174] phi (signed word) sin16s::return#1 = (signed word~) sin16s::return#5 [phi:sin16s::@12/sin16s::@6->sin16s::@3#0] -- register_copy @@ -9682,17 +9678,17 @@ divr16u: { // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. // memset(void* zeropage($29) str, byte register(X) c) memset: { - .label _0 = $3e + .label end = $3e .label dst = $29 .label str = $29 - //SEG411 [215] (void*~) memset::$0 ← (void*) memset::str#2 + (word) $3e8 -- pvoz1=pvoz2_plus_vwuc1 + //SEG411 [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1 lda str clc adc #<$3e8 - sta _0 + sta end lda str+1 adc #>$3e8 - sta _0+1 + sta end+1 //SEG412 [216] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 //SEG413 [217] phi from memset memset::@1 to memset::@1 [phi:memset/memset::@1->memset::@1] //SEG414 [217] phi (byte*) memset::dst#2 = (byte*~) memset::dst#3 [phi:memset/memset::@1->memset::@1#0] -- register_copy @@ -9707,17 +9703,18 @@ memset: { bne !+ inc dst+1 !: - //SEG418 [220] if((byte*) memset::dst#1!=(byte*)(void*~) memset::$0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG418 [220] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 lda dst+1 - cmp _0+1 + cmp end+1 bne b1 lda dst - cmp _0 + cmp end bne b1 //SEG419 memset::@return //SEG420 [221] return rts } +//SEG421 File Data .align $100 xsin: .fill 2*XSIN_SIZE, 0 .pc = LOGO "LOGO" diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.sym b/src/test/ref/examples/scrolllogo/scrolllogo.sym index b72138f1b..91525ea4b 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.sym +++ b/src/test/ref/examples/scrolllogo/scrolllogo.sym @@ -124,7 +124,6 @@ (const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) LOGO#0/(byte) 4&(byte) $f (byte*) main::toD0181_screen (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) -(void*~) memset::$0 $0 zp ZP_WORD:62 0.3333333333333333 (label) memset::@1 (label) memset::@return (byte) memset::c @@ -134,10 +133,11 @@ (byte*) memset::dst#2 dst zp ZP_WORD:41 17.5 (byte*~) memset::dst#3 dst zp ZP_WORD:41 4.0 (byte*) memset::end +(byte*) memset::end#0 end zp ZP_WORD:62 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#2 str zp ZP_WORD:41 1.0 +(void*) memset::str#2 str zp ZP_WORD:41 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 $16 zp ZP_WORD:54 4.0 (word~) mul16s::$9 $9 zp ZP_WORD:54 4.0 @@ -412,4 +412,4 @@ zp ZP_WORD:58 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 zp ZP_WORD:60 [ div32u16u::quotient_hi#0 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] -zp ZP_WORD:62 [ memset::$0 ] +zp ZP_WORD:62 [ memset::end#0 ] diff --git a/src/test/ref/examples/showlogo/showlogo.cfg b/src/test/ref/examples/showlogo/showlogo.cfg index cbb4ea594..7770485df 100644 --- a/src/test/ref/examples/showlogo/showlogo.cfg +++ b/src/test/ref/examples/showlogo/showlogo.cfg @@ -47,14 +47,14 @@ memset: scope:[memset] from main::@3 main::@4 [21] (byte) memset::c#3 ← phi( main::@4/(const byte) WHITE#0|(byte) 8 main::@3/(const byte) BLACK#0 ) [21] (word) memset::num#2 ← phi( main::@4/(word)(number) $28*(number) $19 main::@3/(word)(number) $28*(number) $19 ) [21] (void*) memset::str#2 ← phi( main::@4/(void*)(const byte*) COLS#0 main::@3/(void*)(const byte*) SCREEN#0 ) - [22] (void*) memset::end#0 ← (void*) memset::str#2 + (word) memset::num#2 + [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 to:memset::@1 memset::@1: scope:[memset] from memset memset::@1 [24] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 [26] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 - [27] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 + [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 to:memset::@return memset::@return: scope:[memset] from memset::@1 [28] return diff --git a/src/test/ref/examples/showlogo/showlogo.log b/src/test/ref/examples/showlogo/showlogo.log index f0b882f19..94ed28200 100644 --- a/src/test/ref/examples/showlogo/showlogo.log +++ b/src/test/ref/examples/showlogo/showlogo.log @@ -44,9 +44,6 @@ Adding pointer type conversion cast (void()**) KERNEL_IRQ in (void()**) KERNEL_I Adding pointer type conversion cast (void()**) HARDWARE_IRQ in (void()**) HARDWARE_IRQ ← (number) $fffe Adding pointer type conversion cast to void pointer (byte*) memcpy::source in (byte*) memcpy::src ← (void*) memcpy::source Adding pointer type conversion cast to void pointer (byte*) memcpy::destination in (byte*) memcpy::dst ← (void*) memcpy::destination -Adding pointer type conversion cast to void pointer (byte*) memmove::$3 in (byte*) memmove::src ← (void*~) memmove::$3 -Adding pointer type conversion cast to void pointer (byte*) memmove::$4 in (byte*) memmove::dst ← (void*~) memmove::$4 -Adding pointer type conversion cast to void pointer (byte*) memset::$0 in (byte*) memset::end ← (void*~) memset::$0 Adding pointer type conversion cast to void pointer (byte*) memset::str in (byte*) memset::dst ← (void*) memset::str Adding pointer type conversion cast (byte*) SCREEN in (byte*) SCREEN ← (number) $400 Adding pointer type conversion cast (byte*) LOGO in (byte*) LOGO ← (number) $2000 @@ -91,8 +88,9 @@ memset: scope:[memset] from main::@10 main::@9 (byte) memset::c#3 ← phi( main::@10/(byte) memset::c#1 main::@9/(byte) memset::c#0 ) (word) memset::num#2 ← phi( main::@10/(word) memset::num#1 main::@9/(word) memset::num#0 ) (void*) memset::str#2 ← phi( main::@10/(void*) memset::str#1 main::@9/(void*) memset::str#0 ) - (void*~) memset::$0 ← (void*) memset::str#2 + (word) memset::num#2 - (byte*) memset::end#0 ← ((byte*)) (void*~) memset::$0 + (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 @@ -102,8 +100,8 @@ memset::@1: scope:[memset] from memset memset::@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::$1 ← (byte*) memset::dst#1 != (byte*) memset::end#1 - if((bool~) memset::$1) goto memset::@1 + (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 ) @@ -281,8 +279,9 @@ SYMBOL TABLE SSA (byte*) main::toD0181_screen#0 (byte*) main::toD0181_screen#1 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) -(void*~) memset::$0 -(bool~) memset::$1 +(byte*~) memset::$0 +(byte*~) memset::$1 +(bool~) memset::$2 (label) memset::@1 (label) memset::@2 (label) memset::@return @@ -348,7 +347,7 @@ Inlining cast (byte*) COLS#0 ← (byte*)(number) $d800 Inlining cast (byte) BLACK#0 ← (unumber)(number) 0 Inlining cast (byte) WHITE#0 ← (unumber)(number) 1 Inlining cast (byte) DARK_GREY#0 ← (unumber)(number) $b -Inlining cast (byte*) memset::end#0 ← (byte*)(void*~) memset::$0 +Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400 Inlining cast (byte*) LOGO#0 ← (byte*)(number) $2000 @@ -397,6 +396,7 @@ Inferred type updated to byte in (unumber~) main::toD0181_$6#0 ← (byte~) main: 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 byte in (unumber~) main::$3 ← (byte) WHITE#0 | (byte) 8 +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*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 @@ -411,11 +411,11 @@ 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 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) memset::$1 [20] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -Simple Condition (bool~) main::$5 [69] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1 +Simple Condition (bool~) memset::$2 [21] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 +Simple Condition (bool~) main::$5 [70] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification -Constant right-side identified [55] (word) memset::num#0 ← (unumber)(number) $28*(number) $19 -Constant right-side identified [61] (word) memset::num#1 ← (unumber)(number) $28*(number) $19 +Constant right-side identified [56] (word) memset::num#0 ← (unumber)(number) $28*(number) $19 +Constant right-side identified [62] (word) memset::num#1 ← (unumber)(number) $28*(number) $19 Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte*) BORDERCOL#0 = (byte*) 53280 Constant (const byte*) BGCOL#0 = (byte*) 53281 @@ -439,15 +439,15 @@ Constant (const byte*) main::toD0181_screen#0 = SCREEN#0 Constant (const byte*) main::toD0181_gfx#0 = LOGO#0 Constant (const byte) memset::c#0 = BLACK#0 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (word)main::toD0181_screen#0 in [36] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0 -Constant value identified (word)main::toD0181_gfx#0 in [40] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0 -Constant value identified (void*)SCREEN#0 in [53] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 -Constant value identified (void*)COLS#0 in [59] (void*) memset::str#1 ← (void*)(const byte*) COLS#0 +Constant value identified (word)main::toD0181_screen#0 in [37] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0 +Constant value identified (word)main::toD0181_gfx#0 in [41] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0 +Constant value identified (void*)SCREEN#0 in [54] (void*) memset::str#0 ← (void*)(const byte*) SCREEN#0 +Constant value identified (void*)COLS#0 in [60] (void*) memset::str#1 ← (void*)(const byte*) COLS#0 Successful SSA optimization Pass2ConstantValues -if() condition always true - replacing block destination [70] if(true) goto main::@4 +if() condition always true - replacing block destination [71] if(true) goto main::@4 Successful SSA optimization Pass2ConstantIfs -Resolved ranged next value [67] main::ch#1 ← ++ main::ch#2 to ++ -Resolved ranged comparison value [69] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0 +Resolved ranged next value [68] main::ch#1 ← ++ main::ch#2 to ++ +Resolved ranged comparison value [70] if(main::ch#1!=rangelast(0,$ef)) goto main::@1 to (number) $f0 Eliminating unused variable (void*) memset::return#2 and assignment [28] (void*) memset::return#2 ← (void*) memset::str#2 Eliminating unused variable (void*) memset::return#3 and assignment [32] (void*) memset::return#3 ← (void*) memset::str#2 Successful SSA optimization PassNEliminateUnusedVars @@ -493,8 +493,7 @@ Constant right-side identified [14] (byte) main::toD0181_return#0 ← (const byt 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 [2] (byte*) memset::end#0 ← (byte*)(void*~) memset::$0 keeping memset::end#0 -Successful SSA optimization Pass2NopCastInlining +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 constant with var siblings (const word) memset::num#0 @@ -612,14 +611,14 @@ memset: scope:[memset] from main::@3 main::@4 [21] (byte) memset::c#3 ← phi( main::@4/(const byte) WHITE#0|(byte) 8 main::@3/(const byte) BLACK#0 ) [21] (word) memset::num#2 ← phi( main::@4/(word)(number) $28*(number) $19 main::@3/(word)(number) $28*(number) $19 ) [21] (void*) memset::str#2 ← phi( main::@4/(void*)(const byte*) COLS#0 main::@3/(void*)(const byte*) SCREEN#0 ) - [22] (void*) memset::end#0 ← (void*) memset::str#2 + (word) memset::num#2 + [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 to:memset::@1 memset::@1: scope:[memset] from memset memset::@1 [24] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 [26] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 - [27] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 + [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 to:memset::@return memset::@return: scope:[memset] from memset::@1 [28] return @@ -665,12 +664,12 @@ VARIABLE REGISTER WEIGHTS (byte*) memset::dst#2 17.5 (byte*~) memset::dst#3 4.0 (byte*) memset::end -(void*) memset::end#0 0.3333333333333333 +(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 1.0 +(void*) memset::str#2 Initial phi equivalence classes [ main::ch#2 main::ch#1 ] @@ -843,7 +842,7 @@ memset: { .label str = 3 .label num = 5 .label c = 7 - //SEG45 [22] (void*) memset::end#0 ← (void*) memset::str#2 + (word) memset::num#2 -- pvoz1=pvoz2_plus_vwuz3 + //SEG45 [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3 lda str clc adc num @@ -872,7 +871,7 @@ memset: { bne !+ inc dst+1 !: - //SEG52 [27] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG52 [27] 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 @@ -885,6 +884,7 @@ memset: { //SEG54 [28] return rts } +//SEG55 File Data .pc = LOGO "LOGO" .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) @@ -900,22 +900,22 @@ Statement [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main: Statement [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:3 [ ] ) always clobbers reg byte a -Statement [22] (void*) memset::end#0 ← (void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:14 [ 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:7 [ memset::c#3 ] Statement [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a Statement [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ 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:7 [ memset::c#3 ] -Statement [27] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a Statement [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [6] *((const byte*) BGCOL2#0) ← (const byte) DARK_GREY#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [7] *((const byte*) BGCOL#0) ← *((const byte*) BGCOL2#0) [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [8] *((const byte*) BGCOL3#0) ← (const byte) BLACK#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:3 [ ] ) always clobbers reg byte a Statement [11] *((const byte*) D016#0) ← (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 [ ] ( main:3 [ ] ) always clobbers reg byte a -Statement [22] (void*) memset::end#0 ← (void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:3::memset:12 [ memset::str#2 memset::c#3 memset::end#0 ] main:3::memset:14 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a Statement [23] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#3 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a Statement [25] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#2 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y -Statement [27] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:3::memset:12 [ memset::c#3 memset::end#0 memset::dst#1 ] main:3::memset:14 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , Potential registers zp ZP_WORD:3 [ memset::str#2 ] : zp ZP_WORD:3 , Potential registers zp ZP_WORD:5 [ memset::num#2 ] : zp ZP_WORD:5 , @@ -924,13 +924,13 @@ Potential registers zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] : Potential registers zp ZP_WORD:10 [ memset::end#0 ] : zp ZP_WORD:10 , REGISTER UPLIFT SCOPES -Uplift Scope [memset] 38: zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2: zp ZP_WORD:5 [ memset::num#2 ] 1.57: zp ZP_BYTE:7 [ memset::c#3 ] 1: zp ZP_WORD:3 [ memset::str#2 ] 0.33: zp ZP_WORD:10 [ memset::end#0 ] +Uplift Scope [memset] 38: zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:10 [ memset::end#0 ] 2: zp ZP_WORD:5 [ memset::num#2 ] 1.57: zp ZP_BYTE:7 [ memset::c#3 ] 0: zp ZP_WORD:3 [ memset::str#2 ] Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::ch#2 main::ch#1 ] Uplift Scope [] -Uplifting [memset] best 3936 combination zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:5 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:3 [ memset::str#2 ] zp ZP_WORD:10 [ memset::end#0 ] -Uplifting [main] best 3816 combination reg byte x [ main::ch#2 main::ch#1 ] -Uplifting [] best 3816 combination +Uplifting [memset] best 6240 combination zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:10 [ memset::end#0 ] zp ZP_WORD:5 [ memset::num#2 ] reg byte x [ memset::c#3 ] zp ZP_WORD:3 [ memset::str#2 ] +Uplifting [main] best 6120 combination reg byte x [ main::ch#2 main::ch#1 ] +Uplifting [] best 6120 combination Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ memset::str#2 ] ] with [ zp ZP_WORD:8 [ memset::dst#2 memset::dst#3 memset::dst#1 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ memset::num#2 ] ] with [ zp ZP_WORD:10 [ memset::end#0 ] ] - score: 1 Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] @@ -1079,7 +1079,7 @@ memset: { .label dst = 2 .label str = 2 .label num = 4 - //SEG45 [22] (void*) memset::end#0 ← (void*) memset::str#2 + (word) memset::num#2 -- pvoz1=pvoz2_plus_vwuz1 + //SEG45 [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 lda end clc adc str @@ -1104,7 +1104,7 @@ memset: { bne !+ inc dst+1 !: - //SEG52 [27] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG52 [27] 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 @@ -1117,6 +1117,7 @@ memset: { //SEG54 [28] return rts } +//SEG55 File Data .pc = LOGO "LOGO" .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) @@ -1234,12 +1235,12 @@ FINAL SYMBOL TABLE (byte*) memset::dst#2 dst zp ZP_WORD:2 17.5 (byte*~) memset::dst#3 dst zp ZP_WORD:2 4.0 (byte*) memset::end -(void*) memset::end#0 end zp ZP_WORD:4 0.3333333333333333 +(byte*) memset::end#0 end zp ZP_WORD:4 2.1666666666666665 (word) memset::num (word) memset::num#2 num zp ZP_WORD:4 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#2 str zp ZP_WORD:2 1.0 +(void*) memset::str#2 str zp ZP_WORD:2 reg byte x [ main::ch#2 main::ch#1 ] zp ZP_WORD:2 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] @@ -1248,7 +1249,7 @@ reg byte x [ memset::c#3 ] FINAL ASSEMBLER -Score: 3572 +Score: 5876 //SEG0 File Comments //SEG1 Basic Upstart @@ -1366,7 +1367,7 @@ memset: { .label dst = 2 .label str = 2 .label num = 4 - //SEG45 [22] (void*) memset::end#0 ← (void*) memset::str#2 + (word) memset::num#2 -- pvoz1=pvoz2_plus_vwuz1 + //SEG45 [22] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1 lda end clc adc str @@ -1388,7 +1389,7 @@ memset: { bne !+ inc dst+1 !: - //SEG52 [27] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG52 [27] 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 @@ -1399,6 +1400,7 @@ memset: { //SEG54 [28] return rts } +//SEG55 File Data .pc = LOGO "LOGO" .var logoPic = LoadPicture("logo.png", List().add($444444, $808080, $000000, $ffffff)) .for (var y=0; y<6 ; y++) diff --git a/src/test/ref/examples/showlogo/showlogo.sym b/src/test/ref/examples/showlogo/showlogo.sym index 66c9b5195..872a57277 100644 --- a/src/test/ref/examples/showlogo/showlogo.sym +++ b/src/test/ref/examples/showlogo/showlogo.sym @@ -62,12 +62,12 @@ (byte*) memset::dst#2 dst zp ZP_WORD:2 17.5 (byte*~) memset::dst#3 dst zp ZP_WORD:2 4.0 (byte*) memset::end -(void*) memset::end#0 end zp ZP_WORD:4 0.3333333333333333 +(byte*) memset::end#0 end zp ZP_WORD:4 2.1666666666666665 (word) memset::num (word) memset::num#2 num zp ZP_WORD:4 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#2 str zp ZP_WORD:2 1.0 +(void*) memset::str#2 str zp ZP_WORD:2 reg byte x [ main::ch#2 main::ch#1 ] zp ZP_WORD:2 [ memset::str#2 memset::dst#2 memset::dst#3 memset::dst#1 ] diff --git a/src/test/ref/examples/sinsprites/sinus-sprites.log b/src/test/ref/examples/sinsprites/sinus-sprites.log index 955c228ba..085665009 100644 --- a/src/test/ref/examples/sinsprites/sinus-sprites.log +++ b/src/test/ref/examples/sinsprites/sinus-sprites.log @@ -5041,6 +5041,7 @@ place_sprites: { //SEG473 [226] return rts } +//SEG474 File Data sintab_x: .fill $dd, 0 sintab_y: .fill $c5, 0 @@ -6822,6 +6823,7 @@ place_sprites: { //SEG473 [226] return rts } +//SEG474 File Data sintab_x: .fill $dd, 0 sintab_y: .fill $c5, 0 @@ -8590,6 +8592,7 @@ place_sprites: { //SEG473 [226] return rts } +//SEG474 File Data sintab_x: .fill $dd, 0 sintab_y: .fill $c5, 0 diff --git a/src/test/ref/fibmem.log b/src/test/ref/fibmem.log index 809918c4d..dd23bb249 100644 --- a/src/test/ref/fibmem.log +++ b/src/test/ref/fibmem.log @@ -228,6 +228,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte[$f]) fibs#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -305,6 +306,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -394,4 +396,5 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data diff --git a/src/test/ref/fillscreen.log b/src/test/ref/fillscreen.log index ebbe8275c..707feea99 100644 --- a/src/test/ref/fillscreen.log +++ b/src/test/ref/fillscreen.log @@ -304,6 +304,7 @@ fillscreen: { //SEG29 [16] return rts } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ fillscreen::j#2 fillscreen::j#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -392,6 +393,7 @@ fillscreen: { //SEG29 [16] return rts } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -508,4 +510,5 @@ fillscreen: { //SEG29 [16] return rts } +//SEG30 File Data diff --git a/src/test/ref/flipper-rex2.log b/src/test/ref/flipper-rex2.log index a159ebfbb..98e4d7a14 100644 --- a/src/test/ref/flipper-rex2.log +++ b/src/test/ref/flipper-rex2.log @@ -990,6 +990,7 @@ prepare: { //SEG108 [47] return rts } +//SEG109 File Data buffer1: .fill $10*$10, 0 buffer2: .fill $10*$10, 0 @@ -1327,6 +1328,7 @@ prepare: { //SEG108 [47] return rts } +//SEG109 File Data buffer1: .fill $10*$10, 0 buffer2: .fill $10*$10, 0 @@ -1712,6 +1714,7 @@ prepare: { //SEG108 [47] return rts } +//SEG109 File Data buffer1: .fill $10*$10, 0 buffer2: .fill $10*$10, 0 diff --git a/src/test/ref/for-empty-increment.log b/src/test/ref/for-empty-increment.log index 6d81c3e10..15aefe44f 100644 --- a/src/test/ref/for-empty-increment.log +++ b/src/test/ref/for-empty-increment.log @@ -174,6 +174,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -237,6 +238,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -318,4 +320,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/for-empty-init.log b/src/test/ref/for-empty-init.log index 3a3221239..fca6bb884 100644 --- a/src/test/ref/for-empty-init.log +++ b/src/test/ref/for-empty-init.log @@ -174,6 +174,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -237,6 +238,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -318,4 +320,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/for-two-vars.log b/src/test/ref/for-two-vars.log index 31f38f41d..a77d9acad 100644 --- a/src/test/ref/for-two-vars.log +++ b/src/test/ref/for-two-vars.log @@ -217,6 +217,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::sc#2) ← (byte) main::i#2 [ main::i#2 main::sc#2 ] ( main:2 [ main::i#2 main::sc#2 ] ) always clobbers reg byte y @@ -303,6 +304,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -403,4 +405,5 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data diff --git a/src/test/ref/forclassicmin.log b/src/test/ref/forclassicmin.log index 19722d026..21cf33c67 100644 --- a/src/test/ref/forclassicmin.log +++ b/src/test/ref/forclassicmin.log @@ -188,6 +188,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -251,6 +252,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -332,4 +334,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/forincrementassign.log b/src/test/ref/forincrementassign.log index 55dccba7f..569d0f84c 100644 --- a/src/test/ref/forincrementassign.log +++ b/src/test/ref/forincrementassign.log @@ -188,6 +188,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -253,6 +254,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -336,4 +338,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/forrangedwords.log b/src/test/ref/forrangedwords.log index c1ce8c7b6..2cdc1c611 100644 --- a/src/test/ref/forrangedwords.log +++ b/src/test/ref/forrangedwords.log @@ -326,6 +326,7 @@ main: { //SEG34 [19] return rts } +//SEG35 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$0 ← < (word) main::w#2 [ main::w#2 main::$0 ] ( main:2 [ main::w#2 main::$0 ] ) always clobbers reg byte a @@ -449,6 +450,7 @@ main: { //SEG34 [19] return rts } +//SEG35 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -595,4 +597,5 @@ main: { //SEG34 [19] return rts } +//SEG35 File Data diff --git a/src/test/ref/forrangemin.log b/src/test/ref/forrangemin.log index d22686e7e..4f13319b4 100644 --- a/src/test/ref/forrangemin.log +++ b/src/test/ref/forrangemin.log @@ -262,6 +262,7 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -346,6 +347,7 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -455,4 +457,5 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data diff --git a/src/test/ref/forrangesymbolic.log b/src/test/ref/forrangesymbolic.log index 62d2ffdb1..ffcd724db 100644 --- a/src/test/ref/forrangesymbolic.log +++ b/src/test/ref/forrangesymbolic.log @@ -200,6 +200,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::b#2) ← (byte) $5a [ main::b#2 ] ( main:2 [ main::b#2 ] ) always clobbers reg byte a reg byte y @@ -280,6 +281,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -376,4 +378,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/fragment-synth.log b/src/test/ref/fragment-synth.log index b98527019..34e0ae8de 100644 --- a/src/test/ref/fragment-synth.log +++ b/src/test/ref/fragment-synth.log @@ -391,6 +391,7 @@ fct: { //SEG33 [17] return rts } +//SEG34 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((byte*) 1104+(byte) 2) ← (byte) $f0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -501,6 +502,7 @@ fct: { //SEG33 [17] return rts } +//SEG34 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -637,4 +639,5 @@ fct: { //SEG33 [17] return rts } +//SEG34 File Data diff --git a/src/test/ref/fragment-variations.log b/src/test/ref/fragment-variations.log index d1bda92ec..2b699eb5f 100644 --- a/src/test/ref/fragment-variations.log +++ b/src/test/ref/fragment-variations.log @@ -415,6 +415,7 @@ mul16u: { //SEG32 [16] return rts } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (dword) mul16u::return#0 ← (dword) mul16u::return#2 [ mul16u::return#0 ] ( main:2 [ mul16u::return#0 ] ) always clobbers reg byte a @@ -571,6 +572,7 @@ mul16u: { //SEG32 [16] return rts } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -737,4 +739,5 @@ mul16u: { //SEG32 [16] return rts } +//SEG33 File Data diff --git a/src/test/ref/function-pointer-noarg-2.log b/src/test/ref/function-pointer-noarg-2.log index a8246e467..5694dc3ed 100644 --- a/src/test/ref/function-pointer-noarg-2.log +++ b/src/test/ref/function-pointer-noarg-2.log @@ -265,6 +265,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -339,6 +340,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -432,4 +434,5 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data diff --git a/src/test/ref/function-pointer-noarg-3.log b/src/test/ref/function-pointer-noarg-3.log index bbdc8a175..99dfb7834 100644 --- a/src/test/ref/function-pointer-noarg-3.log +++ b/src/test/ref/function-pointer-noarg-3.log @@ -371,6 +371,7 @@ fn1: { //SEG37 [16] return rts } +//SEG38 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -494,6 +495,7 @@ fn1: { //SEG37 [16] return rts } +//SEG38 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -642,4 +644,5 @@ fn1: { //SEG37 [16] return rts } +//SEG38 File Data diff --git a/src/test/ref/function-pointer-noarg-call-10.log b/src/test/ref/function-pointer-noarg-call-10.log index cee18942c..63ac2a106 100644 --- a/src/test/ref/function-pointer-noarg-call-10.log +++ b/src/test/ref/function-pointer-noarg-call-10.log @@ -553,6 +553,7 @@ hello: { rts msg: .text "hello @" } +//SEG60 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [1] (byte) idx#16 ← (byte) 0 [ ] ( ) always clobbers reg byte a @@ -763,6 +764,7 @@ hello: { rts msg: .text "hello @" } +//SEG60 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -988,4 +990,5 @@ hello: { rts msg: .text "hello @" } +//SEG60 File Data diff --git a/src/test/ref/function-pointer-noarg-call-2.log b/src/test/ref/function-pointer-noarg-call-2.log index 7816f716b..9bb9b60ba 100644 --- a/src/test/ref/function-pointer-noarg-call-2.log +++ b/src/test/ref/function-pointer-noarg-call-2.log @@ -353,6 +353,7 @@ fn1: { //SEG35 [15] return rts } +//SEG36 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [11] call *((void()*) main::f#3) [ main::i#1 ] ( main:2 [ main::i#1 ] ) always clobbers reg byte a reg byte x reg byte y @@ -479,6 +480,7 @@ fn1: { //SEG35 [15] return rts } +//SEG36 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -622,4 +624,5 @@ fn1: { //SEG35 [15] return rts } +//SEG36 File Data diff --git a/src/test/ref/function-pointer-noarg-call-3.log b/src/test/ref/function-pointer-noarg-call-3.log index b9594ac0b..2fb242f2f 100644 --- a/src/test/ref/function-pointer-noarg-call-3.log +++ b/src/test/ref/function-pointer-noarg-call-3.log @@ -420,6 +420,7 @@ fn1: { //SEG42 [20] return rts } +//SEG43 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [9] (void()*) getfn::return#0 ← (void()*) getfn::return#3 [ main::i#1 getfn::return#0 ] ( main:2 [ main::i#1 getfn::return#0 ] ) always clobbers reg byte a @@ -571,6 +572,7 @@ fn1: { //SEG42 [20] return rts } +//SEG43 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -738,4 +740,5 @@ fn1: { //SEG42 [20] return rts } +//SEG43 File Data diff --git a/src/test/ref/function-pointer-noarg-call-4.log b/src/test/ref/function-pointer-noarg-call-4.log index 7ce19bfc4..5022693a3 100644 --- a/src/test/ref/function-pointer-noarg-call-4.log +++ b/src/test/ref/function-pointer-noarg-call-4.log @@ -285,6 +285,7 @@ getfn: { //SEG29 [13] return rts } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -373,6 +374,7 @@ getfn: { //SEG29 [13] return rts } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -481,4 +483,5 @@ getfn: { //SEG29 [13] return rts } +//SEG30 File Data diff --git a/src/test/ref/function-pointer-noarg-call-5.log b/src/test/ref/function-pointer-noarg-call-5.log index 76384e13a..5a8d82e44 100644 --- a/src/test/ref/function-pointer-noarg-call-5.log +++ b/src/test/ref/function-pointer-noarg-call-5.log @@ -307,6 +307,7 @@ fn1: { //SEG29 [14] return rts } +//SEG30 File Data fns: .word fn1, fn2 REGISTER UPLIFT POTENTIAL REGISTERS @@ -422,6 +423,7 @@ fn1: { //SEG29 [14] return rts } +//SEG30 File Data fns: .word fn1, fn2 ASSEMBLER OPTIMIZATIONS @@ -549,5 +551,6 @@ fn1: { //SEG29 [14] return rts } +//SEG30 File Data fns: .word fn1, fn2 diff --git a/src/test/ref/function-pointer-noarg-call-6.log b/src/test/ref/function-pointer-noarg-call-6.log index 3d78c94f2..d7590d7e8 100644 --- a/src/test/ref/function-pointer-noarg-call-6.log +++ b/src/test/ref/function-pointer-noarg-call-6.log @@ -303,6 +303,7 @@ fn1: { //SEG33 [16] return rts } +//SEG34 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] *((byte*) main::cols#2) ← ++ *((byte*) main::cols#2) [ main::cols#2 ] ( main:2 [ main::cols#2 ] ) always clobbers reg byte a reg byte y @@ -437,6 +438,7 @@ fn1: { //SEG33 [16] return rts } +//SEG34 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -592,4 +594,5 @@ fn1: { //SEG33 [16] return rts } +//SEG34 File Data diff --git a/src/test/ref/function-pointer-noarg-call-7.log b/src/test/ref/function-pointer-noarg-call-7.log index 8be51fa52..f07659e96 100644 --- a/src/test/ref/function-pointer-noarg-call-7.log +++ b/src/test/ref/function-pointer-noarg-call-7.log @@ -391,6 +391,7 @@ hello: { //SEG42 [20] return rts } +//SEG43 File Data msg: .text "hello @" REGISTER UPLIFT POTENTIAL REGISTERS @@ -531,6 +532,7 @@ hello: { //SEG42 [20] return rts } +//SEG43 File Data msg: .text "hello @" ASSEMBLER OPTIMIZATIONS @@ -689,5 +691,6 @@ hello: { //SEG42 [20] return rts } +//SEG43 File Data msg: .text "hello @" diff --git a/src/test/ref/function-pointer-noarg-call-8.log b/src/test/ref/function-pointer-noarg-call-8.log index b4ac4f50c..26039b871 100644 --- a/src/test/ref/function-pointer-noarg-call-8.log +++ b/src/test/ref/function-pointer-noarg-call-8.log @@ -476,6 +476,7 @@ hello: { //SEG47 [23] return rts } +//SEG48 File Data msg1: .text "hello @" msg2: .text "world @" @@ -646,6 +647,7 @@ hello: { //SEG47 [23] return rts } +//SEG48 File Data msg1: .text "hello @" msg2: .text "world @" @@ -835,6 +837,7 @@ hello: { //SEG47 [23] return rts } +//SEG48 File Data msg1: .text "hello @" msg2: .text "world @" diff --git a/src/test/ref/function-pointer-noarg-call-9.log b/src/test/ref/function-pointer-noarg-call-9.log index a4f464815..9067f2270 100644 --- a/src/test/ref/function-pointer-noarg-call-9.log +++ b/src/test/ref/function-pointer-noarg-call-9.log @@ -204,6 +204,7 @@ fn1: { //SEG21 [11] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) idx#0 ← (byte) 0 [ idx#0 ] ( ) always clobbers reg byte a @@ -281,6 +282,7 @@ fn1: { //SEG21 [11] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -369,4 +371,5 @@ fn1: { //SEG21 [11] return rts } +//SEG22 File Data diff --git a/src/test/ref/function-pointer-noarg-call.log b/src/test/ref/function-pointer-noarg-call.log index ea548e4ae..fc0043dd3 100644 --- a/src/test/ref/function-pointer-noarg-call.log +++ b/src/test/ref/function-pointer-noarg-call.log @@ -154,6 +154,7 @@ fn1: { //SEG17 [8] return rts } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS @@ -211,6 +212,7 @@ fn1: { //SEG17 [8] return rts } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -281,4 +283,5 @@ fn1: { //SEG17 [8] return rts } +//SEG18 File Data diff --git a/src/test/ref/function-pointer-noarg.log b/src/test/ref/function-pointer-noarg.log index 7def5bf05..d543d203b 100644 --- a/src/test/ref/function-pointer-noarg.log +++ b/src/test/ref/function-pointer-noarg.log @@ -290,6 +290,7 @@ fn1: { //SEG23 [12] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← <(word)&(void()) fn1() [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -373,6 +374,7 @@ fn1: { //SEG23 [12] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -469,4 +471,5 @@ fn1: { //SEG23 [12] return rts } +//SEG24 File Data diff --git a/src/test/ref/function-pointer-return.log b/src/test/ref/function-pointer-return.log index 5156b801f..bba79defc 100644 --- a/src/test/ref/function-pointer-return.log +++ b/src/test/ref/function-pointer-return.log @@ -399,6 +399,7 @@ fn1: { //SEG36 [16] return rts } +//SEG37 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [11] (byte~) main::$4 ← (byte)(byte()*) main::f#3 [ main::i#1 main::$4 ] ( main:2 [ main::i#1 main::$4 ] ) always clobbers reg byte a @@ -522,6 +523,7 @@ fn1: { //SEG36 [16] return rts } +//SEG37 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -670,4 +672,5 @@ fn1: { //SEG36 [16] return rts } +//SEG37 File Data diff --git a/src/test/ref/gfxbank.log b/src/test/ref/gfxbank.log index f764832fb..fbedc3453 100644 --- a/src/test/ref/gfxbank.log +++ b/src/test/ref/gfxbank.log @@ -309,6 +309,7 @@ main: { //SEG18 [8] return rts } +//SEG19 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -375,6 +376,7 @@ main: { //SEG18 [8] return rts } +//SEG19 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -466,4 +468,5 @@ main: { //SEG18 [8] return rts } +//SEG19 File Data diff --git a/src/test/ref/global-pc.log b/src/test/ref/global-pc.log index 9c91ba7ef..18cebbae9 100644 --- a/src/test/ref/global-pc.log +++ b/src/test/ref/global-pc.log @@ -148,6 +148,7 @@ main: { sta BGCOL jmp b1 } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::col#0 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -196,6 +197,7 @@ main: { sta BGCOL jmp b1 } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -260,4 +262,5 @@ main: { sta BGCOL jmp b1 } +//SEG14 File Data diff --git a/src/test/ref/halfscii.log b/src/test/ref/halfscii.log index d3ccdf832..a3178bb31 100644 --- a/src/test/ref/halfscii.log +++ b/src/test/ref/halfscii.log @@ -1236,6 +1236,7 @@ main: { //SEG92 [59] return rts } +//SEG93 File Data bits_count: .byte 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 REGISTER UPLIFT POTENTIAL REGISTERS @@ -1699,6 +1700,7 @@ main: { //SEG92 [59] return rts } +//SEG93 File Data bits_count: .byte 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 ASSEMBLER OPTIMIZATIONS @@ -2128,5 +2130,6 @@ main: { //SEG92 [59] return rts } +//SEG93 File Data bits_count: .byte 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 diff --git a/src/test/ref/helloworld0.log b/src/test/ref/helloworld0.log index dd1fc7b84..d8275e83c 100644 --- a/src/test/ref/helloworld0.log +++ b/src/test/ref/helloworld0.log @@ -181,6 +181,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data msg: .text "hello world!@" REGISTER UPLIFT POTENTIAL REGISTERS @@ -248,6 +249,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data msg: .text "hello world!@" ASSEMBLER OPTIMIZATIONS @@ -332,5 +334,6 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data msg: .text "hello world!@" diff --git a/src/test/ref/helloworld2-inline.log b/src/test/ref/helloworld2-inline.log index 40048758a..0dfaa580a 100644 --- a/src/test/ref/helloworld2-inline.log +++ b/src/test/ref/helloworld2-inline.log @@ -418,6 +418,7 @@ main: { rts hello: .text "hello world!@" } +//SEG39 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a @@ -540,6 +541,7 @@ main: { rts hello: .text "hello world!@" } +//SEG39 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -690,4 +692,5 @@ main: { rts hello: .text "hello world!@" } +//SEG39 File Data diff --git a/src/test/ref/helloworld2.log b/src/test/ref/helloworld2.log index a5a6a7c8e..d943c246f 100644 --- a/src/test/ref/helloworld2.log +++ b/src/test/ref/helloworld2.log @@ -340,6 +340,7 @@ print2: { //SEG34 [15] return rts } +//SEG35 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [11] *((byte*) print2::at#3 + (byte) print2::j#2) ← *((const byte*) main::hello#0 + (byte) print2::i#2) [ print2::at#3 print2::i#2 print2::j#2 ] ( main:2::print2:5 [ print2::at#3 print2::i#2 print2::j#2 ] main:2::print2:7 [ print2::at#3 print2::i#2 print2::j#2 ] ) always clobbers reg byte a @@ -453,6 +454,7 @@ print2: { //SEG34 [15] return rts } +//SEG35 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -587,4 +589,5 @@ print2: { //SEG34 [15] return rts } +//SEG35 File Data diff --git a/src/test/ref/hex2dec-ptrptr.log b/src/test/ref/hex2dec-ptrptr.log index c721dd111..10e6f2f02 100644 --- a/src/test/ref/hex2dec-ptrptr.log +++ b/src/test/ref/hex2dec-ptrptr.log @@ -1103,6 +1103,7 @@ cls: { //SEG108 [51] return rts } +//SEG109 File Data // Digits used for utoa() DIGITS: .text "0123456789abcdef@" @@ -1468,6 +1469,7 @@ cls: { //SEG108 [51] return rts } +//SEG109 File Data // Digits used for utoa() DIGITS: .text "0123456789abcdef@" @@ -1860,6 +1862,7 @@ cls: { //SEG108 [51] return rts } +//SEG109 File Data // Digits used for utoa() DIGITS: .text "0123456789abcdef@" diff --git a/src/test/ref/hex2dec.log b/src/test/ref/hex2dec.log index 5e8853639..1b1b1750e 100644 --- a/src/test/ref/hex2dec.log +++ b/src/test/ref/hex2dec.log @@ -2030,6 +2030,7 @@ cls: { //SEG181 [90] return rts } +//SEG182 File Data // Digits used for utoa() DIGITS: .text "0123456789abcdef@" // Subtraction values used for decimal utoa() @@ -2716,6 +2717,7 @@ cls: { //SEG181 [90] return rts } +//SEG182 File Data // Digits used for utoa() DIGITS: .text "0123456789abcdef@" // Subtraction values used for decimal utoa() @@ -3418,6 +3420,7 @@ cls: { //SEG181 [90] return rts } +//SEG182 File Data // Digits used for utoa() DIGITS: .text "0123456789abcdef@" // Subtraction values used for decimal utoa() diff --git a/src/test/ref/ifmin.log b/src/test/ref/ifmin.log index 4de589dbc..09fcc915c 100644 --- a/src/test/ref/ifmin.log +++ b/src/test/ref/ifmin.log @@ -214,6 +214,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -285,6 +286,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -376,4 +378,5 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data diff --git a/src/test/ref/immzero.log b/src/test/ref/immzero.log index c3cf1bd85..f2cf9eea5 100644 --- a/src/test/ref/immzero.log +++ b/src/test/ref/immzero.log @@ -201,6 +201,7 @@ main: { //SEG22 [9] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (word) main::w#1 ← (word) main::w#2 + (byte) main::j#2 [ main::j#2 main::w#1 ] ( main:2 [ main::j#2 main::w#1 ] ) always clobbers reg byte a @@ -279,6 +280,7 @@ main: { //SEG22 [9] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -375,4 +377,5 @@ main: { //SEG22 [9] return rts } +//SEG23 File Data diff --git a/src/test/ref/importing.log b/src/test/ref/importing.log index 6594b90c8..8a98517f8 100644 --- a/src/test/ref/importing.log +++ b/src/test/ref/importing.log @@ -136,6 +136,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -186,6 +187,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -250,4 +252,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/incd020.log b/src/test/ref/incd020.log index 4c7dcbe8d..0578ee8f4 100644 --- a/src/test/ref/incd020.log +++ b/src/test/ref/incd020.log @@ -123,6 +123,7 @@ main: { dec BGCOL jmp b1 } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS @@ -170,6 +171,7 @@ main: { dec BGCOL jmp b1 } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -229,4 +231,5 @@ main: { dec BGCOL jmp b1 } +//SEG14 File Data diff --git a/src/test/ref/incrementinarray.log b/src/test/ref/incrementinarray.log index bf09db80c..1e891e9ca 100644 --- a/src/test/ref/incrementinarray.log +++ b/src/test/ref/incrementinarray.log @@ -752,6 +752,7 @@ print_cls: { //SEG69 [32] return rts } +//SEG70 File Data txt: .text "camelot@" REGISTER UPLIFT POTENTIAL REGISTERS @@ -1011,6 +1012,7 @@ print_cls: { //SEG69 [32] return rts } +//SEG70 File Data txt: .text "camelot@" ASSEMBLER OPTIMIZATIONS @@ -1293,5 +1295,6 @@ print_cls: { //SEG69 [32] return rts } +//SEG70 File Data txt: .text "camelot@" diff --git a/src/test/ref/infloop-error.log b/src/test/ref/infloop-error.log index 0bfb043ea..7b5e598dc 100644 --- a/src/test/ref/infloop-error.log +++ b/src/test/ref/infloop-error.log @@ -377,6 +377,7 @@ main: { //SEG36 [5] phi (byte) main::pos#2 = (byte) main::pos#1 [phi:main::@4->main::@1#2] -- register_copy jmp b1 } +//SEG37 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::pos#2 main::pos#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -479,6 +480,7 @@ main: { //SEG36 [5] phi (byte) main::pos#2 = (byte) main::pos#1 [phi:main::@4->main::@1#2] -- register_copy jmp b1 } +//SEG37 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -613,4 +615,5 @@ main: { //SEG36 [5] phi (byte) main::pos#2 = (byte) main::pos#1 [phi:main::@4->main::@1#2] -- register_copy jmp b2 } +//SEG37 File Data diff --git a/src/test/ref/init-volatiles.log b/src/test/ref/init-volatiles.log index d6326a125..22fd1ee0d 100644 --- a/src/test/ref/init-volatiles.log +++ b/src/test/ref/init-volatiles.log @@ -194,6 +194,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) x#0 ← (byte) $c [ x#0 ] ( ) always clobbers reg byte a @@ -265,6 +266,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -349,4 +351,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/inline-asm-clobber-none.log b/src/test/ref/inline-asm-clobber-none.log index a1dcdca13..569d97a08 100644 --- a/src/test/ref/inline-asm-clobber-none.log +++ b/src/test/ref/inline-asm-clobber-none.log @@ -323,6 +323,7 @@ main: { //SEG36 [15] return rts } +//SEG37 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#6 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -435,6 +436,7 @@ main: { //SEG36 [15] return rts } +//SEG37 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -575,4 +577,5 @@ main: { //SEG36 [15] return rts } +//SEG37 File Data diff --git a/src/test/ref/inline-asm-clobber.log b/src/test/ref/inline-asm-clobber.log index 35af2201f..de06e7fdb 100644 --- a/src/test/ref/inline-asm-clobber.log +++ b/src/test/ref/inline-asm-clobber.log @@ -393,6 +393,7 @@ main: { //SEG45 [20] return rts } +//SEG46 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement asm { eor#$55 tax } always clobbers reg byte a reg byte x @@ -535,6 +536,7 @@ main: { //SEG45 [20] return rts } +//SEG46 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -701,4 +703,5 @@ main: { //SEG45 [20] return rts } +//SEG46 File Data diff --git a/src/test/ref/inline-asm-jsr-clobber.log b/src/test/ref/inline-asm-jsr-clobber.log index d94cad3dd..1fb269ebd 100644 --- a/src/test/ref/inline-asm-jsr-clobber.log +++ b/src/test/ref/inline-asm-jsr-clobber.log @@ -162,6 +162,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement asm { jsr$e544 } always clobbers reg byte a reg byte x reg byte y @@ -235,6 +236,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -315,4 +317,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/inline-asm-label.log b/src/test/ref/inline-asm-label.log index 9876231b9..d6f6627c4 100644 --- a/src/test/ref/inline-asm-label.log +++ b/src/test/ref/inline-asm-label.log @@ -119,6 +119,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" REGISTER UPLIFT POTENTIAL REGISTERS @@ -170,6 +171,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" ASSEMBLER OPTIMIZATIONS @@ -234,5 +236,6 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" diff --git a/src/test/ref/inline-asm-optimized.log b/src/test/ref/inline-asm-optimized.log index 96a3e5b5e..bfb37297c 100644 --- a/src/test/ref/inline-asm-optimized.log +++ b/src/test/ref/inline-asm-optimized.log @@ -138,6 +138,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -197,6 +198,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -265,4 +267,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/inline-asm-ref-scoped.log b/src/test/ref/inline-asm-ref-scoped.log index 6d2a87c0e..fd0ddb715 100644 --- a/src/test/ref/inline-asm-ref-scoped.log +++ b/src/test/ref/inline-asm-ref-scoped.log @@ -133,6 +133,7 @@ sub: { //SEG17 [8] return rts } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement asm { lda#'c' stasub.ll+1 } always clobbers reg byte a @@ -194,6 +195,7 @@ sub: { //SEG17 [8] return rts } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -263,4 +265,5 @@ sub: { //SEG17 [8] return rts } +//SEG18 File Data diff --git a/src/test/ref/inline-asm-refout-const.log b/src/test/ref/inline-asm-refout-const.log index cf5f3c222..452a1ec34 100644 --- a/src/test/ref/inline-asm-refout-const.log +++ b/src/test/ref/inline-asm-refout-const.log @@ -119,6 +119,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" REGISTER UPLIFT POTENTIAL REGISTERS @@ -170,6 +171,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" ASSEMBLER OPTIMIZATIONS @@ -234,5 +236,6 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" diff --git a/src/test/ref/inline-asm-refout.log b/src/test/ref/inline-asm-refout.log index cab60047e..467558e44 100644 --- a/src/test/ref/inline-asm-refout.log +++ b/src/test/ref/inline-asm-refout.log @@ -142,6 +142,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data table: .text "cml!" REGISTER UPLIFT POTENTIAL REGISTERS @@ -197,6 +198,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data table: .text "cml!" ASSEMBLER OPTIMIZATIONS @@ -264,5 +266,6 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data table: .text "cml!" diff --git a/src/test/ref/inline-asm.log b/src/test/ref/inline-asm.log index f13f68297..56f60f7d6 100644 --- a/src/test/ref/inline-asm.log +++ b/src/test/ref/inline-asm.log @@ -100,6 +100,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement asm { lda#'a' ldx#$ff !: sta$0400,x sta$0500,x sta$0600,x sta$0700,x dex bne!- } always clobbers reg byte a reg byte x @@ -150,6 +151,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -209,4 +211,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/inline-assignment.log b/src/test/ref/inline-assignment.log index 3819c9834..6c526911f 100644 --- a/src/test/ref/inline-assignment.log +++ b/src/test/ref/inline-assignment.log @@ -202,6 +202,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::a#1 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -267,6 +268,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -351,4 +353,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/inline-function-if.log b/src/test/ref/inline-function-if.log index 45adaf30b..be7183a4b 100644 --- a/src/test/ref/inline-function-if.log +++ b/src/test/ref/inline-function-if.log @@ -326,6 +326,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) screen#0) ← (const byte) main::toUpper1_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -396,6 +397,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -493,4 +495,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/inline-function-level2.log b/src/test/ref/inline-function-level2.log index 5d62e74a9..f24930e4e 100644 --- a/src/test/ref/inline-function-level2.log +++ b/src/test/ref/inline-function-level2.log @@ -833,6 +833,7 @@ main: { //SEG58 [25] return rts } +//SEG59 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::sc#2) ← (byte) ' ' [ main::sc#2 ] ( main:2 [ main::sc#2 ] ) always clobbers reg byte a reg byte y @@ -1077,6 +1078,7 @@ main: { //SEG58 [25] return rts } +//SEG59 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1368,4 +1370,5 @@ main: { //SEG58 [25] return rts } +//SEG59 File Data diff --git a/src/test/ref/inline-function-min.log b/src/test/ref/inline-function-min.log index 72d9297c2..610bd443f 100644 --- a/src/test/ref/inline-function-min.log +++ b/src/test/ref/inline-function-min.log @@ -365,6 +365,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) screen#0) ← (const byte) main::sum1_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -453,6 +454,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -577,4 +579,5 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data diff --git a/src/test/ref/inline-function-print.log b/src/test/ref/inline-function-print.log index dee3ba673..2186d357b 100644 --- a/src/test/ref/inline-function-print.log +++ b/src/test/ref/inline-function-print.log @@ -417,6 +417,7 @@ main: { rts hello: .text "hello world!@" } +//SEG39 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a @@ -540,6 +541,7 @@ main: { rts hello: .text "hello world!@" } +//SEG39 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -691,4 +693,5 @@ main: { rts hello: .text "hello world!@" } +//SEG39 File Data diff --git a/src/test/ref/inline-function.log b/src/test/ref/inline-function.log index 9d7e3c7f9..1ffe93820 100644 --- a/src/test/ref/inline-function.log +++ b/src/test/ref/inline-function.log @@ -503,6 +503,7 @@ main: { sta BGCOL jmp b1 } +//SEG25 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -598,6 +599,7 @@ main: { sta BGCOL jmp b1 } +//SEG25 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -734,4 +736,5 @@ main: { sta BGCOL jmp b1 } +//SEG25 File Data diff --git a/src/test/ref/inline-kasm-clobber.log b/src/test/ref/inline-kasm-clobber.log index acdf47f42..3ca4fda23 100644 --- a/src/test/ref/inline-kasm-clobber.log +++ b/src/test/ref/inline-kasm-clobber.log @@ -332,6 +332,7 @@ main: { //SEG36 [15] return rts } +//SEG37 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement kickasm( uses SCREEN#0) {{ lda #0 @@ -461,6 +462,7 @@ main: { //SEG36 [15] return rts } +//SEG37 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -603,4 +605,5 @@ main: { //SEG36 [15] return rts } +//SEG37 File Data diff --git a/src/test/ref/inline-kasm-data.log b/src/test/ref/inline-kasm-data.log index 25850d761..176c8cab6 100644 --- a/src/test/ref/inline-kasm-data.log +++ b/src/test/ref/inline-kasm-data.log @@ -281,6 +281,7 @@ main: { //SEG29 [13] return rts } +//SEG30 File Data .pc = sintab "sintab" .fill 25, 20 + 20*sin(toRadians(i*360/25)) @@ -305,8 +306,8 @@ REGISTER UPLIFT SCOPES Uplift Scope [main] 22: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 15.4: zp ZP_WORD:3 [ main::screen#2 main::screen#1 ] 13.93: zp ZP_WORD:5 [ main::cols#2 main::cols#1 ] 11: zp ZP_BYTE:7 [ main::sin#0 ] Uplift Scope [] -Uplifting [main] best 1204 combination reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:3 [ main::screen#2 main::screen#1 ] zp ZP_WORD:5 [ main::cols#2 main::cols#1 ] reg byte y [ main::sin#0 ] -Uplifting [] best 1204 combination +Uplifting [main] best 3508 combination reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:3 [ main::screen#2 main::screen#1 ] zp ZP_WORD:5 [ main::cols#2 main::cols#1 ] reg byte y [ main::sin#0 ] +Uplifting [] best 3508 combination Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ main::screen#2 main::screen#1 ] Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ main::cols#2 main::cols#1 ] @@ -398,6 +399,7 @@ main: { //SEG29 [13] return rts } +//SEG30 File Data .pc = sintab "sintab" .fill 25, 20 + 20*sin(toRadians(i*360/25)) @@ -455,7 +457,7 @@ reg byte y [ main::sin#0 ] FINAL ASSEMBLER -Score: 1102 +Score: 3406 //SEG0 File Comments // Example of inline kickasm data @@ -529,6 +531,7 @@ main: { //SEG29 [13] return rts } +//SEG30 File Data .pc = sintab "sintab" .fill 25, 20 + 20*sin(toRadians(i*360/25)) diff --git a/src/test/ref/inline-kasm-loop.log b/src/test/ref/inline-kasm-loop.log index 3532f3662..672573cbc 100644 --- a/src/test/ref/inline-kasm-loop.log +++ b/src/test/ref/inline-kasm-loop.log @@ -139,6 +139,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0+(word) $3e8) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -190,6 +191,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -252,4 +254,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/inline-kasm-refout.log b/src/test/ref/inline-kasm-refout.log index 0944678d0..d718dc16b 100644 --- a/src/test/ref/inline-kasm-refout.log +++ b/src/test/ref/inline-kasm-refout.log @@ -134,6 +134,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" REGISTER UPLIFT POTENTIAL REGISTERS @@ -185,6 +186,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" ASSEMBLER OPTIMIZATIONS @@ -250,5 +252,6 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data table: .text "cml!" diff --git a/src/test/ref/inline-kasm-resource.log b/src/test/ref/inline-kasm-resource.log index 1841bcf46..71c570fe4 100644 --- a/src/test/ref/inline-kasm-resource.log +++ b/src/test/ref/inline-kasm-resource.log @@ -217,6 +217,7 @@ main: { //SEG16 [8] return rts } +//SEG17 File Data .pc = SPRITE "SPRITE" .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) @@ -234,8 +235,8 @@ REGISTER UPLIFT SCOPES Uplift Scope [main] Uplift Scope [] -Uplifting [main] best 301 combination -Uplifting [] best 301 combination +Uplifting [main] best 2605 combination +Uplifting [] best 2605 combination ASSEMBLER BEFORE OPTIMIZATION //SEG0 File Comments @@ -285,6 +286,7 @@ main: { //SEG16 [8] return rts } +//SEG17 File Data .pc = SPRITE "SPRITE" .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) @@ -332,7 +334,7 @@ FINAL SYMBOL TABLE FINAL ASSEMBLER -Score: 284 +Score: 2588 //SEG0 File Comments // Example of inline kickasm resource data @@ -370,6 +372,7 @@ main: { //SEG16 [8] return rts } +//SEG17 File Data .pc = SPRITE "SPRITE" .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) diff --git a/src/test/ref/inline-pointer-0.log b/src/test/ref/inline-pointer-0.log index a1ede0c84..e5e91d6fc 100644 --- a/src/test/ref/inline-pointer-0.log +++ b/src/test/ref/inline-pointer-0.log @@ -133,6 +133,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -178,6 +179,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -234,4 +236,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/inline-pointer-1.log b/src/test/ref/inline-pointer-1.log index 9511d2358..dce5411a5 100644 --- a/src/test/ref/inline-pointer-1.log +++ b/src/test/ref/inline-pointer-1.log @@ -258,6 +258,7 @@ puta: { //SEG27 [12] return rts } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [11] *((byte*)(word) puta::screen#0) ← (byte) 'a' [ ] ( main:2::puta:5 [ ] main:2::puta:7 [ ] ) always clobbers reg byte a reg byte y @@ -345,6 +346,7 @@ puta: { //SEG27 [12] return rts } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -447,4 +449,5 @@ puta: { //SEG27 [12] return rts } +//SEG28 File Data diff --git a/src/test/ref/inline-pointer-2.log b/src/test/ref/inline-pointer-2.log index 79c7cfcc6..2916c55d7 100644 --- a/src/test/ref/inline-pointer-2.log +++ b/src/test/ref/inline-pointer-2.log @@ -152,6 +152,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -197,6 +198,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -253,4 +255,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/inline-string-2.log b/src/test/ref/inline-string-2.log index 67fa30f84..000e19821 100644 --- a/src/test/ref/inline-string-2.log +++ b/src/test/ref/inline-string-2.log @@ -494,6 +494,7 @@ print: { !: jmp b1_from_b2 } +//SEG49 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [13] (byte*) print::msg#0 ← (byte*) print_msg::msg#3 [ screen#18 print::msg#0 ] ( main:2::print_msg:5 [ screen#18 print::msg#0 ] main:2::print_msg:7 [ screen#18 print::msg#0 ] ) always clobbers reg byte a @@ -658,6 +659,7 @@ print: { !: jmp b1_from_b2 } +//SEG49 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -847,4 +849,5 @@ print: { !: jmp b1 } +//SEG49 File Data diff --git a/src/test/ref/inline-string-3.log b/src/test/ref/inline-string-3.log index fa9b53c58..9b970b8f2 100644 --- a/src/test/ref/inline-string-3.log +++ b/src/test/ref/inline-string-3.log @@ -199,6 +199,7 @@ main: { rts STRING: .text "camelot" } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::PTR#0) ← <(const byte[]) main::STRING#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -265,6 +266,7 @@ main: { rts STRING: .text "camelot" } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -345,4 +347,5 @@ main: { rts STRING: .text "camelot" } +//SEG16 File Data diff --git a/src/test/ref/inline-string.log b/src/test/ref/inline-string.log index c562255c7..4522c4a3d 100644 --- a/src/test/ref/inline-string.log +++ b/src/test/ref/inline-string.log @@ -378,6 +378,7 @@ print: { !: jmp b1_from_b2 } +//SEG41 File Data msg1: .text "message 1 @" REGISTER UPLIFT POTENTIAL REGISTERS @@ -515,6 +516,7 @@ print: { !: jmp b1_from_b2 } +//SEG41 File Data msg1: .text "message 1 @" ASSEMBLER OPTIMIZATIONS @@ -679,5 +681,6 @@ print: { !: jmp b1 } +//SEG41 File Data msg1: .text "message 1 @" diff --git a/src/test/ref/inline-word-0.log b/src/test/ref/inline-word-0.log index 4902830a7..bd5f5e4f3 100644 --- a/src/test/ref/inline-word-0.log +++ b/src/test/ref/inline-word-0.log @@ -157,6 +157,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const word*) main::screen#0) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -205,6 +206,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -266,4 +268,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/inline-word-1.log b/src/test/ref/inline-word-1.log index 678c44eee..5719ceee5 100644 --- a/src/test/ref/inline-word-1.log +++ b/src/test/ref/inline-word-1.log @@ -157,6 +157,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const word*) main::screen#0) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -205,6 +206,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -266,4 +268,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/inline-word-2.log b/src/test/ref/inline-word-2.log index ff814450c..762a8e435 100644 --- a/src/test/ref/inline-word-2.log +++ b/src/test/ref/inline-word-2.log @@ -157,6 +157,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const word*) main::screen#0) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -205,6 +206,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -266,4 +268,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/inline-word.log b/src/test/ref/inline-word.log index 857c7be69..651622fe1 100644 --- a/src/test/ref/inline-word.log +++ b/src/test/ref/inline-word.log @@ -324,6 +324,7 @@ main: { rts his: .byte >SCREEN, >SCREEN+$100, >SCREEN+$200 } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (word) main::w#0 ← *((const byte[]) main::his#0 + (byte) main::h#4) w= (byte) main::l#2 [ main::h#4 main::l#2 main::w#0 ] ( main:2 [ main::h#4 main::l#2 main::w#0 ] ) always clobbers reg byte a @@ -430,6 +431,7 @@ main: { rts his: .byte >SCREEN, >SCREEN+$100, >SCREEN+$200 } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -554,4 +556,5 @@ main: { rts his: .byte >SCREEN, >SCREEN+$100, >SCREEN+$200 } +//SEG30 File Data diff --git a/src/test/ref/inlinearrayproblem.log b/src/test/ref/inlinearrayproblem.log index 188a9be3e..83b0d8dec 100644 --- a/src/test/ref/inlinearrayproblem.log +++ b/src/test/ref/inlinearrayproblem.log @@ -212,6 +212,7 @@ main: { txt: .text "qwe" data: .byte 1, 2, 3 } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← *((const byte[]) main::txt#0 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -287,6 +288,7 @@ main: { txt: .text "qwe" data: .byte 1, 2, 3 } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -381,4 +383,5 @@ main: { txt: .text "qwe" data: .byte 1, 2, 3 } +//SEG22 File Data diff --git a/src/test/ref/inmem-const-array.log b/src/test/ref/inmem-const-array.log index e0d2dac51..6cac42012 100644 --- a/src/test/ref/inmem-const-array.log +++ b/src/test/ref/inmem-const-array.log @@ -335,6 +335,7 @@ main: { rts colseq: .byte WHITE, RED, GREEN } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 main::j#3 ] ( main:2 [ main::i#2 main::j#3 ] ) always clobbers reg byte a @@ -436,6 +437,7 @@ main: { rts colseq: .byte WHITE, RED, GREEN } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -566,4 +568,5 @@ main: { rts colseq: .byte WHITE, RED, GREEN } +//SEG33 File Data diff --git a/src/test/ref/inmemarray.log b/src/test/ref/inmemarray.log index bf31a731b..ea747982d 100644 --- a/src/test/ref/inmemarray.log +++ b/src/test/ref/inmemarray.log @@ -294,6 +294,7 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data TXT: .byte 3, 1, $d, 5, $c, $f, $14, $20 REGISTER UPLIFT POTENTIAL REGISTERS @@ -386,6 +387,7 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data TXT: .byte 3, 1, $d, 5, $c, $f, $14, $20 ASSEMBLER OPTIMIZATIONS @@ -501,5 +503,6 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data TXT: .byte 3, 1, $d, 5, $c, $f, $14, $20 diff --git a/src/test/ref/inmemstring.log b/src/test/ref/inmemstring.log index 890fe8df3..e914f6b33 100644 --- a/src/test/ref/inmemstring.log +++ b/src/test/ref/inmemstring.log @@ -297,6 +297,7 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data TEXT: .text "camelot " REGISTER UPLIFT POTENTIAL REGISTERS @@ -406,6 +407,7 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data TEXT: .text "camelot " ASSEMBLER OPTIMIZATIONS @@ -536,5 +538,6 @@ main: { //SEG31 [13] return rts } +//SEG32 File Data TEXT: .text "camelot " diff --git a/src/test/ref/int-conversion.log b/src/test/ref/int-conversion.log index 8a548a566..e414b8cde 100644 --- a/src/test/ref/int-conversion.log +++ b/src/test/ref/int-conversion.log @@ -2457,6 +2457,7 @@ testUnaryOperator: { //SEG335 [106] return rts } +//SEG336 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::s#2) ← (byte) ' ' [ main::s#2 ] ( main:2 [ main::s#2 ] ) always clobbers reg byte a reg byte y @@ -3261,6 +3262,7 @@ testUnaryOperator: { //SEG335 [106] return rts } +//SEG336 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -4179,4 +4181,5 @@ testUnaryOperator: { //SEG335 [106] return rts } +//SEG336 File Data diff --git a/src/test/ref/int-literals.log b/src/test/ref/int-literals.log index 553d5c451..f36b06f44 100644 --- a/src/test/ref/int-literals.log +++ b/src/test/ref/int-literals.log @@ -1133,6 +1133,7 @@ assertType: { sta COLS,y jmp b2 } +//SEG142 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*) main::s#2) ← (byte) ' ' [ main::s#2 ] ( main:2 [ main::s#2 ] ) always clobbers reg byte a reg byte y @@ -1516,6 +1517,7 @@ assertType: { sta COLS,x jmp b2 } +//SEG142 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1955,4 +1957,5 @@ assertType: { sta COLS,x jmp b2 } +//SEG142 File Data diff --git a/src/test/ref/interrupt-volatile-reuse-problem1.log b/src/test/ref/interrupt-volatile-reuse-problem1.log index f6a062550..3cad2ca0f 100644 --- a/src/test/ref/interrupt-volatile-reuse-problem1.log +++ b/src/test/ref/interrupt-volatile-reuse-problem1.log @@ -237,6 +237,7 @@ irq: { //SEG22 [11] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a @@ -324,6 +325,7 @@ irq: { //SEG22 [11] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -422,4 +424,5 @@ irq: { //SEG22 [11] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data diff --git a/src/test/ref/interrupt-volatile-reuse-problem2.log b/src/test/ref/interrupt-volatile-reuse-problem2.log index 2b54c32fb..410873553 100644 --- a/src/test/ref/interrupt-volatile-reuse-problem2.log +++ b/src/test/ref/interrupt-volatile-reuse-problem2.log @@ -473,6 +473,7 @@ irq: { //SEG46 [21] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG47 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) col1#0 ← (byte) 0 [ ] ( ) always clobbers reg byte a @@ -639,6 +640,7 @@ irq: { //SEG46 [21] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG47 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -827,4 +829,5 @@ irq: { //SEG46 [21] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG47 File Data diff --git a/src/test/ref/irq-hardware-clobber-jsr.log b/src/test/ref/irq-hardware-clobber-jsr.log index 775c05bb7..1aa9ab3ea 100644 --- a/src/test/ref/irq-hardware-clobber-jsr.log +++ b/src/test/ref/irq-hardware-clobber-jsr.log @@ -465,6 +465,7 @@ do_irq: { //SEG31 [20] return rts } +//SEG32 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -621,6 +622,7 @@ do_irq: { //SEG31 [20] return rts } +//SEG32 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -801,4 +803,5 @@ do_irq: { //SEG31 [20] return rts } +//SEG32 File Data diff --git a/src/test/ref/irq-hardware-clobber.log b/src/test/ref/irq-hardware-clobber.log index 7c918cfab..6644d9e20 100644 --- a/src/test/ref/irq-hardware-clobber.log +++ b/src/test/ref/irq-hardware-clobber.log @@ -386,6 +386,7 @@ irq: { ldy #00 rti } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -524,6 +525,7 @@ irq: { lda #00 rti } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -686,4 +688,5 @@ irq: { lda #00 rti } +//SEG28 File Data diff --git a/src/test/ref/irq-hardware.log b/src/test/ref/irq-hardware.log index d1ab18acf..72bdbd246 100644 --- a/src/test/ref/irq-hardware.log +++ b/src/test/ref/irq-hardware.log @@ -386,6 +386,7 @@ irq: { ldy #00 rti } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -523,6 +524,7 @@ irq: { ldy #00 rti } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -691,4 +693,5 @@ irq: { ldy #00 rti } +//SEG28 File Data diff --git a/src/test/ref/irq-idx-problem.log b/src/test/ref/irq-idx-problem.log index 1e4fb8568..f5ff4d34e 100644 --- a/src/test/ref/irq-idx-problem.log +++ b/src/test/ref/irq-idx-problem.log @@ -672,6 +672,7 @@ table_driven_irq: { sta VIC_BASE,y jmp b1_from_b2 } +//SEG47 File Data IRQ_CHANGE_VAL: .byte $b, $b, $63, 0, 0, $80, 7, 7, $83, 0, 0, $60 IRQ_CHANGE_IDX: .byte $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT @@ -875,6 +876,7 @@ table_driven_irq: { sta VIC_BASE,y jmp b1_from_b2 } +//SEG47 File Data IRQ_CHANGE_VAL: .byte $b, $b, $63, 0, 0, $80, 7, 7, $83, 0, 0, $60 IRQ_CHANGE_IDX: .byte $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT @@ -1113,6 +1115,7 @@ table_driven_irq: { sta VIC_BASE,y jmp b1 } +//SEG47 File Data IRQ_CHANGE_VAL: .byte $b, $b, $63, 0, 0, $80, 7, 7, $83, 0, 0, $60 IRQ_CHANGE_IDX: .byte $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT, $20, $21, IRQ_CHANGE_NEXT diff --git a/src/test/ref/irq-kernel-minimal.log b/src/test/ref/irq-kernel-minimal.log index 2c39005d6..aa51bd49d 100644 --- a/src/test/ref/irq-kernel-minimal.log +++ b/src/test/ref/irq-kernel-minimal.log @@ -240,6 +240,7 @@ irq: { //SEG20 [10] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_KEYBOARD)(void()) irq() [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -317,6 +318,7 @@ irq: { //SEG20 [10] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -409,4 +411,5 @@ irq: { //SEG20 [10] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG21 File Data diff --git a/src/test/ref/irq-kernel.log b/src/test/ref/irq-kernel.log index 9b81f2012..9e8f8d842 100644 --- a/src/test/ref/irq-kernel.log +++ b/src/test/ref/irq-kernel.log @@ -293,6 +293,7 @@ irq: { //SEG25 [15] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG26 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -400,6 +401,7 @@ irq: { //SEG25 [15] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG26 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -531,4 +533,5 @@ irq: { //SEG25 [15] return - exit interrupt(KERNEL_KEYBOARD) jmp $ea31 } +//SEG26 File Data diff --git a/src/test/ref/irq-local-var-overlap-problem.log b/src/test/ref/irq-local-var-overlap-problem.log index 3f4de55be..a54682927 100644 --- a/src/test/ref/irq-local-var-overlap-problem.log +++ b/src/test/ref/irq-local-var-overlap-problem.log @@ -1348,6 +1348,7 @@ sub_irq: { //SEG142 [69] return rts } +//SEG143 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -1843,6 +1844,7 @@ sub_irq: { //SEG142 [69] return rts } +//SEG143 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -2390,4 +2392,5 @@ sub_irq: { //SEG142 [69] return rts } +//SEG143 File Data diff --git a/src/test/ref/irq-raster.log b/src/test/ref/irq-raster.log index 122c29156..2a7d48a89 100644 --- a/src/test/ref/irq-raster.log +++ b/src/test/ref/irq-raster.log @@ -293,6 +293,7 @@ irq: { //SEG25 [15] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG26 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -400,6 +401,7 @@ irq: { //SEG25 [15] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG26 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -531,4 +533,5 @@ irq: { //SEG25 [15] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG26 File Data diff --git a/src/test/ref/irq-volatile-bool-problem.log b/src/test/ref/irq-volatile-bool-problem.log index 23323c246..cc7abd97d 100644 --- a/src/test/ref/irq-volatile-bool-problem.log +++ b/src/test/ref/irq-volatile-bool-problem.log @@ -445,6 +445,7 @@ irq: { //SEG39 [21] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG40 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [1] (bool) framedone#11 ← false [ framedone#11 ] ( ) always clobbers reg byte a @@ -594,6 +595,7 @@ irq: { //SEG39 [21] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG40 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -780,4 +782,5 @@ irq: { //SEG39 [21] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG40 File Data diff --git a/src/test/ref/iterarray.log b/src/test/ref/iterarray.log index ec49393d2..3ee818564 100644 --- a/src/test/ref/iterarray.log +++ b/src/test/ref/iterarray.log @@ -210,6 +210,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -276,6 +277,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -361,4 +363,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/keyboard-glitch.log b/src/test/ref/keyboard-glitch.log index 125937a67..3cbb701d6 100644 --- a/src/test/ref/keyboard-glitch.log +++ b/src/test/ref/keyboard-glitch.log @@ -1033,6 +1033,7 @@ pressed: { //SEG84 [49] return rts } +//SEG85 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -1332,6 +1333,7 @@ pressed: { //SEG84 [49] return rts } +//SEG85 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -1687,6 +1689,7 @@ pressed: { //SEG84 [49] return rts } +//SEG85 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) diff --git a/src/test/ref/line-anim.asm b/src/test/ref/line-anim.asm index b41603f3f..f741d35a3 100644 --- a/src/test/ref/line-anim.asm +++ b/src/test/ref/line-anim.asm @@ -237,24 +237,20 @@ point_init: { jmp b5 abs16s2_b1: sec - lda y_diff - eor #$ff - adc #0 + lda #0 + sbc y_diff sta abs16s2_return - lda y_diff+1 - eor #$ff - adc #0 + lda #0 + sbc y_diff+1 sta abs16s2_return+1 jmp b6 abs16s1_b1: sec - lda x_diff - eor #$ff - adc #0 + lda #0 + sbc x_diff sta abs16s1_return - lda x_diff+1 - eor #$ff - adc #0 + lda #0 + sbc x_diff+1 sta abs16s1_return+1 jmp abs16s2 } @@ -282,25 +278,21 @@ divr16s: { cpy #0 beq breturn sec - lda return - eor #$ff - adc #0 + lda #0 + sbc return sta return - lda return+1 - eor #$ff - adc #0 + lda #0 + sbc return+1 sta return+1 breturn: rts b3: sec - lda divisoru - eor #$ff - adc #0 + lda #0 + sbc divisoru sta divisoru - lda divisoru+1 - eor #$ff - adc #0 + lda #0 + sbc divisoru+1 sta divisoru+1 tya eor #1 @@ -308,13 +300,11 @@ divr16s: { jmp b4 b1: sec - lda remu - eor #$ff - adc #0 + lda #0 + sbc remu sta remu - lda remu+1 - eor #$ff - adc #0 + lda #0 + sbc remu+1 sta remu+1 ldy #1 jmp b2 diff --git a/src/test/ref/line-anim.log b/src/test/ref/line-anim.log index a595b6ac4..067876ed0 100644 --- a/src/test/ref/line-anim.log +++ b/src/test/ref/line-anim.log @@ -3298,13 +3298,11 @@ point_init: { abs16s2_b1: //SEG110 [66] (signed word) point_init::abs16s2_return#0 ← - (signed word) point_init::y_diff#0 -- vwsz1=_neg_vwsz2 sec - lda y_diff - eor #$ff - adc #0 + lda #0 + sbc y_diff sta abs16s2_return - lda y_diff+1 - eor #$ff - adc #0 + lda #0 + sbc y_diff+1 sta abs16s2_return+1 //SEG111 [67] (word~) point_init::abs16s2_return#5 ← (word)(signed word) point_init::abs16s2_return#0 -- vwuz1=vwuz2 lda abs16s2_return @@ -3316,13 +3314,11 @@ point_init: { abs16s1_b1: //SEG113 [68] (signed word) point_init::abs16s1_return#0 ← - (signed word) point_init::x_diff#1 -- vwsz1=_neg_vwsz2 sec - lda x_diff - eor #$ff - adc #0 + lda #0 + sbc x_diff sta abs16s1_return - lda x_diff+1 - eor #$ff - adc #0 + lda #0 + sbc x_diff+1 sta abs16s1_return+1 //SEG114 [69] (word~) point_init::abs16s1_return#5 ← (word)(signed word) point_init::abs16s1_return#0 -- vwuz1=vwuz2 lda abs16s1_return @@ -3431,13 +3427,11 @@ divr16s: { b8: //SEG140 [83] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0 -- vwsz1=_neg_vwsz2 sec - lda resultu - eor #$ff - adc #0 + lda #0 + sbc resultu sta return - lda resultu+1 - eor #$ff - adc #0 + lda #0 + sbc resultu+1 sta return+1 //SEG141 [84] phi from divr16s::@5 divr16s::@8 to divr16s::@return [phi:divr16s::@5/divr16s::@8->divr16s::@return] breturn_from_b5: @@ -3460,13 +3454,11 @@ divr16s: { b3: //SEG148 [87] (signed word) divr16s::divisoru#1 ← - (signed word) divr16s::divisor#0 -- vwsz1=_neg_vwsz2 sec - lda divisor - eor #$ff - adc #0 + lda #0 + sbc divisor sta divisoru - lda divisor+1 - eor #$ff - adc #0 + lda #0 + sbc divisor+1 sta divisoru+1 //SEG149 [88] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte) 1 -- vbuz1=vbuz1_bxor_vbuc1 lda #1 @@ -3482,13 +3474,11 @@ divr16s: { b1: //SEG152 [90] (signed word) divr16s::remu#1 ← - (signed word) divr16s::rem#0 -- vwsz1=_neg_vwsz2 sec - lda rem - eor #$ff - adc #0 + lda #0 + sbc rem sta remu - lda rem+1 - eor #$ff - adc #0 + lda #0 + sbc rem+1 sta remu+1 //SEG153 [91] (word~) divr16s::remu#7 ← (word)(signed word) divr16s::remu#1 -- vwuz1=vwuz2 lda remu @@ -3905,6 +3895,7 @@ bitmap_init: { //SEG284 [151] return rts } +//SEG285 File Data // The coordinates of the lines to animate x_start: .word $a, $14, $1e, $1e y_start: .byte $a, $a, $a, $14 @@ -4149,31 +4140,31 @@ Uplift Scope [main] 24.36: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:3 Uplift Scope [bitmap_plot] 15: zp ZP_BYTE:38 [ bitmap_plot::y#0 ] 4: zp ZP_WORD:41 [ bitmap_plot::$1 ] 4: zp ZP_BYTE:45 [ bitmap_plot::$2 ] 3: zp ZP_WORD:36 [ bitmap_plot::x#0 ] 3: zp ZP_WORD:43 [ bitmap_plot::plotter#1 ] 1: zp ZP_WORD:39 [ bitmap_plot::plotter#0 ] Uplift Scope [] -Uplifting [divr16u] best 30457 combination zp ZP_WORD:14 [ divr16u::rem#4 divr16u::rem#3 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:16 [ divr16u::dividend#2 divr16u::dividend#0 ] zp ZP_WORD:76 [ divr16u::divisor#0 ] zp ZP_WORD:78 [ divr16u::return#2 ] -Uplifting [bitmap_clear] best 29557 combination zp ZP_WORD:26 [ bitmap_clear::bitmap#2 bitmap_clear::bitmap#3 bitmap_clear::bitmap#5 bitmap_clear::bitmap#1 ] reg byte x [ bitmap_clear::x#2 bitmap_clear::x#1 ] zp ZP_BYTE:25 [ bitmap_clear::y#4 bitmap_clear::y#1 ] zp ZP_WORD:88 [ bitmap_clear::bitmap#0 ] -Uplifting [screen_fill] best 28657 combination zp ZP_WORD:22 [ screen_fill::screen#2 screen_fill::screen#3 screen_fill::screen#1 ] reg byte x [ screen_fill::x#2 screen_fill::x#1 ] zp ZP_BYTE:21 [ screen_fill::y#4 screen_fill::y#1 ] -Uplifting [bitmap_init] best 28147 combination zp ZP_WORD:32 [ 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:92 [ bitmap_init::$5 ] zp ZP_BYTE:93 [ bitmap_init::$6 ] zp ZP_BYTE:90 [ bitmap_init::$7 ] +Uplifting [divr16u] best 30437 combination zp ZP_WORD:14 [ divr16u::rem#4 divr16u::rem#3 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:16 [ divr16u::dividend#2 divr16u::dividend#0 ] zp ZP_WORD:76 [ divr16u::divisor#0 ] zp ZP_WORD:78 [ divr16u::return#2 ] +Uplifting [bitmap_clear] best 29537 combination zp ZP_WORD:26 [ bitmap_clear::bitmap#2 bitmap_clear::bitmap#3 bitmap_clear::bitmap#5 bitmap_clear::bitmap#1 ] reg byte x [ bitmap_clear::x#2 bitmap_clear::x#1 ] zp ZP_BYTE:25 [ bitmap_clear::y#4 bitmap_clear::y#1 ] zp ZP_WORD:88 [ bitmap_clear::bitmap#0 ] +Uplifting [screen_fill] best 28637 combination zp ZP_WORD:22 [ screen_fill::screen#2 screen_fill::screen#3 screen_fill::screen#1 ] reg byte x [ screen_fill::x#2 screen_fill::x#1 ] zp ZP_BYTE:21 [ screen_fill::y#4 screen_fill::y#1 ] +Uplifting [bitmap_init] best 28127 combination zp ZP_WORD:32 [ 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:92 [ bitmap_init::$5 ] zp ZP_BYTE:93 [ bitmap_init::$6 ] zp ZP_BYTE:90 [ bitmap_init::$7 ] Limited combination testing to 100 combinations of 15360 possible. -Uplifting [point_init] best 28121 combination zp ZP_WORD:5 [ point_init::abs16s2_return#2 point_init::abs16s2_return#5 point_init::abs16s2_return#6 ] zp ZP_WORD:3 [ point_init::abs16s1_return#2 point_init::abs16s1_return#5 point_init::abs16s1_return#6 ] zp ZP_WORD:51 [ point_init::$4 ] zp ZP_WORD:56 [ point_init::$9 ] zp ZP_WORD:58 [ point_init::$10 ] zp ZP_WORD:60 [ point_init::$11 ] zp ZP_WORD:68 [ point_init::x_stepf#0 ] reg byte a [ point_init::$14 ] reg byte a [ point_init::$18 ] zp ZP_WORD:49 [ point_init::$3 ] reg byte a [ point_init::$16 ] zp ZP_WORD:72 [ point_init::abs16s2_return#0 ] zp ZP_WORD:74 [ point_init::abs16s1_return#0 ] reg byte x [ point_init::$20 ] zp ZP_BYTE:34 [ point_init::point_idx#0 ] zp ZP_WORD:47 [ point_init::x_diff#1 ] zp ZP_WORD:53 [ point_init::y_diff#0 ] +Uplifting [point_init] best 28101 combination zp ZP_WORD:5 [ point_init::abs16s2_return#2 point_init::abs16s2_return#5 point_init::abs16s2_return#6 ] zp ZP_WORD:3 [ point_init::abs16s1_return#2 point_init::abs16s1_return#5 point_init::abs16s1_return#6 ] zp ZP_WORD:51 [ point_init::$4 ] zp ZP_WORD:56 [ point_init::$9 ] zp ZP_WORD:58 [ point_init::$10 ] zp ZP_WORD:60 [ point_init::$11 ] zp ZP_WORD:68 [ point_init::x_stepf#0 ] reg byte a [ point_init::$14 ] reg byte a [ point_init::$18 ] zp ZP_WORD:49 [ point_init::$3 ] reg byte a [ point_init::$16 ] zp ZP_WORD:72 [ point_init::abs16s2_return#0 ] zp ZP_WORD:74 [ point_init::abs16s1_return#0 ] reg byte x [ point_init::$20 ] zp ZP_BYTE:34 [ point_init::point_idx#0 ] zp ZP_WORD:47 [ point_init::x_diff#1 ] zp ZP_WORD:53 [ point_init::y_diff#0 ] Limited combination testing to 100 combinations of 576 possible. -Uplifting [divr16s] best 28110 combination zp ZP_WORD:9 [ divr16s::divisoru#3 divr16s::divisoru#4 divr16s::divisoru#5 ] zp ZP_WORD:12 [ divr16s::return#2 divr16s::return#1 divr16s::return#7 ] zp ZP_WORD:7 [ divr16s::remu#3 divr16s::remu#7 divr16s::remu#8 ] reg byte y [ divr16s::neg#4 divr16s::neg#2 divr16s::neg#3 ] zp ZP_WORD:66 [ divr16s::return#3 ] zp ZP_WORD:64 [ divr16s::rem#0 ] zp ZP_WORD:84 [ divr16s::remu#1 ] zp ZP_WORD:80 [ divr16s::resultu#0 ] zp ZP_WORD:82 [ divr16s::divisoru#1 ] zp ZP_WORD:62 [ divr16s::divisor#0 ] -Uplifting [main] best 28070 combination zp ZP_BYTE:2 [ main::i#2 main::i#1 ] reg byte a [ main::$13 ] -Uplifting [bitmap_plot] best 28033 combination reg byte x [ bitmap_plot::y#0 ] zp ZP_WORD:41 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:36 [ bitmap_plot::x#0 ] zp ZP_WORD:43 [ bitmap_plot::plotter#1 ] zp ZP_WORD:39 [ bitmap_plot::plotter#0 ] -Uplifting [] best 28033 combination +Uplifting [divr16s] best 28090 combination zp ZP_WORD:9 [ divr16s::divisoru#3 divr16s::divisoru#4 divr16s::divisoru#5 ] zp ZP_WORD:12 [ divr16s::return#2 divr16s::return#1 divr16s::return#7 ] zp ZP_WORD:7 [ divr16s::remu#3 divr16s::remu#7 divr16s::remu#8 ] reg byte y [ divr16s::neg#4 divr16s::neg#2 divr16s::neg#3 ] zp ZP_WORD:66 [ divr16s::return#3 ] zp ZP_WORD:64 [ divr16s::rem#0 ] zp ZP_WORD:84 [ divr16s::remu#1 ] zp ZP_WORD:80 [ divr16s::resultu#0 ] zp ZP_WORD:82 [ divr16s::divisoru#1 ] zp ZP_WORD:62 [ divr16s::divisor#0 ] +Uplifting [main] best 28050 combination zp ZP_BYTE:2 [ main::i#2 main::i#1 ] reg byte a [ main::$13 ] +Uplifting [bitmap_plot] best 28013 combination reg byte x [ bitmap_plot::y#0 ] zp ZP_WORD:41 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp ZP_WORD:36 [ bitmap_plot::x#0 ] zp ZP_WORD:43 [ bitmap_plot::plotter#1 ] zp ZP_WORD:39 [ bitmap_plot::plotter#0 ] +Uplifting [] best 28013 combination Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::i#2 main::i#1 ] -Uplifting [main] best 28033 combination zp ZP_BYTE:2 [ main::i#2 main::i#1 ] +Uplifting [main] best 28013 combination zp ZP_BYTE:2 [ main::i#2 main::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:92 [ bitmap_init::$5 ] -Uplifting [bitmap_init] best 27973 combination reg byte a [ bitmap_init::$5 ] +Uplifting [bitmap_init] best 27953 combination reg byte a [ bitmap_init::$5 ] Attempting to uplift remaining variables inzp ZP_BYTE:93 [ bitmap_init::$6 ] -Uplifting [bitmap_init] best 27913 combination reg byte a [ bitmap_init::$6 ] +Uplifting [bitmap_init] best 27893 combination reg byte a [ bitmap_init::$6 ] Attempting to uplift remaining variables inzp ZP_BYTE:21 [ screen_fill::y#4 screen_fill::y#1 ] -Uplifting [screen_fill] best 27913 combination zp ZP_BYTE:21 [ screen_fill::y#4 screen_fill::y#1 ] +Uplifting [screen_fill] best 27893 combination zp ZP_BYTE:21 [ screen_fill::y#4 screen_fill::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ bitmap_clear::y#4 bitmap_clear::y#1 ] -Uplifting [bitmap_clear] best 27913 combination zp ZP_BYTE:25 [ bitmap_clear::y#4 bitmap_clear::y#1 ] +Uplifting [bitmap_clear] best 27893 combination zp ZP_BYTE:25 [ bitmap_clear::y#4 bitmap_clear::y#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:90 [ bitmap_init::$7 ] -Uplifting [bitmap_init] best 27913 combination zp ZP_BYTE:90 [ bitmap_init::$7 ] +Uplifting [bitmap_init] best 27893 combination zp ZP_BYTE:90 [ bitmap_init::$7 ] Attempting to uplift remaining variables inzp ZP_BYTE:34 [ point_init::point_idx#0 ] -Uplifting [point_init] best 27913 combination zp ZP_BYTE:34 [ point_init::point_idx#0 ] +Uplifting [point_init] best 27893 combination zp ZP_BYTE:34 [ point_init::point_idx#0 ] Coalescing zero page register with common assignment [ zp ZP_WORD:12 [ divr16s::return#2 divr16s::return#1 divr16s::return#7 ] ] with [ zp ZP_WORD:80 [ divr16s::resultu#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_BYTE:2 [ main::i#2 main::i#1 ] ] with [ zp ZP_BYTE:34 [ point_init::point_idx#0 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ point_init::abs16s1_return#2 point_init::abs16s1_return#5 point_init::abs16s1_return#6 ] ] with [ zp ZP_WORD:74 [ point_init::abs16s1_return#0 ] ] - score: 1 @@ -4625,13 +4616,11 @@ point_init: { abs16s2_b1: //SEG110 [66] (signed word) point_init::abs16s2_return#0 ← - (signed word) point_init::y_diff#0 -- vwsz1=_neg_vwsz2 sec - lda y_diff - eor #$ff - adc #0 + lda #0 + sbc y_diff sta abs16s2_return - lda y_diff+1 - eor #$ff - adc #0 + lda #0 + sbc y_diff+1 sta abs16s2_return+1 //SEG111 [67] (word~) point_init::abs16s2_return#5 ← (word)(signed word) point_init::abs16s2_return#0 jmp abs16s2_breturn_from_abs16s2_b1 @@ -4639,13 +4628,11 @@ point_init: { abs16s1_b1: //SEG113 [68] (signed word) point_init::abs16s1_return#0 ← - (signed word) point_init::x_diff#1 -- vwsz1=_neg_vwsz2 sec - lda x_diff - eor #$ff - adc #0 + lda #0 + sbc x_diff sta abs16s1_return - lda x_diff+1 - eor #$ff - adc #0 + lda #0 + sbc x_diff+1 sta abs16s1_return+1 //SEG114 [69] (word~) point_init::abs16s1_return#5 ← (word)(signed word) point_init::abs16s1_return#0 jmp abs16s1_breturn_from_abs16s1_b1 @@ -4716,13 +4703,11 @@ divr16s: { b8: //SEG140 [83] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0 -- vwsz1=_neg_vwsz1 sec - lda return - eor #$ff - adc #0 + lda #0 + sbc return sta return - lda return+1 - eor #$ff - adc #0 + lda #0 + sbc return+1 sta return+1 //SEG141 [84] phi from divr16s::@5 divr16s::@8 to divr16s::@return [phi:divr16s::@5/divr16s::@8->divr16s::@return] breturn_from_b5: @@ -4741,13 +4726,11 @@ divr16s: { b3: //SEG148 [87] (signed word) divr16s::divisoru#1 ← - (signed word) divr16s::divisor#0 -- vwsz1=_neg_vwsz1 sec - lda divisoru - eor #$ff - adc #0 + lda #0 + sbc divisoru sta divisoru - lda divisoru+1 - eor #$ff - adc #0 + lda #0 + sbc divisoru+1 sta divisoru+1 //SEG149 [88] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte) 1 -- vbuyy=vbuyy_bxor_vbuc1 tya @@ -4759,13 +4742,11 @@ divr16s: { b1: //SEG152 [90] (signed word) divr16s::remu#1 ← - (signed word) divr16s::rem#0 -- vwsz1=_neg_vwsz1 sec - lda remu - eor #$ff - adc #0 + lda #0 + sbc remu sta remu - lda remu+1 - eor #$ff - adc #0 + lda #0 + sbc remu+1 sta remu+1 //SEG153 [91] (word~) divr16s::remu#7 ← (word)(signed word) divr16s::remu#1 //SEG154 [73] phi from divr16s::@1 to divr16s::@2 [phi:divr16s::@1->divr16s::@2] @@ -5129,6 +5110,7 @@ bitmap_init: { //SEG284 [151] return rts } +//SEG285 File Data // The coordinates of the lines to animate x_start: .word $a, $14, $1e, $1e y_start: .byte $a, $a, $a, $14 @@ -5680,7 +5662,7 @@ reg byte a [ bitmap_init::$6 ] FINAL ASSEMBLER -Score: 21989 +Score: 21969 //SEG0 File Comments // Animated lines drawn on a single color bitmap @@ -6032,13 +6014,11 @@ point_init: { abs16s2_b1: //SEG110 [66] (signed word) point_init::abs16s2_return#0 ← - (signed word) point_init::y_diff#0 -- vwsz1=_neg_vwsz2 sec - lda y_diff - eor #$ff - adc #0 + lda #0 + sbc y_diff sta abs16s2_return - lda y_diff+1 - eor #$ff - adc #0 + lda #0 + sbc y_diff+1 sta abs16s2_return+1 //SEG111 [67] (word~) point_init::abs16s2_return#5 ← (word)(signed word) point_init::abs16s2_return#0 jmp b6 @@ -6046,13 +6026,11 @@ point_init: { abs16s1_b1: //SEG113 [68] (signed word) point_init::abs16s1_return#0 ← - (signed word) point_init::x_diff#1 -- vwsz1=_neg_vwsz2 sec - lda x_diff - eor #$ff - adc #0 + lda #0 + sbc x_diff sta abs16s1_return - lda x_diff+1 - eor #$ff - adc #0 + lda #0 + sbc x_diff+1 sta abs16s1_return+1 //SEG114 [69] (word~) point_init::abs16s1_return#5 ← (word)(signed word) point_init::abs16s1_return#0 jmp abs16s2 @@ -6107,13 +6085,11 @@ divr16s: { //SEG139 divr16s::@8 //SEG140 [83] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0 -- vwsz1=_neg_vwsz1 sec - lda return - eor #$ff - adc #0 + lda #0 + sbc return sta return - lda return+1 - eor #$ff - adc #0 + lda #0 + sbc return+1 sta return+1 //SEG141 [84] phi from divr16s::@5 divr16s::@8 to divr16s::@return [phi:divr16s::@5/divr16s::@8->divr16s::@return] //SEG142 [84] phi (signed word) divr16s::return#2 = (signed word~) divr16s::return#7 [phi:divr16s::@5/divr16s::@8->divr16s::@return#0] -- register_copy @@ -6127,13 +6103,11 @@ divr16s: { b3: //SEG148 [87] (signed word) divr16s::divisoru#1 ← - (signed word) divr16s::divisor#0 -- vwsz1=_neg_vwsz1 sec - lda divisoru - eor #$ff - adc #0 + lda #0 + sbc divisoru sta divisoru - lda divisoru+1 - eor #$ff - adc #0 + lda #0 + sbc divisoru+1 sta divisoru+1 //SEG149 [88] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte) 1 -- vbuyy=vbuyy_bxor_vbuc1 tya @@ -6145,13 +6119,11 @@ divr16s: { b1: //SEG152 [90] (signed word) divr16s::remu#1 ← - (signed word) divr16s::rem#0 -- vwsz1=_neg_vwsz1 sec - lda remu - eor #$ff - adc #0 + lda #0 + sbc remu sta remu - lda remu+1 - eor #$ff - adc #0 + lda #0 + sbc remu+1 sta remu+1 //SEG153 [91] (word~) divr16s::remu#7 ← (word)(signed word) divr16s::remu#1 //SEG154 [73] phi from divr16s::@1 to divr16s::@2 [phi:divr16s::@1->divr16s::@2] @@ -6449,6 +6421,7 @@ bitmap_init: { //SEG284 [151] return rts } +//SEG285 File Data // The coordinates of the lines to animate x_start: .word $a, $14, $1e, $1e y_start: .byte $a, $a, $a, $14 diff --git a/src/test/ref/linegen.log b/src/test/ref/linegen.log index ad7aefafc..379e0074b 100644 --- a/src/test/ref/linegen.log +++ b/src/test/ref/linegen.log @@ -3210,6 +3210,7 @@ divr16u: { //SEG308 [137] return rts } +//SEG309 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -4315,6 +4316,7 @@ divr16u: { //SEG308 [137] return rts } +//SEG309 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -5483,5 +5485,6 @@ divr16u: { //SEG308 [137] return rts } +//SEG309 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/literal-char-minus-number.log b/src/test/ref/literal-char-minus-number.log index 081f08a76..7f6a1c0ae 100644 --- a/src/test/ref/literal-char-minus-number.log +++ b/src/test/ref/literal-char-minus-number.log @@ -114,6 +114,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (byte) 'a'-(byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -159,6 +160,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -215,4 +217,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/literal-strings.log b/src/test/ref/literal-strings.log index 019433678..d1515ed11 100644 --- a/src/test/ref/literal-strings.log +++ b/src/test/ref/literal-strings.log @@ -205,6 +205,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data msgz: .text "cml" msg: .text "cml@" @@ -278,6 +279,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data msgz: .text "cml" msg: .text "cml@" @@ -368,6 +370,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data msgz: .text "cml" msg: .text "cml@" diff --git a/src/test/ref/literals.log b/src/test/ref/literals.log index 3f1724d0f..3b3d365a2 100644 --- a/src/test/ref/literals.log +++ b/src/test/ref/literals.log @@ -252,6 +252,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data str: .text "bcde@" nums: .byte 2, 3, 4, 5 @@ -334,6 +335,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data str: .text "bcde@" nums: .byte 2, 3, 4, 5 @@ -433,6 +435,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data str: .text "bcde@" nums: .byte 2, 3, 4, 5 diff --git a/src/test/ref/liverange-call-problem.log b/src/test/ref/liverange-call-problem.log index 33f7a8500..52c24bd62 100644 --- a/src/test/ref/liverange-call-problem.log +++ b/src/test/ref/liverange-call-problem.log @@ -419,6 +419,7 @@ incw1: { //SEG41 [20] return rts } +//SEG42 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] *((const word*) main::SCREEN#0) ← (word) w1#12 [ w2#11 ] ( main:2 [ w2#11 ] ) always clobbers reg byte a @@ -556,6 +557,7 @@ incw1: { //SEG41 [20] return rts } +//SEG42 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -715,4 +717,5 @@ incw1: { //SEG41 [20] return rts } +//SEG42 File Data diff --git a/src/test/ref/liverange.log b/src/test/ref/liverange.log index 35f0684be..33c8d1e14 100644 --- a/src/test/ref/liverange.log +++ b/src/test/ref/liverange.log @@ -372,6 +372,7 @@ inci: { //SEG33 [19] return rts } +//SEG34 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] (byte) main::a#2 ← (byte) main::a#1 + (byte~) main::$2 [ main::a#2 i#11 ] ( main:2 [ main::a#2 i#11 ] ) always clobbers reg byte a @@ -483,6 +484,7 @@ inci: { //SEG33 [19] return rts } +//SEG34 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -610,4 +612,5 @@ inci: { //SEG33 [19] return rts } +//SEG34 File Data diff --git a/src/test/ref/local-string.log b/src/test/ref/local-string.log index abc0f6735..c3fd36056 100644 --- a/src/test/ref/local-string.log +++ b/src/test/ref/local-string.log @@ -193,6 +193,7 @@ main: { jmp b1 msg: .text "message 2 @" } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if(*((const byte[]) main::msg#0 + (byte) main::i#2)!=(byte) '@') goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -265,6 +266,7 @@ main: { jmp b1 msg: .text "message 2 @" } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -351,4 +353,5 @@ main: { jmp b1 msg: .text "message 2 @" } +//SEG22 File Data diff --git a/src/test/ref/localscope-loops.log b/src/test/ref/localscope-loops.log index 9259d4da6..fc7db8f1e 100644 --- a/src/test/ref/localscope-loops.log +++ b/src/test/ref/localscope-loops.log @@ -253,6 +253,7 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 'a' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -342,6 +343,7 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -448,4 +450,5 @@ main: { //SEG28 [13] return rts } +//SEG29 File Data diff --git a/src/test/ref/localscope-simple.log b/src/test/ref/localscope-simple.log index 9d1f003a1..94a3e6330 100644 --- a/src/test/ref/localscope-simple.log +++ b/src/test/ref/localscope-simple.log @@ -135,6 +135,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) BGCOL#0) ← (const byte) main::i#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -186,6 +187,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -251,4 +253,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/longbranch-interrupt-problem.log b/src/test/ref/longbranch-interrupt-problem.log index ffd05212d..e3b319c72 100644 --- a/src/test/ref/longbranch-interrupt-problem.log +++ b/src/test/ref/longbranch-interrupt-problem.log @@ -327,6 +327,7 @@ irq: { //SEG30 [13] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG31 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( ) always clobbers reg byte a @@ -436,6 +437,7 @@ irq: { //SEG30 [13] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG31 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -573,4 +575,5 @@ irq: { //SEG30 [13] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG31 File Data diff --git a/src/test/ref/longjump.log b/src/test/ref/longjump.log index a2a77cf30..f05c1b34e 100644 --- a/src/test/ref/longjump.log +++ b/src/test/ref/longjump.log @@ -433,6 +433,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -753,6 +754,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1094,4 +1096,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/longjump2.log b/src/test/ref/longjump2.log index d946fa6ce..13622985f 100644 --- a/src/test/ref/longjump2.log +++ b/src/test/ref/longjump2.log @@ -846,6 +846,7 @@ long1: { //SEG42 [22] return rts } +//SEG43 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ long2::i#2 long2::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -1477,6 +1478,7 @@ long1: { //SEG42 [22] return rts } +//SEG43 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -2140,4 +2142,5 @@ long1: { //SEG42 [22] return rts } +//SEG43 File Data diff --git a/src/test/ref/loop-break-continue.log b/src/test/ref/loop-break-continue.log index 2d1702b32..ae1d8af66 100644 --- a/src/test/ref/loop-break-continue.log +++ b/src/test/ref/loop-break-continue.log @@ -295,6 +295,7 @@ main: { jmp b1 str: .text "hello brave new world@" } +//SEG31 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if(*((const byte[]) main::str#0 + (byte) main::i#2)!=(byte) '@') goto main::@2 [ main::i#2 main::screen#2 ] ( main:2 [ main::i#2 main::screen#2 ] ) always clobbers reg byte a @@ -402,6 +403,7 @@ main: { jmp b1 str: .text "hello brave new world@" } +//SEG31 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -524,4 +526,5 @@ main: { jmp b1 str: .text "hello brave new world@" } +//SEG31 File Data diff --git a/src/test/ref/loop-break-nested.log b/src/test/ref/loop-break-nested.log index 1cc6a0881..501adbad8 100644 --- a/src/test/ref/loop-break-nested.log +++ b/src/test/ref/loop-break-nested.log @@ -317,6 +317,7 @@ main: { //SEG31 [5] phi (byte*) main::line#2 = (byte*) main::line#1 [phi:main::@4->main::@1#0] -- register_copy jmp b1 } +//SEG32 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if(*((byte*) main::line#2)!=(byte) 'a') goto main::@2 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a reg byte y @@ -438,6 +439,7 @@ main: { //SEG31 [5] phi (byte*) main::line#2 = (byte*) main::line#1 [phi:main::@4->main::@1#0] -- register_copy jmp b1 } +//SEG32 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -572,4 +574,5 @@ main: { //SEG31 [5] phi (byte*) main::line#2 = (byte*) main::line#1 [phi:main::@4->main::@1#0] -- register_copy jmp b1 } +//SEG32 File Data diff --git a/src/test/ref/loop-break.log b/src/test/ref/loop-break.log index d869f1ecf..aeb28c98d 100644 --- a/src/test/ref/loop-break.log +++ b/src/test/ref/loop-break.log @@ -200,6 +200,7 @@ main: { //SEG22 [10] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if(*((const byte*) SCREEN#0 + (byte) main::i#2)==(byte) 'a') goto main::@return [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -275,6 +276,7 @@ main: { //SEG22 [10] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -364,4 +366,5 @@ main: { //SEG22 [10] return rts } +//SEG23 File Data diff --git a/src/test/ref/loop-continue.log b/src/test/ref/loop-continue.log index e68c272a2..dc33e54fc 100644 --- a/src/test/ref/loop-continue.log +++ b/src/test/ref/loop-continue.log @@ -210,6 +210,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if(*((const byte*) SCREEN#0 + (byte) main::i#2)==(byte) ' ') goto main::@3 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -285,6 +286,7 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -377,4 +379,5 @@ main: { //SEG23 [10] return rts } +//SEG24 File Data diff --git a/src/test/ref/loop-problem.log b/src/test/ref/loop-problem.log index 3d32f5cd1..c97ef6ee1 100644 --- a/src/test/ref/loop-problem.log +++ b/src/test/ref/loop-problem.log @@ -268,6 +268,7 @@ d: { //SEG33 [16] return rts } +//SEG34 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -368,6 +369,7 @@ d: { //SEG33 [16] return rts } +//SEG34 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -487,4 +489,5 @@ d: { //SEG33 [16] return rts } +//SEG34 File Data diff --git a/src/test/ref/loop-problem2.log b/src/test/ref/loop-problem2.log index 7bc278bb4..13344e76f 100644 --- a/src/test/ref/loop-problem2.log +++ b/src/test/ref/loop-problem2.log @@ -355,6 +355,7 @@ print_cls: { //SEG37 [19] return rts } +//SEG38 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] *((const byte*) BORDERCOL#0) ← (byte) 3 [ ] ( main:2::mode_ctrl:7 [ ] ) always clobbers reg byte a @@ -484,6 +485,7 @@ print_cls: { //SEG37 [19] return rts } +//SEG38 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -635,4 +637,5 @@ print_cls: { //SEG37 [19] return rts } +//SEG38 File Data diff --git a/src/test/ref/loop-while-continue.log b/src/test/ref/loop-while-continue.log index ea98f0f91..4e8ce34ef 100644 --- a/src/test/ref/loop-while-continue.log +++ b/src/test/ref/loop-while-continue.log @@ -217,6 +217,7 @@ main: { inc SCREEN,x jmp b1_from_b3 } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [9] if(*((const byte*) SCREEN#0 + (byte) main::i#1)==(byte) ' ') goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) always clobbers reg byte a @@ -293,6 +294,7 @@ main: { inc SCREEN,x jmp b1_from_b3 } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -387,4 +389,5 @@ main: { inc SCREEN,x jmp b1 } +//SEG24 File Data diff --git a/src/test/ref/loop100.log b/src/test/ref/loop100.log index 3cc92020f..f08e7e363 100644 --- a/src/test/ref/loop100.log +++ b/src/test/ref/loop100.log @@ -158,6 +158,7 @@ main: { //SEG19 [8] return rts } +//SEG20 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -216,6 +217,7 @@ main: { //SEG19 [8] return rts } +//SEG20 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -290,4 +292,5 @@ main: { //SEG19 [8] return rts } +//SEG20 File Data diff --git a/src/test/ref/loopmin.log b/src/test/ref/loopmin.log index 2f6e46ac2..c159ead69 100644 --- a/src/test/ref/loopmin.log +++ b/src/test/ref/loopmin.log @@ -257,6 +257,7 @@ main: { //SEG27 [11] return rts } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte) main::s#1 ← (byte) main::s#2 + (byte) main::i#2 [ main::i#2 main::s#1 ] ( main:2 [ main::i#2 main::s#1 ] ) always clobbers reg byte a @@ -339,6 +340,7 @@ main: { //SEG27 [11] return rts } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -441,4 +443,5 @@ main: { //SEG27 [11] return rts } +//SEG28 File Data diff --git a/src/test/ref/loopnest.log b/src/test/ref/loopnest.log index 74a005cb6..731d4d56c 100644 --- a/src/test/ref/loopnest.log +++ b/src/test/ref/loopnest.log @@ -275,6 +275,7 @@ nest: { //SEG33 [15] return rts } +//SEG34 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -370,6 +371,7 @@ nest: { //SEG33 [15] return rts } +//SEG34 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -489,4 +491,5 @@ nest: { //SEG33 [15] return rts } +//SEG34 File Data diff --git a/src/test/ref/loopnest2.log b/src/test/ref/loopnest2.log index 76f051f7d..6a2c95364 100644 --- a/src/test/ref/loopnest2.log +++ b/src/test/ref/loopnest2.log @@ -595,6 +595,7 @@ nest2: { //SEG70 [30] return rts } +//SEG71 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#5 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -797,6 +798,7 @@ nest2: { //SEG70 [30] return rts } +//SEG71 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1041,4 +1043,5 @@ nest2: { //SEG70 [30] return rts } +//SEG71 File Data diff --git a/src/test/ref/loopnest3.log b/src/test/ref/loopnest3.log index a3264d8ad..6ef78ec79 100644 --- a/src/test/ref/loopnest3.log +++ b/src/test/ref/loopnest3.log @@ -350,6 +350,7 @@ c: { //SEG39 [19] return rts } +//SEG40 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -464,6 +465,7 @@ c: { //SEG39 [19] return rts } +//SEG40 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -606,4 +608,5 @@ c: { //SEG39 [19] return rts } +//SEG40 File Data diff --git a/src/test/ref/loopsplit.log b/src/test/ref/loopsplit.log index 63abe8305..a738a2360 100644 --- a/src/test/ref/loopsplit.log +++ b/src/test/ref/loopsplit.log @@ -282,6 +282,7 @@ main: { inc s jmp b1_from_b4 } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -366,6 +367,7 @@ main: { iny jmp b1_from_b4 } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -479,4 +481,5 @@ main: { iny jmp b1 } +//SEG30 File Data diff --git a/src/test/ref/mem-alignment.log b/src/test/ref/mem-alignment.log index e4a277db5..3c3b6d445 100644 --- a/src/test/ref/mem-alignment.log +++ b/src/test/ref/mem-alignment.log @@ -279,6 +279,7 @@ main: { .align $100 cs: .fill $100, 0 } +//SEG32 File Data .align $100 bs: .fill $100, 0 @@ -375,6 +376,7 @@ main: { .align $100 cs: .fill $100, 0 } +//SEG32 File Data .align $100 bs: .fill $100, 0 @@ -495,6 +497,7 @@ main: { .align $100 cs: .fill $100, 0 } +//SEG32 File Data .align $100 bs: .fill $100, 0 diff --git a/src/test/ref/memory-heap.log b/src/test/ref/memory-heap.log index 63cf273af..67a505241 100644 --- a/src/test/ref/memory-heap.log +++ b/src/test/ref/memory-heap.log @@ -595,6 +595,7 @@ malloc: { //SEG53 [29] return rts } +//SEG54 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte*) malloc::return#2 ← (byte*) malloc::return#0 [ malloc::return#2 heap_head#1 ] ( main:2 [ malloc::return#2 heap_head#1 ] ) always clobbers reg byte a @@ -799,6 +800,7 @@ malloc: { //SEG53 [29] return rts } +//SEG54 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1015,4 +1017,5 @@ malloc: { //SEG53 [29] return rts } +//SEG54 File Data diff --git a/src/test/ref/min-fmul-16.log b/src/test/ref/min-fmul-16.log index 93290c5d8..2257cf9bd 100644 --- a/src/test/ref/min-fmul-16.log +++ b/src/test/ref/min-fmul-16.log @@ -1933,6 +1933,7 @@ mulf_init: { //SEG155 [76] return rts } +//SEG156 File Data print_hextab: .text "0123456789abcdef" // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // mul8u::@1#2] -- register_copy jmp b1 } +//SEG65 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [10] (word) mul8u::return#2 ← (word) mul8u::res#2 [ main::a#4 main::b#2 main::i#2 mul8u::return#2 ] ( main:2 [ main::a#4 main::b#2 main::i#2 mul8u::return#2 ] ) always clobbers reg byte a @@ -878,6 +879,7 @@ mul8u: { //SEG64 [21] phi (byte) mul8u::a#2 = (byte) mul8u::a#0 [phi:mul8u::@3->mul8u::@1#2] -- register_copy jmp b1 } +//SEG65 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1125,4 +1127,5 @@ mul8u: { //SEG64 [21] phi (byte) mul8u::a#2 = (byte) mul8u::a#0 [phi:mul8u::@3->mul8u::@1#2] -- register_copy jmp b1 } +//SEG65 File Data diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log index 0495f2795..5da33b39e 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log @@ -3208,6 +3208,7 @@ plexShowSprite: { sta SPRITES_XMSB jmp b2 } +//SEG227 File Data // Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again. PLEX_FREE_YPOS: .fill 8, 0 // The x-positions of the multiplexer sprites ($000-$1ff) @@ -3462,56 +3463,56 @@ Uplift Scope [plexShowSprite] 4: zp ZP_BYTE:26 [ plexShowSprite::plexFreeAdd1_$0 Uplift Scope [plex_irq] 11: zp ZP_BYTE:23 [ plex_irq::$4 ] 4: zp ZP_BYTE:22 [ plex_irq::plexFreeNextYpos1_return#0 ] Uplift Scope [main] -Uplifting [plexSort] best 60882 combination reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] zp ZP_BYTE:20 [ plexSort::s#2 ] zp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 ] zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 65490 combination reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] zp ZP_BYTE:20 [ plexSort::s#2 ] zp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 ] zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] Limited combination testing to 10 combinations of 972 possible. -Uplifting [] best 60882 combination zp ZP_BYTE:16 [ plex_sprite_msb#28 plex_sprite_msb#11 plex_sprite_msb#0 plex_sprite_msb#1 plex_sprite_msb#17 plex_sprite_msb#3 plex_sprite_msb#4 ] zp ZP_BYTE:15 [ plex_free_next#27 plex_free_next#10 plex_free_next#31 plex_free_next#0 plexShowSprite::plexFreeAdd1_$2#0 ] zp ZP_BYTE:14 [ plex_show_idx#27 plex_show_idx#10 plex_show_idx#0 plex_show_idx#1 plex_show_idx#16 ] zp ZP_BYTE:13 [ plex_sprite_idx#25 plex_sprite_idx#10 plex_sprite_idx#0 plex_sprite_idx#1 plexShowSprite::$6 ] zp ZP_BOOL:17 [ framedone#10 framedone#12 framedone#17 framedone#5 framedone#3 ] -Uplifting [loop] best 58952 combination reg byte y [ loop::sy#2 loop::sy#1 ] reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplifting [] best 65490 combination zp ZP_BYTE:16 [ plex_sprite_msb#28 plex_sprite_msb#11 plex_sprite_msb#0 plex_sprite_msb#1 plex_sprite_msb#17 plex_sprite_msb#3 plex_sprite_msb#4 ] zp ZP_BYTE:15 [ plex_free_next#27 plex_free_next#10 plex_free_next#31 plex_free_next#0 plexShowSprite::plexFreeAdd1_$2#0 ] zp ZP_BYTE:14 [ plex_show_idx#27 plex_show_idx#10 plex_show_idx#0 plex_show_idx#1 plex_show_idx#16 ] zp ZP_BYTE:13 [ plex_sprite_idx#25 plex_sprite_idx#10 plex_sprite_idx#0 plex_sprite_idx#1 plexShowSprite::$6 ] zp ZP_BOOL:17 [ framedone#10 framedone#12 framedone#17 framedone#5 framedone#3 ] +Uplifting [loop] best 63560 combination reg byte y [ loop::sy#2 loop::sy#1 ] reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] Limited combination testing to 10 combinations of 27 possible. -Uplifting [init] best 58702 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp ZP_BYTE:21 [ init::$9 ] zp ZP_WORD:9 [ init::xp#2 init::xp#1 ] +Uplifting [init] best 63310 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp ZP_BYTE:21 [ init::$9 ] zp ZP_WORD:9 [ init::xp#2 init::xp#1 ] Limited combination testing to 10 combinations of 36 possible. -Uplifting [plexInit] best 58582 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] -Uplifting [plexShowSprite] best 58572 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ] zp ZP_BYTE:28 [ plexShowSprite::xpos_idx#0 ] zp ZP_BYTE:30 [ plexShowSprite::$2 ] zp ZP_BYTE:31 [ plexShowSprite::$3 ] zp ZP_BYTE:32 [ plexShowSprite::$9 ] zp ZP_BYTE:33 [ plexShowSprite::$5 ] zp ZP_BYTE:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp ZP_BYTE:29 [ plexShowSprite::$11 ] zp ZP_BYTE:24 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexInit] best 63190 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] +Uplifting [plexShowSprite] best 63180 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ] zp ZP_BYTE:28 [ plexShowSprite::xpos_idx#0 ] zp ZP_BYTE:30 [ plexShowSprite::$2 ] zp ZP_BYTE:31 [ plexShowSprite::$3 ] zp ZP_BYTE:32 [ plexShowSprite::$9 ] zp ZP_BYTE:33 [ plexShowSprite::$5 ] zp ZP_BYTE:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp ZP_BYTE:29 [ plexShowSprite::$11 ] zp ZP_BYTE:24 [ plexShowSprite::plex_sprite_idx2#0 ] Limited combination testing to 10 combinations of 98304 possible. -Uplifting [plex_irq] best 58509 combination zp ZP_BYTE:23 [ plex_irq::$4 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] -Uplifting [main] best 58509 combination +Uplifting [plex_irq] best 63117 combination zp ZP_BYTE:23 [ plex_irq::$4 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +Uplifting [main] best 63117 combination Attempting to uplift remaining variables inzp ZP_BYTE:20 [ plexSort::s#2 ] -Uplifting [plexSort] best 57909 combination reg byte x [ plexSort::s#2 ] +Uplifting [plexSort] best 62517 combination reg byte x [ plexSort::s#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 ] -Uplifting [plexSort] best 57909 combination zp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 ] +Uplifting [plexSort] best 62517 combination zp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:19 [ plexSort::nxt_y#0 ] -Uplifting [plexSort] best 57909 combination zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] +Uplifting [plexSort] best 62517 combination zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:16 [ plex_sprite_msb#28 plex_sprite_msb#11 plex_sprite_msb#0 plex_sprite_msb#1 plex_sprite_msb#17 plex_sprite_msb#3 plex_sprite_msb#4 ] -Uplifting [] best 57909 combination zp ZP_BYTE:16 [ plex_sprite_msb#28 plex_sprite_msb#11 plex_sprite_msb#0 plex_sprite_msb#1 plex_sprite_msb#17 plex_sprite_msb#3 plex_sprite_msb#4 ] +Uplifting [] best 62517 combination zp ZP_BYTE:16 [ plex_sprite_msb#28 plex_sprite_msb#11 plex_sprite_msb#0 plex_sprite_msb#1 plex_sprite_msb#17 plex_sprite_msb#3 plex_sprite_msb#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:15 [ plex_free_next#27 plex_free_next#10 plex_free_next#31 plex_free_next#0 plexShowSprite::plexFreeAdd1_$2#0 ] -Uplifting [] best 57909 combination zp ZP_BYTE:15 [ plex_free_next#27 plex_free_next#10 plex_free_next#31 plex_free_next#0 plexShowSprite::plexFreeAdd1_$2#0 ] +Uplifting [] best 62517 combination zp ZP_BYTE:15 [ plex_free_next#27 plex_free_next#10 plex_free_next#31 plex_free_next#0 plexShowSprite::plexFreeAdd1_$2#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:14 [ plex_show_idx#27 plex_show_idx#10 plex_show_idx#0 plex_show_idx#1 plex_show_idx#16 ] -Uplifting [] best 57909 combination zp ZP_BYTE:14 [ plex_show_idx#27 plex_show_idx#10 plex_show_idx#0 plex_show_idx#1 plex_show_idx#16 ] +Uplifting [] best 62517 combination zp ZP_BYTE:14 [ plex_show_idx#27 plex_show_idx#10 plex_show_idx#0 plex_show_idx#1 plex_show_idx#16 ] Attempting to uplift remaining variables inzp ZP_BYTE:13 [ plex_sprite_idx#25 plex_sprite_idx#10 plex_sprite_idx#0 plex_sprite_idx#1 plexShowSprite::$6 ] -Uplifting [] best 57909 combination zp ZP_BYTE:13 [ plex_sprite_idx#25 plex_sprite_idx#10 plex_sprite_idx#0 plex_sprite_idx#1 plexShowSprite::$6 ] +Uplifting [] best 62517 combination zp ZP_BYTE:13 [ plex_sprite_idx#25 plex_sprite_idx#10 plex_sprite_idx#0 plex_sprite_idx#1 plexShowSprite::$6 ] Attempting to uplift remaining variables inzp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] -Uplifting [plexSort] best 57909 combination zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 62517 combination zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:21 [ init::$9 ] -Uplifting [init] best 57869 combination reg byte a [ init::$9 ] +Uplifting [init] best 62477 combination reg byte a [ init::$9 ] Attempting to uplift remaining variables inzp ZP_BYTE:23 [ plex_irq::$4 ] -Uplifting [plex_irq] best 57869 combination zp ZP_BYTE:23 [ plex_irq::$4 ] +Uplifting [plex_irq] best 62477 combination zp ZP_BYTE:23 [ plex_irq::$4 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] -Uplifting [loop] best 57869 combination zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplifting [loop] best 62477 combination zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:28 [ plexShowSprite::xpos_idx#0 ] -Uplifting [plexShowSprite] best 57863 combination reg byte a [ plexShowSprite::xpos_idx#0 ] +Uplifting [plexShowSprite] best 62471 combination reg byte a [ plexShowSprite::xpos_idx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:30 [ plexShowSprite::$2 ] -Uplifting [plexShowSprite] best 57857 combination reg byte a [ plexShowSprite::$2 ] +Uplifting [plexShowSprite] best 62465 combination reg byte a [ plexShowSprite::$2 ] Attempting to uplift remaining variables inzp ZP_BYTE:31 [ plexShowSprite::$3 ] -Uplifting [plexShowSprite] best 57851 combination reg byte a [ plexShowSprite::$3 ] +Uplifting [plexShowSprite] best 62459 combination reg byte a [ plexShowSprite::$3 ] Attempting to uplift remaining variables inzp ZP_BYTE:32 [ plexShowSprite::$9 ] -Uplifting [plexShowSprite] best 57845 combination reg byte a [ plexShowSprite::$9 ] +Uplifting [plexShowSprite] best 62453 combination reg byte a [ plexShowSprite::$9 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ plexShowSprite::$5 ] -Uplifting [plexShowSprite] best 57839 combination reg byte x [ plexShowSprite::$5 ] +Uplifting [plexShowSprite] best 62447 combination reg byte x [ plexShowSprite::$5 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] -Uplifting [plexShowSprite] best 57830 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Uplifting [plexShowSprite] best 62438 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:29 [ plexShowSprite::$11 ] -Uplifting [plexShowSprite] best 57823 combination reg byte x [ plexShowSprite::$11 ] +Uplifting [plexShowSprite] best 62431 combination reg byte x [ plexShowSprite::$11 ] Attempting to uplift remaining variables inzp ZP_BYTE:24 [ plexShowSprite::plex_sprite_idx2#0 ] -Uplifting [plexShowSprite] best 57823 combination zp ZP_BYTE:24 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexShowSprite] best 62431 combination zp ZP_BYTE:24 [ plexShowSprite::plex_sprite_idx2#0 ] Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:3 [ plexSort::m#2 plexSort::m#1 ] Allocated (was zp ZP_WORD:9) zp ZP_WORD:4 [ init::xp#2 init::xp#1 ] Allocated (was zp ZP_BYTE:13) zp ZP_BYTE:6 [ plex_sprite_idx#25 plex_sprite_idx#10 plex_sprite_idx#0 plex_sprite_idx#1 plexShowSprite::$6 ] @@ -4191,6 +4192,7 @@ plexShowSprite: { sta SPRITES_XMSB jmp b2 } +//SEG227 File Data // Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again. PLEX_FREE_YPOS: .fill 8, 0 // The x-positions of the multiplexer sprites ($000-$1ff) @@ -4604,7 +4606,7 @@ reg byte x [ plexShowSprite::$5 ] FINAL ASSEMBLER -Score: 44248 +Score: 48856 //SEG0 File Comments // A simple usage of the flexible sprite multiplexer routine @@ -5154,6 +5156,7 @@ plexShowSprite: { sta SPRITES_XMSB jmp b2 } +//SEG227 File Data // Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again. PLEX_FREE_YPOS: .fill 8, 0 // The x-positions of the multiplexer sprites ($000-$1ff) diff --git a/src/test/ref/multiply-2s.log b/src/test/ref/multiply-2s.log index f260b12f6..df064ae10 100644 --- a/src/test/ref/multiply-2s.log +++ b/src/test/ref/multiply-2s.log @@ -349,6 +349,7 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$3 ] ( main:2 [ main::i#2 main::$3 ] ) always clobbers reg byte a @@ -461,6 +462,7 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -580,4 +582,5 @@ main: { //SEG29 [18] return rts } +//SEG30 File Data diff --git a/src/test/ref/multiply-ns.log b/src/test/ref/multiply-ns.log index 270b619a9..6e52c34f6 100644 --- a/src/test/ref/multiply-ns.log +++ b/src/test/ref/multiply-ns.log @@ -826,6 +826,7 @@ main: { //SEG64 [53] return rts } +//SEG65 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte) main::$31 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$31 ] ( main:2 [ main::i#2 main::$31 ] ) always clobbers reg byte a @@ -1184,6 +1185,7 @@ main: { //SEG64 [53] return rts } +//SEG65 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1465,4 +1467,5 @@ main: { //SEG64 [53] return rts } +//SEG65 File Data diff --git a/src/test/ref/no-recursion-heavy.log b/src/test/ref/no-recursion-heavy.log index 27fe573e7..c02ed17b2 100644 --- a/src/test/ref/no-recursion-heavy.log +++ b/src/test/ref/no-recursion-heavy.log @@ -3855,6 +3855,7 @@ fc: { //SEG440 [182] return rts } +//SEG441 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ ba#17 ba#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -4867,6 +4868,7 @@ fc: { //SEG440 [182] return rts } +//SEG441 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -6126,4 +6128,5 @@ fc: { //SEG440 [182] return rts } +//SEG441 File Data diff --git a/src/test/ref/noop-cast-elimination.log b/src/test/ref/noop-cast-elimination.log index f68a5a45d..f490dbafa 100644 --- a/src/test/ref/noop-cast-elimination.log +++ b/src/test/ref/noop-cast-elimination.log @@ -245,6 +245,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (signed word) main::sw#1 ← (signed word) main::sw#2 + (signed byte)(byte) main::i#2 [ main::i#2 main::sw#1 ] ( main:2 [ main::i#2 main::sw#1 ] ) always clobbers reg byte a @@ -346,6 +347,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -461,4 +463,5 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data diff --git a/src/test/ref/norom-charset.log b/src/test/ref/norom-charset.log index c67e15f81..b59911437 100644 --- a/src/test/ref/norom-charset.log +++ b/src/test/ref/norom-charset.log @@ -761,6 +761,7 @@ gen_char3: { //SEG65 [30] return rts } +//SEG66 File Data // Stores chars as 15 bits (in 2 bytes) specifying the 3x5 // The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0 charset_spec_row: .word $f7da, $f7de, $f24e, $d6de @@ -995,6 +996,7 @@ gen_char3: { //SEG65 [30] return rts } +//SEG66 File Data // Stores chars as 15 bits (in 2 bytes) specifying the 3x5 // The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0 charset_spec_row: .word $f7da, $f7de, $f24e, $d6de @@ -1259,6 +1261,7 @@ gen_char3: { //SEG65 [30] return rts } +//SEG66 File Data // Stores chars as 15 bits (in 2 bytes) specifying the 3x5 // The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0 charset_spec_row: .word $f7da, $f7de, $f24e, $d6de diff --git a/src/test/ref/number-conversion.log b/src/test/ref/number-conversion.log index 905d21982..009357af3 100644 --- a/src/test/ref/number-conversion.log +++ b/src/test/ref/number-conversion.log @@ -2039,6 +2039,7 @@ assertType: { sta COLS,y jmp b2 } +//SEG267 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [77] *((const byte*) COLS#0 + (byte) idx#79) ← (const byte) RED#0 [ assertType::t1#35 idx#79 ] ( main:2::assertType:5 [ assertType::t1#35 idx#79 ] main:2::assertType:7 [ assertType::t1#35 idx#79 ] main:2::assertType:9 [ assertType::t1#35 idx#79 ] main:2::assertType:11 [ assertType::t1#35 idx#79 ] main:2::assertType:13 [ assertType::t1#35 idx#79 ] main:2::assertType:15 [ assertType::t1#35 idx#79 ] main:2::assertType:17 [ assertType::t1#35 idx#79 ] main:2::assertType:19 [ assertType::t1#35 idx#79 ] main:2::assertType:21 [ assertType::t1#35 idx#79 ] main:2::assertType:23 [ assertType::t1#35 idx#79 ] main:2::assertType:25 [ assertType::t1#35 idx#79 ] main:2::assertType:27 [ assertType::t1#35 idx#79 ] main:2::assertType:29 [ assertType::t1#35 idx#79 ] main:2::assertType:31 [ assertType::t1#35 idx#79 ] main:2::assertType:33 [ assertType::t1#35 idx#79 ] main:2::assertType:35 [ assertType::t1#35 idx#79 ] main:2::assertType:37 [ assertType::t1#35 idx#79 ] main:2::assertType:39 [ assertType::t1#35 idx#79 ] main:2::assertType:41 [ assertType::t1#35 idx#79 ] main:2::assertType:43 [ assertType::t1#35 idx#79 ] main:2::assertType:45 [ assertType::t1#35 idx#79 ] main:2::assertType:47 [ assertType::t1#35 idx#79 ] main:2::assertType:49 [ assertType::t1#35 idx#79 ] main:2::assertType:51 [ assertType::t1#35 idx#79 ] main:2::assertType:53 [ assertType::t1#35 idx#79 ] main:2::assertType:55 [ assertType::t1#35 idx#79 ] main:2::assertType:57 [ assertType::t1#35 idx#79 ] main:2::assertType:59 [ assertType::t1#35 idx#79 ] main:2::assertType:61 [ assertType::t1#35 idx#79 ] main:2::assertType:63 [ assertType::t1#35 idx#79 ] main:2::assertType:65 [ assertType::t1#35 idx#79 ] main:2::assertType:67 [ assertType::t1#35 idx#79 ] main:2::assertType:69 [ assertType::t1#35 idx#79 ] main:2::assertType:71 [ assertType::t1#35 idx#79 ] main:2::assertType:73 [ assertType::t1#35 idx#79 ] ) always clobbers reg byte a @@ -2668,6 +2669,7 @@ assertType: { sta COLS,x jmp b2 } +//SEG267 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -3388,4 +3390,5 @@ assertType: { sta COLS,x jmp b2 } +//SEG267 File Data diff --git a/src/test/ref/number-inference-sum.log b/src/test/ref/number-inference-sum.log index ab0523ac0..d39413f68 100644 --- a/src/test/ref/number-inference-sum.log +++ b/src/test/ref/number-inference-sum.log @@ -224,6 +224,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const word*) main::screen#0) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -284,6 +285,7 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -365,4 +367,5 @@ main: { //SEG14 [6] return rts } +//SEG15 File Data diff --git a/src/test/ref/number-type.log b/src/test/ref/number-type.log index b38245354..dcb1dd111 100644 --- a/src/test/ref/number-type.log +++ b/src/test/ref/number-type.log @@ -665,6 +665,7 @@ testBytes: { //SEG47 [35] return rts } +//SEG48 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [9] *((const signed byte*) testSBytes::SCREEN#0) ← (signed byte) -$c [ ] ( main:2::testSBytes:7 [ ] ) always clobbers reg byte a @@ -840,6 +841,7 @@ testBytes: { //SEG47 [35] return rts } +//SEG48 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1007,4 +1009,5 @@ testBytes: { //SEG47 [35] return rts } +//SEG48 File Data diff --git a/src/test/ref/operator-lohi-problem-1.log b/src/test/ref/operator-lohi-problem-1.log index a8e65aca1..d8c80f251 100644 --- a/src/test/ref/operator-lohi-problem-1.log +++ b/src/test/ref/operator-lohi-problem-1.log @@ -190,6 +190,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← <(word)(const dword) DVAL#0/(word) $400 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -244,6 +245,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -310,4 +312,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/operator-lohi-problem.log b/src/test/ref/operator-lohi-problem.log index 62f147452..7fe43cbae 100644 --- a/src/test/ref/operator-lohi-problem.log +++ b/src/test/ref/operator-lohi-problem.log @@ -222,6 +222,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -285,6 +286,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -362,4 +364,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/overlap-allocation-2.log b/src/test/ref/overlap-allocation-2.log index a5f61be97..c95fbc9b9 100644 --- a/src/test/ref/overlap-allocation-2.log +++ b/src/test/ref/overlap-allocation-2.log @@ -416,6 +416,7 @@ plot: { //SEG52 [24] return rts } +//SEG53 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' [ ] ( main:2::line:7::plot:18 [ main::i#2 line::l#2 ] main:2::line:12::plot:18 [ main::j#2 line::l#2 ] main:2::line:7::plot:20 [ main::i#2 ] main:2::line:12::plot:20 [ main::j#2 ] ) always clobbers reg byte a @@ -569,6 +570,7 @@ plot: { //SEG52 [24] return rts } +//SEG53 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -746,4 +748,5 @@ plot: { //SEG52 [24] return rts } +//SEG53 File Data diff --git a/src/test/ref/overlap-allocation.log b/src/test/ref/overlap-allocation.log index caf1ccc96..c887fb4ef 100644 --- a/src/test/ref/overlap-allocation.log +++ b/src/test/ref/overlap-allocation.log @@ -414,6 +414,7 @@ plot: { //SEG52 [23] return rts } +//SEG53 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' [ ] ( main:2::plot:7 [ main::i#2 ] main:2::plot:12 [ main::j#2 ] main:2::plot:17 [ main::k#2 ] ) always clobbers reg byte a @@ -556,6 +557,7 @@ plot: { //SEG52 [23] return rts } +//SEG53 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -729,4 +731,5 @@ plot: { //SEG52 [23] return rts } +//SEG53 File Data diff --git a/src/test/ref/plus-0.log b/src/test/ref/plus-0.log index 9c4e91277..2c16181ed 100644 --- a/src/test/ref/plus-0.log +++ b/src/test/ref/plus-0.log @@ -484,6 +484,7 @@ fill: { //SEG41 [18] return rts } +//SEG42 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] (byte*~) fill::$5 ← (byte*) fill::screen#4 + (byte) 1*(byte) $28 [ fill::screen#4 fill::ch#4 fill::i#4 fill::$5 ] ( main:2::fill:5 [ fill::screen#4 fill::ch#4 fill::i#4 fill::$5 ] main:2::fill:7 [ fill::screen#4 fill::ch#4 fill::i#4 fill::$5 ] ) always clobbers reg byte a @@ -638,6 +639,7 @@ fill: { //SEG41 [18] return rts } +//SEG42 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -808,4 +810,5 @@ fill: { //SEG41 [18] return rts } +//SEG42 File Data diff --git a/src/test/ref/pointer-cast-2.log b/src/test/ref/pointer-cast-2.log index a2cb67261..9f88ab0f1 100644 --- a/src/test/ref/pointer-cast-2.log +++ b/src/test/ref/pointer-cast-2.log @@ -215,6 +215,7 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::ub#0 ← (byte) $ff [ main::ub#0 ] ( main:2 [ main::ub#0 ] ) always clobbers reg byte a @@ -291,6 +292,7 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -379,4 +381,5 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data diff --git a/src/test/ref/pointer-cast-3.log b/src/test/ref/pointer-cast-3.log index 6c645cee8..d5b67a90b 100644 --- a/src/test/ref/pointer-cast-3.log +++ b/src/test/ref/pointer-cast-3.log @@ -118,6 +118,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const signed byte*) main::sb_screen#0) ← (const signed byte) main::sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -164,6 +165,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -223,4 +225,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/pointer-cast-4.log b/src/test/ref/pointer-cast-4.log index 20482b939..93cbe319a 100644 --- a/src/test/ref/pointer-cast-4.log +++ b/src/test/ref/pointer-cast-4.log @@ -222,6 +222,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (word~) main::$1 ← (word)(byte) main::i#2 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) always clobbers reg byte a @@ -308,6 +309,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -408,4 +410,5 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data diff --git a/src/test/ref/pointer-cast.log b/src/test/ref/pointer-cast.log index f19f8a047..e73cfd759 100644 --- a/src/test/ref/pointer-cast.log +++ b/src/test/ref/pointer-cast.log @@ -542,6 +542,7 @@ main: { //SEG27 [20] return rts } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) ub_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -672,6 +673,7 @@ main: { //SEG27 [20] return rts } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -814,4 +816,5 @@ main: { //SEG27 [20] return rts } +//SEG28 File Data diff --git a/src/test/ref/pointer-plus-0.log b/src/test/ref/pointer-plus-0.log index b10f6e70d..b9264c992 100644 --- a/src/test/ref/pointer-plus-0.log +++ b/src/test/ref/pointer-plus-0.log @@ -327,6 +327,7 @@ first: { //SEG29 [15] return rts } +//SEG30 File Data msg1: .text "hello world!@" msg2: .text "goodbye sky?@" @@ -436,6 +437,7 @@ first: { //SEG29 [15] return rts } +//SEG30 File Data msg1: .text "hello world!@" msg2: .text "goodbye sky?@" @@ -556,6 +558,7 @@ first: { //SEG29 [15] return rts } +//SEG30 File Data msg1: .text "hello world!@" msg2: .text "goodbye sky?@" diff --git a/src/test/ref/pointer-pointer-1.log b/src/test/ref/pointer-pointer-1.log index c93f2db87..c98b46eac 100644 --- a/src/test/ref/pointer-pointer-1.log +++ b/src/test/ref/pointer-pointer-1.log @@ -155,6 +155,7 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::b#0 ← (byte) 'a' [ main::b#0 ] ( main:2 [ main::b#0 ] ) always clobbers reg byte a @@ -218,6 +219,7 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -294,4 +296,5 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data diff --git a/src/test/ref/pointer-pointer-2.log b/src/test/ref/pointer-pointer-2.log index 7eb4e193b..e1402f8b1 100644 --- a/src/test/ref/pointer-pointer-2.log +++ b/src/test/ref/pointer-pointer-2.log @@ -522,6 +522,7 @@ nexttext: { sta textp+1 jmp breturn } +//SEG47 File Data text1: .text "camelot @" text2: .text "rex @" @@ -695,6 +696,7 @@ nexttext: { sta textp+1 jmp breturn } +//SEG47 File Data text1: .text "camelot @" text2: .text "rex @" @@ -896,6 +898,7 @@ nexttext: { sta textp+1 rts } +//SEG47 File Data text1: .text "camelot @" text2: .text "rex @" diff --git a/src/test/ref/pointer-pointer-3.log b/src/test/ref/pointer-pointer-3.log index 17567de2a..0c1aca7c7 100644 --- a/src/test/ref/pointer-pointer-3.log +++ b/src/test/ref/pointer-pointer-3.log @@ -286,6 +286,7 @@ setscreen: { //SEG27 [12] return rts } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte*) screen#0 ← (byte*) 1024 [ screen#0 ] ( ) always clobbers reg byte a @@ -391,6 +392,7 @@ setscreen: { //SEG27 [12] return rts } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -513,4 +515,5 @@ setscreen: { //SEG27 [12] return rts } +//SEG28 File Data diff --git a/src/test/ref/pointer-void-0.log b/src/test/ref/pointer-void-0.log index d1a8fbb76..8ab81c531 100644 --- a/src/test/ref/pointer-void-0.log +++ b/src/test/ref/pointer-void-0.log @@ -161,6 +161,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (word) main::w#0 ← (word) $4d2 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -217,6 +218,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -291,4 +293,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/pointer-void-1.log b/src/test/ref/pointer-void-1.log index 3e9ff67cb..9581e769e 100644 --- a/src/test/ref/pointer-void-1.log +++ b/src/test/ref/pointer-void-1.log @@ -418,6 +418,7 @@ print: { //SEG35 [16] return rts } +//SEG36 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (dword) main::d#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -561,6 +562,7 @@ print: { //SEG35 [16] return rts } +//SEG36 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -720,4 +722,5 @@ print: { //SEG35 [16] return rts } +//SEG36 File Data diff --git a/src/test/ref/pointer-void-2.log b/src/test/ref/pointer-void-2.log index 4ae5d6a7d..ac9d258ab 100644 --- a/src/test/ref/pointer-void-2.log +++ b/src/test/ref/pointer-void-2.log @@ -396,6 +396,7 @@ print: { //SEG35 [16] return rts } +//SEG36 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (dword) main::d#0 ← (dword) $12345678 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -536,6 +537,7 @@ print: { //SEG35 [16] return rts } +//SEG36 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -686,4 +688,5 @@ print: { //SEG35 [16] return rts } +//SEG36 File Data diff --git a/src/test/ref/print-problem.log b/src/test/ref/print-problem.log index 2c80dc0db..061904da6 100644 --- a/src/test/ref/print-problem.log +++ b/src/test/ref/print-problem.log @@ -336,6 +336,7 @@ ln: { //SEG32 [15] return rts } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ line#12 line#13 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -425,6 +426,7 @@ ln: { //SEG32 [15] return rts } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -533,4 +535,5 @@ ln: { //SEG32 [15] return rts } +//SEG33 File Data diff --git a/src/test/ref/printmsg.log b/src/test/ref/printmsg.log index 6ea3d819e..ea1115b74 100644 --- a/src/test/ref/printmsg.log +++ b/src/test/ref/printmsg.log @@ -650,6 +650,7 @@ print_str: { !: jmp b1_from_b2 } +//SEG64 File Data msg: .text "hello world! @" msg2: .text "hello c64! @" msg3: .text "hello 2017! @" @@ -868,6 +869,7 @@ print_str: { !: jmp b1_from_b2 } +//SEG64 File Data msg: .text "hello world! @" msg2: .text "hello c64! @" msg3: .text "hello 2017! @" @@ -1123,6 +1125,7 @@ print_str: { !: jmp b1 } +//SEG64 File Data msg: .text "hello world! @" msg2: .text "hello c64! @" msg3: .text "hello 2017! @" diff --git a/src/test/ref/ptr-complex.log b/src/test/ref/ptr-complex.log index 6f8254376..638d6acbf 100644 --- a/src/test/ref/ptr-complex.log +++ b/src/test/ref/ptr-complex.log @@ -381,6 +381,7 @@ main: { //SEG35 [18] return rts } +//SEG36 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::screen#0 + (byte) main::i#2) ← *((const byte*) main::screen#0+(byte) $28 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -498,6 +499,7 @@ main: { //SEG35 [18] return rts } +//SEG36 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -633,4 +635,5 @@ main: { //SEG35 [18] return rts } +//SEG36 File Data diff --git a/src/test/ref/ptrptr-optimize-0.log b/src/test/ref/ptrptr-optimize-0.log index 79b08e4d3..3f52fad8c 100644 --- a/src/test/ref/ptrptr-optimize-0.log +++ b/src/test/ref/ptrptr-optimize-0.log @@ -141,6 +141,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte*) main::screen#0 ← (byte*) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -205,6 +206,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -280,4 +282,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/ptrptr-optimize-1.log b/src/test/ref/ptrptr-optimize-1.log index dd985e946..1cf7379ff 100644 --- a/src/test/ref/ptrptr-optimize-1.log +++ b/src/test/ref/ptrptr-optimize-1.log @@ -236,6 +236,7 @@ sub: { //SEG25 [12] return rts } +//SEG26 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte*) main::screen#0 ← (byte*) 1024 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -324,6 +325,7 @@ sub: { //SEG25 [12] return rts } +//SEG26 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -427,4 +429,5 @@ sub: { //SEG25 [12] return rts } +//SEG26 File Data diff --git a/src/test/ref/ptrptr-optimize-2.log b/src/test/ref/ptrptr-optimize-2.log index 6c5305ff0..9f88315f1 100644 --- a/src/test/ref/ptrptr-optimize-2.log +++ b/src/test/ref/ptrptr-optimize-2.log @@ -236,6 +236,7 @@ sub: { //SEG25 [12] return rts } +//SEG26 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte*) main::screen#0 ← (byte*) 1024 [ main::screen#0 ] ( main:2 [ main::screen#0 ] ) always clobbers reg byte a @@ -324,6 +325,7 @@ sub: { //SEG25 [12] return rts } +//SEG26 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -425,4 +427,5 @@ sub: { //SEG25 [12] return rts } +//SEG26 File Data diff --git a/src/test/ref/ptrtest.log b/src/test/ref/ptrtest.log index 471740494..c35ca4a04 100644 --- a/src/test/ref/ptrtest.log +++ b/src/test/ref/ptrtest.log @@ -801,6 +801,7 @@ lvalue: { //SEG89 [37] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy jmp b1 } +//SEG90 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) always clobbers reg byte a reg byte y @@ -1078,6 +1079,7 @@ lvalue: { //SEG89 [37] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy jmp b1 } +//SEG90 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1397,4 +1399,5 @@ lvalue: { //SEG89 [37] phi (byte) lvalue::i#2 = (byte) lvalue::i#1 [phi:lvalue::@2->lvalue::@1#0] -- register_copy jmp b1 } +//SEG90 File Data diff --git a/src/test/ref/ptrtestmin.log b/src/test/ref/ptrtestmin.log index 61c3df122..518db82ec 100644 --- a/src/test/ref/ptrtestmin.log +++ b/src/test/ref/ptrtestmin.log @@ -234,6 +234,7 @@ main: { //SEG25 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG26 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -308,6 +309,7 @@ main: { //SEG25 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG26 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -403,4 +405,5 @@ main: { //SEG25 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG26 File Data diff --git a/src/test/ref/reserve-zp-global.log b/src/test/ref/reserve-zp-global.log index e63ea9cd3..3b2f63b79 100644 --- a/src/test/ref/reserve-zp-global.log +++ b/src/test/ref/reserve-zp-global.log @@ -271,6 +271,7 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::i#0 ← (byte) 0 [ main::i#0 ] ( main:2 [ main::i#0 ] ) always clobbers reg byte a @@ -365,6 +366,7 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -478,4 +480,5 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data diff --git a/src/test/ref/reserve-zp-procedure-1.log b/src/test/ref/reserve-zp-procedure-1.log index 5ec95a047..66ef24bc7 100644 --- a/src/test/ref/reserve-zp-procedure-1.log +++ b/src/test/ref/reserve-zp-procedure-1.log @@ -271,6 +271,7 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::i#0 ← (byte) 0 [ main::i#0 ] ( main:2 [ main::i#0 ] ) always clobbers reg byte a @@ -365,6 +366,7 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -478,4 +480,5 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data diff --git a/src/test/ref/reserve-zp-procedure-2.log b/src/test/ref/reserve-zp-procedure-2.log index 929738173..1dde22d1e 100644 --- a/src/test/ref/reserve-zp-procedure-2.log +++ b/src/test/ref/reserve-zp-procedure-2.log @@ -404,6 +404,7 @@ sub1: { //SEG38 [23] return rts } +//SEG39 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::i#0 ← (byte) 0 [ main::i#0 ] ( main:2 [ main::i#0 ] ) always clobbers reg byte a @@ -545,6 +546,7 @@ sub1: { //SEG38 [23] return rts } +//SEG39 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -701,4 +703,5 @@ sub1: { //SEG38 [23] return rts } +//SEG39 File Data diff --git a/src/test/ref/reserve-zp-procedure-3.log b/src/test/ref/reserve-zp-procedure-3.log index 4cca1164a..fa7f709d5 100644 --- a/src/test/ref/reserve-zp-procedure-3.log +++ b/src/test/ref/reserve-zp-procedure-3.log @@ -272,6 +272,7 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::i#0 ← (byte) 0 [ main::i#0 ] ( main:2 [ main::i#0 ] ) always clobbers reg byte a @@ -366,6 +367,7 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -479,4 +481,5 @@ sub1: { //SEG27 [15] return rts } +//SEG28 File Data diff --git a/src/test/ref/robozzle64-label-problem.log b/src/test/ref/robozzle64-label-problem.log index 8ba9ec7cc..d927fe280 100644 --- a/src/test/ref/robozzle64-label-problem.log +++ b/src/test/ref/robozzle64-label-problem.log @@ -652,6 +652,7 @@ mul8u: { //SEG63 [21] phi (byte) mul8u::a#3 = (byte) mul8u::a#0 [phi:mul8u::@3->mul8u::@1#2] -- register_copy jmp b1 } +//SEG64 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [8] (word) mul8u::return#2 ← (word) mul8u::res#2 [ main::y#2 main::screen#1 mul8u::return#2 ] ( main:2 [ main::y#2 main::screen#1 mul8u::return#2 ] ) always clobbers reg byte a @@ -886,6 +887,7 @@ mul8u: { //SEG63 [21] phi (byte) mul8u::a#3 = (byte) mul8u::a#0 [phi:mul8u::@3->mul8u::@1#2] -- register_copy jmp b1 } +//SEG64 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1141,4 +1143,5 @@ mul8u: { //SEG63 [21] phi (byte) mul8u::a#3 = (byte) mul8u::a#0 [phi:mul8u::@3->mul8u::@1#2] -- register_copy jmp b1 } +//SEG64 File Data diff --git a/src/test/ref/roll-sprite-msb.log b/src/test/ref/roll-sprite-msb.log index a7c5189ad..dc175b8d5 100644 --- a/src/test/ref/roll-sprite-msb.log +++ b/src/test/ref/roll-sprite-msb.log @@ -537,6 +537,7 @@ position_sprite: { sta SPRITES_XMSB jmp breturn } +//SEG42 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (word) position_sprite::x#0 ← (word) main::xpos#2 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ( main:2 [ main::s#2 main::xpos#2 position_sprite::spriteno#0 position_sprite::x#0 ] ) always clobbers reg byte a @@ -730,6 +731,7 @@ position_sprite: { sta SPRITES_XMSB jmp breturn } +//SEG42 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -931,4 +933,5 @@ position_sprite: { sta SPRITES_XMSB rts } +//SEG42 File Data diff --git a/src/test/ref/roll-variable.log b/src/test/ref/roll-variable.log index 6581c0efe..e05cc411a 100644 --- a/src/test/ref/roll-variable.log +++ b/src/test/ref/roll-variable.log @@ -200,6 +200,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$0 ← (byte) $55 << (byte) main::b#2 [ main::b#2 main::$0 ] ( main:2 [ main::b#2 main::$0 ] ) always clobbers reg byte a @@ -282,6 +283,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -378,4 +380,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/runtime-unused-procedure.log b/src/test/ref/runtime-unused-procedure.log index 3521b8db4..ef0e45fb7 100644 --- a/src/test/ref/runtime-unused-procedure.log +++ b/src/test/ref/runtime-unused-procedure.log @@ -189,6 +189,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) screen#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -234,6 +235,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -291,4 +293,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/sandbox-ternary-error.log b/src/test/ref/sandbox-ternary-error.log index 2ffe5f7cb..539302a67 100644 --- a/src/test/ref/sandbox-ternary-error.log +++ b/src/test/ref/sandbox-ternary-error.log @@ -320,6 +320,7 @@ main: { //SEG35 [14] return rts } +//SEG36 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::b#2 main::b#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -420,6 +421,7 @@ main: { //SEG35 [14] return rts } +//SEG36 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -549,4 +551,5 @@ main: { //SEG35 [14] return rts } +//SEG36 File Data diff --git a/src/test/ref/sandbox.log b/src/test/ref/sandbox.log index 43555100d..b67684548 100644 --- a/src/test/ref/sandbox.log +++ b/src/test/ref/sandbox.log @@ -5873,6 +5873,7 @@ divr16u: { //SEG466 [213] return rts } +//SEG467 File Data // "char buf16[16]" is the normal way -- not supported -- https://gitlab.com/camelot/kickc/issues/162 strTemp: .fill $64, 0 @@ -7648,6 +7649,7 @@ divr16u: { //SEG466 [213] return rts } +//SEG467 File Data // "char buf16[16]" is the normal way -- not supported -- https://gitlab.com/camelot/kickc/issues/162 strTemp: .fill $64, 0 @@ -9461,6 +9463,7 @@ divr16u: { //SEG466 [213] return rts } +//SEG467 File Data // "char buf16[16]" is the normal way -- not supported -- https://gitlab.com/camelot/kickc/issues/162 strTemp: .fill $64, 0 diff --git a/src/test/ref/scan-desire-problem.cfg b/src/test/ref/scan-desire-problem.cfg index fc66e3a40..6b90a1cb4 100644 --- a/src/test/ref/scan-desire-problem.cfg +++ b/src/test/ref/scan-desire-problem.cfg @@ -120,14 +120,14 @@ init::@return: scope:[init] from init::@1 memset: scope:[memset] from init::@2 init::@3 [70] (byte) memset::c#3 ← phi( init::@2/(byte) 0 init::@3/(const byte) BLACK#0 ) [70] (void*) memset::str#2 ← phi( init::@2/(void*)(const byte*) screen#0 init::@3/(void*)(const byte*) colors#0 ) - [71] (void*) memset::end#0 ← (void*) memset::str#2 + (word) $3e8 + [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 to:memset::@1 memset::@1: scope:[memset] from memset memset::@1 [73] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 [75] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 - [76] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 + [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 to:memset::@return memset::@return: scope:[memset] from memset::@1 [77] return diff --git a/src/test/ref/scan-desire-problem.log b/src/test/ref/scan-desire-problem.log index a81d0ad73..bdfed351a 100644 --- a/src/test/ref/scan-desire-problem.log +++ b/src/test/ref/scan-desire-problem.log @@ -44,9 +44,6 @@ Adding pointer type conversion cast (void()**) KERNEL_IRQ in (void()**) KERNEL_I Adding pointer type conversion cast (void()**) HARDWARE_IRQ in (void()**) HARDWARE_IRQ ← (number) $fffe Adding pointer type conversion cast to void pointer (byte*) memcpy::source in (byte*) memcpy::src ← (void*) memcpy::source Adding pointer type conversion cast to void pointer (byte*) memcpy::destination in (byte*) memcpy::dst ← (void*) memcpy::destination -Adding pointer type conversion cast to void pointer (byte*) memmove::$3 in (byte*) memmove::src ← (void*~) memmove::$3 -Adding pointer type conversion cast to void pointer (byte*) memmove::$4 in (byte*) memmove::dst ← (void*~) memmove::$4 -Adding pointer type conversion cast to void pointer (byte*) memset::$0 in (byte*) memset::end ← (void*~) memset::$0 Adding pointer type conversion cast to void pointer (byte*) memset::str in (byte*) memset::dst ← (void*) memset::str Adding pointer type conversion cast (byte*) screen in (byte*) screen ← (number) $400 Adding pointer type conversion cast (byte*) charset in (byte*) charset ← (number) $2000 @@ -114,8 +111,9 @@ memset: scope:[memset] from init::@2 init::@3 (byte) memset::c#3 ← phi( init::@2/(byte) memset::c#0 init::@3/(byte) memset::c#1 ) (word) memset::num#2 ← phi( init::@2/(word) memset::num#0 init::@3/(word) memset::num#1 ) (void*) memset::str#2 ← phi( init::@2/(void*) memset::str#0 init::@3/(void*) memset::str#1 ) - (void*~) memset::$0 ← (void*) memset::str#2 + (word) memset::num#2 - (byte*) memset::end#0 ← ((byte*)) (void*~) memset::$0 + (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 @@ -125,8 +123,8 @@ memset::@1: scope:[memset] from memset memset::@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::$1 ← (byte*) memset::dst#1 != (byte*) memset::end#1 - if((bool~) memset::$1) goto memset::@1 + (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 ) @@ -497,8 +495,9 @@ SYMBOL TABLE SSA (byte) main::z (byte) main::z#0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) -(void*~) memset::$0 -(bool~) memset::$1 +(byte*~) memset::$0 +(byte*~) memset::$1 +(bool~) memset::$2 (label) memset::@1 (label) memset::@2 (label) memset::@return @@ -654,7 +653,7 @@ Inlining cast (byte) RED#0 ← (unumber)(number) 2 Inlining cast (byte) GREEN#0 ← (unumber)(number) 5 Inlining cast (byte) BLUE#0 ← (unumber)(number) 6 Inlining cast (byte) YELLOW#0 ← (unumber)(number) 7 -Inlining cast (byte*) memset::end#0 ← (byte*)(void*~) memset::$0 +Inlining cast (byte*~) memset::$0 ← (byte*)(void*) memset::str#2 Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2 Inlining cast (word) mul8u::res#0 ← (unumber)(number) 0 Inlining cast (byte*) screen#0 ← (byte*)(number) $400 @@ -793,8 +792,9 @@ Inferred type updated to word in (unumber~) draw_block::$7 ← (word) draw_block Inferred type updated to word in (unumber~) draw_block::$8 ← (word) draw_block::z#1 + (byte) $28 Inferred type updated to word in (unumber~) draw_block::$9 ← (word) draw_block::z#1 + (byte) $29 Inferred type updated to word in (unumber~) draw_block::$10 ← (word) draw_block::z#1 + (byte) $29 -Inversing boolean not [41] (bool~) mul8u::$3 ← (byte~) mul8u::$1 == (byte) 0 from [40] (bool~) mul8u::$2 ← (byte~) mul8u::$1 != (byte) 0 +Inversing boolean not [42] (bool~) mul8u::$3 ← (byte~) mul8u::$1 == (byte) 0 from [41] (bool~) mul8u::$2 ← (byte~) mul8u::$1 != (byte) 0 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 (word) mul8u::mb#0 = (byte) mul8u::b#1 Alias (byte) mul8u::a#2 = (byte) mul8u::a#3 (byte) mul8u::a#6 @@ -834,11 +834,11 @@ Identical Phi Values (byte) draw_block::tileno#2 (byte) draw_block::tileno#0 Identical Phi Values (byte) draw_block::x#1 (byte) draw_block::x#0 Identical Phi Values (byte) draw_block::y#2 (byte) draw_block::y#0 Successful SSA optimization Pass2IdenticalPhiElimination -Simple Condition (bool~) memset::$1 [26] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 -Simple Condition (bool~) mul8u::$0 [37] if((byte) mul8u::a#2!=(byte) 0) goto mul8u::@2 -Simple Condition (bool~) mul8u::$3 [42] if((byte~) mul8u::$1==(byte) 0) goto mul8u::@4 -Simple Condition (bool~) main::$3 [77] if((byte) main::y#1<(byte) 9) goto main::@2 -Simple Condition (bool~) main::$4 [81] if((byte) main::x#1<(byte) $10) goto main::@1 +Simple Condition (bool~) memset::$2 [27] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 +Simple Condition (bool~) mul8u::$0 [38] if((byte) mul8u::a#2!=(byte) 0) goto mul8u::@2 +Simple Condition (bool~) mul8u::$3 [43] if((byte~) mul8u::$1==(byte) 0) goto mul8u::@4 +Simple Condition (bool~) main::$3 [78] if((byte) main::y#1<(byte) 9) goto main::@2 +Simple Condition (bool~) main::$4 [82] if((byte) main::x#1<(byte) $10) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SPRITES_XMSB#0 = (byte*) 53264 Constant (const byte*) SPRITES_ENABLE#0 = (byte*) 53269 @@ -876,21 +876,21 @@ Constant (const byte) memset::c#1 = BLACK#0 Constant (const byte*) init::toD0181_screen#0 = screen#0 Constant (const byte*) init::toD0181_gfx#0 = charset#0 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (void*)screen#0 in [85] (void*) memset::str#0 ← (void*)(const byte*) screen#0 -Constant value identified (void*)colors#0 in [90] (void*) memset::str#1 ← (void*)(const byte*) colors#0 -Constant value identified (word)init::toD0181_screen#0 in [98] (word~) init::toD0181_$0#0 ← (word)(const byte*) init::toD0181_screen#0 -Constant value identified (word)init::toD0181_gfx#0 in [102] (word~) init::toD0181_$4#0 ← (word)(const byte*) init::toD0181_gfx#0 +Constant value identified (void*)screen#0 in [86] (void*) memset::str#0 ← (void*)(const byte*) screen#0 +Constant value identified (void*)colors#0 in [91] (void*) memset::str#1 ← (void*)(const byte*) colors#0 +Constant value identified (word)init::toD0181_screen#0 in [99] (word~) init::toD0181_$0#0 ← (word)(const byte*) init::toD0181_screen#0 +Constant value identified (word)init::toD0181_gfx#0 in [103] (word~) init::toD0181_$4#0 ← (word)(const byte*) init::toD0181_gfx#0 Successful SSA optimization Pass2ConstantValues -if() condition always true - replacing block destination [82] if(true) goto main::@5 +if() condition always true - replacing block destination [83] if(true) goto main::@5 Successful SSA optimization Pass2ConstantIfs -De-inlining pointer[w] to *(pointer+w) [144] *((const byte*) screen#0 + (word) draw_block::z#1) ← (byte) draw_block::drawtile#0 -De-inlining pointer[w] to *(pointer+w) [145] *((const byte*) colors#0 + (word) draw_block::z#1) ← (const byte) YELLOW#0 -De-inlining pointer[w] to *(pointer+w) [147] *((const byte*) screen#0 + (word~) draw_block::$5) ← (byte) 1 -De-inlining pointer[w] to *(pointer+w) [149] *((const byte*) colors#0 + (word~) draw_block::$6) ← (const byte) YELLOW#0 -De-inlining pointer[w] to *(pointer+w) [151] *((const byte*) screen#0 + (word~) draw_block::$7) ← (byte) 2 -De-inlining pointer[w] to *(pointer+w) [153] *((const byte*) colors#0 + (word~) draw_block::$8) ← (const byte) YELLOW#0 -De-inlining pointer[w] to *(pointer+w) [155] *((const byte*) screen#0 + (word~) draw_block::$9) ← (byte) 3 -De-inlining pointer[w] to *(pointer+w) [157] *((const byte*) colors#0 + (word~) draw_block::$10) ← (const byte) YELLOW#0 +De-inlining pointer[w] to *(pointer+w) [145] *((const byte*) screen#0 + (word) draw_block::z#1) ← (byte) draw_block::drawtile#0 +De-inlining pointer[w] to *(pointer+w) [146] *((const byte*) colors#0 + (word) draw_block::z#1) ← (const byte) YELLOW#0 +De-inlining pointer[w] to *(pointer+w) [148] *((const byte*) screen#0 + (word~) draw_block::$5) ← (byte) 1 +De-inlining pointer[w] to *(pointer+w) [150] *((const byte*) colors#0 + (word~) draw_block::$6) ← (const byte) YELLOW#0 +De-inlining pointer[w] to *(pointer+w) [152] *((const byte*) screen#0 + (word~) draw_block::$7) ← (byte) 2 +De-inlining pointer[w] to *(pointer+w) [154] *((const byte*) colors#0 + (word~) draw_block::$8) ← (const byte) YELLOW#0 +De-inlining pointer[w] to *(pointer+w) [156] *((const byte*) screen#0 + (word~) draw_block::$9) ← (byte) 3 +De-inlining pointer[w] to *(pointer+w) [158] *((const byte*) colors#0 + (word~) draw_block::$10) ← (const byte) YELLOW#0 Successful SSA optimization Pass2DeInlineWordDerefIdx 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 @@ -925,8 +925,7 @@ Constant right-side identified [34] (byte) init::toD0181_return#0 ← (const byt Successful SSA optimization Pass2ConstantRValueConsolidation Constant (const byte) init::toD0181_return#0 = init::toD0181_$3#0|init::toD0181_$7#0 Successful SSA optimization Pass2ConstantIdentification -Inlining Noop Cast [2] (byte*) memset::end#0 ← (byte*)(void*~) memset::$0 keeping memset::end#0 -Successful SSA optimization Pass2NopCastInlining +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 constant with var siblings (const byte) memset::c#0 @@ -1156,14 +1155,14 @@ init::@return: scope:[init] from init::@1 memset: scope:[memset] from init::@2 init::@3 [70] (byte) memset::c#3 ← phi( init::@2/(byte) 0 init::@3/(const byte) BLACK#0 ) [70] (void*) memset::str#2 ← phi( init::@2/(void*)(const byte*) screen#0 init::@3/(void*)(const byte*) colors#0 ) - [71] (void*) memset::end#0 ← (void*) memset::str#2 + (word) $3e8 + [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 to:memset::@1 memset::@1: scope:[memset] from memset memset::@1 [73] (byte*) memset::dst#2 ← phi( memset/(byte*~) memset::dst#3 memset::@1/(byte*) memset::dst#1 ) [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 [75] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 - [76] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 + [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 to:memset::@return memset::@return: scope:[memset] from memset::@1 [77] return @@ -1261,11 +1260,11 @@ VARIABLE REGISTER WEIGHTS (byte*) memset::dst#2 17.5 (byte*~) memset::dst#3 4.0 (byte*) memset::end -(void*) memset::end#0 0.3333333333333333 +(byte*) memset::end#0 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#2 1.0 +(void*) memset::str#2 (word()) mul8u((byte) mul8u::a , (byte) mul8u::b) (byte~) mul8u::$1 2002.0 (byte) mul8u::a @@ -1833,7 +1832,7 @@ memset: { .label dst = $c .label str = 9 .label c = $b - //SEG117 [71] (void*) memset::end#0 ← (void*) memset::str#2 + (word) $3e8 -- pvoz1=pvoz2_plus_vwuc1 + //SEG117 [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1 lda str clc adc #<$3e8 @@ -1862,7 +1861,7 @@ memset: { bne !+ inc dst+1 !: - //SEG124 [76] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG124 [76] 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 @@ -1902,6 +1901,7 @@ init_sprites: { //SEG135 [84] return rts } +//SEG136 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [8] (byte) main::z#0 ← (byte) main::x#4 + (byte) main::y#2 [ main::x#4 main::y#2 main::z#0 ] ( main:2 [ main::x#4 main::y#2 main::z#0 ] ) always clobbers reg byte a @@ -1944,12 +1944,12 @@ Statement [65] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0 [ ] ( main:2:: Statement [66] *((const byte*) BGCOL2#0) ← (const byte) RED#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [67] *((const byte*) BGCOL3#0) ← (const byte) BLUE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [68] *((const byte*) BGCOL4#0) ← (const byte) GREEN#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [71] (void*) memset::end#0 ← (void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ 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:11 [ memset::c#3 ] Statement [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a Statement [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#2 ] main:2::init:5::memset:60 [ 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:11 [ memset::c#3 ] -Statement [76] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a Statement [78] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a Statement [79] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a Statement [80] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a @@ -1988,10 +1988,10 @@ Statement [65] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0 [ ] ( main:2:: Statement [66] *((const byte*) BGCOL2#0) ← (const byte) RED#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [67] *((const byte*) BGCOL3#0) ← (const byte) BLUE#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a Statement [68] *((const byte*) BGCOL4#0) ← (const byte) GREEN#0 [ ] ( main:2::init:5 [ ] ) always clobbers reg byte a -Statement [71] (void*) memset::end#0 ← (void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a +Statement [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 [ memset::str#2 memset::c#3 memset::end#0 ] ( main:2::init:5::memset:58 [ memset::str#2 memset::c#3 memset::end#0 ] main:2::init:5::memset:60 [ memset::str#2 memset::c#3 memset::end#0 ] ) always clobbers reg byte a Statement [72] (byte*~) memset::dst#3 ← (byte*)(void*) memset::str#2 [ memset::c#3 memset::end#0 memset::dst#3 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#3 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#3 ] ) always clobbers reg byte a Statement [74] *((byte*) memset::dst#2) ← (byte) memset::c#3 [ memset::c#3 memset::end#0 memset::dst#2 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#2 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#2 ] ) always clobbers reg byte a reg byte y -Statement [76] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a +Statement [76] if((byte*) memset::dst#1!=(byte*) memset::end#0) goto memset::@1 [ memset::c#3 memset::end#0 memset::dst#1 ] ( main:2::init:5::memset:58 [ memset::c#3 memset::end#0 memset::dst#1 ] main:2::init:5::memset:60 [ memset::c#3 memset::end#0 memset::dst#1 ] ) always clobbers reg byte a Statement [78] *((const byte*) SPRITES_ENABLE#0) ← (byte) 1 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a Statement [79] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a Statement [80] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0 [ ] ( main:2::init:5::init_sprites:56 [ ] ) always clobbers reg byte a @@ -2033,7 +2033,7 @@ REGISTER UPLIFT SCOPES Uplift Scope [mul8u] 3,503.83: zp ZP_WORD:5 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] 2,431: zp ZP_WORD:7 [ mul8u::mb#2 mul8u::mb#1 ] 2,002: zp ZP_BYTE:46 [ mul8u::$1 ] 1,670.67: zp ZP_BYTE:4 [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] 4: zp ZP_WORD:23 [ mul8u::return#2 ] Uplift Scope [main] 209.21: zp ZP_BYTE:3 [ main::y#2 main::y#1 ] 202: zp ZP_BYTE:14 [ main::z#0 ] 202: zp ZP_BYTE:15 [ main::tile#0 ] 38.9: zp ZP_BYTE:2 [ main::x#4 main::x#1 ] Uplift Scope [draw_block] 34.33: zp ZP_BYTE:16 [ draw_block::tileno#0 ] 34.33: zp ZP_BYTE:17 [ draw_block::x#0 ] 34.33: zp ZP_BYTE:18 [ draw_block::y#0 ] 4: zp ZP_BYTE:22 [ draw_block::y#1 ] 4: zp ZP_WORD:25 [ draw_block::z#0 ] 4: zp ZP_WORD:30 [ draw_block::$11 ] 4: zp ZP_WORD:32 [ draw_block::$12 ] 4: zp ZP_WORD:34 [ draw_block::$13 ] 4: zp ZP_WORD:36 [ draw_block::$14 ] 4: zp ZP_WORD:38 [ draw_block::$15 ] 4: zp ZP_WORD:40 [ draw_block::$16 ] 4: zp ZP_WORD:42 [ draw_block::$17 ] 4: zp ZP_WORD:44 [ draw_block::$18 ] 2: zp ZP_BYTE:29 [ draw_block::drawtile#0 ] 1.12: zp ZP_WORD:27 [ draw_block::z#1 ] 0.67: zp ZP_WORD:20 [ draw_block::x1#0 ] 0.5: zp ZP_BYTE:19 [ draw_block::tileno#1 ] -Uplift Scope [memset] 38: zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 1.57: zp ZP_BYTE:11 [ memset::c#3 ] 1: zp ZP_WORD:9 [ memset::str#2 ] 0.33: zp ZP_WORD:47 [ memset::end#0 ] +Uplift Scope [memset] 38: zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] 2.17: zp ZP_WORD:47 [ memset::end#0 ] 1.57: zp ZP_BYTE:11 [ memset::c#3 ] 0: zp ZP_WORD:9 [ memset::str#2 ] Uplift Scope [init] Uplift Scope [init_sprites] Uplift Scope [] @@ -2042,7 +2042,7 @@ Uplifting [mul8u] best 92836 combination zp ZP_WORD:5 [ mul8u::res#2 mul8u::res# Uplifting [main] best 91836 combination zp ZP_BYTE:3 [ main::y#2 main::y#1 ] reg byte a [ main::z#0 ] reg byte a [ main::tile#0 ] zp ZP_BYTE:2 [ main::x#4 main::x#1 ] Uplifting [draw_block] best 90927 combination reg byte a [ draw_block::tileno#0 ] reg byte y [ draw_block::x#0 ] reg byte x [ draw_block::y#0 ] reg byte a [ draw_block::y#1 ] zp ZP_WORD:25 [ draw_block::z#0 ] zp ZP_WORD:30 [ draw_block::$11 ] zp ZP_WORD:32 [ draw_block::$12 ] zp ZP_WORD:34 [ draw_block::$13 ] zp ZP_WORD:36 [ draw_block::$14 ] zp ZP_WORD:38 [ draw_block::$15 ] zp ZP_WORD:40 [ draw_block::$16 ] zp ZP_WORD:42 [ draw_block::$17 ] zp ZP_WORD:44 [ draw_block::$18 ] zp ZP_BYTE:29 [ draw_block::drawtile#0 ] zp ZP_WORD:27 [ draw_block::z#1 ] zp ZP_WORD:20 [ draw_block::x1#0 ] zp ZP_BYTE:19 [ draw_block::tileno#1 ] Limited combination testing to 100 combinations of 1296 possible. -Uplifting [memset] best 90911 combination zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] reg byte x [ memset::c#3 ] zp ZP_WORD:9 [ memset::str#2 ] zp ZP_WORD:47 [ memset::end#0 ] +Uplifting [memset] best 90911 combination zp ZP_WORD:12 [ memset::dst#2 memset::dst#3 memset::dst#1 ] zp ZP_WORD:47 [ memset::end#0 ] reg byte x [ memset::c#3 ] zp ZP_WORD:9 [ memset::str#2 ] Uplifting [init] best 90911 combination Uplifting [init_sprites] best 90911 combination Uplifting [] best 90911 combination @@ -2497,7 +2497,7 @@ memset: { .label end = $1b .label dst = 8 .label str = 8 - //SEG117 [71] (void*) memset::end#0 ← (void*) memset::str#2 + (word) $3e8 -- pvoz1=pvoz2_plus_vwuc1 + //SEG117 [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1 lda str clc adc #<$3e8 @@ -2522,7 +2522,7 @@ memset: { bne !+ inc dst+1 !: - //SEG124 [76] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG124 [76] 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 @@ -2562,6 +2562,7 @@ init_sprites: { //SEG135 [84] return rts } +//SEG136 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -2773,11 +2774,11 @@ FINAL SYMBOL TABLE (byte*) memset::dst#2 dst zp ZP_WORD:8 17.5 (byte*~) memset::dst#3 dst zp ZP_WORD:8 4.0 (byte*) memset::end -(void*) memset::end#0 end zp ZP_WORD:27 0.3333333333333333 +(byte*) memset::end#0 end zp ZP_WORD:27 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#2 str zp ZP_WORD:8 1.0 +(void*) memset::str#2 str zp ZP_WORD:8 (word()) mul8u((byte) mul8u::a , (byte) mul8u::b) (byte~) mul8u::$1 reg byte a 2002.0 (label) mul8u::@1 @@ -3193,7 +3194,7 @@ memset: { .label end = $1b .label dst = 8 .label str = 8 - //SEG117 [71] (void*) memset::end#0 ← (void*) memset::str#2 + (word) $3e8 -- pvoz1=pvoz2_plus_vwuc1 + //SEG117 [71] (byte*) memset::end#0 ← (byte*)(void*) memset::str#2 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1 lda str clc adc #<$3e8 @@ -3215,7 +3216,7 @@ memset: { bne !+ inc dst+1 !: - //SEG124 [76] if((byte*) memset::dst#1!=(byte*)(void*) memset::end#0) goto memset::@1 -- pbuz1_neq_pbuz2_then_la1 + //SEG124 [76] 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 @@ -3249,4 +3250,5 @@ init_sprites: { //SEG135 [84] return rts } +//SEG136 File Data diff --git a/src/test/ref/scan-desire-problem.sym b/src/test/ref/scan-desire-problem.sym index a2093b956..8099d8155 100644 --- a/src/test/ref/scan-desire-problem.sym +++ b/src/test/ref/scan-desire-problem.sym @@ -117,11 +117,11 @@ (byte*) memset::dst#2 dst zp ZP_WORD:8 17.5 (byte*~) memset::dst#3 dst zp ZP_WORD:8 4.0 (byte*) memset::end -(void*) memset::end#0 end zp ZP_WORD:27 0.3333333333333333 +(byte*) memset::end#0 end zp ZP_WORD:27 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#2 str zp ZP_WORD:8 1.0 +(void*) memset::str#2 str zp ZP_WORD:8 (word()) mul8u((byte) mul8u::a , (byte) mul8u::b) (byte~) mul8u::$1 reg byte a 2002.0 (label) mul8u::@1 diff --git a/src/test/ref/scroll-clobber.log b/src/test/ref/scroll-clobber.log index a6a770a0d..8b90dfcfb 100644 --- a/src/test/ref/scroll-clobber.log +++ b/src/test/ref/scroll-clobber.log @@ -287,6 +287,7 @@ main: { //SEG31 [5] phi (byte*) main::nxt#3 = (byte*) main::nxt#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG32 File Data TEXT: .text "01234567@" REGISTER UPLIFT POTENTIAL REGISTERS @@ -389,6 +390,7 @@ main: { //SEG31 [5] phi (byte*) main::nxt#3 = (byte*) main::nxt#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG32 File Data TEXT: .text "01234567@" ASSEMBLER OPTIMIZATIONS @@ -515,5 +517,6 @@ main: { //SEG31 [5] phi (byte*) main::nxt#3 = (byte*) main::nxt#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG32 File Data TEXT: .text "01234567@" diff --git a/src/test/ref/scrollbig-clobber.log b/src/test/ref/scrollbig-clobber.log index ad5d0b54d..2d8c22e68 100644 --- a/src/test/ref/scrollbig-clobber.log +++ b/src/test/ref/scrollbig-clobber.log @@ -405,6 +405,7 @@ next_char: { //SEG41 [18] return rts } +//SEG42 File Data TEXT: .text "cml @" REGISTER UPLIFT POTENTIAL REGISTERS @@ -536,6 +537,7 @@ next_char: { //SEG41 [18] return rts } +//SEG42 File Data TEXT: .text "cml @" ASSEMBLER OPTIMIZATIONS @@ -697,5 +699,6 @@ next_char: { //SEG41 [18] return rts } +//SEG42 File Data TEXT: .text "cml @" diff --git a/src/test/ref/semi-struct-1.log b/src/test/ref/semi-struct-1.log index 5c9927d74..543c08f29 100644 --- a/src/test/ref/semi-struct-1.log +++ b/src/test/ref/semi-struct-1.log @@ -1859,6 +1859,7 @@ init_points: { //SEG144 [70] return rts } +//SEG145 File Data print_hextab: .text "0123456789abcdef" // All points points: .fill NUM_POINTS*SIZEOF_POINT, 0 @@ -2394,6 +2395,7 @@ init_points: { //SEG144 [70] return rts } +//SEG145 File Data print_hextab: .text "0123456789abcdef" // All points points: .fill NUM_POINTS*SIZEOF_POINT, 0 @@ -2990,6 +2992,7 @@ init_points: { //SEG144 [70] return rts } +//SEG145 File Data print_hextab: .text "0123456789abcdef" // All points points: .fill NUM_POINTS*SIZEOF_POINT, 0 diff --git a/src/test/ref/semi-struct-2.log b/src/test/ref/semi-struct-2.log index a6c4817aa..82606c51d 100644 --- a/src/test/ref/semi-struct-2.log +++ b/src/test/ref/semi-struct-2.log @@ -6956,6 +6956,7 @@ keyboard_init: { //SEG579 [257] return rts } +//SEG580 File Data print_hextab: .text "0123456789abcdef" // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f @@ -8999,6 +9000,7 @@ keyboard_init: { //SEG579 [257] return rts } +//SEG580 File Data print_hextab: .text "0123456789abcdef" // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f @@ -11224,6 +11226,7 @@ keyboard_init: { //SEG579 [257] return rts } +//SEG580 File Data print_hextab: .text "0123456789abcdef" // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f diff --git a/src/test/ref/sequence-locality-0.log b/src/test/ref/sequence-locality-0.log index f04bfd95d..c135e35c7 100644 --- a/src/test/ref/sequence-locality-0.log +++ b/src/test/ref/sequence-locality-0.log @@ -302,6 +302,7 @@ main: { inc idx jmp b3_from_b2 } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -396,6 +397,7 @@ main: { iny jmp b3_from_b2 } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -518,4 +520,5 @@ main: { iny jmp b3 } +//SEG33 File Data diff --git a/src/test/ref/sequence-locality-1.log b/src/test/ref/sequence-locality-1.log index 1cb88c748..f2cff58c0 100644 --- a/src/test/ref/sequence-locality-1.log +++ b/src/test/ref/sequence-locality-1.log @@ -297,6 +297,7 @@ main: { sta j jmp b2_from_b4 } +//SEG32 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte) main::j#1 ← (byte) main::i#3 + (byte) main::i#3 [ main::i#3 main::idx#2 main::j#1 ] ( main:2 [ main::i#3 main::idx#2 main::j#1 ] ) always clobbers reg byte a @@ -391,6 +392,7 @@ main: { tya jmp b2_from_b4 } +//SEG32 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -510,4 +512,5 @@ main: { tya jmp b2 } +//SEG32 File Data diff --git a/src/test/ref/signed-bytes.log b/src/test/ref/signed-bytes.log index 977b9e0bb..4cd883820 100644 --- a/src/test/ref/signed-bytes.log +++ b/src/test/ref/signed-bytes.log @@ -228,6 +228,7 @@ main: { //SEG24 [5] phi (signed byte) main::i#2 = (signed byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG25 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] if((signed byte) main::i#2<(signed byte) $7f) goto main::@2 [ main::i#2 main::j#2 ] ( main:2 [ main::i#2 main::j#2 ] ) always clobbers reg byte a @@ -309,6 +310,7 @@ main: { //SEG24 [5] phi (signed byte) main::i#2 = (signed byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG25 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -404,4 +406,5 @@ main: { //SEG24 [5] phi (signed byte) main::i#2 = (signed byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG25 File Data diff --git a/src/test/ref/signed-indexed-subtract.asm b/src/test/ref/signed-indexed-subtract.asm index e95866718..7d5348b8f 100644 --- a/src/test/ref/signed-indexed-subtract.asm +++ b/src/test/ref/signed-indexed-subtract.asm @@ -79,13 +79,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word diff --git a/src/test/ref/signed-indexed-subtract.log b/src/test/ref/signed-indexed-subtract.log index f74570e8f..dd02dd7b1 100644 --- a/src/test/ref/signed-indexed-subtract.log +++ b/src/test/ref/signed-indexed-subtract.log @@ -1243,13 +1243,11 @@ print_sword: { b3: //SEG80 [34] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG81 [35] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -1429,6 +1427,7 @@ sub: { //SEG138 [64] return rts } +//SEG139 File Data print_hextab: .text "0123456789abcdef" words: .word -$6000, -$600, -$60, -6, 0, 6, $60, $600, $6000 @@ -1497,17 +1496,17 @@ Uplift Scope [print_sword] 9.58: zp ZP_WORD:6 [ print_sword::w#3 print_sword::w# Uplift Scope [print_ln] Uplift Scope [print_word] -Uplifting [] best 6545 combination zp ZP_WORD:4 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#1 ] zp ZP_WORD:10 [ print_char_cursor#32 print_char_cursor#44 print_char_cursor#41 print_char_cursor#46 print_char_cursor#63 print_char_cursor#12 ] -Uplifting [sub] best 6442 combination reg byte a [ sub::idx#3 sub::idx#0 sub::idx#1 sub::idx#2 ] reg byte a [ sub::$0 ] reg byte x [ sub::s#3 ] -Uplifting [main] best 6182 combination reg byte y [ main::i#2 main::i#1 ] reg byte a [ main::$8 ] reg byte x [ main::j#2 main::j#1 ] -Uplifting [print_cls] best 6182 combination zp ZP_WORD:12 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_byte] best 6174 combination zp ZP_BYTE:8 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [print_char] best 6162 combination reg byte a [ print_char::ch#3 print_char::ch#1 print_char::ch#2 ] -Uplifting [print_sword] best 6162 combination zp ZP_WORD:6 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] -Uplifting [print_ln] best 6162 combination -Uplifting [print_word] best 6162 combination +Uplifting [] best 6541 combination zp ZP_WORD:4 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#1 ] zp ZP_WORD:10 [ print_char_cursor#32 print_char_cursor#44 print_char_cursor#41 print_char_cursor#46 print_char_cursor#63 print_char_cursor#12 ] +Uplifting [sub] best 6438 combination reg byte a [ sub::idx#3 sub::idx#0 sub::idx#1 sub::idx#2 ] reg byte a [ sub::$0 ] reg byte x [ sub::s#3 ] +Uplifting [main] best 6178 combination reg byte y [ main::i#2 main::i#1 ] reg byte a [ main::$8 ] reg byte x [ main::j#2 main::j#1 ] +Uplifting [print_cls] best 6178 combination zp ZP_WORD:12 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_byte] best 6170 combination zp ZP_BYTE:8 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [print_char] best 6158 combination reg byte a [ print_char::ch#3 print_char::ch#1 print_char::ch#2 ] +Uplifting [print_sword] best 6158 combination zp ZP_WORD:6 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] +Uplifting [print_ln] best 6158 combination +Uplifting [print_word] best 6158 combination Attempting to uplift remaining variables inzp ZP_BYTE:8 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Uplifting [print_byte] best 6162 combination zp ZP_BYTE:8 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Uplifting [print_byte] best 6158 combination zp ZP_BYTE:8 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] Allocated (was zp ZP_WORD:4) zp ZP_WORD:2 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#1 ] Allocated (was zp ZP_WORD:6) zp ZP_WORD:4 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] Allocated (was zp ZP_BYTE:8) zp ZP_BYTE:6 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] @@ -1725,13 +1724,11 @@ print_sword: { b3: //SEG80 [34] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG81 [35] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -1899,6 +1896,7 @@ sub: { //SEG138 [64] return rts } +//SEG139 File Data print_hextab: .text "0123456789abcdef" words: .word -$6000, -$600, -$60, -6, 0, 6, $60, $600, $6000 @@ -2095,7 +2093,7 @@ reg byte a [ sub::$0 ] FINAL ASSEMBLER -Score: 5265 +Score: 5261 //SEG0 File Comments // Tests that signed indexed subtract works as intended @@ -2259,13 +2257,11 @@ print_sword: { //SEG79 print_sword::@3 //SEG80 [34] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG81 [35] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG82 [35] phi (byte*) print_char_cursor#41 = (byte*) print_char_cursor#46 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -2406,6 +2402,7 @@ sub: { //SEG138 [64] return rts } +//SEG139 File Data print_hextab: .text "0123456789abcdef" words: .word -$6000, -$600, -$60, -6, 0, 6, $60, $600, $6000 diff --git a/src/test/ref/signed-word-minus-byte-2.log b/src/test/ref/signed-word-minus-byte-2.log index f82f3771a..9e0e0527e 100644 --- a/src/test/ref/signed-word-minus-byte-2.log +++ b/src/test/ref/signed-word-minus-byte-2.log @@ -243,6 +243,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (signed word) main::w1#1 ← (signed word) main::w1#2 - (signed byte) $29 [ main::i#2 main::w1#1 ] ( main:2 [ main::i#2 main::w1#1 ] ) always clobbers reg byte a @@ -336,6 +337,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -444,4 +446,5 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data diff --git a/src/test/ref/signed-words.asm b/src/test/ref/signed-words.asm index 844e0f04e..cf99f6b61 100644 --- a/src/test/ref/signed-words.asm +++ b/src/test/ref/signed-words.asm @@ -57,13 +57,11 @@ anim: { lda ypos+1 bpl b1 sec - lda xvel - eor #$ff - adc #0 + lda #0 + sbc xvel sta xvel - lda xvel+1 - eor #$ff - adc #0 + lda #0 + sbc xvel+1 sta xvel+1 lda yvel_init sec diff --git a/src/test/ref/signed-words.log b/src/test/ref/signed-words.log index 65dd7ff7d..000c06343 100644 --- a/src/test/ref/signed-words.log +++ b/src/test/ref/signed-words.log @@ -1124,13 +1124,11 @@ anim: { b2: //SEG33 [11] (signed word) xvel#14 ← - (signed word) xvel#12 -- vwsz1=_neg_vwsz1 sec - lda xvel - eor #$ff - adc #0 + lda #0 + sbc xvel sta xvel - lda xvel+1 - eor #$ff - adc #0 + lda #0 + sbc xvel+1 sta xvel+1 //SEG34 [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a -- vwsz1=vwsz1_minus_vbsc1 lda yvel_init @@ -1381,6 +1379,7 @@ init: { //SEG97 [47] return rts } +//SEG98 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@1 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ( main:2 [ yvel#12 xpos#12 ypos#13 xvel#12 yvel_init#13 ] ) always clobbers reg byte a @@ -1457,10 +1456,10 @@ Uplift Scope [] 14.25: zp ZP_WORD:6 [ yvel#9 yvel#12 yvel#10 yvel#20 ] 8.94: zp Uplift Scope [anim] 4: zp ZP_WORD:15 [ anim::$5 ] 4: zp ZP_WORD:19 [ anim::$7 ] 4: zp ZP_BYTE:23 [ anim::$9 ] 4: zp ZP_BYTE:24 [ anim::$10 ] 4: zp ZP_BYTE:25 [ anim::$11 ] 0.67: zp ZP_WORD:21 [ anim::sprite_y#0 ] 0.57: zp ZP_WORD:17 [ anim::sprite_x#0 ] Uplift Scope [main] -Uplifting [init] best 8058 combination zp ZP_WORD:12 [ init::sc#2 init::sc#1 ] reg byte x [ init::i#2 init::i#1 ] -Uplifting [] best 8058 combination zp ZP_WORD:6 [ yvel#9 yvel#12 yvel#10 yvel#20 ] zp ZP_WORD:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ] zp ZP_WORD:8 [ xpos#9 xpos#12 xpos#10 ] zp ZP_WORD:10 [ ypos#10 ypos#13 ypos#11 ] zp ZP_WORD:2 [ xvel#12 xvel#10 xvel#14 ] -Uplifting [anim] best 8040 combination zp ZP_WORD:15 [ anim::$5 ] zp ZP_WORD:19 [ anim::$7 ] reg byte a [ anim::$9 ] reg byte a [ anim::$10 ] reg byte a [ anim::$11 ] zp ZP_WORD:21 [ anim::sprite_y#0 ] zp ZP_WORD:17 [ anim::sprite_x#0 ] -Uplifting [main] best 8040 combination +Uplifting [init] best 8054 combination zp ZP_WORD:12 [ init::sc#2 init::sc#1 ] reg byte x [ init::i#2 init::i#1 ] +Uplifting [] best 8054 combination zp ZP_WORD:6 [ yvel#9 yvel#12 yvel#10 yvel#20 ] zp ZP_WORD:4 [ yvel_init#13 yvel_init#11 yvel#4 yvel_init#3 ] zp ZP_WORD:8 [ xpos#9 xpos#12 xpos#10 ] zp ZP_WORD:10 [ ypos#10 ypos#13 ypos#11 ] zp ZP_WORD:2 [ xvel#12 xvel#10 xvel#14 ] +Uplifting [anim] best 8036 combination zp ZP_WORD:15 [ anim::$5 ] zp ZP_WORD:19 [ anim::$7 ] reg byte a [ anim::$9 ] reg byte a [ anim::$10 ] reg byte a [ anim::$11 ] zp ZP_WORD:21 [ anim::sprite_y#0 ] zp ZP_WORD:17 [ anim::sprite_x#0 ] +Uplifting [main] best 8036 combination Coalescing zero page register with common assignment [ zp ZP_WORD:15 [ anim::$5 ] ] with [ zp ZP_WORD:17 [ anim::sprite_x#0 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:19 [ anim::$7 ] ] with [ zp ZP_WORD:21 [ anim::sprite_y#0 ] ] - score: 1 Allocated (was zp ZP_WORD:15) zp ZP_WORD:14 [ anim::$5 anim::sprite_x#0 ] @@ -1582,13 +1581,11 @@ anim: { b2: //SEG33 [11] (signed word) xvel#14 ← - (signed word) xvel#12 -- vwsz1=_neg_vwsz1 sec - lda xvel - eor #$ff - adc #0 + lda #0 + sbc xvel sta xvel - lda xvel+1 - eor #$ff - adc #0 + lda #0 + sbc xvel+1 sta xvel+1 //SEG34 [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a -- vwsz1=vwsz1_minus_vbsc1 lda yvel_init @@ -1829,6 +1826,7 @@ init: { //SEG97 [47] return rts } +//SEG98 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1992,7 +1990,7 @@ reg byte a [ anim::$11 ] FINAL ASSEMBLER -Score: 6617 +Score: 6613 //SEG0 File Comments //SEG1 Basic Upstart @@ -2087,13 +2085,11 @@ anim: { //SEG32 anim::@2 //SEG33 [11] (signed word) xvel#14 ← - (signed word) xvel#12 -- vwsz1=_neg_vwsz1 sec - lda xvel - eor #$ff - adc #0 + lda #0 + sbc xvel sta xvel - lda xvel+1 - eor #$ff - adc #0 + lda #0 + sbc xvel+1 sta xvel+1 //SEG34 [12] (signed word) yvel_init#3 ← (signed word) yvel_init#13 - (signed byte) $a -- vwsz1=vwsz1_minus_vbsc1 lda yvel_init @@ -2306,4 +2302,5 @@ init: { //SEG97 [47] return rts } +//SEG98 File Data diff --git a/src/test/ref/simple-loop.log b/src/test/ref/simple-loop.log index 2edd9c93e..bc5032366 100644 --- a/src/test/ref/simple-loop.log +++ b/src/test/ref/simple-loop.log @@ -194,6 +194,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) 'a' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -265,6 +266,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -349,4 +351,5 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data diff --git a/src/test/ref/sinus-basic.log b/src/test/ref/sinus-basic.log index 476f4b611..8bc84401b 100644 --- a/src/test/ref/sinus-basic.log +++ b/src/test/ref/sinus-basic.log @@ -1770,6 +1770,7 @@ divFACby10: { //SEG189 [95] return rts } +//SEG190 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -2429,6 +2430,7 @@ divFACby10: { //SEG189 [95] return rts } +//SEG190 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -3114,5 +3116,6 @@ divFACby10: { //SEG189 [95] return rts } +//SEG190 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/sinusgen16.asm b/src/test/ref/sinusgen16.asm index 3406d04d5..6b2bd99c7 100644 --- a/src/test/ref/sinusgen16.asm +++ b/src/test/ref/sinusgen16.asm @@ -99,13 +99,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word @@ -414,13 +412,11 @@ sin16s: { cmp #0 beq b3 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 b3: rts diff --git a/src/test/ref/sinusgen16.log b/src/test/ref/sinusgen16.log index 922be596e..338d30e8e 100644 --- a/src/test/ref/sinusgen16.log +++ b/src/test/ref/sinusgen16.log @@ -2805,13 +2805,11 @@ print_sword: { b3: //SEG69 [31] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG70 [32] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -3434,13 +3432,11 @@ sin16s: { b6: //SEG223 [109] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz2 sec - lda usinx_1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1 sta sinx - lda usinx_1+1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1+1 sta sinx+1 //SEG224 [110] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -3837,6 +3833,7 @@ divr16u: { //SEG321 [159] return rts } +//SEG322 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -4072,22 +4069,22 @@ Uplift Scope [div32u16u] 4: zp ZP_DWORD:57 [ div32u16u::return#2 ] 4: zp ZP_WORD Uplift Scope [print_sword] 9.58: zp ZP_WORD:6 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] Uplift Scope [print_word] -Uplifting [mul16u] best 26849 combination zp ZP_DWORD:36 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:40 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:34 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp ZP_DWORD:101 [ mul16u::return#2 ] zp ZP_WORD:44 [ mul16u::b#0 ] -Uplifting [print_str] best 26849 combination zp ZP_WORD:4 [ print_str::str#3 print_str::str#5 print_str::str#0 ] -Uplifting [divr16u] best 26639 combination zp ZP_WORD:46 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:50 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:48 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:116 [ divr16u::return#2 ] zp ZP_WORD:120 [ divr16u::return#3 ] -Uplifting [] best 26639 combination zp ZP_WORD:10 [ print_char_cursor#33 print_char_cursor#46 print_char_cursor#43 print_char_cursor#51 print_char_cursor#48 print_char_cursor#49 print_char_cursor#2 print_char_cursor#12 print_char_cursor#1 ] zp ZP_WORD:130 [ rem16u#1 ] -Uplifting [sin16s] best 26639 combination zp ZP_DWORD:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:65 [ sin16s::return#0 ] zp ZP_WORD:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:69 [ sin16s::$4 ] zp ZP_WORD:77 [ sin16s::x2#0 ] zp ZP_WORD:85 [ sin16s::x3_6#0 ] zp ZP_WORD:91 [ sin16s::x4#0 ] zp ZP_WORD:95 [ sin16s::x5#0 ] zp ZP_WORD:97 [ sin16s::x5_128#0 ] zp ZP_WORD:81 [ sin16s::x3#0 ] zp ZP_WORD:99 [ sin16s::usinx#1 ] zp ZP_WORD:73 [ sin16s::x1#0 ] zp ZP_WORD:87 [ sin16s::usinx#0 ] zp ZP_BYTE:22 [ sin16s::isUpper#2 ] -Uplifting [mulu16_sel] best 26623 combination zp ZP_WORD:29 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:31 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:75 [ mulu16_sel::return#0 ] zp ZP_WORD:79 [ mulu16_sel::return#1 ] zp ZP_WORD:83 [ mulu16_sel::return#2 ] zp ZP_WORD:89 [ mulu16_sel::return#10 ] zp ZP_WORD:93 [ mulu16_sel::return#11 ] zp ZP_DWORD:105 [ mulu16_sel::$0 ] zp ZP_DWORD:109 [ mulu16_sel::$1 ] zp ZP_WORD:113 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [sin16s_gen] best 26623 combination zp ZP_WORD:67 [ sin16s_gen::$1 ] zp ZP_WORD:20 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp ZP_DWORD:14 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp ZP_WORD:18 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp ZP_DWORD:61 [ sin16s_gen::step#0 ] -Uplifting [print_cls] best 26623 combination zp ZP_WORD:12 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [main] best 26623 combination zp ZP_WORD:2 [ main::st1#2 main::st1#1 ] zp ZP_WORD:53 [ main::sw#0 ] -Uplifting [print_byte] best 26609 combination reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] -Uplifting [print_char] best 26597 combination reg byte a [ print_char::ch#3 print_char::ch#1 print_char::ch#2 ] -Uplifting [div32u16u] best 26597 combination zp ZP_DWORD:57 [ div32u16u::return#2 ] zp ZP_WORD:122 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:124 [ div32u16u::return#0 ] zp ZP_WORD:118 [ div32u16u::quotient_hi#0 ] -Uplifting [print_sword] best 26597 combination zp ZP_WORD:6 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] -Uplifting [print_word] best 26597 combination +Uplifting [mul16u] best 26841 combination zp ZP_DWORD:36 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:40 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:34 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp ZP_DWORD:101 [ mul16u::return#2 ] zp ZP_WORD:44 [ mul16u::b#0 ] +Uplifting [print_str] best 26841 combination zp ZP_WORD:4 [ print_str::str#3 print_str::str#5 print_str::str#0 ] +Uplifting [divr16u] best 26631 combination zp ZP_WORD:46 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:50 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:48 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:116 [ divr16u::return#2 ] zp ZP_WORD:120 [ divr16u::return#3 ] +Uplifting [] best 26631 combination zp ZP_WORD:10 [ print_char_cursor#33 print_char_cursor#46 print_char_cursor#43 print_char_cursor#51 print_char_cursor#48 print_char_cursor#49 print_char_cursor#2 print_char_cursor#12 print_char_cursor#1 ] zp ZP_WORD:130 [ rem16u#1 ] +Uplifting [sin16s] best 26631 combination zp ZP_DWORD:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:65 [ sin16s::return#0 ] zp ZP_WORD:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:69 [ sin16s::$4 ] zp ZP_WORD:77 [ sin16s::x2#0 ] zp ZP_WORD:85 [ sin16s::x3_6#0 ] zp ZP_WORD:91 [ sin16s::x4#0 ] zp ZP_WORD:95 [ sin16s::x5#0 ] zp ZP_WORD:97 [ sin16s::x5_128#0 ] zp ZP_WORD:81 [ sin16s::x3#0 ] zp ZP_WORD:99 [ sin16s::usinx#1 ] zp ZP_WORD:73 [ sin16s::x1#0 ] zp ZP_WORD:87 [ sin16s::usinx#0 ] zp ZP_BYTE:22 [ sin16s::isUpper#2 ] +Uplifting [mulu16_sel] best 26615 combination zp ZP_WORD:29 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:31 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:75 [ mulu16_sel::return#0 ] zp ZP_WORD:79 [ mulu16_sel::return#1 ] zp ZP_WORD:83 [ mulu16_sel::return#2 ] zp ZP_WORD:89 [ mulu16_sel::return#10 ] zp ZP_WORD:93 [ mulu16_sel::return#11 ] zp ZP_DWORD:105 [ mulu16_sel::$0 ] zp ZP_DWORD:109 [ mulu16_sel::$1 ] zp ZP_WORD:113 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [sin16s_gen] best 26615 combination zp ZP_WORD:67 [ sin16s_gen::$1 ] zp ZP_WORD:20 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp ZP_DWORD:14 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp ZP_WORD:18 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp ZP_DWORD:61 [ sin16s_gen::step#0 ] +Uplifting [print_cls] best 26615 combination zp ZP_WORD:12 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [main] best 26615 combination zp ZP_WORD:2 [ main::st1#2 main::st1#1 ] zp ZP_WORD:53 [ main::sw#0 ] +Uplifting [print_byte] best 26601 combination reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] +Uplifting [print_char] best 26589 combination reg byte a [ print_char::ch#3 print_char::ch#1 print_char::ch#2 ] +Uplifting [div32u16u] best 26589 combination zp ZP_DWORD:57 [ div32u16u::return#2 ] zp ZP_WORD:122 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:124 [ div32u16u::return#0 ] zp ZP_WORD:118 [ div32u16u::quotient_hi#0 ] +Uplifting [print_sword] best 26589 combination zp ZP_WORD:6 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] +Uplifting [print_word] best 26589 combination Attempting to uplift remaining variables inzp ZP_BYTE:22 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 26597 combination zp ZP_BYTE:22 [ sin16s::isUpper#2 ] +Uplifting [sin16s] best 26589 combination zp ZP_BYTE:22 [ sin16s::isUpper#2 ] Coalescing zero page register with common assignment [ zp ZP_WORD:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp ZP_WORD:99 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:29 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] ] with [ zp ZP_WORD:81 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:46 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] ] with [ zp ZP_WORD:130 [ rem16u#1 ] ] - score: 2 @@ -4354,13 +4351,11 @@ print_sword: { b3: //SEG69 [31] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG70 [32] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -4887,13 +4882,11 @@ sin16s: { b6: //SEG223 [109] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG224 [110] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -5219,6 +5212,7 @@ divr16u: { //SEG321 [159] return rts } +//SEG322 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -5706,7 +5700,7 @@ reg byte a [ divr16u::$2 ] FINAL ASSEMBLER -Score: 22665 +Score: 22657 //SEG0 File Comments // Generates a 16-bit signed sinus @@ -5879,13 +5873,11 @@ print_sword: { //SEG68 print_sword::@3 //SEG69 [31] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG70 [32] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG71 [32] phi (byte*) print_char_cursor#43 = (byte*) print_char_cursor#48 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -6348,13 +6340,11 @@ sin16s: { //SEG222 sin16s::@6 //SEG223 [109] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG224 [110] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] //SEG225 [110] phi (signed word) sin16s::return#1 = (signed word~) sin16s::return#5 [phi:sin16s::@12/sin16s::@6->sin16s::@3#0] -- register_copy @@ -6628,5 +6618,6 @@ divr16u: { //SEG321 [159] return rts } +//SEG322 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/sinusgen16b.asm b/src/test/ref/sinusgen16b.asm index fb824b566..d8d30fd9d 100644 --- a/src/test/ref/sinusgen16b.asm +++ b/src/test/ref/sinusgen16b.asm @@ -116,13 +116,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word @@ -394,13 +392,11 @@ sin16sb: { cmp #0 beq b3 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 b3: rts @@ -822,13 +818,11 @@ sin16s: { cmp #0 beq b3 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 b3: rts diff --git a/src/test/ref/sinusgen16b.log b/src/test/ref/sinusgen16b.log index 237596f58..d380f8642 100644 --- a/src/test/ref/sinusgen16b.log +++ b/src/test/ref/sinusgen16b.log @@ -3712,13 +3712,11 @@ print_sword: { b3: //SEG79 [35] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG80 [36] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -4297,13 +4295,11 @@ sin16sb: { b6: //SEG232 [112] (signed word) sin16sb::sinx#1 ← - (signed word)(word) sin16sb::usinx#1 -- vwsz1=_neg_vwsz2 sec - lda usinx_1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1 sta sinx - lda usinx_1+1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1+1 sta sinx+1 //SEG233 [113] phi from sin16sb::@12 sin16sb::@6 to sin16sb::@3 [phi:sin16sb::@12/sin16sb::@6->sin16sb::@3] b3_from_b12: @@ -5174,13 +5170,11 @@ sin16s: { b6: //SEG431 [214] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz2 sec - lda usinx_1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1 sta sinx - lda usinx_1+1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1+1 sta sinx+1 //SEG432 [215] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -5203,6 +5197,7 @@ sin16s: { sta return_5+1 jmp b3_from_b12 } +//SEG439 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -5546,28 +5541,28 @@ Uplift Scope [print_char] 14: zp ZP_BYTE:12 [ print_char::ch#3 print_char::ch#1 Uplift Scope [print_sword] 9.58: zp ZP_WORD:9 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] Uplift Scope [print_word] -Uplifting [mul16u] best 29894 combination zp ZP_DWORD:37 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:41 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:35 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp ZP_DWORD:113 [ mul16u::return#2 ] zp ZP_WORD:45 [ mul16u::b#0 ] -Uplifting [print_str] best 29894 combination zp ZP_WORD:7 [ print_str::str#3 print_str::str#5 print_str::str#0 ] -Uplifting [divr16u] best 29684 combination zp ZP_WORD:47 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:51 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:128 [ divr16u::return#2 ] zp ZP_WORD:132 [ divr16u::return#3 ] -Uplifting [] best 29684 combination zp ZP_WORD:13 [ print_char_cursor#33 print_char_cursor#46 print_char_cursor#43 print_char_cursor#51 print_char_cursor#48 print_char_cursor#49 print_char_cursor#2 print_char_cursor#12 print_char_cursor#1 ] zp ZP_WORD:142 [ rem16u#1 ] -Uplifting [mulu16_sel] best 29653 combination zp ZP_WORD:30 [ mulu16_sel::v1#10 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 mulu16_sel::v1#8 mulu16_sel::v1#9 mulu16_sel::v1#5 mulu16_sel::v1#6 mulu16_sel::v1#7 ] zp ZP_WORD:32 [ mulu16_sel::v2#10 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mulu16_sel::v2#8 mulu16_sel::v2#9 mulu16_sel::v2#5 mulu16_sel::v2#6 ] zp ZP_WORD:87 [ mulu16_sel::return#18 ] zp ZP_WORD:91 [ mulu16_sel::return#19 ] zp ZP_WORD:95 [ mulu16_sel::return#20 ] zp ZP_WORD:101 [ mulu16_sel::return#10 ] zp ZP_WORD:105 [ mulu16_sel::return#11 ] zp ZP_DWORD:117 [ mulu16_sel::$0 ] zp ZP_DWORD:121 [ mulu16_sel::$1 ] zp ZP_WORD:162 [ mulu16_sel::return#0 ] zp ZP_WORD:166 [ mulu16_sel::return#1 ] zp ZP_WORD:170 [ mulu16_sel::return#14 ] zp ZP_WORD:176 [ mulu16_sel::return#15 ] zp ZP_WORD:180 [ mulu16_sel::return#16 ] zp ZP_WORD:125 [ mulu16_sel::return#17 ] reg byte x [ mulu16_sel::select#10 ] -Uplifting [sin16s] best 29653 combination zp ZP_DWORD:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:152 [ sin16s::return#0 ] zp ZP_WORD:67 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:156 [ sin16s::$4 ] zp ZP_WORD:164 [ sin16s::x2#0 ] zp ZP_WORD:172 [ sin16s::x3_6#0 ] zp ZP_WORD:178 [ sin16s::x4#0 ] zp ZP_WORD:182 [ sin16s::x5#0 ] zp ZP_WORD:184 [ sin16s::x5_128#0 ] zp ZP_WORD:168 [ sin16s::x3#0 ] zp ZP_WORD:186 [ sin16s::usinx#1 ] zp ZP_WORD:160 [ sin16s::x1#0 ] zp ZP_WORD:174 [ sin16s::usinx#0 ] zp ZP_BYTE:62 [ sin16s::isUpper#2 ] -Uplifting [sin16sb] best 29653 combination zp ZP_WORD:26 [ sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 ] zp ZP_WORD:81 [ sin16sb::return#0 ] zp ZP_WORD:28 [ sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 ] zp ZP_WORD:89 [ sin16sb::x2#0 ] zp ZP_WORD:97 [ sin16sb::x3_6#0 ] zp ZP_WORD:103 [ sin16sb::x4#0 ] zp ZP_WORD:107 [ sin16sb::x5#0 ] zp ZP_WORD:109 [ sin16sb::x5_128#0 ] zp ZP_WORD:93 [ sin16sb::x3#0 ] zp ZP_WORD:111 [ sin16sb::usinx#1 ] zp ZP_WORD:85 [ sin16sb::x1#0 ] zp ZP_WORD:99 [ sin16sb::usinx#0 ] zp ZP_BYTE:25 [ sin16sb::isUpper#2 ] -Uplifting [sin16s_gen] best 29653 combination zp ZP_WORD:154 [ sin16s_gen::$1 ] zp ZP_WORD:60 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp ZP_DWORD:54 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp ZP_WORD:58 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp ZP_DWORD:148 [ sin16s_gen::step#0 ] -Uplifting [sin16s_genb] best 29653 combination zp ZP_WORD:83 [ sin16s_genb::$2 ] zp ZP_WORD:23 [ sin16s_genb::i#2 sin16s_genb::i#1 ] zp ZP_DWORD:17 [ sin16s_genb::x#2 sin16s_genb::x#1 ] zp ZP_WORD:21 [ sin16s_genb::sintab#2 sin16s_genb::sintab#0 ] zp ZP_DWORD:77 [ sin16s_genb::step#0 ] -Uplifting [main] best 29563 combination reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:4 [ main::st2#2 main::st2#1 ] zp ZP_WORD:2 [ main::st1#2 main::st1#1 ] zp ZP_WORD:69 [ main::sw#0 ] -Uplifting [print_cls] best 29563 combination zp ZP_WORD:15 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_byte] best 29555 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [div32u16u] best 29555 combination zp ZP_DWORD:73 [ div32u16u::return#3 ] zp ZP_WORD:134 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:144 [ div32u16u::return#2 ] zp ZP_DWORD:136 [ div32u16u::return#0 ] zp ZP_WORD:130 [ div32u16u::quotient_hi#0 ] -Uplifting [print_char] best 29543 combination reg byte a [ print_char::ch#3 print_char::ch#1 print_char::ch#2 ] -Uplifting [print_sword] best 29543 combination zp ZP_WORD:9 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] -Uplifting [print_word] best 29543 combination +Uplifting [mul16u] best 29882 combination zp ZP_DWORD:37 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:41 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:35 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp ZP_DWORD:113 [ mul16u::return#2 ] zp ZP_WORD:45 [ mul16u::b#0 ] +Uplifting [print_str] best 29882 combination zp ZP_WORD:7 [ print_str::str#3 print_str::str#5 print_str::str#0 ] +Uplifting [divr16u] best 29672 combination zp ZP_WORD:47 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:51 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp ZP_WORD:128 [ divr16u::return#2 ] zp ZP_WORD:132 [ divr16u::return#3 ] +Uplifting [] best 29672 combination zp ZP_WORD:13 [ print_char_cursor#33 print_char_cursor#46 print_char_cursor#43 print_char_cursor#51 print_char_cursor#48 print_char_cursor#49 print_char_cursor#2 print_char_cursor#12 print_char_cursor#1 ] zp ZP_WORD:142 [ rem16u#1 ] +Uplifting [mulu16_sel] best 29641 combination zp ZP_WORD:30 [ mulu16_sel::v1#10 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 mulu16_sel::v1#8 mulu16_sel::v1#9 mulu16_sel::v1#5 mulu16_sel::v1#6 mulu16_sel::v1#7 ] zp ZP_WORD:32 [ mulu16_sel::v2#10 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mulu16_sel::v2#8 mulu16_sel::v2#9 mulu16_sel::v2#5 mulu16_sel::v2#6 ] zp ZP_WORD:87 [ mulu16_sel::return#18 ] zp ZP_WORD:91 [ mulu16_sel::return#19 ] zp ZP_WORD:95 [ mulu16_sel::return#20 ] zp ZP_WORD:101 [ mulu16_sel::return#10 ] zp ZP_WORD:105 [ mulu16_sel::return#11 ] zp ZP_DWORD:117 [ mulu16_sel::$0 ] zp ZP_DWORD:121 [ mulu16_sel::$1 ] zp ZP_WORD:162 [ mulu16_sel::return#0 ] zp ZP_WORD:166 [ mulu16_sel::return#1 ] zp ZP_WORD:170 [ mulu16_sel::return#14 ] zp ZP_WORD:176 [ mulu16_sel::return#15 ] zp ZP_WORD:180 [ mulu16_sel::return#16 ] zp ZP_WORD:125 [ mulu16_sel::return#17 ] reg byte x [ mulu16_sel::select#10 ] +Uplifting [sin16s] best 29641 combination zp ZP_DWORD:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:152 [ sin16s::return#0 ] zp ZP_WORD:67 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:156 [ sin16s::$4 ] zp ZP_WORD:164 [ sin16s::x2#0 ] zp ZP_WORD:172 [ sin16s::x3_6#0 ] zp ZP_WORD:178 [ sin16s::x4#0 ] zp ZP_WORD:182 [ sin16s::x5#0 ] zp ZP_WORD:184 [ sin16s::x5_128#0 ] zp ZP_WORD:168 [ sin16s::x3#0 ] zp ZP_WORD:186 [ sin16s::usinx#1 ] zp ZP_WORD:160 [ sin16s::x1#0 ] zp ZP_WORD:174 [ sin16s::usinx#0 ] zp ZP_BYTE:62 [ sin16s::isUpper#2 ] +Uplifting [sin16sb] best 29641 combination zp ZP_WORD:26 [ sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 ] zp ZP_WORD:81 [ sin16sb::return#0 ] zp ZP_WORD:28 [ sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 ] zp ZP_WORD:89 [ sin16sb::x2#0 ] zp ZP_WORD:97 [ sin16sb::x3_6#0 ] zp ZP_WORD:103 [ sin16sb::x4#0 ] zp ZP_WORD:107 [ sin16sb::x5#0 ] zp ZP_WORD:109 [ sin16sb::x5_128#0 ] zp ZP_WORD:93 [ sin16sb::x3#0 ] zp ZP_WORD:111 [ sin16sb::usinx#1 ] zp ZP_WORD:85 [ sin16sb::x1#0 ] zp ZP_WORD:99 [ sin16sb::usinx#0 ] zp ZP_BYTE:25 [ sin16sb::isUpper#2 ] +Uplifting [sin16s_gen] best 29641 combination zp ZP_WORD:154 [ sin16s_gen::$1 ] zp ZP_WORD:60 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp ZP_DWORD:54 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp ZP_WORD:58 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp ZP_DWORD:148 [ sin16s_gen::step#0 ] +Uplifting [sin16s_genb] best 29641 combination zp ZP_WORD:83 [ sin16s_genb::$2 ] zp ZP_WORD:23 [ sin16s_genb::i#2 sin16s_genb::i#1 ] zp ZP_DWORD:17 [ sin16s_genb::x#2 sin16s_genb::x#1 ] zp ZP_WORD:21 [ sin16s_genb::sintab#2 sin16s_genb::sintab#0 ] zp ZP_DWORD:77 [ sin16s_genb::step#0 ] +Uplifting [main] best 29551 combination reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:4 [ main::st2#2 main::st2#1 ] zp ZP_WORD:2 [ main::st1#2 main::st1#1 ] zp ZP_WORD:69 [ main::sw#0 ] +Uplifting [print_cls] best 29551 combination zp ZP_WORD:15 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_byte] best 29543 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [div32u16u] best 29543 combination zp ZP_DWORD:73 [ div32u16u::return#3 ] zp ZP_WORD:134 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:144 [ div32u16u::return#2 ] zp ZP_DWORD:136 [ div32u16u::return#0 ] zp ZP_WORD:130 [ div32u16u::quotient_hi#0 ] +Uplifting [print_char] best 29531 combination reg byte a [ print_char::ch#3 print_char::ch#1 print_char::ch#2 ] +Uplifting [print_sword] best 29531 combination zp ZP_WORD:9 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] +Uplifting [print_word] best 29531 combination Attempting to uplift remaining variables inzp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Uplifting [print_byte] best 29543 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Uplifting [print_byte] best 29531 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ sin16sb::isUpper#2 ] -Uplifting [sin16sb] best 29543 combination zp ZP_BYTE:25 [ sin16sb::isUpper#2 ] +Uplifting [sin16sb] best 29531 combination zp ZP_BYTE:25 [ sin16sb::isUpper#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:62 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 29543 combination zp ZP_BYTE:62 [ sin16s::isUpper#2 ] +Uplifting [sin16s] best 29531 combination zp ZP_BYTE:62 [ sin16s::isUpper#2 ] Coalescing zero page register with common assignment [ zp ZP_WORD:28 [ sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 ] ] with [ zp ZP_WORD:111 [ sin16sb::usinx#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:30 [ mulu16_sel::v1#10 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 mulu16_sel::v1#8 mulu16_sel::v1#9 mulu16_sel::v1#5 mulu16_sel::v1#6 mulu16_sel::v1#7 ] ] with [ zp ZP_WORD:93 [ sin16sb::x3#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:30 [ mulu16_sel::v1#10 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 mulu16_sel::v1#8 mulu16_sel::v1#9 mulu16_sel::v1#5 mulu16_sel::v1#6 mulu16_sel::v1#7 sin16sb::x3#0 ] ] with [ zp ZP_WORD:168 [ sin16s::x3#0 ] ] - score: 2 @@ -5892,13 +5887,11 @@ print_sword: { b3: //SEG79 [35] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG80 [36] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -6387,13 +6380,11 @@ sin16sb: { b6: //SEG232 [112] (signed word) sin16sb::sinx#1 ← - (signed word)(word) sin16sb::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG233 [113] phi from sin16sb::@12 sin16sb::@6 to sin16sb::@3 [phi:sin16sb::@12/sin16sb::@6->sin16sb::@3] b3_from_b12: @@ -7105,13 +7096,11 @@ sin16s: { b6: //SEG431 [214] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG432 [215] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -7130,6 +7119,7 @@ sin16s: { //SEG438 [217] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1 jmp b3_from_b12 } +//SEG439 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -7773,7 +7763,7 @@ zp ZP_WORD:71 [ sin16s::x1#0 ] FINAL ASSEMBLER -Score: 24953 +Score: 24941 //SEG0 File Comments // Generates a 16-bit signed sinus @@ -7973,13 +7963,11 @@ print_sword: { //SEG78 print_sword::@3 //SEG79 [35] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG80 [36] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG81 [36] phi (byte*) print_char_cursor#43 = (byte*) print_char_cursor#48 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -8404,13 +8392,11 @@ sin16sb: { //SEG231 sin16sb::@6 //SEG232 [112] (signed word) sin16sb::sinx#1 ← - (signed word)(word) sin16sb::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG233 [113] phi from sin16sb::@12 sin16sb::@6 to sin16sb::@3 [phi:sin16sb::@12/sin16sb::@6->sin16sb::@3] //SEG234 [113] phi (signed word) sin16sb::return#1 = (signed word~) sin16sb::return#5 [phi:sin16sb::@12/sin16sb::@6->sin16sb::@3#0] -- register_copy @@ -9031,13 +9017,11 @@ sin16s: { //SEG430 sin16s::@6 //SEG431 [214] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG432 [215] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] //SEG433 [215] phi (signed word) sin16s::return#1 = (signed word~) sin16s::return#5 [phi:sin16s::@12/sin16s::@6->sin16s::@3#0] -- register_copy @@ -9049,5 +9033,6 @@ sin16s: { //SEG437 sin16s::@12 //SEG438 [217] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1 } +//SEG439 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/sinusgen8.log b/src/test/ref/sinusgen8.log index 31f277ae5..27c96ab2c 100644 --- a/src/test/ref/sinusgen8.log +++ b/src/test/ref/sinusgen8.log @@ -3605,6 +3605,7 @@ divr16u: { //SEG305 [152] return rts } +//SEG306 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -4740,6 +4741,7 @@ divr16u: { //SEG305 [152] return rts } +//SEG306 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -5967,5 +5969,6 @@ divr16u: { //SEG305 [152] return rts } +//SEG306 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/sinusgen8b.asm b/src/test/ref/sinusgen8b.asm index 5ceff247d..7d06eae51 100644 --- a/src/test/ref/sinusgen8b.asm +++ b/src/test/ref/sinusgen8b.asm @@ -410,13 +410,11 @@ sin16s: { cmp #0 beq b3 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 b3: rts diff --git a/src/test/ref/sinusgen8b.log b/src/test/ref/sinusgen8b.log index 51423a6da..d9b44b062 100644 --- a/src/test/ref/sinusgen8b.log +++ b/src/test/ref/sinusgen8b.log @@ -4586,13 +4586,11 @@ sin16s: { b6: //SEG215 [109] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz2 sec - lda usinx_1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1 sta sinx - lda usinx_1+1 - eor #$ff - adc #0 + lda #0 + sbc usinx_1+1 sta sinx+1 //SEG216 [110] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -5562,6 +5560,7 @@ div16u: { //SEG472 [241] return rts } +//SEG473 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -5898,60 +5897,60 @@ Uplift Scope [print_byte] 4: zp ZP_BYTE:81 [ print_byte::$0 ] 4: zp ZP_BYTE:82 [ Uplift Scope [print_sbyte] 7.83: zp ZP_BYTE:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] Uplift Scope [div16u] 4: zp ZP_WORD:158 [ div16u::return#2 ] 1.33: zp ZP_WORD:189 [ div16u::return#0 ] -Uplifting [mul8u] best 38976 combination zp ZP_WORD:65 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:67 [ mul8u::mb#2 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] zp ZP_WORD:179 [ mul8u::return#2 ] reg byte a [ mul8u::b#0 ] -Uplifting [mul16u] best 38376 combination zp ZP_DWORD:33 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:37 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:31 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp ZP_DWORD:127 [ mul16u::return#2 ] zp ZP_WORD:41 [ mul16u::b#0 ] -Uplifting [print_str] best 38376 combination zp ZP_WORD:3 [ print_str::str#2 print_str::str#0 ] -Uplifting [divr16u] best 38166 combination zp ZP_WORD:43 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:47 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 ] zp ZP_WORD:142 [ divr16u::return#3 ] zp ZP_WORD:146 [ divr16u::return#4 ] zp ZP_WORD:187 [ divr16u::return#2 ] -Uplifting [] best 38166 combination zp ZP_WORD:7 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] zp ZP_WORD:156 [ rem16u#1 ] -Uplifting [main] best 37936 combination zp ZP_WORD:71 [ main::$3 ] zp ZP_WORD:73 [ main::$11 ] zp ZP_WORD:75 [ main::$4 ] zp ZP_WORD:77 [ main::sw#0 ] reg byte a [ main::sd#0 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$5 ] zp ZP_BYTE:70 [ main::sb#0 ] -Uplifting [sin8s] best 37831 combination zp ZP_WORD:57 [ sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 ] reg byte a [ sin8s::return#0 ] reg byte a [ sin8s::return#1 sin8s::return#5 sin8s::sinx#1 ] reg byte x [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] zp ZP_WORD:164 [ sin8s::$4 ] zp ZP_BYTE:168 [ sin8s::x2#0 ] zp ZP_BYTE:172 [ sin8s::x3_6#0 ] zp ZP_BYTE:175 [ sin8s::x4#0 ] zp ZP_BYTE:177 [ sin8s::x5#0 ] zp ZP_BYTE:178 [ sin8s::x5_128#0 ] zp ZP_BYTE:170 [ sin8s::x3#0 ] zp ZP_BYTE:166 [ sin8s::x1#0 ] zp ZP_BYTE:173 [ sin8s::usinx#0 ] zp ZP_BYTE:56 [ sin8s::isUpper#10 ] +Uplifting [mul8u] best 38972 combination zp ZP_WORD:65 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:67 [ mul8u::mb#2 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] zp ZP_WORD:179 [ mul8u::return#2 ] reg byte a [ mul8u::b#0 ] +Uplifting [mul16u] best 38372 combination zp ZP_DWORD:33 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp ZP_DWORD:37 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp ZP_WORD:31 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp ZP_DWORD:127 [ mul16u::return#2 ] zp ZP_WORD:41 [ mul16u::b#0 ] +Uplifting [print_str] best 38372 combination zp ZP_WORD:3 [ print_str::str#2 print_str::str#0 ] +Uplifting [divr16u] best 38162 combination zp ZP_WORD:43 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:47 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 ] zp ZP_WORD:142 [ divr16u::return#3 ] zp ZP_WORD:146 [ divr16u::return#4 ] zp ZP_WORD:187 [ divr16u::return#2 ] +Uplifting [] best 38162 combination zp ZP_WORD:7 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] zp ZP_WORD:156 [ rem16u#1 ] +Uplifting [main] best 37932 combination zp ZP_WORD:71 [ main::$3 ] zp ZP_WORD:73 [ main::$11 ] zp ZP_WORD:75 [ main::$4 ] zp ZP_WORD:77 [ main::sw#0 ] reg byte a [ main::sd#0 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$5 ] zp ZP_BYTE:70 [ main::sb#0 ] +Uplifting [sin8s] best 37827 combination zp ZP_WORD:57 [ sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 ] reg byte a [ sin8s::return#0 ] reg byte a [ sin8s::return#1 sin8s::return#5 sin8s::sinx#1 ] reg byte x [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] zp ZP_WORD:164 [ sin8s::$4 ] zp ZP_BYTE:168 [ sin8s::x2#0 ] zp ZP_BYTE:172 [ sin8s::x3_6#0 ] zp ZP_BYTE:175 [ sin8s::x4#0 ] zp ZP_BYTE:177 [ sin8s::x5#0 ] zp ZP_BYTE:178 [ sin8s::x5_128#0 ] zp ZP_BYTE:170 [ sin8s::x3#0 ] zp ZP_BYTE:166 [ sin8s::x1#0 ] zp ZP_BYTE:173 [ sin8s::usinx#0 ] zp ZP_BYTE:56 [ sin8s::isUpper#10 ] Limited combination testing to 100 combinations of 5308416 possible. -Uplifting [sin16s] best 37831 combination zp ZP_DWORD:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:91 [ sin16s::return#0 ] zp ZP_WORD:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:95 [ sin16s::$4 ] zp ZP_WORD:103 [ sin16s::x2#0 ] zp ZP_WORD:111 [ sin16s::x3_6#0 ] zp ZP_WORD:117 [ sin16s::x4#0 ] zp ZP_WORD:121 [ sin16s::x5#0 ] zp ZP_WORD:123 [ sin16s::x5_128#0 ] zp ZP_WORD:107 [ sin16s::x3#0 ] zp ZP_WORD:125 [ sin16s::usinx#1 ] zp ZP_WORD:99 [ sin16s::x1#0 ] zp ZP_WORD:113 [ sin16s::usinx#0 ] zp ZP_BYTE:19 [ sin16s::isUpper#2 ] -Uplifting [mulu16_sel] best 37815 combination zp ZP_WORD:26 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:28 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:101 [ mulu16_sel::return#0 ] zp ZP_WORD:105 [ mulu16_sel::return#1 ] zp ZP_WORD:109 [ mulu16_sel::return#2 ] zp ZP_WORD:115 [ mulu16_sel::return#10 ] zp ZP_WORD:119 [ mulu16_sel::return#11 ] zp ZP_DWORD:131 [ mulu16_sel::$0 ] zp ZP_DWORD:135 [ mulu16_sel::$1 ] zp ZP_WORD:139 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [mulu8_sel] best 37769 combination reg byte x [ mulu8_sel::v1#5 mulu8_sel::v1#1 mulu8_sel::v1#2 mulu8_sel::v1#3 mulu8_sel::v1#4 mulu8_sel::v1#0 ] reg byte y [ mulu8_sel::v2#5 mulu8_sel::v2#1 mulu8_sel::v2#3 mulu8_sel::v2#4 mulu8_sel::v2#0 ] reg byte a [ mulu8_sel::return#0 ] reg byte a [ mulu8_sel::return#1 ] zp ZP_BYTE:171 [ mulu8_sel::return#2 ] zp ZP_BYTE:174 [ mulu8_sel::return#10 ] zp ZP_BYTE:176 [ mulu8_sel::return#11 ] zp ZP_WORD:181 [ mulu8_sel::$0 ] zp ZP_WORD:183 [ mulu8_sel::$1 ] zp ZP_BYTE:185 [ mulu8_sel::return#12 ] zp ZP_BYTE:63 [ mulu8_sel::select#5 ] +Uplifting [sin16s] best 37827 combination zp ZP_DWORD:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp ZP_WORD:91 [ sin16s::return#0 ] zp ZP_WORD:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp ZP_DWORD:95 [ sin16s::$4 ] zp ZP_WORD:103 [ sin16s::x2#0 ] zp ZP_WORD:111 [ sin16s::x3_6#0 ] zp ZP_WORD:117 [ sin16s::x4#0 ] zp ZP_WORD:121 [ sin16s::x5#0 ] zp ZP_WORD:123 [ sin16s::x5_128#0 ] zp ZP_WORD:107 [ sin16s::x3#0 ] zp ZP_WORD:125 [ sin16s::usinx#1 ] zp ZP_WORD:99 [ sin16s::x1#0 ] zp ZP_WORD:113 [ sin16s::usinx#0 ] zp ZP_BYTE:19 [ sin16s::isUpper#2 ] +Uplifting [mulu16_sel] best 37811 combination zp ZP_WORD:26 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] zp ZP_WORD:28 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp ZP_WORD:101 [ mulu16_sel::return#0 ] zp ZP_WORD:105 [ mulu16_sel::return#1 ] zp ZP_WORD:109 [ mulu16_sel::return#2 ] zp ZP_WORD:115 [ mulu16_sel::return#10 ] zp ZP_WORD:119 [ mulu16_sel::return#11 ] zp ZP_DWORD:131 [ mulu16_sel::$0 ] zp ZP_DWORD:135 [ mulu16_sel::$1 ] zp ZP_WORD:139 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [mulu8_sel] best 37765 combination reg byte x [ mulu8_sel::v1#5 mulu8_sel::v1#1 mulu8_sel::v1#2 mulu8_sel::v1#3 mulu8_sel::v1#4 mulu8_sel::v1#0 ] reg byte y [ mulu8_sel::v2#5 mulu8_sel::v2#1 mulu8_sel::v2#3 mulu8_sel::v2#4 mulu8_sel::v2#0 ] reg byte a [ mulu8_sel::return#0 ] reg byte a [ mulu8_sel::return#1 ] zp ZP_BYTE:171 [ mulu8_sel::return#2 ] zp ZP_BYTE:174 [ mulu8_sel::return#10 ] zp ZP_BYTE:176 [ mulu8_sel::return#11 ] zp ZP_WORD:181 [ mulu8_sel::$0 ] zp ZP_WORD:183 [ mulu8_sel::$1 ] zp ZP_BYTE:185 [ mulu8_sel::return#12 ] zp ZP_BYTE:63 [ mulu8_sel::select#5 ] Limited combination testing to 100 combinations of 196608 possible. -Uplifting [sin16s_gen] best 37769 combination zp ZP_WORD:93 [ sin16s_gen::$1 ] zp ZP_WORD:17 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp ZP_DWORD:11 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp ZP_WORD:15 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp ZP_DWORD:87 [ sin16s_gen::step#0 ] -Uplifting [sin8s_gen] best 37709 combination reg byte a [ sin8s_gen::$1 ] zp ZP_WORD:54 [ sin8s_gen::i#2 sin8s_gen::i#1 ] zp ZP_WORD:50 [ sin8s_gen::x#2 sin8s_gen::x#1 ] zp ZP_WORD:52 [ sin8s_gen::sintab#2 sin8s_gen::sintab#0 ] zp ZP_WORD:160 [ sin8s_gen::step#0 ] -Uplifting [print_cls] best 37709 combination zp ZP_WORD:9 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_char] best 37694 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] -Uplifting [div32u16u] best 37694 combination zp ZP_DWORD:83 [ div32u16u::return#2 ] zp ZP_WORD:148 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:150 [ div32u16u::return#0 ] zp ZP_WORD:144 [ div32u16u::quotient_hi#0 ] -Uplifting [print_byte] best 37686 combination reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [print_sbyte] best 37686 combination zp ZP_BYTE:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] -Uplifting [div16u] best 37686 combination zp ZP_WORD:158 [ div16u::return#2 ] zp ZP_WORD:189 [ div16u::return#0 ] +Uplifting [sin16s_gen] best 37765 combination zp ZP_WORD:93 [ sin16s_gen::$1 ] zp ZP_WORD:17 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp ZP_DWORD:11 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp ZP_WORD:15 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp ZP_DWORD:87 [ sin16s_gen::step#0 ] +Uplifting [sin8s_gen] best 37705 combination reg byte a [ sin8s_gen::$1 ] zp ZP_WORD:54 [ sin8s_gen::i#2 sin8s_gen::i#1 ] zp ZP_WORD:50 [ sin8s_gen::x#2 sin8s_gen::x#1 ] zp ZP_WORD:52 [ sin8s_gen::sintab#2 sin8s_gen::sintab#0 ] zp ZP_WORD:160 [ sin8s_gen::step#0 ] +Uplifting [print_cls] best 37705 combination zp ZP_WORD:9 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_char] best 37690 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] +Uplifting [div32u16u] best 37690 combination zp ZP_DWORD:83 [ div32u16u::return#2 ] zp ZP_WORD:148 [ div32u16u::quotient_lo#0 ] zp ZP_DWORD:150 [ div32u16u::return#0 ] zp ZP_WORD:144 [ div32u16u::quotient_hi#0 ] +Uplifting [print_byte] best 37682 combination reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [print_sbyte] best 37682 combination zp ZP_BYTE:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] +Uplifting [div16u] best 37682 combination zp ZP_WORD:158 [ div16u::return#2 ] zp ZP_WORD:189 [ div16u::return#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] -Uplifting [print_sbyte] best 37686 combination zp ZP_BYTE:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] +Uplifting [print_sbyte] best 37682 combination zp ZP_BYTE:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:168 [ sin8s::x2#0 ] -Uplifting [sin8s] best 37682 combination reg byte a [ sin8s::x2#0 ] +Uplifting [sin8s] best 37678 combination reg byte a [ sin8s::x2#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:171 [ mulu8_sel::return#2 ] -Uplifting [mulu8_sel] best 37676 combination reg byte a [ mulu8_sel::return#2 ] +Uplifting [mulu8_sel] best 37672 combination reg byte a [ mulu8_sel::return#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:172 [ sin8s::x3_6#0 ] -Uplifting [sin8s] best 37672 combination reg byte a [ sin8s::x3_6#0 ] +Uplifting [sin8s] best 37668 combination reg byte a [ sin8s::x3_6#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:174 [ mulu8_sel::return#10 ] -Uplifting [mulu8_sel] best 37666 combination reg byte a [ mulu8_sel::return#10 ] +Uplifting [mulu8_sel] best 37662 combination reg byte a [ mulu8_sel::return#10 ] Attempting to uplift remaining variables inzp ZP_BYTE:175 [ sin8s::x4#0 ] -Uplifting [sin8s] best 37662 combination reg byte a [ sin8s::x4#0 ] +Uplifting [sin8s] best 37658 combination reg byte a [ sin8s::x4#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:176 [ mulu8_sel::return#11 ] -Uplifting [mulu8_sel] best 37656 combination reg byte a [ mulu8_sel::return#11 ] +Uplifting [mulu8_sel] best 37652 combination reg byte a [ mulu8_sel::return#11 ] Attempting to uplift remaining variables inzp ZP_BYTE:177 [ sin8s::x5#0 ] -Uplifting [sin8s] best 37650 combination reg byte a [ sin8s::x5#0 ] +Uplifting [sin8s] best 37646 combination reg byte a [ sin8s::x5#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:178 [ sin8s::x5_128#0 ] -Uplifting [sin8s] best 37644 combination reg byte a [ sin8s::x5_128#0 ] +Uplifting [sin8s] best 37640 combination reg byte a [ sin8s::x5_128#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:70 [ main::sb#0 ] -Uplifting [main] best 37644 combination zp ZP_BYTE:70 [ main::sb#0 ] +Uplifting [main] best 37640 combination zp ZP_BYTE:70 [ main::sb#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:185 [ mulu8_sel::return#12 ] -Uplifting [mulu8_sel] best 37626 combination reg byte a [ mulu8_sel::return#12 ] +Uplifting [mulu8_sel] best 37622 combination reg byte a [ mulu8_sel::return#12 ] Attempting to uplift remaining variables inzp ZP_BYTE:170 [ sin8s::x3#0 ] -Uplifting [sin8s] best 37626 combination zp ZP_BYTE:170 [ sin8s::x3#0 ] +Uplifting [sin8s] best 37622 combination zp ZP_BYTE:170 [ sin8s::x3#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:166 [ sin8s::x1#0 ] -Uplifting [sin8s] best 37626 combination zp ZP_BYTE:166 [ sin8s::x1#0 ] +Uplifting [sin8s] best 37622 combination zp ZP_BYTE:166 [ sin8s::x1#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:63 [ mulu8_sel::select#5 ] -Uplifting [mulu8_sel] best 37626 combination zp ZP_BYTE:63 [ mulu8_sel::select#5 ] +Uplifting [mulu8_sel] best 37622 combination zp ZP_BYTE:63 [ mulu8_sel::select#5 ] Attempting to uplift remaining variables inzp ZP_BYTE:173 [ sin8s::usinx#0 ] -Uplifting [sin8s] best 37626 combination zp ZP_BYTE:173 [ sin8s::usinx#0 ] +Uplifting [sin8s] best 37622 combination zp ZP_BYTE:173 [ sin8s::usinx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:19 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 37626 combination zp ZP_BYTE:19 [ sin16s::isUpper#2 ] +Uplifting [sin16s] best 37622 combination zp ZP_BYTE:19 [ sin16s::isUpper#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:56 [ sin8s::isUpper#10 ] -Uplifting [sin8s] best 37626 combination zp ZP_BYTE:56 [ sin8s::isUpper#10 ] +Uplifting [sin8s] best 37622 combination zp ZP_BYTE:56 [ sin8s::isUpper#10 ] Coalescing zero page register with common assignment [ zp ZP_WORD:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp ZP_WORD:125 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:26 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 ] ] with [ zp ZP_WORD:107 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:43 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] ] with [ zp ZP_WORD:156 [ rem16u#1 ] ] - score: 2 @@ -6758,13 +6757,11 @@ sin16s: { b6: //SEG215 [109] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG216 [110] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] b3_from_b12: @@ -7559,6 +7556,7 @@ div16u: { //SEG472 [241] return rts } +//SEG473 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -8289,7 +8287,7 @@ reg byte a [ mul8u::$1 ] FINAL ASSEMBLER -Score: 31878 +Score: 31874 //SEG0 File Comments //SEG1 Basic Upstart @@ -8919,13 +8917,11 @@ sin16s: { //SEG214 sin16s::@6 //SEG215 [109] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1 -- vwsz1=_neg_vwsz1 sec - lda sinx - eor #$ff - adc #0 + lda #0 + sbc sinx sta sinx - lda sinx+1 - eor #$ff - adc #0 + lda #0 + sbc sinx+1 sta sinx+1 //SEG216 [110] phi from sin16s::@12 sin16s::@6 to sin16s::@3 [phi:sin16s::@12/sin16s::@6->sin16s::@3] //SEG217 [110] phi (signed word) sin16s::return#1 = (signed word~) sin16s::return#5 [phi:sin16s::@12/sin16s::@6->sin16s::@3#0] -- register_copy @@ -9595,5 +9591,6 @@ div16u: { //SEG472 [241] return rts } +//SEG473 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/sinusgenscale8.asm b/src/test/ref/sinusgenscale8.asm index 0a9a6a182..015b32862 100644 --- a/src/test/ref/sinusgenscale8.asm +++ b/src/test/ref/sinusgenscale8.asm @@ -268,13 +268,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: lda w diff --git a/src/test/ref/sinusgenscale8.log b/src/test/ref/sinusgenscale8.log index 8d4bba333..8423fbeb1 100644 --- a/src/test/ref/sinusgenscale8.log +++ b/src/test/ref/sinusgenscale8.log @@ -4243,13 +4243,11 @@ print_sword: { b3: //SEG211 [94] (signed word) print_sword::w#0 ← - (signed word)(word) mul8su::m#2 -- vwsz1=_neg_vwsz2 sec - lda mul8su.m - eor #$ff - adc #0 + lda #0 + sbc mul8su.m sta w - lda mul8su.m+1 - eor #$ff - adc #0 + lda #0 + sbc mul8su.m+1 sta w+1 //SEG212 [95] phi from print_sword::@3 print_sword::@4 to print_sword::@1 [phi:print_sword::@3/print_sword::@4->print_sword::@1] b1_from_b3: @@ -5068,6 +5066,7 @@ print_cls: { //SEG461 [215] return rts } +//SEG462 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -5269,59 +5268,59 @@ Uplift Scope [div16u] 4: zp ZP_WORD:46 [ div16u::return#2 ] 1.33: zp ZP_WORD:86 Uplift Scope [print_ln] Uplift Scope [main] -Uplifting [mul8u] best 23946 combination zp ZP_WORD:25 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:27 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte x [ mul8u::a#3 mul8u::a#6 mul8u::a#8 mul8u::a#2 mul8u::a#0 ] reg byte a [ mul8u::b#1 ] zp ZP_WORD:57 [ mul8u::return#2 ] zp ZP_WORD:77 [ mul8u::return#3 ] -Uplifting [] best 23946 combination zp ZP_WORD:8 [ print_line_cursor#12 print_line_cursor#23 print_line_cursor#1 ] zp ZP_WORD:16 [ print_char_cursor#94 print_char_cursor#105 print_char_cursor#64 print_char_cursor#100 print_char_cursor#18 print_char_cursor#99 print_char_cursor#2 print_char_cursor#113 print_char_cursor#1 ] -Uplifting [print_str] best 23946 combination zp ZP_WORD:12 [ print_str::str#10 print_str::str#12 print_str::str#0 ] -Uplifting [divr16u] best 23736 combination zp ZP_WORD:37 [ divr16u::rem#4 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:41 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:39 [ divr16u::dividend#2 divr16u::dividend#0 ] zp ZP_WORD:84 [ divr16u::return#2 ] -Uplifting [sin8s] best 23631 combination zp ZP_WORD:30 [ sin8s::x#6 sin8s::x#4 sin8s::x#2 sin8s::x#0 sin8s::x#1 ] reg byte a [ sin8s::return#2 ] reg byte a [ sin8s::return#0 sin8s::return#5 sin8s::sinx#1 ] reg byte x [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] zp ZP_WORD:62 [ sin8s::$4 ] zp ZP_BYTE:66 [ sin8s::x2#0 ] zp ZP_BYTE:70 [ sin8s::x3_6#0 ] zp ZP_BYTE:73 [ sin8s::x4#0 ] zp ZP_BYTE:75 [ sin8s::x5#0 ] zp ZP_BYTE:76 [ sin8s::x5_128#0 ] zp ZP_BYTE:68 [ sin8s::x3#0 ] zp ZP_BYTE:64 [ sin8s::x1#0 ] zp ZP_BYTE:71 [ sin8s::usinx#0 ] zp ZP_BYTE:29 [ sin8s::isUpper#10 ] +Uplifting [mul8u] best 23942 combination zp ZP_WORD:25 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp ZP_WORD:27 [ mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 ] reg byte a [ mul8u::$1 ] reg byte x [ mul8u::a#3 mul8u::a#6 mul8u::a#8 mul8u::a#2 mul8u::a#0 ] reg byte a [ mul8u::b#1 ] zp ZP_WORD:57 [ mul8u::return#2 ] zp ZP_WORD:77 [ mul8u::return#3 ] +Uplifting [] best 23942 combination zp ZP_WORD:8 [ print_line_cursor#12 print_line_cursor#23 print_line_cursor#1 ] zp ZP_WORD:16 [ print_char_cursor#94 print_char_cursor#105 print_char_cursor#64 print_char_cursor#100 print_char_cursor#18 print_char_cursor#99 print_char_cursor#2 print_char_cursor#113 print_char_cursor#1 ] +Uplifting [print_str] best 23942 combination zp ZP_WORD:12 [ print_str::str#10 print_str::str#12 print_str::str#0 ] +Uplifting [divr16u] best 23732 combination zp ZP_WORD:37 [ divr16u::rem#4 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:41 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:39 [ divr16u::dividend#2 divr16u::dividend#0 ] zp ZP_WORD:84 [ divr16u::return#2 ] +Uplifting [sin8s] best 23627 combination zp ZP_WORD:30 [ sin8s::x#6 sin8s::x#4 sin8s::x#2 sin8s::x#0 sin8s::x#1 ] reg byte a [ sin8s::return#2 ] reg byte a [ sin8s::return#0 sin8s::return#5 sin8s::sinx#1 ] reg byte x [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] zp ZP_WORD:62 [ sin8s::$4 ] zp ZP_BYTE:66 [ sin8s::x2#0 ] zp ZP_BYTE:70 [ sin8s::x3_6#0 ] zp ZP_BYTE:73 [ sin8s::x4#0 ] zp ZP_BYTE:75 [ sin8s::x5#0 ] zp ZP_BYTE:76 [ sin8s::x5_128#0 ] zp ZP_BYTE:68 [ sin8s::x3#0 ] zp ZP_BYTE:64 [ sin8s::x1#0 ] zp ZP_BYTE:71 [ sin8s::usinx#0 ] zp ZP_BYTE:29 [ sin8s::isUpper#10 ] Limited combination testing to 100 combinations of 5308416 possible. -Uplifting [mulu8_sel] best 23585 combination reg byte x [ mulu8_sel::v1#5 mulu8_sel::v1#1 mulu8_sel::v1#2 mulu8_sel::v1#3 mulu8_sel::v1#4 mulu8_sel::v1#0 ] reg byte y [ mulu8_sel::v2#5 mulu8_sel::v2#1 mulu8_sel::v2#3 mulu8_sel::v2#4 mulu8_sel::v2#0 ] reg byte a [ mulu8_sel::return#0 ] reg byte a [ mulu8_sel::return#1 ] zp ZP_BYTE:69 [ mulu8_sel::return#2 ] zp ZP_BYTE:72 [ mulu8_sel::return#10 ] zp ZP_BYTE:74 [ mulu8_sel::return#11 ] zp ZP_WORD:79 [ mulu8_sel::$0 ] zp ZP_WORD:81 [ mulu8_sel::$1 ] zp ZP_BYTE:83 [ mulu8_sel::return#12 ] zp ZP_BYTE:36 [ mulu8_sel::select#5 ] +Uplifting [mulu8_sel] best 23581 combination reg byte x [ mulu8_sel::v1#5 mulu8_sel::v1#1 mulu8_sel::v1#2 mulu8_sel::v1#3 mulu8_sel::v1#4 mulu8_sel::v1#0 ] reg byte y [ mulu8_sel::v2#5 mulu8_sel::v2#1 mulu8_sel::v2#3 mulu8_sel::v2#4 mulu8_sel::v2#0 ] reg byte a [ mulu8_sel::return#0 ] reg byte a [ mulu8_sel::return#1 ] zp ZP_BYTE:69 [ mulu8_sel::return#2 ] zp ZP_BYTE:72 [ mulu8_sel::return#10 ] zp ZP_BYTE:74 [ mulu8_sel::return#11 ] zp ZP_WORD:79 [ mulu8_sel::$0 ] zp ZP_WORD:81 [ mulu8_sel::$1 ] zp ZP_BYTE:83 [ mulu8_sel::return#12 ] zp ZP_BYTE:36 [ mulu8_sel::select#5 ] Limited combination testing to 100 combinations of 196608 possible. -Uplifting [sin8u_table] best 23475 combination reg byte a [ sin8u_table::$21 ] zp ZP_WORD:6 [ sin8u_table::i#10 sin8u_table::i#1 ] zp ZP_WORD:2 [ sin8u_table::x#10 sin8u_table::x#1 ] zp ZP_WORD:4 [ sin8u_table::sintab#2 sin8u_table::sintab#1 ] zp ZP_BYTE:51 [ sin8u_table::sinx#0 ] reg byte x [ sin8u_table::sinx_tr#0 ] zp ZP_WORD:48 [ sin8u_table::step#0 ] -Uplifting [print_byte] best 23467 combination zp ZP_BYTE:10 [ print_byte::b#8 print_byte::b#10 print_byte::b#1 print_byte::b#2 print_byte::b#7 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [print_word] best 23467 combination zp ZP_WORD:18 [ print_word::w#3 print_word::w#5 print_word::w#2 print_word::w#1 ] -Uplifting [print_cls] best 23467 combination zp ZP_WORD:44 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [mul8su] best 23425 combination zp ZP_WORD:21 [ mul8su::m#2 mul8su::m#1 mul8su::m#0 ] reg byte a [ mul8su::$7 ] reg byte a [ mul8su::$10 ] reg byte y [ mul8su::a#0 ] -Uplifting [print_char] best 23407 combination reg byte a [ print_char::ch#5 print_char::ch#3 print_char::ch#4 ] -Uplifting [print_sword] best 23407 combination zp ZP_WORD:14 [ print_sword::w#3 print_sword::w#6 print_sword::w#0 ] -Uplifting [print_sbyte] best 23407 combination zp ZP_BYTE:20 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] -Uplifting [div16u] best 23407 combination zp ZP_WORD:46 [ div16u::return#2 ] zp ZP_WORD:86 [ div16u::return#0 ] -Uplifting [print_ln] best 23407 combination -Uplifting [main] best 23407 combination +Uplifting [sin8u_table] best 23471 combination reg byte a [ sin8u_table::$21 ] zp ZP_WORD:6 [ sin8u_table::i#10 sin8u_table::i#1 ] zp ZP_WORD:2 [ sin8u_table::x#10 sin8u_table::x#1 ] zp ZP_WORD:4 [ sin8u_table::sintab#2 sin8u_table::sintab#1 ] zp ZP_BYTE:51 [ sin8u_table::sinx#0 ] reg byte x [ sin8u_table::sinx_tr#0 ] zp ZP_WORD:48 [ sin8u_table::step#0 ] +Uplifting [print_byte] best 23463 combination zp ZP_BYTE:10 [ print_byte::b#8 print_byte::b#10 print_byte::b#1 print_byte::b#2 print_byte::b#7 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [print_word] best 23463 combination zp ZP_WORD:18 [ print_word::w#3 print_word::w#5 print_word::w#2 print_word::w#1 ] +Uplifting [print_cls] best 23463 combination zp ZP_WORD:44 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [mul8su] best 23421 combination zp ZP_WORD:21 [ mul8su::m#2 mul8su::m#1 mul8su::m#0 ] reg byte a [ mul8su::$7 ] reg byte a [ mul8su::$10 ] reg byte y [ mul8su::a#0 ] +Uplifting [print_char] best 23403 combination reg byte a [ print_char::ch#5 print_char::ch#3 print_char::ch#4 ] +Uplifting [print_sword] best 23403 combination zp ZP_WORD:14 [ print_sword::w#3 print_sword::w#6 print_sword::w#0 ] +Uplifting [print_sbyte] best 23403 combination zp ZP_BYTE:20 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] +Uplifting [div16u] best 23403 combination zp ZP_WORD:46 [ div16u::return#2 ] zp ZP_WORD:86 [ div16u::return#0 ] +Uplifting [print_ln] best 23403 combination +Uplifting [main] best 23403 combination Attempting to uplift remaining variables inzp ZP_BYTE:10 [ print_byte::b#8 print_byte::b#10 print_byte::b#1 print_byte::b#2 print_byte::b#7 ] -Uplifting [print_byte] best 23407 combination zp ZP_BYTE:10 [ print_byte::b#8 print_byte::b#10 print_byte::b#1 print_byte::b#2 print_byte::b#7 ] +Uplifting [print_byte] best 23403 combination zp ZP_BYTE:10 [ print_byte::b#8 print_byte::b#10 print_byte::b#1 print_byte::b#2 print_byte::b#7 ] Attempting to uplift remaining variables inzp ZP_BYTE:20 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] -Uplifting [print_sbyte] best 23407 combination zp ZP_BYTE:20 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] +Uplifting [print_sbyte] best 23403 combination zp ZP_BYTE:20 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:66 [ sin8s::x2#0 ] -Uplifting [sin8s] best 23403 combination reg byte a [ sin8s::x2#0 ] +Uplifting [sin8s] best 23399 combination reg byte a [ sin8s::x2#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:69 [ mulu8_sel::return#2 ] -Uplifting [mulu8_sel] best 23397 combination reg byte a [ mulu8_sel::return#2 ] +Uplifting [mulu8_sel] best 23393 combination reg byte a [ mulu8_sel::return#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:70 [ sin8s::x3_6#0 ] -Uplifting [sin8s] best 23393 combination reg byte a [ sin8s::x3_6#0 ] +Uplifting [sin8s] best 23389 combination reg byte a [ sin8s::x3_6#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:72 [ mulu8_sel::return#10 ] -Uplifting [mulu8_sel] best 23387 combination reg byte a [ mulu8_sel::return#10 ] +Uplifting [mulu8_sel] best 23383 combination reg byte a [ mulu8_sel::return#10 ] Attempting to uplift remaining variables inzp ZP_BYTE:73 [ sin8s::x4#0 ] -Uplifting [sin8s] best 23383 combination reg byte a [ sin8s::x4#0 ] +Uplifting [sin8s] best 23379 combination reg byte a [ sin8s::x4#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:74 [ mulu8_sel::return#11 ] -Uplifting [mulu8_sel] best 23377 combination reg byte a [ mulu8_sel::return#11 ] +Uplifting [mulu8_sel] best 23373 combination reg byte a [ mulu8_sel::return#11 ] Attempting to uplift remaining variables inzp ZP_BYTE:75 [ sin8s::x5#0 ] -Uplifting [sin8s] best 23371 combination reg byte a [ sin8s::x5#0 ] +Uplifting [sin8s] best 23367 combination reg byte a [ sin8s::x5#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:76 [ sin8s::x5_128#0 ] -Uplifting [sin8s] best 23365 combination reg byte a [ sin8s::x5_128#0 ] +Uplifting [sin8s] best 23361 combination reg byte a [ sin8s::x5_128#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:51 [ sin8u_table::sinx#0 ] -Uplifting [sin8u_table] best 23365 combination zp ZP_BYTE:51 [ sin8u_table::sinx#0 ] +Uplifting [sin8u_table] best 23361 combination zp ZP_BYTE:51 [ sin8u_table::sinx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:83 [ mulu8_sel::return#12 ] -Uplifting [mulu8_sel] best 23347 combination reg byte a [ mulu8_sel::return#12 ] +Uplifting [mulu8_sel] best 23343 combination reg byte a [ mulu8_sel::return#12 ] Attempting to uplift remaining variables inzp ZP_BYTE:68 [ sin8s::x3#0 ] -Uplifting [sin8s] best 23347 combination zp ZP_BYTE:68 [ sin8s::x3#0 ] +Uplifting [sin8s] best 23343 combination zp ZP_BYTE:68 [ sin8s::x3#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:64 [ sin8s::x1#0 ] -Uplifting [sin8s] best 23347 combination zp ZP_BYTE:64 [ sin8s::x1#0 ] +Uplifting [sin8s] best 23343 combination zp ZP_BYTE:64 [ sin8s::x1#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:36 [ mulu8_sel::select#5 ] -Uplifting [mulu8_sel] best 23347 combination zp ZP_BYTE:36 [ mulu8_sel::select#5 ] +Uplifting [mulu8_sel] best 23343 combination zp ZP_BYTE:36 [ mulu8_sel::select#5 ] Attempting to uplift remaining variables inzp ZP_BYTE:71 [ sin8s::usinx#0 ] -Uplifting [sin8s] best 23347 combination zp ZP_BYTE:71 [ sin8s::usinx#0 ] +Uplifting [sin8s] best 23343 combination zp ZP_BYTE:71 [ sin8s::usinx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:29 [ sin8s::isUpper#10 ] -Uplifting [sin8s] best 23347 combination zp ZP_BYTE:29 [ sin8s::isUpper#10 ] +Uplifting [sin8s] best 23343 combination zp ZP_BYTE:29 [ sin8s::isUpper#10 ] Coalescing zero page register with common assignment [ zp ZP_WORD:14 [ print_sword::w#3 print_sword::w#6 print_sword::w#0 ] ] with [ zp ZP_WORD:21 [ mul8su::m#2 mul8su::m#1 mul8su::m#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_BYTE:10 [ print_byte::b#8 print_byte::b#10 print_byte::b#1 print_byte::b#2 print_byte::b#7 ] ] with [ zp ZP_BYTE:20 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:25 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] ] with [ zp ZP_WORD:57 [ mul8u::return#2 ] ] - score: 1 @@ -5956,13 +5955,11 @@ print_sword: { b3: //SEG211 [94] (signed word) print_sword::w#0 ← - (signed word)(word) mul8su::m#2 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG212 [95] phi from print_sword::@3 print_sword::@4 to print_sword::@1 [phi:print_sword::@3/print_sword::@4->print_sword::@1] b1_from_b3: @@ -6659,6 +6656,7 @@ print_cls: { //SEG461 [215] return rts } +//SEG462 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -7324,7 +7322,7 @@ reg byte a [ divr16u::$2 ] FINAL ASSEMBLER -Score: 19557 +Score: 19553 //SEG0 File Comments //SEG1 Basic Upstart @@ -7808,13 +7806,11 @@ print_sword: { //SEG210 print_sword::@3 //SEG211 [94] (signed word) print_sword::w#0 ← - (signed word)(word) mul8su::m#2 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG212 [95] phi from print_sword::@3 print_sword::@4 to print_sword::@1 [phi:print_sword::@3/print_sword::@4->print_sword::@1] //SEG213 [95] phi (byte*) print_char_cursor#94 = (byte*) print_char_cursor#18 [phi:print_sword::@3/print_sword::@4->print_sword::@1#0] -- register_copy @@ -8390,5 +8386,6 @@ print_cls: { //SEG461 [215] return rts } +//SEG462 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/sizeof-arrays.log b/src/test/ref/sizeof-arrays.log index ed917ee39..ae196ccda 100644 --- a/src/test/ref/sizeof-arrays.log +++ b/src/test/ref/sizeof-arrays.log @@ -405,6 +405,7 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) '0'+(byte) 3*(const byte) SIZEOF_BYTE/(const byte) SIZEOF_BYTE [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -473,6 +474,7 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -558,4 +560,5 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data diff --git a/src/test/ref/sizeof-expr.log b/src/test/ref/sizeof-expr.log index 4c1c28f53..661b0d70b 100644 --- a/src/test/ref/sizeof-expr.log +++ b/src/test/ref/sizeof-expr.log @@ -389,6 +389,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::b#0 ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -483,6 +484,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -587,4 +589,5 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data diff --git a/src/test/ref/sizeof-struct.log b/src/test/ref/sizeof-struct.log index fb884deea..389fa0bee 100644 --- a/src/test/ref/sizeof-struct.log +++ b/src/test/ref/sizeof-struct.log @@ -411,6 +411,7 @@ main: { //SEG19 [12] return rts } +//SEG20 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) '0'+(const byte) SIZEOF_STRUCT_POINT [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -494,6 +495,7 @@ main: { //SEG19 [12] return rts } +//SEG20 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -590,4 +592,5 @@ main: { //SEG19 [12] return rts } +//SEG20 File Data diff --git a/src/test/ref/sizeof-types.log b/src/test/ref/sizeof-types.log index 1066c8a28..37314cf28 100644 --- a/src/test/ref/sizeof-types.log +++ b/src/test/ref/sizeof-types.log @@ -504,6 +504,7 @@ main: { //SEG32 [25] return rts } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -637,6 +638,7 @@ main: { //SEG32 [25] return rts } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -771,4 +773,5 @@ main: { //SEG32 [25] return rts } +//SEG33 File Data diff --git a/src/test/ref/statement-sequence-1.log b/src/test/ref/statement-sequence-1.log index e34ad5fc1..886b4ee3a 100644 --- a/src/test/ref/statement-sequence-1.log +++ b/src/test/ref/statement-sequence-1.log @@ -307,6 +307,7 @@ main: { //SEG30 [15] return rts } +//SEG31 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -400,6 +401,7 @@ main: { //SEG30 [15] return rts } +//SEG31 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -520,4 +522,5 @@ main: { //SEG30 [15] return rts } +//SEG31 File Data diff --git a/src/test/ref/string-const-consolidation-noroot.log b/src/test/ref/string-const-consolidation-noroot.log index 0fc008d03..608642045 100644 --- a/src/test/ref/string-const-consolidation-noroot.log +++ b/src/test/ref/string-const-consolidation-noroot.log @@ -369,6 +369,7 @@ print: { //SEG40 [12] phi (byte*) print::string#4 = (byte*) print::string#3 [phi:print::@2->print::@1#1] -- register_copy jmp b1 } +//SEG41 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [13] if(*((byte*) print::string#4)!=(byte) '@') goto print::@2 [ screen#12 print::string#4 ] ( main:2::print:5 [ screen#12 print::string#4 ] main:2::print:7 [ screen#12 print::string#4 ] main:2::print:9 [ screen#12 print::string#4 ] ) always clobbers reg byte a reg byte y @@ -496,6 +497,7 @@ print: { //SEG40 [12] phi (byte*) print::string#4 = (byte*) print::string#3 [phi:print::@2->print::@1#1] -- register_copy jmp b1 } +//SEG41 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -646,4 +648,5 @@ print: { //SEG40 [12] phi (byte*) print::string#4 = (byte*) print::string#3 [phi:print::@2->print::@1#1] -- register_copy jmp b1 } +//SEG41 File Data diff --git a/src/test/ref/string-const-consolidation.log b/src/test/ref/string-const-consolidation.log index 99cc5d5f1..934c6155b 100644 --- a/src/test/ref/string-const-consolidation.log +++ b/src/test/ref/string-const-consolidation.log @@ -368,6 +368,7 @@ print: { //SEG40 [12] phi (byte*) print::string#4 = (byte*) print::string#3 [phi:print::@2->print::@1#1] -- register_copy jmp b1 } +//SEG41 File Data rex1: .text "rex@" REGISTER UPLIFT POTENTIAL REGISTERS @@ -495,6 +496,7 @@ print: { //SEG40 [12] phi (byte*) print::string#4 = (byte*) print::string#3 [phi:print::@2->print::@1#1] -- register_copy jmp b1 } +//SEG41 File Data rex1: .text "rex@" ASSEMBLER OPTIMIZATIONS @@ -645,5 +647,6 @@ print: { //SEG40 [12] phi (byte*) print::string#4 = (byte*) print::string#3 [phi:print::@2->print::@1#1] -- register_copy jmp b1 } +//SEG41 File Data rex1: .text "rex@" diff --git a/src/test/ref/string-encoding-literals.log b/src/test/ref/string-encoding-literals.log index b6991da4b..7f3c14e74 100644 --- a/src/test/ref/string-encoding-literals.log +++ b/src/test/ref/string-encoding-literals.log @@ -307,6 +307,7 @@ main: { //SEG26 [15] return rts } +//SEG27 File Data .encoding "petscii_mixed" petscii_mixed: .text "abcABC1@" .encoding "petscii_upper" @@ -416,6 +417,7 @@ main: { //SEG26 [15] return rts } +//SEG27 File Data .encoding "petscii_mixed" petscii_mixed: .text "abcABC1@" .encoding "petscii_upper" @@ -542,6 +544,7 @@ main: { //SEG26 [15] return rts } +//SEG27 File Data .encoding "petscii_mixed" petscii_mixed: .text "abcABC1@" .encoding "petscii_upper" diff --git a/src/test/ref/string-encoding-pragma.log b/src/test/ref/string-encoding-pragma.log index 73c9417be..9a5ca95db 100644 --- a/src/test/ref/string-encoding-pragma.log +++ b/src/test/ref/string-encoding-pragma.log @@ -288,6 +288,7 @@ main: { //SEG25 [14] return rts } +//SEG26 File Data // Default encoding (screencode_mixed) screencode_mixed1: .text "abcABC1@" .encoding "petscii_mixed" @@ -391,6 +392,7 @@ main: { //SEG25 [14] return rts } +//SEG26 File Data // Default encoding (screencode_mixed) screencode_mixed1: .text "abcABC1@" .encoding "petscii_mixed" @@ -511,6 +513,7 @@ main: { //SEG25 [14] return rts } +//SEG26 File Data // Default encoding (screencode_mixed) screencode_mixed1: .text "abcABC1@" .encoding "petscii_mixed" diff --git a/src/test/ref/strip.log b/src/test/ref/strip.log index 6a8b01c0c..b919bf2ef 100644 --- a/src/test/ref/strip.log +++ b/src/test/ref/strip.log @@ -618,6 +618,7 @@ strip: { sta p_8+1 jmp b1_from_b4 } +//SEG65 File Data msg1: .text "hello world!@" msg2: .text "goodbye blue sky!@" @@ -866,6 +867,7 @@ strip: { sta p_8+1 jmp b1_from_b4 } +//SEG65 File Data msg1: .text "hello world!@" msg2: .text "goodbye blue sky!@" @@ -1140,6 +1142,7 @@ strip: { sta p_8+1 jmp b1 } +//SEG65 File Data msg1: .text "hello world!@" msg2: .text "goodbye blue sky!@" diff --git a/src/test/ref/struct-0.log b/src/test/ref/struct-0.log index 8c0c39948..8b9b35695 100644 --- a/src/test/ref/struct-0.log +++ b/src/test/ref/struct-0.log @@ -195,6 +195,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) point_x#1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -248,6 +249,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -315,4 +317,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/struct-1.log b/src/test/ref/struct-1.log index c2a1c4050..1eb522e27 100644 --- a/src/test/ref/struct-1.log +++ b/src/test/ref/struct-1.log @@ -246,6 +246,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) point1_y#1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -299,6 +300,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -368,4 +370,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/struct-2.log b/src/test/ref/struct-2.log index 6f4b5e481..60cddaed3 100644 --- a/src/test/ref/struct-2.log +++ b/src/test/ref/struct-2.log @@ -274,6 +274,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) point1_x#1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -336,6 +337,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -413,4 +415,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/struct-3.log b/src/test/ref/struct-3.log index f016a0619..86312d5f6 100644 --- a/src/test/ref/struct-3.log +++ b/src/test/ref/struct-3.log @@ -366,6 +366,7 @@ print: { //SEG29 [14] return rts } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (const byte) main::p1_y#1 [ idx#4 ] ( main:2::print:5 [ idx#4 ] main:2::print:7 [ idx#4 ] ) always clobbers reg byte a @@ -458,6 +459,7 @@ print: { //SEG29 [14] return rts } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -571,4 +573,5 @@ print: { //SEG29 [14] return rts } +//SEG30 File Data diff --git a/src/test/ref/struct-4.log b/src/test/ref/struct-4.log index 77e8494a1..1834bb23a 100644 --- a/src/test/ref/struct-4.log +++ b/src/test/ref/struct-4.log @@ -179,6 +179,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -233,6 +234,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -304,4 +306,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/struct-5.log b/src/test/ref/struct-5.log index e87da2f86..1ae402c09 100644 --- a/src/test/ref/struct-5.log +++ b/src/test/ref/struct-5.log @@ -299,6 +299,7 @@ point: { //SEG20 [10] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::SCREEN#0) ← (const byte) point::p_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -371,6 +372,7 @@ point: { //SEG20 [10] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -464,4 +466,5 @@ point: { //SEG20 [10] return rts } +//SEG21 File Data diff --git a/src/test/ref/struct-6.log b/src/test/ref/struct-6.log index 6cd87876b..4f8179e54 100644 --- a/src/test/ref/struct-6.log +++ b/src/test/ref/struct-6.log @@ -204,6 +204,7 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::p_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -264,6 +265,7 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -341,4 +343,5 @@ main: { //SEG14 [7] return rts } +//SEG15 File Data diff --git a/src/test/ref/struct-7.log b/src/test/ref/struct-7.log index 0719b47ff..57d1132b5 100644 --- a/src/test/ref/struct-7.log +++ b/src/test/ref/struct-7.log @@ -278,6 +278,7 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::t_c1_center_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -355,6 +356,7 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -450,4 +452,5 @@ main: { //SEG17 [10] return rts } +//SEG18 File Data diff --git a/src/test/ref/struct-ptr-0.log b/src/test/ref/struct-ptr-0.log index b1eabe49c..9db8a6c3f 100644 --- a/src/test/ref/struct-ptr-0.log +++ b/src/test/ref/struct-ptr-0.log @@ -373,6 +373,7 @@ main: { //SEG33 [18] return rts } +//SEG34 File Data points: .fill 2*4, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -502,6 +503,7 @@ main: { //SEG33 [18] return rts } +//SEG34 File Data points: .fill 2*4, 0 ASSEMBLER OPTIMIZATIONS @@ -643,5 +645,6 @@ main: { //SEG33 [18] return rts } +//SEG34 File Data points: .fill 2*4, 0 diff --git a/src/test/ref/struct-ptr-1.log b/src/test/ref/struct-ptr-1.log index 41687bb83..e3d52f2cd 100644 --- a/src/test/ref/struct-ptr-1.log +++ b/src/test/ref/struct-ptr-1.log @@ -428,6 +428,7 @@ main: { //SEG33 [18] return rts } +//SEG34 File Data points: .fill 2*4, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -556,6 +557,7 @@ main: { //SEG33 [18] return rts } +//SEG34 File Data points: .fill 2*4, 0 ASSEMBLER OPTIMIZATIONS @@ -697,5 +699,6 @@ main: { //SEG33 [18] return rts } +//SEG34 File Data points: .fill 2*4, 0 diff --git a/src/test/ref/struct-ptr-10.log b/src/test/ref/struct-ptr-10.log index e3881d6b7..760faa346 100644 --- a/src/test/ref/struct-ptr-10.log +++ b/src/test/ref/struct-ptr-10.log @@ -478,6 +478,7 @@ main: { //SEG39 [24] return rts } +//SEG40 File Data points: .fill 2*$1f4, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -721,6 +722,7 @@ main: { //SEG39 [24] return rts } +//SEG40 File Data points: .fill 2*$1f4, 0 ASSEMBLER OPTIMIZATIONS @@ -960,5 +962,6 @@ main: { //SEG39 [24] return rts } +//SEG40 File Data points: .fill 2*$1f4, 0 diff --git a/src/test/ref/struct-ptr-11.log b/src/test/ref/struct-ptr-11.log index 1fccaf45a..f16f16b5b 100644 --- a/src/test/ref/struct-ptr-11.log +++ b/src/test/ref/struct-ptr-11.log @@ -432,6 +432,7 @@ main: { //SEG37 [22] return rts } +//SEG38 File Data points: .fill 3*4, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -595,6 +596,7 @@ main: { //SEG37 [22] return rts } +//SEG38 File Data points: .fill 3*4, 0 ASSEMBLER OPTIMIZATIONS @@ -756,5 +758,6 @@ main: { //SEG37 [22] return rts } +//SEG38 File Data points: .fill 3*4, 0 diff --git a/src/test/ref/struct-ptr-12-ref.log b/src/test/ref/struct-ptr-12-ref.log index f2145e275..e2d6beb70 100644 --- a/src/test/ref/struct-ptr-12-ref.log +++ b/src/test/ref/struct-ptr-12-ref.log @@ -197,6 +197,7 @@ main: { //SEG16 [9] return rts } +//SEG17 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (word) main::p#0 ← (byte) 2*(word) $100+(byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -257,6 +258,7 @@ main: { //SEG16 [9] return rts } +//SEG17 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -334,4 +336,5 @@ main: { //SEG16 [9] return rts } +//SEG17 File Data diff --git a/src/test/ref/struct-ptr-12.log b/src/test/ref/struct-ptr-12.log index 7fc9c15f8..887303069 100644 --- a/src/test/ref/struct-ptr-12.log +++ b/src/test/ref/struct-ptr-12.log @@ -207,6 +207,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::p_x#0 ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -276,6 +277,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -357,4 +359,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/struct-ptr-13.log b/src/test/ref/struct-ptr-13.log index 1c04327d9..fd4dbb7d5 100644 --- a/src/test/ref/struct-ptr-13.log +++ b/src/test/ref/struct-ptr-13.log @@ -209,6 +209,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((byte*)(const struct Point*) points#0) ← *((byte*)(const struct Point*) points#0) + (byte) 5 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -274,6 +275,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -350,4 +352,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/struct-ptr-14.log b/src/test/ref/struct-ptr-14.log index 458ae0156..705abc570 100644 --- a/src/test/ref/struct-ptr-14.log +++ b/src/test/ref/struct-ptr-14.log @@ -290,6 +290,7 @@ set: { //SEG22 [12] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (byte) main::p_x#0 ← (byte) 2 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -382,6 +383,7 @@ set: { //SEG22 [12] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -486,4 +488,5 @@ set: { //SEG22 [12] return rts } +//SEG23 File Data diff --git a/src/test/ref/struct-ptr-2.log b/src/test/ref/struct-ptr-2.log index d0d2e6dbb..8d4bb4e97 100644 --- a/src/test/ref/struct-ptr-2.log +++ b/src/test/ref/struct-ptr-2.log @@ -438,6 +438,7 @@ main: { //SEG35 [20] return rts } +//SEG36 File Data points: .fill 2*4, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -598,6 +599,7 @@ main: { //SEG35 [20] return rts } +//SEG36 File Data points: .fill 2*4, 0 ASSEMBLER OPTIMIZATIONS @@ -764,5 +766,6 @@ main: { //SEG35 [20] return rts } +//SEG36 File Data points: .fill 2*4, 0 diff --git a/src/test/ref/struct-ptr-3.log b/src/test/ref/struct-ptr-3.log index 2e715c0c9..0fb1866f5 100644 --- a/src/test/ref/struct-ptr-3.log +++ b/src/test/ref/struct-ptr-3.log @@ -224,6 +224,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← *((byte*)(struct Point*) 4096) [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -285,6 +286,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -357,4 +359,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/struct-ptr-4.log b/src/test/ref/struct-ptr-4.log index e395babee..d9cd78aae 100644 --- a/src/test/ref/struct-ptr-4.log +++ b/src/test/ref/struct-ptr-4.log @@ -454,6 +454,7 @@ main: { //SEG43 [22] return rts } +//SEG44 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((byte*)(struct Point*) main::points#4) ← (byte) main::i#2 [ main::points#4 main::i#2 ] ( main:2 [ main::points#4 main::i#2 ] ) always clobbers reg byte y @@ -639,6 +640,7 @@ main: { //SEG43 [22] return rts } +//SEG44 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -832,4 +834,5 @@ main: { //SEG43 [22] return rts } +//SEG44 File Data diff --git a/src/test/ref/struct-ptr-5.log b/src/test/ref/struct-ptr-5.log index eeb1f158b..329e3ad66 100644 --- a/src/test/ref/struct-ptr-5.log +++ b/src/test/ref/struct-ptr-5.log @@ -516,6 +516,7 @@ main: { //SEG38 [10] phi (struct Entry*) main::entry#2 = (struct Entry*) main::entry#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG39 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((struct Entry**)(const struct Entry*) ENTRIES#0+(const byte) OFFSET_STRUCT_ENTRY_NEXT) ← (const struct Entry*) main::entry2#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -699,6 +700,7 @@ main: { //SEG38 [10] phi (struct Entry*) main::entry#2 = (struct Entry*) main::entry#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG39 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -880,4 +882,5 @@ main: { //SEG38 [10] phi (struct Entry*) main::entry#2 = (struct Entry*) main::entry#1 [phi:main::@2->main::@1#1] -- register_copy jmp b1 } +//SEG39 File Data diff --git a/src/test/ref/struct-ptr-6.log b/src/test/ref/struct-ptr-6.log index 55b9e01da..0b1e22511 100644 --- a/src/test/ref/struct-ptr-6.log +++ b/src/test/ref/struct-ptr-6.log @@ -224,6 +224,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← *((byte*)(struct Point*) 4096) [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -285,6 +286,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -357,4 +359,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/struct-ptr-7.log b/src/test/ref/struct-ptr-7.log index 090b2b7cb..0cdf88237 100644 --- a/src/test/ref/struct-ptr-7.log +++ b/src/test/ref/struct-ptr-7.log @@ -356,6 +356,7 @@ main: { //SEG19 [12] return rts } +//SEG20 File Data points: .fill 2*2, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -434,6 +435,7 @@ main: { //SEG19 [12] return rts } +//SEG20 File Data points: .fill 2*2, 0 ASSEMBLER OPTIMIZATIONS @@ -520,5 +522,6 @@ main: { //SEG19 [12] return rts } +//SEG20 File Data points: .fill 2*2, 0 diff --git a/src/test/ref/struct-ptr-8.log b/src/test/ref/struct-ptr-8.log index 11b5149fe..2b5e91d54 100644 --- a/src/test/ref/struct-ptr-8.log +++ b/src/test/ref/struct-ptr-8.log @@ -445,6 +445,7 @@ main: { //SEG40 [23] return rts } +//SEG41 File Data points: .fill 2*2, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -615,6 +616,7 @@ main: { //SEG40 [23] return rts } +//SEG41 File Data points: .fill 2*2, 0 ASSEMBLER OPTIMIZATIONS @@ -783,5 +785,6 @@ main: { //SEG40 [23] return rts } +//SEG41 File Data points: .fill 2*2, 0 diff --git a/src/test/ref/struct-ptr-9.log b/src/test/ref/struct-ptr-9.log index da81db370..b01a87611 100644 --- a/src/test/ref/struct-ptr-9.log +++ b/src/test/ref/struct-ptr-9.log @@ -351,6 +351,7 @@ main: { //SEG32 [17] return rts } +//SEG33 File Data points: .fill 2*2, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -470,6 +471,7 @@ main: { //SEG32 [17] return rts } +//SEG33 File Data points: .fill 2*2, 0 ASSEMBLER OPTIMIZATIONS @@ -601,5 +603,6 @@ main: { //SEG32 [17] return rts } +//SEG33 File Data points: .fill 2*2, 0 diff --git a/src/test/ref/subexpr-optimize-0.log b/src/test/ref/subexpr-optimize-0.log index c73661f8c..28df541f3 100644 --- a/src/test/ref/subexpr-optimize-0.log +++ b/src/test/ref/subexpr-optimize-0.log @@ -257,6 +257,7 @@ main: { //SEG26 [13] return rts } +//SEG27 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$1 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::screen#3 main::$1 ] ( main:2 [ main::i#2 main::screen#3 main::$1 ] ) always clobbers reg byte a @@ -369,6 +370,7 @@ main: { //SEG26 [13] return rts } +//SEG27 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -483,4 +485,5 @@ main: { //SEG26 [13] return rts } +//SEG27 File Data diff --git a/src/test/ref/subexpr-optimize-1.log b/src/test/ref/subexpr-optimize-1.log index 28bab399c..4f9c2f8be 100644 --- a/src/test/ref/subexpr-optimize-1.log +++ b/src/test/ref/subexpr-optimize-1.log @@ -279,6 +279,7 @@ main: { //SEG23 [12] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← *((const byte*) main::SCREEN#0+(byte) 1 + (byte) main::i#2) [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -360,6 +361,7 @@ main: { //SEG23 [12] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -450,4 +452,5 @@ main: { //SEG23 [12] return rts } +//SEG24 File Data diff --git a/src/test/ref/subexpr-optimize-2.log b/src/test/ref/subexpr-optimize-2.log index 0b2e26130..b5a5f68af 100644 --- a/src/test/ref/subexpr-optimize-2.log +++ b/src/test/ref/subexpr-optimize-2.log @@ -297,6 +297,7 @@ main: { //SEG29 [16] return rts } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte~) main::$1 ← (byte~) main::$0 << (byte) 1 [ main::i#2 main::screen#3 main::$1 ] ( main:2 [ main::i#2 main::screen#3 main::$1 ] ) always clobbers reg byte a @@ -418,6 +419,7 @@ main: { //SEG29 [16] return rts } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -544,4 +546,5 @@ main: { //SEG29 [16] return rts } +//SEG30 File Data diff --git a/src/test/ref/subexpr-optimize-3.log b/src/test/ref/subexpr-optimize-3.log index 36ca59224..a1fa29195 100644 --- a/src/test/ref/subexpr-optimize-3.log +++ b/src/test/ref/subexpr-optimize-3.log @@ -320,6 +320,7 @@ main: { //SEG30 [17] return rts } +//SEG31 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::screen#3 main::$3 ] ( main:2 [ main::i#2 main::screen#3 main::$3 ] ) always clobbers reg byte a @@ -454,6 +455,7 @@ main: { //SEG30 [17] return rts } +//SEG31 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -586,4 +588,5 @@ main: { //SEG30 [17] return rts } +//SEG31 File Data diff --git a/src/test/ref/subexpr-optimize-4.log b/src/test/ref/subexpr-optimize-4.log index f9954eccd..929fd9782 100644 --- a/src/test/ref/subexpr-optimize-4.log +++ b/src/test/ref/subexpr-optimize-4.log @@ -488,6 +488,7 @@ main: { stx _4 jmp b4_from_b2 } +//SEG44 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [8] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::screen#3 main::$2 ] ( main:2 [ main::i#2 main::screen#3 main::$2 ] ) always clobbers reg byte a @@ -656,6 +657,7 @@ main: { adc #3 jmp b4_from_b2 } +//SEG44 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -833,4 +835,5 @@ main: { adc #3 jmp b4 } +//SEG44 File Data diff --git a/src/test/ref/summin.log b/src/test/ref/summin.log index 7181c8a8c..597acb09b 100644 --- a/src/test/ref/summin.log +++ b/src/test/ref/summin.log @@ -424,6 +424,7 @@ sum: { //SEG40 [20] return rts } +//SEG41 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [14] (byte~) main::$3 ← (byte) main::s1#0 + (byte) main::s2#0 [ main::s3#0 main::$3 ] ( main:2 [ main::s3#0 main::$3 ] ) always clobbers reg byte a @@ -568,6 +569,7 @@ sum: { //SEG40 [20] return rts } +//SEG41 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -722,4 +724,5 @@ sum: { //SEG40 [20] return rts } +//SEG41 File Data diff --git a/src/test/ref/ternary-1.log b/src/test/ref/ternary-1.log index 588f2f6e9..d497015ac 100644 --- a/src/test/ref/ternary-1.log +++ b/src/test/ref/ternary-1.log @@ -253,6 +253,7 @@ main: { //SEG28 [12] return rts } +//SEG29 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -336,6 +337,7 @@ main: { //SEG28 [12] return rts } +//SEG29 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -441,4 +443,5 @@ main: { //SEG28 [12] return rts } +//SEG29 File Data diff --git a/src/test/ref/ternary-2.log b/src/test/ref/ternary-2.log index 40e968360..61d51240b 100644 --- a/src/test/ref/ternary-2.log +++ b/src/test/ref/ternary-2.log @@ -201,6 +201,7 @@ main: { //SEG16 [7] return rts } +//SEG17 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) main::SCREEN#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -258,6 +259,7 @@ main: { //SEG16 [7] return rts } +//SEG17 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -327,4 +329,5 @@ main: { //SEG16 [7] return rts } +//SEG17 File Data diff --git a/src/test/ref/ternary-3.log b/src/test/ref/ternary-3.log index 1a23611af..fcc5df837 100644 --- a/src/test/ref/ternary-3.log +++ b/src/test/ref/ternary-3.log @@ -553,6 +553,7 @@ cond: { //SEG53 [29] return rts } +//SEG54 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [28] (bool) cond::return#1 ← (byte) cond::b#0 < (byte) 5 [ cond::return#1 ] ( main:2::cond:7 [ main::i#2 cond::return#1 ] ) always clobbers reg byte a @@ -715,6 +716,7 @@ cond: { //SEG53 [29] return rts } +//SEG54 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -918,4 +920,5 @@ cond: { //SEG53 [29] return rts } +//SEG54 File Data diff --git a/src/test/ref/ternary-inference.log b/src/test/ref/ternary-inference.log index 3c03dd3cf..57ac7118d 100644 --- a/src/test/ref/ternary-inference.log +++ b/src/test/ref/ternary-inference.log @@ -280,6 +280,7 @@ main: { //SEG29 [13] return rts } +//SEG30 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [9] (byte~) main::$4 ← (byte~) main::$3 + (byte) main::i#2 [ main::i#2 main::$4 ] ( main:2 [ main::i#2 main::$4 ] ) always clobbers reg byte a @@ -371,6 +372,7 @@ main: { //SEG29 [13] return rts } +//SEG30 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -482,4 +484,5 @@ main: { //SEG29 [13] return rts } +//SEG30 File Data diff --git a/src/test/ref/test-comments-block.log b/src/test/ref/test-comments-block.log index 848fb2673..54c1a28ae 100644 --- a/src/test/ref/test-comments-block.log +++ b/src/test/ref/test-comments-block.log @@ -347,6 +347,7 @@ sum: { //SEG32 [16] return rts } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::b#2 main::b#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -457,6 +458,7 @@ sum: { //SEG32 [16] return rts } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -597,4 +599,5 @@ sum: { //SEG32 [16] return rts } +//SEG33 File Data diff --git a/src/test/ref/test-comments-loop.log b/src/test/ref/test-comments-loop.log index 293e10299..8447278e1 100644 --- a/src/test/ref/test-comments-loop.log +++ b/src/test/ref/test-comments-loop.log @@ -173,6 +173,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] *((const byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) 'a' [ main::b#2 ] ( main:2 [ main::b#2 ] ) always clobbers reg byte a @@ -239,6 +240,7 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -320,4 +322,5 @@ main: { //SEG20 [9] return rts } +//SEG21 File Data diff --git a/src/test/ref/test-comments-single.log b/src/test/ref/test-comments-single.log index 23332a3a4..c3864be00 100644 --- a/src/test/ref/test-comments-single.log +++ b/src/test/ref/test-comments-single.log @@ -345,6 +345,7 @@ sum: { //SEG32 [16] return rts } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::b#2 main::b#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -453,6 +454,7 @@ sum: { //SEG32 [16] return rts } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -591,4 +593,5 @@ sum: { //SEG32 [16] return rts } +//SEG33 File Data diff --git a/src/test/ref/test-comments-usage.log b/src/test/ref/test-comments-usage.log index a66d76d86..32e0a4f68 100644 --- a/src/test/ref/test-comments-usage.log +++ b/src/test/ref/test-comments-usage.log @@ -107,6 +107,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -153,6 +154,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -210,4 +212,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/test-comparisons-sword.asm b/src/test/ref/test-comparisons-sword.asm index c8fb08c9f..84277ce7e 100644 --- a/src/test/ref/test-comparisons-sword.asm +++ b/src/test/ref/test-comparisons-sword.asm @@ -311,13 +311,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word diff --git a/src/test/ref/test-comparisons-sword.log b/src/test/ref/test-comparisons-sword.log index 2ba1e16ab..4f718f18d 100644 --- a/src/test/ref/test-comparisons-sword.log +++ b/src/test/ref/test-comparisons-sword.log @@ -2962,13 +2962,11 @@ print_sword: { b3: //SEG235 [85] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#3 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG236 [86] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -3145,6 +3143,7 @@ print_cls: { //SEG295 [114] return rts } +//SEG296 File Data print_hextab: .text "0123456789abcdef" swords: .word -$6fed, $12, $7fed @@ -3258,27 +3257,27 @@ Uplift Scope [print_sword] 15.83: zp ZP_WORD:12 [ print_sword::w#4 print_sword:: Uplift Scope [print_ln] Uplift Scope [print_word] -Uplifting [] best 1156373 combination zp ZP_WORD:6 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#29 print_line_cursor#31 print_line_cursor#23 print_line_cursor#1 ] zp ZP_WORD:14 [ print_char_cursor#60 print_char_cursor#43 print_char_cursor#71 print_char_cursor#2 print_char_cursor#70 print_char_cursor#67 print_char_cursor#75 print_char_cursor#80 print_char_cursor#76 print_char_cursor#14 print_char_cursor#128 print_char_cursor#63 print_char_cursor#61 print_char_cursor#1 ] -Uplifting [print_str] best 1156373 combination zp ZP_WORD:17 [ print_str::str#2 print_str::str#1 print_str::str#0 ] -Uplifting [main] best 1143933 combination zp ZP_BYTE:5 [ main::s#3 main::s#5 main::s#7 main::s#10 main::s#1 ] reg byte x [ main::op#2 main::op#1 ] reg byte a [ main::$9 ] zp ZP_BYTE:3 [ main::j#2 main::j#1 ] zp ZP_WORD:25 [ main::w2#0 ] zp ZP_WORD:22 [ main::w1#0 ] reg byte a [ main::$8 ] zp ZP_BYTE:2 [ main::i#2 main::i#1 ] +Uplifting [] best 1156369 combination zp ZP_WORD:6 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#29 print_line_cursor#31 print_line_cursor#23 print_line_cursor#1 ] zp ZP_WORD:14 [ print_char_cursor#60 print_char_cursor#43 print_char_cursor#71 print_char_cursor#2 print_char_cursor#70 print_char_cursor#67 print_char_cursor#75 print_char_cursor#80 print_char_cursor#76 print_char_cursor#14 print_char_cursor#128 print_char_cursor#63 print_char_cursor#61 print_char_cursor#1 ] +Uplifting [print_str] best 1156369 combination zp ZP_WORD:17 [ print_str::str#2 print_str::str#1 print_str::str#0 ] +Uplifting [main] best 1143929 combination zp ZP_BYTE:5 [ main::s#3 main::s#5 main::s#7 main::s#10 main::s#1 ] reg byte x [ main::op#2 main::op#1 ] reg byte a [ main::$9 ] zp ZP_BYTE:3 [ main::j#2 main::j#1 ] zp ZP_WORD:25 [ main::w2#0 ] zp ZP_WORD:22 [ main::w1#0 ] reg byte a [ main::$8 ] zp ZP_BYTE:2 [ main::i#2 main::i#1 ] Limited combination testing to 100 combinations of 256 possible. -Uplifting [compare] best 1140915 combination reg byte x [ compare::op#0 ] zp ZP_WORD:27 [ compare::w1#0 ] zp ZP_WORD:29 [ compare::w2#0 ] zp ZP_BYTE:10 [ compare::r#10 compare::r#17 compare::r#18 compare::r#19 compare::r#20 compare::r#21 compare::r#22 ] zp ZP_WORD:8 [ compare::ops#10 ] -Uplifting [print_cls] best 1140915 combination zp ZP_WORD:19 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_char] best 1140894 combination reg byte a [ print_char::ch#6 print_char::ch#4 print_char::ch#1 print_char::ch#2 ] -Uplifting [print_byte] best 1140886 combination zp ZP_BYTE:16 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [print_sword] best 1140886 combination zp ZP_WORD:12 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 ] -Uplifting [print_ln] best 1140886 combination -Uplifting [print_word] best 1140886 combination +Uplifting [compare] best 1140911 combination reg byte x [ compare::op#0 ] zp ZP_WORD:27 [ compare::w1#0 ] zp ZP_WORD:29 [ compare::w2#0 ] zp ZP_BYTE:10 [ compare::r#10 compare::r#17 compare::r#18 compare::r#19 compare::r#20 compare::r#21 compare::r#22 ] zp ZP_WORD:8 [ compare::ops#10 ] +Uplifting [print_cls] best 1140911 combination zp ZP_WORD:19 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_char] best 1140890 combination reg byte a [ print_char::ch#6 print_char::ch#4 print_char::ch#1 print_char::ch#2 ] +Uplifting [print_byte] best 1140882 combination zp ZP_BYTE:16 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [print_sword] best 1140882 combination zp ZP_WORD:12 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 ] +Uplifting [print_ln] best 1140882 combination +Uplifting [print_word] best 1140882 combination Attempting to uplift remaining variables inzp ZP_BYTE:5 [ main::s#3 main::s#5 main::s#7 main::s#10 main::s#1 ] -Uplifting [main] best 1140886 combination zp ZP_BYTE:5 [ main::s#3 main::s#5 main::s#7 main::s#10 main::s#1 ] +Uplifting [main] best 1140882 combination zp ZP_BYTE:5 [ main::s#3 main::s#5 main::s#7 main::s#10 main::s#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::j#2 main::j#1 ] -Uplifting [main] best 1140886 combination zp ZP_BYTE:3 [ main::j#2 main::j#1 ] +Uplifting [main] best 1140882 combination zp ZP_BYTE:3 [ main::j#2 main::j#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::i#2 main::i#1 ] -Uplifting [main] best 1140886 combination zp ZP_BYTE:2 [ main::i#2 main::i#1 ] +Uplifting [main] best 1140882 combination zp ZP_BYTE:2 [ main::i#2 main::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:10 [ compare::r#10 compare::r#17 compare::r#18 compare::r#19 compare::r#20 compare::r#21 compare::r#22 ] -Uplifting [compare] best 1140886 combination zp ZP_BYTE:10 [ compare::r#10 compare::r#17 compare::r#18 compare::r#19 compare::r#20 compare::r#21 compare::r#22 ] +Uplifting [compare] best 1140882 combination zp ZP_BYTE:10 [ compare::r#10 compare::r#17 compare::r#18 compare::r#19 compare::r#20 compare::r#21 compare::r#22 ] Attempting to uplift remaining variables inzp ZP_BYTE:16 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Uplifting [print_byte] best 1140886 combination zp ZP_BYTE:16 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Uplifting [print_byte] best 1140882 combination zp ZP_BYTE:16 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ compare::ops#10 ] ] with [ zp ZP_WORD:17 [ print_str::str#2 print_str::str#1 print_str::str#0 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:12 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 ] ] with [ zp ZP_WORD:27 [ compare::w1#0 ] ] - score: 1 Coalescing zero page register with common assignment [ zp ZP_WORD:25 [ main::w2#0 ] ] with [ zp ZP_WORD:29 [ compare::w2#0 ] ] - score: 1 @@ -3966,13 +3965,11 @@ print_sword: { b3: //SEG235 [85] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#3 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG236 [86] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -4143,6 +4140,7 @@ print_cls: { //SEG295 [114] return rts } +//SEG296 File Data print_hextab: .text "0123456789abcdef" swords: .word -$6fed, $12, $7fed @@ -4547,7 +4545,7 @@ reg byte a [ print_byte::$2 ] FINAL ASSEMBLER -Score: 966649 +Score: 966645 //SEG0 File Comments // Test signed word comparisons @@ -5098,13 +5096,11 @@ print_sword: { //SEG234 print_sword::@3 //SEG235 [85] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#3 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG236 [86] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG237 [86] phi (byte*) print_char_cursor#60 = (byte*) print_char_cursor#61 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -5246,6 +5242,7 @@ print_cls: { //SEG295 [114] return rts } +//SEG296 File Data print_hextab: .text "0123456789abcdef" swords: .word -$6fed, $12, $7fed diff --git a/src/test/ref/test-comparisons-word.log b/src/test/ref/test-comparisons-word.log index aff2f8019..b8212f300 100644 --- a/src/test/ref/test-comparisons-word.log +++ b/src/test/ref/test-comparisons-word.log @@ -2768,6 +2768,7 @@ print_cls: { //SEG264 [101] return rts } +//SEG265 File Data print_hextab: .text "0123456789abcdef" words: .word $12, $3f34, $cfed @@ -3666,6 +3667,7 @@ print_cls: { //SEG264 [101] return rts } +//SEG265 File Data print_hextab: .text "0123456789abcdef" words: .word $12, $3f34, $cfed @@ -4647,6 +4649,7 @@ print_cls: { //SEG264 [101] return rts } +//SEG265 File Data print_hextab: .text "0123456789abcdef" words: .word $12, $3f34, $cfed diff --git a/src/test/ref/test-comparisons.log b/src/test/ref/test-comparisons.log index 4d6c0faa9..751a2466f 100644 --- a/src/test/ref/test-comparisons.log +++ b/src/test/ref/test-comparisons.log @@ -4659,6 +4659,7 @@ print_cls: { //SEG522 [204] return rts } +//SEG523 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -6182,6 +6183,7 @@ print_cls: { //SEG522 [204] return rts } +//SEG523 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -7753,5 +7755,6 @@ print_cls: { //SEG522 [204] return rts } +//SEG523 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/test-division.asm b/src/test/ref/test-division.asm index b29cf1837..cc02e4b6b 100644 --- a/src/test/ref/test-division.asm +++ b/src/test/ref/test-division.asm @@ -107,13 +107,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word @@ -233,34 +231,28 @@ divr16s: { cpy #0 beq breturn sec - lda rem16s - eor #$ff - adc #0 + lda #0 + sbc rem16s sta rem16s - lda rem16s+1 - eor #$ff - adc #0 + lda #0 + sbc rem16s+1 sta rem16s+1 sec - lda return - eor #$ff - adc #0 + lda #0 + sbc return sta return - lda return+1 - eor #$ff - adc #0 + lda #0 + sbc return+1 sta return+1 breturn: rts b3: sec - lda _13 - eor #$ff - adc #0 + lda #0 + sbc _13 sta _13 - lda _13+1 - eor #$ff - adc #0 + lda #0 + sbc _13+1 sta _13+1 tya eor #1 @@ -268,13 +260,11 @@ divr16s: { jmp b4 b1: sec - lda _8 - eor #$ff - adc #0 + lda #0 + sbc _8 sta _8 - lda _8+1 - eor #$ff - adc #0 + lda #0 + sbc _8+1 sta _8+1 ldy #1 jmp b2 diff --git a/src/test/ref/test-division.log b/src/test/ref/test-division.log index b40968828..b77fda612 100644 --- a/src/test/ref/test-division.log +++ b/src/test/ref/test-division.log @@ -5210,13 +5210,11 @@ print_sword: { b3: //SEG112 [54] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#5 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG113 [55] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -5523,23 +5521,19 @@ divr16s: { b8: //SEG206 [102] (signed word) rem16s#2 ← - (signed word)(word) rem16u#1 -- vwsz1=_neg_vwsz2 sec - lda rem16u - eor #$ff - adc #0 + lda #0 + sbc rem16u sta rem16s - lda rem16u+1 - eor #$ff - adc #0 + lda #0 + sbc rem16u+1 sta rem16s+1 //SEG207 [103] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0 -- vwsz1=_neg_vwsz2 sec - lda resultu - eor #$ff - adc #0 + lda #0 + sbc resultu sta return - lda resultu+1 - eor #$ff - adc #0 + lda #0 + sbc resultu+1 sta return+1 //SEG208 [104] phi from divr16s::@5 divr16s::@8 to divr16s::@return [phi:divr16s::@5/divr16s::@8->divr16s::@return] breturn_from_b5: @@ -5568,13 +5562,11 @@ divr16s: { b3: //SEG217 [108] (signed word~) divr16s::$13 ← - (signed word) divr16s::divisor#0 -- vwsz1=_neg_vwsz2 sec - lda divisor - eor #$ff - adc #0 + lda #0 + sbc divisor sta _13 - lda divisor+1 - eor #$ff - adc #0 + lda #0 + sbc divisor+1 sta _13+1 //SEG218 [109] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte) 1 -- vbuz1=vbuz1_bxor_vbuc1 lda #1 @@ -5590,13 +5582,11 @@ divr16s: { b1: //SEG221 [111] (signed word~) divr16s::$8 ← - (signed word) divr16s::dividend#0 -- vwsz1=_neg_vwsz2 sec - lda dividend - eor #$ff - adc #0 + lda #0 + sbc dividend sta _8 - lda dividend+1 - eor #$ff - adc #0 + lda #0 + sbc dividend+1 sta _8+1 //SEG222 [112] (word~) divr16s::dividendu#7 ← (word)(signed word~) divr16s::$8 -- vwuz1=vwuz2 lda _8 @@ -6712,6 +6702,7 @@ print_cls: { //SEG601 [288] return rts } +//SEG602 File Data print_hextab: .text "0123456789abcdef" str: .text " / @" str1: .text " = @" @@ -7100,78 +7091,78 @@ Uplift Scope [print_char] 14: zp ZP_BYTE:10 [ print_char::ch#5 print_char::ch#3 Uplift Scope [print_ln] Uplift Scope [main] -Uplifting [divr16u] best 45199 combination zp ZP_WORD:26 [ divr16u::rem#5 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:30 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:28 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#1 divr16u::dividend#2 divr16u::dividend#0 ] zp ZP_WORD:24 [ divr16u::divisor#6 divr16u::divisor#0 divr16u::divisor#1 ] zp ZP_WORD:73 [ divr16u::return#3 ] zp ZP_WORD:113 [ divr16u::return#2 ] -Uplifting [divr8u] best 42796 combination reg byte y [ divr8u::rem#4 divr8u::rem#10 divr8u::rem#5 divr8u::rem#1 divr8u::rem#2 divr8u::rem#3 ] zp ZP_BYTE:44 [ divr8u::quotient#3 divr8u::return#1 divr8u::quotient#1 divr8u::quotient#2 ] reg byte a [ divr8u::$1 ] reg byte x [ divr8u::i#2 divr8u::i#1 ] zp ZP_BYTE:43 [ divr8u::dividend#2 divr8u::dividend#0 divr8u::dividend#1 ] zp ZP_BYTE:95 [ divr8u::divisor#0 ] zp ZP_BYTE:96 [ divr8u::return#0 ] +Uplifting [divr16u] best 45179 combination zp ZP_WORD:26 [ divr16u::rem#5 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] zp ZP_WORD:30 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] zp ZP_WORD:28 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#1 divr16u::dividend#2 divr16u::dividend#0 ] zp ZP_WORD:24 [ divr16u::divisor#6 divr16u::divisor#0 divr16u::divisor#1 ] zp ZP_WORD:73 [ divr16u::return#3 ] zp ZP_WORD:113 [ divr16u::return#2 ] +Uplifting [divr8u] best 42776 combination reg byte y [ divr8u::rem#4 divr8u::rem#10 divr8u::rem#5 divr8u::rem#1 divr8u::rem#2 divr8u::rem#3 ] zp ZP_BYTE:44 [ divr8u::quotient#3 divr8u::return#1 divr8u::quotient#1 divr8u::quotient#2 ] reg byte a [ divr8u::$1 ] reg byte x [ divr8u::i#2 divr8u::i#1 ] zp ZP_BYTE:43 [ divr8u::dividend#2 divr8u::dividend#0 divr8u::dividend#1 ] zp ZP_BYTE:95 [ divr8u::divisor#0 ] zp ZP_BYTE:96 [ divr8u::return#0 ] Limited combination testing to 100 combinations of 3888 possible. -Uplifting [] best 42729 combination zp ZP_WORD:11 [ print_char_cursor#82 print_char_cursor#136 print_char_cursor#135 print_char_cursor#130 print_char_cursor#131 print_char_cursor#161 print_char_cursor#128 print_char_cursor#18 print_char_cursor#172 print_char_cursor#138 print_char_cursor#132 print_char_cursor#1 print_char_cursor#167 print_char_cursor#188 ] zp ZP_WORD:3 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 print_line_cursor#41 ] reg byte x [ rem8s#3 rem8s#2 rem8s#33 ] zp ZP_WORD:22 [ rem16s#11 rem16s#2 rem16s#37 ] reg byte x [ rem8u#17 ] zp ZP_WORD:83 [ rem16u#1 ] -Uplifting [print_str] best 42729 combination zp ZP_WORD:13 [ print_str::str#13 print_str::str#15 print_str::str#0 ] -Uplifting [print_byte] best 42721 combination zp ZP_BYTE:9 [ print_byte::b#7 print_byte::b#9 print_byte::b#1 print_byte::b#2 print_byte::b#3 print_byte::b#4 print_byte::b#5 print_byte::b#6 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [print_word] best 42721 combination zp ZP_WORD:7 [ print_word::w#5 print_word::w#7 print_word::w#1 print_word::w#2 print_word::w#3 print_word::w#4 ] -Uplifting [print_sword] best 42721 combination zp ZP_WORD:5 [ print_sword::w#6 print_sword::w#5 print_sword::w#1 print_sword::w#2 print_sword::w#3 print_sword::w#4 print_sword::w#0 ] -Uplifting [print_sbyte] best 42721 combination zp ZP_BYTE:34 [ print_sbyte::b#7 print_sbyte::b#0 print_sbyte::b#10 print_sbyte::b#1 print_sbyte::b#2 print_sbyte::b#3 print_sbyte::b#4 ] -Uplifting [div8u] best 42583 combination reg byte x [ div8u::divisor#2 div8u::divisor#0 div8u::divisor#1 ] reg byte a [ div8u::dividend#2 div8u::dividend#0 div8u::dividend#1 ] reg byte a [ div8u::return#3 ] reg byte a [ div8u::return#2 ] zp ZP_BYTE:97 [ div8u::return#0 ] +Uplifting [] best 42709 combination zp ZP_WORD:11 [ print_char_cursor#82 print_char_cursor#136 print_char_cursor#135 print_char_cursor#130 print_char_cursor#131 print_char_cursor#161 print_char_cursor#128 print_char_cursor#18 print_char_cursor#172 print_char_cursor#138 print_char_cursor#132 print_char_cursor#1 print_char_cursor#167 print_char_cursor#188 ] zp ZP_WORD:3 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 print_line_cursor#41 ] reg byte x [ rem8s#3 rem8s#2 rem8s#33 ] zp ZP_WORD:22 [ rem16s#11 rem16s#2 rem16s#37 ] reg byte x [ rem8u#17 ] zp ZP_WORD:83 [ rem16u#1 ] +Uplifting [print_str] best 42709 combination zp ZP_WORD:13 [ print_str::str#13 print_str::str#15 print_str::str#0 ] +Uplifting [print_byte] best 42701 combination zp ZP_BYTE:9 [ print_byte::b#7 print_byte::b#9 print_byte::b#1 print_byte::b#2 print_byte::b#3 print_byte::b#4 print_byte::b#5 print_byte::b#6 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [print_word] best 42701 combination zp ZP_WORD:7 [ print_word::w#5 print_word::w#7 print_word::w#1 print_word::w#2 print_word::w#3 print_word::w#4 ] +Uplifting [print_sword] best 42701 combination zp ZP_WORD:5 [ print_sword::w#6 print_sword::w#5 print_sword::w#1 print_sword::w#2 print_sword::w#3 print_sword::w#4 print_sword::w#0 ] +Uplifting [print_sbyte] best 42701 combination zp ZP_BYTE:34 [ print_sbyte::b#7 print_sbyte::b#0 print_sbyte::b#10 print_sbyte::b#1 print_sbyte::b#2 print_sbyte::b#3 print_sbyte::b#4 ] +Uplifting [div8u] best 42563 combination reg byte x [ div8u::divisor#2 div8u::divisor#0 div8u::divisor#1 ] reg byte a [ div8u::dividend#2 div8u::dividend#0 div8u::dividend#1 ] reg byte a [ div8u::return#3 ] reg byte a [ div8u::return#2 ] zp ZP_BYTE:97 [ div8u::return#0 ] Limited combination testing to 100 combinations of 1024 possible. -Uplifting [div8s] best 42478 combination reg byte a [ div8s::return#3 ] reg byte x [ div8s::divisoru#3 div8s::divisoru#4 div8s::divisoru#5 ] reg byte a [ div8s::return#2 div8s::return#1 div8s::return#7 ] zp ZP_BYTE:35 [ div8s::dividendu#3 div8s::dividendu#7 div8s::dividendu#8 ] zp ZP_BYTE:87 [ div8s::dividend#0 ] zp ZP_BYTE:37 [ div8s::neg#4 div8s::neg#2 div8s::neg#3 ] zp ZP_BYTE:88 [ div8s::divisor#0 ] zp ZP_BYTE:94 [ div8s::$5 ] zp ZP_BYTE:93 [ div8s::$8 ] zp ZP_BYTE:92 [ div8s::resultu#0 ] +Uplifting [div8s] best 42458 combination reg byte a [ div8s::return#3 ] reg byte x [ div8s::divisoru#3 div8s::divisoru#4 div8s::divisoru#5 ] reg byte a [ div8s::return#2 div8s::return#1 div8s::return#7 ] zp ZP_BYTE:35 [ div8s::dividendu#3 div8s::dividendu#7 div8s::dividendu#8 ] zp ZP_BYTE:87 [ div8s::dividend#0 ] zp ZP_BYTE:37 [ div8s::neg#4 div8s::neg#2 div8s::neg#3 ] zp ZP_BYTE:88 [ div8s::divisor#0 ] zp ZP_BYTE:94 [ div8s::$5 ] zp ZP_BYTE:93 [ div8s::$8 ] zp ZP_BYTE:92 [ div8s::resultu#0 ] Limited combination testing to 100 combinations of 248832 possible. -Uplifting [test_16u] best 42408 combination zp ZP_BYTE:46 [ test_16u::i#10 test_16u::i#1 ] reg byte x [ test_16u::$11 ] zp ZP_WORD:101 [ test_16u::dividend#0 ] zp ZP_WORD:103 [ test_16u::divisor#0 ] zp ZP_WORD:111 [ test_16u::res#0 ] -Uplifting [test_16s] best 42338 combination zp ZP_BYTE:2 [ test_16s::i#10 test_16s::i#1 ] reg byte x [ test_16s::$11 ] zp ZP_WORD:51 [ test_16s::dividend#0 ] zp ZP_WORD:53 [ test_16s::divisor#0 ] zp ZP_WORD:61 [ test_16s::res#0 ] -Uplifting [divr16s] best 42327 combination zp ZP_WORD:17 [ divr16s::divisoru#3 divr16s::divisoru#4 divr16s::divisoru#5 ] zp ZP_WORD:15 [ divr16s::dividendu#3 divr16s::dividendu#7 divr16s::dividendu#8 ] zp ZP_WORD:20 [ divr16s::return#2 divr16s::return#1 divr16s::return#7 ] reg byte y [ divr16s::neg#4 divr16s::neg#2 divr16s::neg#3 ] zp ZP_WORD:69 [ divr16s::return#3 ] zp ZP_WORD:65 [ divr16s::dividend#0 ] zp ZP_WORD:79 [ divr16s::$8 ] zp ZP_WORD:77 [ divr16s::$13 ] zp ZP_WORD:67 [ divr16s::divisor#0 ] zp ZP_WORD:75 [ divr16s::resultu#0 ] -Uplifting [div16u] best 42327 combination zp ZP_WORD:109 [ div16u::return#2 ] zp ZP_WORD:105 [ div16u::dividend#0 ] zp ZP_WORD:107 [ div16u::divisor#0 ] zp ZP_WORD:115 [ div16u::return#0 ] -Uplifting [div16s] best 42327 combination zp ZP_WORD:59 [ div16s::return#2 ] zp ZP_WORD:55 [ div16s::dividend#0 ] zp ZP_WORD:57 [ div16s::divisor#0 ] zp ZP_WORD:71 [ div16s::return#0 ] -Uplifting [print_cls] best 42327 combination zp ZP_WORD:48 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [test_8s] best 42327 combination zp ZP_BYTE:33 [ test_8s::i#10 test_8s::i#1 ] zp ZP_BYTE:85 [ test_8s::dividend#0 ] zp ZP_BYTE:86 [ test_8s::divisor#0 ] zp ZP_BYTE:90 [ test_8s::res#0 ] -Uplifting [test_8u] best 42327 combination zp ZP_BYTE:47 [ test_8u::i#10 test_8u::i#1 ] zp ZP_BYTE:117 [ test_8u::dividend#0 ] zp ZP_BYTE:118 [ test_8u::divisor#0 ] zp ZP_BYTE:120 [ test_8u::res#0 ] -Uplifting [print_char] best 42309 combination reg byte a [ print_char::ch#5 print_char::ch#3 print_char::ch#4 ] -Uplifting [print_ln] best 42309 combination -Uplifting [main] best 42309 combination +Uplifting [test_16u] best 42388 combination zp ZP_BYTE:46 [ test_16u::i#10 test_16u::i#1 ] reg byte x [ test_16u::$11 ] zp ZP_WORD:101 [ test_16u::dividend#0 ] zp ZP_WORD:103 [ test_16u::divisor#0 ] zp ZP_WORD:111 [ test_16u::res#0 ] +Uplifting [test_16s] best 42318 combination zp ZP_BYTE:2 [ test_16s::i#10 test_16s::i#1 ] reg byte x [ test_16s::$11 ] zp ZP_WORD:51 [ test_16s::dividend#0 ] zp ZP_WORD:53 [ test_16s::divisor#0 ] zp ZP_WORD:61 [ test_16s::res#0 ] +Uplifting [divr16s] best 42307 combination zp ZP_WORD:17 [ divr16s::divisoru#3 divr16s::divisoru#4 divr16s::divisoru#5 ] zp ZP_WORD:15 [ divr16s::dividendu#3 divr16s::dividendu#7 divr16s::dividendu#8 ] zp ZP_WORD:20 [ divr16s::return#2 divr16s::return#1 divr16s::return#7 ] reg byte y [ divr16s::neg#4 divr16s::neg#2 divr16s::neg#3 ] zp ZP_WORD:69 [ divr16s::return#3 ] zp ZP_WORD:65 [ divr16s::dividend#0 ] zp ZP_WORD:79 [ divr16s::$8 ] zp ZP_WORD:77 [ divr16s::$13 ] zp ZP_WORD:67 [ divr16s::divisor#0 ] zp ZP_WORD:75 [ divr16s::resultu#0 ] +Uplifting [div16u] best 42307 combination zp ZP_WORD:109 [ div16u::return#2 ] zp ZP_WORD:105 [ div16u::dividend#0 ] zp ZP_WORD:107 [ div16u::divisor#0 ] zp ZP_WORD:115 [ div16u::return#0 ] +Uplifting [div16s] best 42307 combination zp ZP_WORD:59 [ div16s::return#2 ] zp ZP_WORD:55 [ div16s::dividend#0 ] zp ZP_WORD:57 [ div16s::divisor#0 ] zp ZP_WORD:71 [ div16s::return#0 ] +Uplifting [print_cls] best 42307 combination zp ZP_WORD:48 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [test_8s] best 42307 combination zp ZP_BYTE:33 [ test_8s::i#10 test_8s::i#1 ] zp ZP_BYTE:85 [ test_8s::dividend#0 ] zp ZP_BYTE:86 [ test_8s::divisor#0 ] zp ZP_BYTE:90 [ test_8s::res#0 ] +Uplifting [test_8u] best 42307 combination zp ZP_BYTE:47 [ test_8u::i#10 test_8u::i#1 ] zp ZP_BYTE:117 [ test_8u::dividend#0 ] zp ZP_BYTE:118 [ test_8u::divisor#0 ] zp ZP_BYTE:120 [ test_8u::res#0 ] +Uplifting [print_char] best 42289 combination reg byte a [ print_char::ch#5 print_char::ch#3 print_char::ch#4 ] +Uplifting [print_ln] best 42289 combination +Uplifting [main] best 42289 combination Attempting to uplift remaining variables inzp ZP_BYTE:44 [ divr8u::quotient#3 divr8u::return#1 divr8u::quotient#1 divr8u::quotient#2 ] -Uplifting [divr8u] best 42309 combination zp ZP_BYTE:44 [ divr8u::quotient#3 divr8u::return#1 divr8u::quotient#1 divr8u::quotient#2 ] +Uplifting [divr8u] best 42289 combination zp ZP_BYTE:44 [ divr8u::quotient#3 divr8u::return#1 divr8u::quotient#1 divr8u::quotient#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:9 [ print_byte::b#7 print_byte::b#9 print_byte::b#1 print_byte::b#2 print_byte::b#3 print_byte::b#4 print_byte::b#5 print_byte::b#6 ] -Uplifting [print_byte] best 42309 combination zp ZP_BYTE:9 [ print_byte::b#7 print_byte::b#9 print_byte::b#1 print_byte::b#2 print_byte::b#3 print_byte::b#4 print_byte::b#5 print_byte::b#6 ] +Uplifting [print_byte] best 42289 combination zp ZP_BYTE:9 [ print_byte::b#7 print_byte::b#9 print_byte::b#1 print_byte::b#2 print_byte::b#3 print_byte::b#4 print_byte::b#5 print_byte::b#6 ] Attempting to uplift remaining variables inzp ZP_BYTE:34 [ print_sbyte::b#7 print_sbyte::b#0 print_sbyte::b#10 print_sbyte::b#1 print_sbyte::b#2 print_sbyte::b#3 print_sbyte::b#4 ] -Uplifting [print_sbyte] best 42309 combination zp ZP_BYTE:34 [ print_sbyte::b#7 print_sbyte::b#0 print_sbyte::b#10 print_sbyte::b#1 print_sbyte::b#2 print_sbyte::b#3 print_sbyte::b#4 ] +Uplifting [print_sbyte] best 42289 combination zp ZP_BYTE:34 [ print_sbyte::b#7 print_sbyte::b#0 print_sbyte::b#10 print_sbyte::b#1 print_sbyte::b#2 print_sbyte::b#3 print_sbyte::b#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:43 [ divr8u::dividend#2 divr8u::dividend#0 divr8u::dividend#1 ] -Uplifting [divr8u] best 42309 combination zp ZP_BYTE:43 [ divr8u::dividend#2 divr8u::dividend#0 divr8u::dividend#1 ] +Uplifting [divr8u] best 42289 combination zp ZP_BYTE:43 [ divr8u::dividend#2 divr8u::dividend#0 divr8u::dividend#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ test_8s::i#10 test_8s::i#1 ] -Uplifting [test_8s] best 42309 combination zp ZP_BYTE:33 [ test_8s::i#10 test_8s::i#1 ] +Uplifting [test_8s] best 42289 combination zp ZP_BYTE:33 [ test_8s::i#10 test_8s::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ test_16s::i#10 test_16s::i#1 ] -Uplifting [test_16s] best 42309 combination zp ZP_BYTE:2 [ test_16s::i#10 test_16s::i#1 ] +Uplifting [test_16s] best 42289 combination zp ZP_BYTE:2 [ test_16s::i#10 test_16s::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:46 [ test_16u::i#10 test_16u::i#1 ] -Uplifting [test_16u] best 42309 combination zp ZP_BYTE:46 [ test_16u::i#10 test_16u::i#1 ] +Uplifting [test_16u] best 42289 combination zp ZP_BYTE:46 [ test_16u::i#10 test_16u::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:47 [ test_8u::i#10 test_8u::i#1 ] -Uplifting [test_8u] best 42309 combination zp ZP_BYTE:47 [ test_8u::i#10 test_8u::i#1 ] +Uplifting [test_8u] best 42289 combination zp ZP_BYTE:47 [ test_8u::i#10 test_8u::i#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:95 [ divr8u::divisor#0 ] -Uplifting [divr8u] best 42309 combination zp ZP_BYTE:95 [ divr8u::divisor#0 ] +Uplifting [divr8u] best 42289 combination zp ZP_BYTE:95 [ divr8u::divisor#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:35 [ div8s::dividendu#3 div8s::dividendu#7 div8s::dividendu#8 ] -Uplifting [div8s] best 42302 combination reg byte y [ div8s::dividendu#3 div8s::dividendu#7 div8s::dividendu#8 ] +Uplifting [div8s] best 42282 combination reg byte y [ div8s::dividendu#3 div8s::dividendu#7 div8s::dividendu#8 ] Attempting to uplift remaining variables inzp ZP_BYTE:87 [ div8s::dividend#0 ] -Uplifting [div8s] best 42267 combination reg byte y [ div8s::dividend#0 ] +Uplifting [div8s] best 42247 combination reg byte y [ div8s::dividend#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:85 [ test_8s::dividend#0 ] -Uplifting [test_8s] best 42267 combination zp ZP_BYTE:85 [ test_8s::dividend#0 ] +Uplifting [test_8s] best 42247 combination zp ZP_BYTE:85 [ test_8s::dividend#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:117 [ test_8u::dividend#0 ] -Uplifting [test_8u] best 42267 combination zp ZP_BYTE:117 [ test_8u::dividend#0 ] +Uplifting [test_8u] best 42247 combination zp ZP_BYTE:117 [ test_8u::dividend#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:37 [ div8s::neg#4 div8s::neg#2 div8s::neg#3 ] -Uplifting [div8s] best 42267 combination zp ZP_BYTE:37 [ div8s::neg#4 div8s::neg#2 div8s::neg#3 ] +Uplifting [div8s] best 42247 combination zp ZP_BYTE:37 [ div8s::neg#4 div8s::neg#2 div8s::neg#3 ] Attempting to uplift remaining variables inzp ZP_BYTE:96 [ divr8u::return#0 ] -Uplifting [divr8u] best 42261 combination reg byte a [ divr8u::return#0 ] +Uplifting [divr8u] best 42241 combination reg byte a [ divr8u::return#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:97 [ div8u::return#0 ] -Uplifting [div8u] best 42225 combination reg byte a [ div8u::return#0 ] +Uplifting [div8u] best 42205 combination reg byte a [ div8u::return#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:118 [ test_8u::divisor#0 ] -Uplifting [test_8u] best 42225 combination zp ZP_BYTE:118 [ test_8u::divisor#0 ] +Uplifting [test_8u] best 42205 combination zp ZP_BYTE:118 [ test_8u::divisor#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:86 [ test_8s::divisor#0 ] -Uplifting [test_8s] best 42225 combination zp ZP_BYTE:86 [ test_8s::divisor#0 ] +Uplifting [test_8s] best 42205 combination zp ZP_BYTE:86 [ test_8s::divisor#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:120 [ test_8u::res#0 ] -Uplifting [test_8u] best 42225 combination zp ZP_BYTE:120 [ test_8u::res#0 ] +Uplifting [test_8u] best 42205 combination zp ZP_BYTE:120 [ test_8u::res#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:90 [ test_8s::res#0 ] -Uplifting [test_8s] best 42225 combination zp ZP_BYTE:90 [ test_8s::res#0 ] +Uplifting [test_8s] best 42205 combination zp ZP_BYTE:90 [ test_8s::res#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:88 [ div8s::divisor#0 ] -Uplifting [div8s] best 42190 combination reg byte x [ div8s::divisor#0 ] +Uplifting [div8s] best 42170 combination reg byte x [ div8s::divisor#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:94 [ div8s::$5 ] -Uplifting [div8s] best 42186 combination reg byte a [ div8s::$5 ] +Uplifting [div8s] best 42166 combination reg byte a [ div8s::$5 ] Attempting to uplift remaining variables inzp ZP_BYTE:93 [ div8s::$8 ] -Uplifting [div8s] best 42182 combination reg byte x [ div8s::$8 ] +Uplifting [div8s] best 42162 combination reg byte x [ div8s::$8 ] Attempting to uplift remaining variables inzp ZP_BYTE:92 [ div8s::resultu#0 ] -Uplifting [div8s] best 42179 combination reg byte y [ div8s::resultu#0 ] +Uplifting [div8s] best 42159 combination reg byte y [ div8s::resultu#0 ] Coalescing zero page register with common assignment [ zp ZP_WORD:20 [ divr16s::return#2 divr16s::return#1 divr16s::return#7 ] ] with [ zp ZP_WORD:75 [ divr16s::resultu#0 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:22 [ rem16s#11 rem16s#2 rem16s#37 ] ] with [ zp ZP_WORD:83 [ rem16u#1 ] ] - score: 2 Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ print_sword::w#6 print_sword::w#5 print_sword::w#1 print_sword::w#2 print_sword::w#3 print_sword::w#4 print_sword::w#0 ] ] with [ zp ZP_WORD:7 [ print_word::w#5 print_word::w#7 print_word::w#1 print_word::w#2 print_word::w#3 print_word::w#4 ] ] - score: 1 @@ -7521,13 +7512,11 @@ print_sword: { b3: //SEG112 [54] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#5 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG113 [55] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -7785,23 +7774,19 @@ divr16s: { b8: //SEG206 [102] (signed word) rem16s#2 ← - (signed word)(word) rem16u#1 -- vwsz1=_neg_vwsz1 sec - lda rem16s - eor #$ff - adc #0 + lda #0 + sbc rem16s sta rem16s - lda rem16s+1 - eor #$ff - adc #0 + lda #0 + sbc rem16s+1 sta rem16s+1 //SEG207 [103] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0 -- vwsz1=_neg_vwsz1 sec - lda return - eor #$ff - adc #0 + lda #0 + sbc return sta return - lda return+1 - eor #$ff - adc #0 + lda #0 + sbc return+1 sta return+1 //SEG208 [104] phi from divr16s::@5 divr16s::@8 to divr16s::@return [phi:divr16s::@5/divr16s::@8->divr16s::@return] breturn_from_b5: @@ -7822,13 +7807,11 @@ divr16s: { b3: //SEG217 [108] (signed word~) divr16s::$13 ← - (signed word) divr16s::divisor#0 -- vwsz1=_neg_vwsz1 sec - lda _13 - eor #$ff - adc #0 + lda #0 + sbc _13 sta _13 - lda _13+1 - eor #$ff - adc #0 + lda #0 + sbc _13+1 sta _13+1 //SEG218 [109] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte) 1 -- vbuyy=vbuyy_bxor_vbuc1 tya @@ -7840,13 +7823,11 @@ divr16s: { b1: //SEG221 [111] (signed word~) divr16s::$8 ← - (signed word) divr16s::dividend#0 -- vwsz1=_neg_vwsz1 sec - lda _8 - eor #$ff - adc #0 + lda #0 + sbc _8 sta _8 - lda _8+1 - eor #$ff - adc #0 + lda #0 + sbc _8+1 sta _8+1 //SEG222 [112] (word~) divr16s::dividendu#7 ← (word)(signed word~) divr16s::$8 //SEG223 [92] phi from divr16s::@1 to divr16s::@2 [phi:divr16s::@1->divr16s::@2] @@ -8841,6 +8822,7 @@ print_cls: { //SEG601 [288] return rts } +//SEG602 File Data print_hextab: .text "0123456789abcdef" str: .text " / @" str1: .text " = @" @@ -9671,7 +9653,7 @@ zp ZP_BYTE:34 [ test_8u::res#0 ] FINAL ASSEMBLER -Score: 33176 +Score: 33156 //SEG0 File Comments // Test the binary division library @@ -9895,13 +9877,11 @@ print_sword: { //SEG111 print_sword::@3 //SEG112 [54] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#5 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG113 [55] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG114 [55] phi (byte*) print_char_cursor#130 = (byte*) print_char_cursor#131 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -10115,23 +10095,19 @@ divr16s: { //SEG205 divr16s::@8 //SEG206 [102] (signed word) rem16s#2 ← - (signed word)(word) rem16u#1 -- vwsz1=_neg_vwsz1 sec - lda rem16s - eor #$ff - adc #0 + lda #0 + sbc rem16s sta rem16s - lda rem16s+1 - eor #$ff - adc #0 + lda #0 + sbc rem16s+1 sta rem16s+1 //SEG207 [103] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0 -- vwsz1=_neg_vwsz1 sec - lda return - eor #$ff - adc #0 + lda #0 + sbc return sta return - lda return+1 - eor #$ff - adc #0 + lda #0 + sbc return+1 sta return+1 //SEG208 [104] phi from divr16s::@5 divr16s::@8 to divr16s::@return [phi:divr16s::@5/divr16s::@8->divr16s::@return] //SEG209 [104] phi (signed word) rem16s#11 = (signed word~) rem16s#37 [phi:divr16s::@5/divr16s::@8->divr16s::@return#0] -- register_copy @@ -10147,13 +10123,11 @@ divr16s: { b3: //SEG217 [108] (signed word~) divr16s::$13 ← - (signed word) divr16s::divisor#0 -- vwsz1=_neg_vwsz1 sec - lda _13 - eor #$ff - adc #0 + lda #0 + sbc _13 sta _13 - lda _13+1 - eor #$ff - adc #0 + lda #0 + sbc _13+1 sta _13+1 //SEG218 [109] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte) 1 -- vbuyy=vbuyy_bxor_vbuc1 tya @@ -10165,13 +10139,11 @@ divr16s: { b1: //SEG221 [111] (signed word~) divr16s::$8 ← - (signed word) divr16s::dividend#0 -- vwsz1=_neg_vwsz1 sec - lda _8 - eor #$ff - adc #0 + lda #0 + sbc _8 sta _8 - lda _8+1 - eor #$ff - adc #0 + lda #0 + sbc _8+1 sta _8+1 //SEG222 [112] (word~) divr16s::dividendu#7 ← (word)(signed word~) divr16s::$8 //SEG223 [92] phi from divr16s::@1 to divr16s::@2 [phi:divr16s::@1->divr16s::@2] @@ -10966,6 +10938,7 @@ print_cls: { //SEG601 [288] return rts } +//SEG602 File Data print_hextab: .text "0123456789abcdef" str: .text " / @" str1: .text " = @" diff --git a/src/test/ref/test-interrupt-notype.log b/src/test/ref/test-interrupt-notype.log index f3c67d4cc..49726f00f 100644 --- a/src/test/ref/test-interrupt-notype.log +++ b/src/test/ref/test-interrupt-notype.log @@ -185,6 +185,7 @@ irq: { //SEG18 [8] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG19 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -250,6 +251,7 @@ irq: { //SEG18 [8] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG19 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -329,4 +331,5 @@ irq: { //SEG18 [8] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG19 File Data diff --git a/src/test/ref/test-interrupt-volatile-write.log b/src/test/ref/test-interrupt-volatile-write.log index 7850605f2..686bb5eb6 100644 --- a/src/test/ref/test-interrupt-volatile-write.log +++ b/src/test/ref/test-interrupt-volatile-write.log @@ -348,6 +348,7 @@ irq: { inc col jmp breturn_from_b1 } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( ) always clobbers reg byte a @@ -467,6 +468,7 @@ irq: { inc col jmp breturn_from_b1 } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -613,4 +615,5 @@ irq: { inc col jmp $ea81 } +//SEG33 File Data diff --git a/src/test/ref/test-interrupt-volatile.log b/src/test/ref/test-interrupt-volatile.log index 51d44ce2e..7f3f4dd95 100644 --- a/src/test/ref/test-interrupt-volatile.log +++ b/src/test/ref/test-interrupt-volatile.log @@ -231,6 +231,7 @@ irq: { //SEG22 [9] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] (byte) col#0 ← (byte) 0 [ col#0 ] ( ) always clobbers reg byte a @@ -312,6 +313,7 @@ irq: { //SEG22 [9] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -407,4 +409,5 @@ irq: { //SEG22 [9] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data diff --git a/src/test/ref/test-interrupt.log b/src/test/ref/test-interrupt.log index f3c67d4cc..49726f00f 100644 --- a/src/test/ref/test-interrupt.log +++ b/src/test/ref/test-interrupt.log @@ -185,6 +185,7 @@ irq: { //SEG18 [8] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG19 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -250,6 +251,7 @@ irq: { //SEG18 [8] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG19 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -329,4 +331,5 @@ irq: { //SEG18 [8] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG19 File Data diff --git a/src/test/ref/test-kasm-pc.log b/src/test/ref/test-kasm-pc.log index 0077dacaf..b28c3e1d1 100644 --- a/src/test/ref/test-kasm-pc.log +++ b/src/test/ref/test-kasm-pc.log @@ -182,6 +182,7 @@ main: { //SEG18 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy jmp b1 } +//SEG19 File Data .pc = TABLE "TABLE" .byte 1, 2, 3 @@ -246,6 +247,7 @@ main: { //SEG18 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy jmp b1 } +//SEG19 File Data .pc = TABLE "TABLE" .byte 1, 2, 3 @@ -326,6 +328,7 @@ main: { //SEG18 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy jmp b2 } +//SEG19 File Data .pc = TABLE "TABLE" .byte 1, 2, 3 diff --git a/src/test/ref/test-kasm.log b/src/test/ref/test-kasm.log index bd73962cf..bf650f09e 100644 --- a/src/test/ref/test-kasm.log +++ b/src/test/ref/test-kasm.log @@ -119,6 +119,7 @@ main: { jmp b1 } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS @@ -164,6 +165,7 @@ main: { jmp b1 } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -219,4 +221,5 @@ main: { jmp b1 } +//SEG13 File Data diff --git a/src/test/ref/test-keyboard-space.log b/src/test/ref/test-keyboard-space.log index c4c7feb3b..85925c419 100644 --- a/src/test/ref/test-keyboard-space.log +++ b/src/test/ref/test-keyboard-space.log @@ -656,6 +656,7 @@ keyboard_init: { //SEG43 [25] return rts } +//SEG44 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -827,6 +828,7 @@ keyboard_init: { //SEG43 [25] return rts } +//SEG44 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -1043,6 +1045,7 @@ keyboard_init: { //SEG43 [25] return rts } +//SEG44 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) diff --git a/src/test/ref/test-keyboard.log b/src/test/ref/test-keyboard.log index 59b8dca8c..3b6f61e6e 100644 --- a/src/test/ref/test-keyboard.log +++ b/src/test/ref/test-keyboard.log @@ -1968,6 +1968,7 @@ keyboard_init: { //SEG121 [65] return rts } +//SEG122 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -2484,6 +2485,7 @@ keyboard_init: { //SEG121 [65] return rts } +//SEG122 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) @@ -3156,6 +3158,7 @@ keyboard_init: { //SEG121 [65] return rts } +//SEG122 File Data // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) keyboard_matrix_row_bitmask: .byte $fe, $fd, $fb, $f7, $ef, $df, $bf, $7f // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) diff --git a/src/test/ref/test-lohiconst.log b/src/test/ref/test-lohiconst.log index 8eb3081e7..cf20d68ab 100644 --- a/src/test/ref/test-lohiconst.log +++ b/src/test/ref/test-lohiconst.log @@ -197,6 +197,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← >>(const dword) PI_u4f28#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -255,6 +256,7 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -323,4 +325,5 @@ main: { //SEG15 [8] return rts } +//SEG16 File Data diff --git a/src/test/ref/test-lowhigh.log b/src/test/ref/test-lowhigh.log index df003b835..0ca99ed7a 100644 --- a/src/test/ref/test-lowhigh.log +++ b/src/test/ref/test-lowhigh.log @@ -1726,6 +1726,7 @@ print_cls: { //SEG184 [82] return rts } +//SEG185 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -2370,6 +2371,7 @@ print_cls: { //SEG184 [82] return rts } +//SEG185 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -3026,5 +3028,6 @@ print_cls: { //SEG184 [82] return rts } +//SEG185 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/test-multiply-16bit.asm b/src/test/ref/test-multiply-16bit.asm index b9edcc181..7a363d6ad 100644 --- a/src/test/ref/test-multiply-16bit.asm +++ b/src/test/ref/test-multiply-16bit.asm @@ -323,13 +323,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word diff --git a/src/test/ref/test-multiply-16bit.log b/src/test/ref/test-multiply-16bit.log index df6957db7..fc2ebabad 100644 --- a/src/test/ref/test-multiply-16bit.log +++ b/src/test/ref/test-multiply-16bit.log @@ -5897,13 +5897,11 @@ print_sword: { b3: //SEG285 [131] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#3 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG286 [132] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -7465,6 +7463,7 @@ print_cls: { //SEG677 [308] return rts } +//SEG678 File Data print_hextab: .text "0123456789abcdef" // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // print_sword::@1] b1_from_print_sword: @@ -10138,6 +10135,7 @@ print_cls: { //SEG677 [308] return rts } +//SEG678 File Data print_hextab: .text "0123456789abcdef" // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // print_sword::@1] //SEG287 [132] phi (byte*) print_char_cursor#130 = (byte*) print_char_cursor#128 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -12839,6 +12835,7 @@ print_cls: { //SEG677 [308] return rts } +//SEG678 File Data print_hextab: .text "0123456789abcdef" // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // print_sword::@1] b1_from_print_sword: @@ -7405,6 +7403,7 @@ print_cls: { //SEG716 [332] return rts } +//SEG717 File Data print_hextab: .text "0123456789abcdef" // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // print_sword::@1] b1_from_print_sword: @@ -9885,6 +9882,7 @@ print_cls: { //SEG716 [332] return rts } +//SEG717 File Data print_hextab: .text "0123456789abcdef" // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // print_sword::@1] //SEG197 [92] phi (byte*) print_char_cursor#134 = (byte*) print_char_cursor#132 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -12501,6 +12497,7 @@ print_cls: { //SEG716 [332] return rts } +//SEG717 File Data print_hextab: .text "0123456789abcdef" // mulf_sqr tables will contain f(x)=int(x*x/4) and g(x) = f(x-255). // print_sword::@1] b1_from_print_sword: @@ -1263,6 +1261,7 @@ print_cls: { //SEG124 [56] return rts } +//SEG125 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -1324,16 +1323,16 @@ Uplift Scope [print_char] 14: zp ZP_BYTE:10 [ print_char::ch#4 print_char::ch#1 Uplift Scope [print_ln] Uplift Scope [print_word] -Uplifting [] best 6477 combination zp ZP_WORD:5 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#1 ] zp ZP_WORD:11 [ print_char_cursor#34 print_char_cursor#48 print_char_cursor#45 print_char_cursor#46 print_char_cursor#50 print_char_cursor#64 print_char_cursor#12 ] -Uplifting [print_sword] best 6477 combination zp ZP_WORD:7 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 ] -Uplifting [main] best 6387 combination zp ZP_WORD:2 [ main::w1#2 main::w1#1 ] reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:15 [ main::w2#0 ] -Uplifting [print_cls] best 6387 combination zp ZP_WORD:13 [ print_cls::sc#2 print_cls::sc#1 ] -Uplifting [print_byte] best 6379 combination zp ZP_BYTE:9 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [print_char] best 6364 combination reg byte a [ print_char::ch#4 print_char::ch#1 print_char::ch#2 ] -Uplifting [print_ln] best 6364 combination -Uplifting [print_word] best 6364 combination +Uplifting [] best 6473 combination zp ZP_WORD:5 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#1 ] zp ZP_WORD:11 [ print_char_cursor#34 print_char_cursor#48 print_char_cursor#45 print_char_cursor#46 print_char_cursor#50 print_char_cursor#64 print_char_cursor#12 ] +Uplifting [print_sword] best 6473 combination zp ZP_WORD:7 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 ] +Uplifting [main] best 6383 combination zp ZP_WORD:2 [ main::w1#2 main::w1#1 ] reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:15 [ main::w2#0 ] +Uplifting [print_cls] best 6383 combination zp ZP_WORD:13 [ print_cls::sc#2 print_cls::sc#1 ] +Uplifting [print_byte] best 6375 combination zp ZP_BYTE:9 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [print_char] best 6360 combination reg byte a [ print_char::ch#4 print_char::ch#1 print_char::ch#2 ] +Uplifting [print_ln] best 6360 combination +Uplifting [print_word] best 6360 combination Attempting to uplift remaining variables inzp ZP_BYTE:9 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Uplifting [print_byte] best 6364 combination zp ZP_BYTE:9 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Uplifting [print_byte] best 6360 combination zp ZP_BYTE:9 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ print_line_cursor#9 print_line_cursor#19 print_line_cursor#1 ] Allocated (was zp ZP_WORD:7) zp ZP_WORD:6 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 ] Allocated (was zp ZP_BYTE:9) zp ZP_BYTE:8 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] @@ -1545,13 +1544,11 @@ print_sword: { b3: //SEG71 [30] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#3 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG72 [31] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -1698,6 +1695,7 @@ print_cls: { //SEG124 [56] return rts } +//SEG125 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -1868,7 +1866,7 @@ reg byte a [ print_byte::$2 ] FINAL ASSEMBLER -Score: 5509 +Score: 5505 //SEG0 File Comments // Tests subtracting bytes from signed words @@ -2033,13 +2031,11 @@ print_sword: { //SEG70 print_sword::@3 //SEG71 [30] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#3 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG72 [31] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG73 [31] phi (byte*) print_char_cursor#45 = (byte*) print_char_cursor#46 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -2161,5 +2157,6 @@ print_cls: { //SEG124 [56] return rts } +//SEG125 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/test-word-size-arrays.log b/src/test/ref/test-word-size-arrays.log index fd616b944..3469c244a 100644 --- a/src/test/ref/test-word-size-arrays.log +++ b/src/test/ref/test-word-size-arrays.log @@ -451,6 +451,7 @@ main: { //SEG42 [22] return rts } +//SEG43 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (word~) main::$0 ← (word) main::line#6 + (byte) main::c#2 [ main::line#6 main::c#2 main::$0 ] ( main:2 [ main::line#6 main::c#2 main::$0 ] ) always clobbers reg byte a @@ -663,6 +664,7 @@ main: { //SEG42 [22] return rts } +//SEG43 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -879,4 +881,5 @@ main: { //SEG42 [22] return rts } +//SEG43 File Data diff --git a/src/test/ref/textbox.log b/src/test/ref/textbox.log index 40ba862f4..df3e40112 100644 --- a/src/test/ref/textbox.log +++ b/src/test/ref/textbox.log @@ -2903,6 +2903,7 @@ draw_window: { bcc b6_from_b8 jmp breturn } +//SEG226 File Data text: .text "this is a small test with word wrap, if a word is too long it moves it to the next line. isn't that supercalifragilisticexpialidocious? i think it's cool!@" text2: .text "textbox by scan of desire@" @@ -4151,6 +4152,7 @@ draw_window: { bcc b6_from_b8 jmp breturn } +//SEG226 File Data text: .text "this is a small test with word wrap, if a word is too long it moves it to the next line. isn't that supercalifragilisticexpialidocious? i think it's cool!@" text2: .text "textbox by scan of desire@" @@ -5250,6 +5252,7 @@ draw_window: { bcc b3 rts } +//SEG226 File Data text: .text "this is a small test with word wrap, if a word is too long it moves it to the next line. isn't that supercalifragilisticexpialidocious? i think it's cool!@" text2: .text "textbox by scan of desire@" diff --git a/src/test/ref/tod018-problem.log b/src/test/ref/tod018-problem.log index f38024eb9..894db5188 100644 --- a/src/test/ref/tod018-problem.log +++ b/src/test/ref/tod018-problem.log @@ -153,6 +153,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::D018#0) ← (const byte) main::d018val#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -200,6 +201,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -262,4 +264,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/travis1.log b/src/test/ref/travis1.log index 48d9818c1..ebab54412 100644 --- a/src/test/ref/travis1.log +++ b/src/test/ref/travis1.log @@ -1022,6 +1022,7 @@ game_ready: { rts str: .text "ready@" } +//SEG90 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [10] (byte*~) print_char_cursor#41 ← (byte*) print_line_cursor#14 [ main::i#2 print_line_cursor#14 action_count#11 print_char_cursor#41 ] ( main:2 [ main::i#2 print_line_cursor#14 action_count#11 print_char_cursor#41 ] ) always clobbers reg byte a @@ -1332,6 +1333,7 @@ game_ready: { rts str: .text "ready@" } +//SEG90 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1680,4 +1682,5 @@ game_ready: { rts str: .text "ready@" } +//SEG90 File Data diff --git a/src/test/ref/true-inline-words.log b/src/test/ref/true-inline-words.log index cc0e3a506..53ed6234f 100644 --- a/src/test/ref/true-inline-words.log +++ b/src/test/ref/true-inline-words.log @@ -288,6 +288,7 @@ main: { jmp breturn bs: .byte 'c', 'm' } +//SEG18 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::sc#0) ← *((const byte[]) main::bs#0+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -361,6 +362,7 @@ main: { jmp breturn bs: .byte 'c', 'm' } +//SEG18 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -458,4 +460,5 @@ main: { rts bs: .byte 'c', 'm' } +//SEG18 File Data diff --git a/src/test/ref/type-inference.log b/src/test/ref/type-inference.log index 25e06e97f..6af71b727 100644 --- a/src/test/ref/type-inference.log +++ b/src/test/ref/type-inference.log @@ -212,6 +212,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] (byte~) main::$2 ← (byte) main::b#2 << (byte) 1 [ main::b#2 main::$0 main::$2 ] ( main:2 [ main::b#2 main::$0 main::$2 ] ) always clobbers reg byte a @@ -296,6 +297,7 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -391,4 +393,5 @@ main: { //SEG22 [11] return rts } +//SEG23 File Data diff --git a/src/test/ref/type-mix.log b/src/test/ref/type-mix.log index 99837d12c..431bc248a 100644 --- a/src/test/ref/type-mix.log +++ b/src/test/ref/type-mix.log @@ -234,6 +234,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (signed word) main::w#1 ← (signed word) main::w#2 - (signed byte) $c [ main::i#2 main::w#1 ] ( main:2 [ main::i#2 main::w#1 ] ) always clobbers reg byte a @@ -320,6 +321,7 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -425,4 +427,5 @@ main: { //SEG24 [11] return rts } +//SEG25 File Data diff --git a/src/test/ref/type-signed.asm b/src/test/ref/type-signed.asm index 11e3fb19b..bec447edb 100644 --- a/src/test/ref/type-signed.asm +++ b/src/test/ref/type-signed.asm @@ -141,13 +141,11 @@ print_sword: { lda #'-' jsr print_char sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 b1: jsr print_word diff --git a/src/test/ref/type-signed.log b/src/test/ref/type-signed.log index 2acfefd68..f4a37da84 100644 --- a/src/test/ref/type-signed.log +++ b/src/test/ref/type-signed.log @@ -1104,13 +1104,11 @@ print_sword: { b3: //SEG103 [46] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG104 [47] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -1137,6 +1135,7 @@ print_sword: { //SEG114 [50] return rts } +//SEG115 File Data print_hextab: .text "0123456789abcdef" REGISTER UPLIFT POTENTIAL REGISTERS @@ -1195,15 +1194,15 @@ Uplift Scope [print_char] 14: zp ZP_BYTE:12 [ print_char::ch#4 print_char::ch#1 Uplift Scope [print_sword] 12.25: zp ZP_WORD:15 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] Uplift Scope [print_ln] -Uplifting [] best 6231 combination zp ZP_WORD:7 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ] zp ZP_WORD:13 [ print_char_cursor#31 print_char_cursor#43 print_char_cursor#42 print_char_cursor#12 print_char_cursor#40 print_char_cursor#44 print_char_cursor#59 ] -Uplifting [main] best 6141 combination zp ZP_WORD:2 [ main::a#2 main::a#1 ] zp ZP_WORD:4 [ main::b#2 main::b#1 ] reg byte x [ main::i#2 main::i#1 ] -Uplifting [print_word] best 6141 combination zp ZP_WORD:9 [ print_word::w#2 print_word::w#1 print_word::w#5 ] -Uplifting [print_byte] best 6133 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -Uplifting [print_char] best 6118 combination reg byte a [ print_char::ch#4 print_char::ch#1 print_char::ch#2 ] -Uplifting [print_sword] best 6118 combination zp ZP_WORD:15 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] -Uplifting [print_ln] best 6118 combination +Uplifting [] best 6227 combination zp ZP_WORD:7 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ] zp ZP_WORD:13 [ print_char_cursor#31 print_char_cursor#43 print_char_cursor#42 print_char_cursor#12 print_char_cursor#40 print_char_cursor#44 print_char_cursor#59 ] +Uplifting [main] best 6137 combination zp ZP_WORD:2 [ main::a#2 main::a#1 ] zp ZP_WORD:4 [ main::b#2 main::b#1 ] reg byte x [ main::i#2 main::i#1 ] +Uplifting [print_word] best 6137 combination zp ZP_WORD:9 [ print_word::w#2 print_word::w#1 print_word::w#5 ] +Uplifting [print_byte] best 6129 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] +Uplifting [print_char] best 6114 combination reg byte a [ print_char::ch#4 print_char::ch#1 print_char::ch#2 ] +Uplifting [print_sword] best 6114 combination zp ZP_WORD:15 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] +Uplifting [print_ln] best 6114 combination Attempting to uplift remaining variables inzp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Uplifting [print_byte] best 6118 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Uplifting [print_byte] best 6114 combination zp ZP_BYTE:11 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] Coalescing zero page register with common assignment [ zp ZP_WORD:9 [ print_word::w#2 print_word::w#1 print_word::w#5 ] ] with [ zp ZP_WORD:15 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ] ] - score: 1 Allocated (was zp ZP_WORD:7) zp ZP_WORD:6 [ print_line_cursor#6 print_line_cursor#13 print_line_cursor#1 ] Allocated (was zp ZP_WORD:9) zp ZP_WORD:8 [ print_word::w#2 print_word::w#1 print_word::w#5 print_sword::w#3 print_sword::w#1 print_sword::w#0 ] @@ -1510,13 +1509,11 @@ print_sword: { b3: //SEG103 [46] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG104 [47] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] b1_from_print_sword: @@ -1539,6 +1536,7 @@ print_sword: { //SEG114 [50] return rts } +//SEG115 File Data print_hextab: .text "0123456789abcdef" ASSEMBLER OPTIMIZATIONS @@ -1694,7 +1692,7 @@ reg byte a [ print_byte::$2 ] FINAL ASSEMBLER -Score: 5341 +Score: 5337 //SEG0 File Comments // Tests the special "signed" / "unsigned" without a simple type name @@ -1943,13 +1941,11 @@ print_sword: { //SEG102 print_sword::@3 //SEG103 [46] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1 -- vwsz1=_neg_vwsz1 sec - lda w - eor #$ff - adc #0 + lda #0 + sbc w sta w - lda w+1 - eor #$ff - adc #0 + lda #0 + sbc w+1 sta w+1 //SEG104 [47] phi from print_sword print_sword::@3 to print_sword::@1 [phi:print_sword/print_sword::@3->print_sword::@1] //SEG105 [47] phi (byte*) print_char_cursor#40 = (byte*) print_char_cursor#44 [phi:print_sword/print_sword::@3->print_sword::@1#0] -- register_copy @@ -1966,5 +1962,6 @@ print_sword: { //SEG114 [50] return rts } +//SEG115 File Data print_hextab: .text "0123456789abcdef" diff --git a/src/test/ref/typedef-0.log b/src/test/ref/typedef-0.log index 5fb57c292..3d732a170 100644 --- a/src/test/ref/typedef-0.log +++ b/src/test/ref/typedef-0.log @@ -113,6 +113,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) main::b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -158,6 +159,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -216,4 +218,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/typedef-1.log b/src/test/ref/typedef-1.log index ab651cd2d..d28414313 100644 --- a/src/test/ref/typedef-1.log +++ b/src/test/ref/typedef-1.log @@ -168,6 +168,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((byte*)(const struct PointDef*) main::SCREEN#0) ← (const byte) main::p_x#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -221,6 +222,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -289,4 +291,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/typeid-plus-byte-problem.log b/src/test/ref/typeid-plus-byte-problem.log index 578b3d660..df0139d6d 100644 --- a/src/test/ref/typeid-plus-byte-problem.log +++ b/src/test/ref/typeid-plus-byte-problem.log @@ -143,6 +143,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (const byte) main::ubc1#0+(const byte) main::ubc2#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -190,6 +191,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -252,4 +254,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/typeid-plus-bytes.log b/src/test/ref/typeid-plus-bytes.log index a2a137b29..79ac1d37b 100644 --- a/src/test/ref/typeid-plus-bytes.log +++ b/src/test/ref/typeid-plus-bytes.log @@ -1450,6 +1450,7 @@ testUnsigned: { //SEG92 [74] return rts } +//SEG93 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [13] (signed byte) testSignedVals::sbv1#0 ← (signed byte) -$78 [ testSignedVals::sbv1#0 ] ( main:2::testSignedVals:11 [ testSignedVals::sbv1#0 ] ) always clobbers reg byte a @@ -1811,6 +1812,7 @@ testUnsigned: { //SEG92 [74] return rts } +//SEG93 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -2155,4 +2157,5 @@ testUnsigned: { //SEG92 [74] return rts } +//SEG93 File Data diff --git a/src/test/ref/typeid-simple.log b/src/test/ref/typeid-simple.log index fb9c1e6d7..4c21663ac 100644 --- a/src/test/ref/typeid-simple.log +++ b/src/test/ref/typeid-simple.log @@ -422,6 +422,7 @@ main: { //SEG28 [21] return rts } +//SEG29 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::SCREEN#0) ← (const byte) TYPEID_VOID [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -552,6 +553,7 @@ main: { //SEG28 [21] return rts } +//SEG29 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -695,4 +697,5 @@ main: { //SEG28 [21] return rts } +//SEG29 File Data diff --git a/src/test/ref/typeinference-problem.log b/src/test/ref/typeinference-problem.log index 8bb437c08..ddcb384d9 100644 --- a/src/test/ref/typeinference-problem.log +++ b/src/test/ref/typeinference-problem.log @@ -196,6 +196,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data table: .fill $100, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -271,6 +272,7 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data table: .fill $100, 0 ASSEMBLER OPTIMIZATIONS @@ -360,5 +362,6 @@ main: { //SEG21 [10] return rts } +//SEG22 File Data table: .fill $100, 0 diff --git a/src/test/ref/uninitialized.log b/src/test/ref/uninitialized.log index 0e99114cd..1fdc5d93b 100644 --- a/src/test/ref/uninitialized.log +++ b/src/test/ref/uninitialized.log @@ -211,6 +211,7 @@ main: { //SEG16 [9] return rts } +//SEG17 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (const byte) b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -273,6 +274,7 @@ main: { //SEG16 [9] return rts } +//SEG17 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -347,4 +349,5 @@ main: { //SEG16 [9] return rts } +//SEG17 File Data diff --git a/src/test/ref/unroll-loop-modifyvar.log b/src/test/ref/unroll-loop-modifyvar.log index 0c8166c45..d5b974967 100644 --- a/src/test/ref/unroll-loop-modifyvar.log +++ b/src/test/ref/unroll-loop-modifyvar.log @@ -503,6 +503,7 @@ main: { //SEG36 [17] return rts } +//SEG37 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) main::SCREEN#0+(byte) 3) ← (byte) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -630,6 +631,7 @@ main: { //SEG36 [17] return rts } +//SEG37 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -770,4 +772,5 @@ main: { //SEG36 [17] return rts } +//SEG37 File Data diff --git a/src/test/ref/unroll-screenfill-for-double.log b/src/test/ref/unroll-screenfill-for-double.log index 3bdb630ac..f50a89fcd 100644 --- a/src/test/ref/unroll-screenfill-for-double.log +++ b/src/test/ref/unroll-screenfill-for-double.log @@ -2092,6 +2092,7 @@ main: { //SEG254 [126] return rts } +//SEG255 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [5] *((const byte*) main::SCREEN#0) ← (byte) 0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -2982,6 +2983,7 @@ main: { //SEG254 [126] return rts } +//SEG255 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -3887,4 +3889,5 @@ main: { //SEG254 [126] return rts } +//SEG255 File Data diff --git a/src/test/ref/unroll-screenfill-for.log b/src/test/ref/unroll-screenfill-for.log index 56cca644c..505cd0348 100644 --- a/src/test/ref/unroll-screenfill-for.log +++ b/src/test/ref/unroll-screenfill-for.log @@ -1080,6 +1080,7 @@ main: { //SEG70 [33] return rts } +//SEG71 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::x#4 main::x#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -1293,6 +1294,7 @@ main: { //SEG70 [33] return rts } +//SEG71 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1552,4 +1554,5 @@ main: { //SEG70 [33] return rts } +//SEG71 File Data diff --git a/src/test/ref/unroll-screenfill-while.log b/src/test/ref/unroll-screenfill-while.log index 19a92b901..38abae6b7 100644 --- a/src/test/ref/unroll-screenfill-while.log +++ b/src/test/ref/unroll-screenfill-while.log @@ -1115,6 +1115,7 @@ main: { //SEG70 [33] return rts } +//SEG71 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::x#5 main::x#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -1328,6 +1329,7 @@ main: { //SEG70 [33] return rts } +//SEG71 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -1587,4 +1589,5 @@ main: { //SEG70 [33] return rts } +//SEG71 File Data diff --git a/src/test/ref/unused-irq.log b/src/test/ref/unused-irq.log index 70f9284a1..38a7c4828 100644 --- a/src/test/ref/unused-irq.log +++ b/src/test/ref/unused-irq.log @@ -195,6 +195,7 @@ irq1: { //SEG22 [9] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) 'x' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -277,6 +278,7 @@ irq1: { //SEG22 [9] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -370,4 +372,5 @@ irq1: { //SEG22 [9] return - exit interrupt(KERNEL_MIN) jmp $ea81 } +//SEG23 File Data diff --git a/src/test/ref/unused-method.log b/src/test/ref/unused-method.log index 40dc6526b..95fb8a267 100644 --- a/src/test/ref/unused-method.log +++ b/src/test/ref/unused-method.log @@ -119,6 +119,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -163,6 +164,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -218,4 +220,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/unused-vars.log b/src/test/ref/unused-vars.log index e12a982ec..9249a66c2 100644 --- a/src/test/ref/unused-vars.log +++ b/src/test/ref/unused-vars.log @@ -333,6 +333,7 @@ s: { //SEG26 [13] return rts } +//SEG27 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [7] *((const byte*) main::COLS#0 + (byte) main::i#2) ← (const byte) main::col#0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a @@ -421,6 +422,7 @@ s: { //SEG26 [13] return rts } +//SEG27 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -528,4 +530,5 @@ s: { //SEG26 [13] return rts } +//SEG27 File Data diff --git a/src/test/ref/unusedblockproblem.log b/src/test/ref/unusedblockproblem.log index b20f242cf..48fdf2d51 100644 --- a/src/test/ref/unusedblockproblem.log +++ b/src/test/ref/unusedblockproblem.log @@ -157,6 +157,7 @@ main: { inc SCREEN jmp b1 } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS @@ -201,6 +202,7 @@ main: { inc SCREEN jmp b1 } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -258,4 +260,5 @@ main: { inc SCREEN jmp b1 } +//SEG13 File Data diff --git a/src/test/ref/useglobal.log b/src/test/ref/useglobal.log index 34619bc0a..147eb54f8 100644 --- a/src/test/ref/useglobal.log +++ b/src/test/ref/useglobal.log @@ -113,6 +113,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) SCREEN#0) ← (byte) 1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -158,6 +159,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -214,4 +216,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/useuninitialized.log b/src/test/ref/useuninitialized.log index 161514e09..5f6a3837f 100644 --- a/src/test/ref/useuninitialized.log +++ b/src/test/ref/useuninitialized.log @@ -193,6 +193,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) main::screen#0) ← (const byte) b#1 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -244,6 +245,7 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -309,4 +311,5 @@ main: { //SEG13 [6] return rts } +//SEG14 File Data diff --git a/src/test/ref/var-forward-problem.log b/src/test/ref/var-forward-problem.log index 7f9b158a1..1ae8947f1 100644 --- a/src/test/ref/var-forward-problem.log +++ b/src/test/ref/var-forward-problem.log @@ -114,6 +114,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) screen#0) ← (const byte) b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -160,6 +161,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -219,4 +221,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/var-forward-problem2.log b/src/test/ref/var-forward-problem2.log index afbbdbd87..71c3757c9 100644 --- a/src/test/ref/var-forward-problem2.log +++ b/src/test/ref/var-forward-problem2.log @@ -149,6 +149,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) screen#0) ← (const byte) b#0 [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -195,6 +196,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -254,4 +256,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/var-init-problem.log b/src/test/ref/var-init-problem.log index e7dadda51..ef14b8647 100644 --- a/src/test/ref/var-init-problem.log +++ b/src/test/ref/var-init-problem.log @@ -127,6 +127,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] *((const byte*) screen#1) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a @@ -172,6 +173,7 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -228,4 +230,5 @@ main: { //SEG12 [5] return rts } +//SEG13 File Data diff --git a/src/test/ref/var-register.log b/src/test/ref/var-register.log index 5008412c2..891d5396b 100644 --- a/src/test/ref/var-register.log +++ b/src/test/ref/var-register.log @@ -407,6 +407,7 @@ print: { //SEG44 [20] return rts } +//SEG45 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [8] (byte) main::val1#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ) always clobbers reg byte a @@ -545,6 +546,7 @@ print: { //SEG44 [20] return rts } +//SEG45 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -711,4 +713,5 @@ print: { //SEG44 [20] return rts } +//SEG45 File Data diff --git a/src/test/ref/voronoi.log b/src/test/ref/voronoi.log index 56d27b346..3cc824d7d 100644 --- a/src/test/ref/voronoi.log +++ b/src/test/ref/voronoi.log @@ -1810,6 +1810,7 @@ initscreen: { //SEG150 [81] return rts } +//SEG151 File Data // Points to create the Voronoi from XPOS: .byte 5, $f, 6, $22, $15, $1f YPOS: .byte 5, 8, $e, 2, $11, $16 @@ -2393,6 +2394,7 @@ initscreen: { //SEG150 [81] return rts } +//SEG151 File Data // Points to create the Voronoi from XPOS: .byte 5, $f, 6, $22, $15, $1f YPOS: .byte 5, 8, $e, 2, $11, $16 @@ -3002,6 +3004,7 @@ initscreen: { //SEG150 [81] return rts } +//SEG151 File Data // Points to create the Voronoi from XPOS: .byte 5, $f, 6, $22, $15, $1f YPOS: .byte 5, 8, $e, 2, $11, $16 diff --git a/src/test/ref/wfragment1.log b/src/test/ref/wfragment1.log index 0fd2ff916..b2285933a 100644 --- a/src/test/ref/wfragment1.log +++ b/src/test/ref/wfragment1.log @@ -312,6 +312,7 @@ move_enemy: { //SEG27 [13] return rts } +//SEG28 File Data OBJ_WORLD_X: .fill 2*MAX_OBJECTS, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -407,6 +408,7 @@ move_enemy: { //SEG27 [13] return rts } +//SEG28 File Data OBJ_WORLD_X: .fill 2*MAX_OBJECTS, 0 ASSEMBLER OPTIMIZATIONS @@ -522,5 +524,6 @@ move_enemy: { //SEG27 [13] return rts } +//SEG28 File Data OBJ_WORLD_X: .fill 2*MAX_OBJECTS, 0 diff --git a/src/test/ref/word-array-0.log b/src/test/ref/word-array-0.log index e9efb5252..2936fb28a 100644 --- a/src/test/ref/word-array-0.log +++ b/src/test/ref/word-array-0.log @@ -252,6 +252,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (word) main::w1#0 ← *((const word[3]) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) [ main::w1#0 ] ( main:2 [ main::w1#0 ] ) always clobbers reg byte a @@ -337,6 +338,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -437,4 +439,5 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data diff --git a/src/test/ref/word-array-1.log b/src/test/ref/word-array-1.log index 49711d336..c7ba0fe02 100644 --- a/src/test/ref/word-array-1.log +++ b/src/test/ref/word-array-1.log @@ -309,6 +309,7 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3031, $3233, $3435, $3637 } +//SEG31 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$3 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::idx#4 main::$3 ] ( main:2 [ main::i#2 main::idx#4 main::$3 ] ) always clobbers reg byte a @@ -432,6 +433,7 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3031, $3233, $3435, $3637 } +//SEG31 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -567,4 +569,5 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3031, $3233, $3435, $3637 } +//SEG31 File Data diff --git a/src/test/ref/word-array-2.log b/src/test/ref/word-array-2.log index ebd9ddafe..65f5a1568 100644 --- a/src/test/ref/word-array-2.log +++ b/src/test/ref/word-array-2.log @@ -345,6 +345,7 @@ main: { //SEG28 [16] return rts } +//SEG29 File Data words: .fill 2*$100, 0 REGISTER UPLIFT POTENTIAL REGISTERS @@ -497,6 +498,7 @@ main: { //SEG28 [16] return rts } +//SEG29 File Data words: .fill 2*$100, 0 ASSEMBLER OPTIMIZATIONS @@ -649,5 +651,6 @@ main: { //SEG28 [16] return rts } +//SEG29 File Data words: .fill 2*$100, 0 diff --git a/src/test/ref/word-pointer-compound.log b/src/test/ref/word-pointer-compound.log index fbbae4dd3..05892ece2 100644 --- a/src/test/ref/word-pointer-compound.log +++ b/src/test/ref/word-pointer-compound.log @@ -419,6 +419,7 @@ main: { rts words: .word $3031, $3233, $3435 } +//SEG35 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$7 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a @@ -541,6 +542,7 @@ main: { rts words: .word $3031, $3233, $3435 } +//SEG35 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -678,4 +680,5 @@ main: { rts words: .word $3031, $3233, $3435 } +//SEG35 File Data diff --git a/src/test/ref/word-pointer-iteration-0.log b/src/test/ref/word-pointer-iteration-0.log index f8181a526..f0b6ca9fb 100644 --- a/src/test/ref/word-pointer-iteration-0.log +++ b/src/test/ref/word-pointer-iteration-0.log @@ -266,6 +266,7 @@ main: { //SEG23 [16] return rts } +//SEG24 File Data REGISTER UPLIFT POTENTIAL REGISTERS Potential registers zp ZP_BYTE:2 [ main::$0 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , @@ -343,6 +344,7 @@ main: { //SEG23 [16] return rts } +//SEG24 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -435,4 +437,5 @@ main: { //SEG23 [16] return rts } +//SEG24 File Data diff --git a/src/test/ref/word-pointer-iteration.log b/src/test/ref/word-pointer-iteration.log index 51a733b1d..5540517f0 100644 --- a/src/test/ref/word-pointer-iteration.log +++ b/src/test/ref/word-pointer-iteration.log @@ -328,6 +328,7 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3130, $3332, $3534, $3736 } +//SEG33 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (word) main::w#0 ← *((word*) main::wp#2) [ main::wp#2 main::idx#4 main::i#2 main::w#0 ] ( main:2 [ main::wp#2 main::idx#4 main::i#2 main::w#0 ] ) always clobbers reg byte a reg byte y @@ -464,6 +465,7 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3130, $3332, $3534, $3736 } +//SEG33 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -616,4 +618,5 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3130, $3332, $3534, $3736 } +//SEG33 File Data diff --git a/src/test/ref/word-pointer-math-0.log b/src/test/ref/word-pointer-math-0.log index 0d4ec68d2..a30ff66f0 100644 --- a/src/test/ref/word-pointer-math-0.log +++ b/src/test/ref/word-pointer-math-0.log @@ -263,6 +263,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [4] (word) main::w1#0 ← *((const word*) main::words#0+(byte) 1*(const byte) SIZEOF_WORD) [ main::w1#0 ] ( main:2 [ main::w1#0 ] ) always clobbers reg byte a @@ -348,6 +349,7 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -448,4 +450,5 @@ main: { //SEG21 [14] return rts } +//SEG22 File Data diff --git a/src/test/ref/word-pointer-math.log b/src/test/ref/word-pointer-math.log index 563952424..a143ca5c9 100644 --- a/src/test/ref/word-pointer-math.log +++ b/src/test/ref/word-pointer-math.log @@ -315,6 +315,7 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3130, $3332, $3534, $3736 } +//SEG31 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::idx#4 main::$4 ] ( main:2 [ main::i#2 main::idx#4 main::$4 ] ) always clobbers reg byte a @@ -438,6 +439,7 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3130, $3332, $3534, $3736 } +//SEG31 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -573,4 +575,5 @@ main: { // Clever word array that represents C64 numbers 0-7 words: .word $3130, $3332, $3534, $3736 } +//SEG31 File Data diff --git a/src/test/ref/wordexpr.log b/src/test/ref/wordexpr.log index 41c145044..277b26248 100644 --- a/src/test/ref/wordexpr.log +++ b/src/test/ref/wordexpr.log @@ -205,6 +205,7 @@ main: { //SEG22 [9] return rts } +//SEG23 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [6] (word) main::b#1 ← (word) main::b#2 + (word)(number) $28*(number) 8 [ main::i#2 main::b#1 ] ( main:2 [ main::i#2 main::b#1 ] ) always clobbers reg byte a @@ -283,6 +284,7 @@ main: { //SEG22 [9] return rts } +//SEG23 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -379,4 +381,5 @@ main: { //SEG22 [9] return rts } +//SEG23 File Data diff --git a/src/test/ref/zpparammin.log b/src/test/ref/zpparammin.log index 1e8fdff56..632689641 100644 --- a/src/test/ref/zpparammin.log +++ b/src/test/ref/zpparammin.log @@ -529,6 +529,7 @@ sum: { //SEG45 [28] return rts } +//SEG46 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [23] (byte~) sum2::$0 ← (byte) sum2::a#0 + (byte) sum2::b#0 [ sum2::c#0 sum2::$0 ] ( main:2::sum2:16 [ main::i#2 sum2::c#0 sum2::$0 ] ) always clobbers reg byte a @@ -707,6 +708,7 @@ sum: { //SEG45 [28] return rts } +//SEG46 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -908,4 +910,5 @@ sum: { //SEG45 [28] return rts } +//SEG46 File Data diff --git a/src/test/ref/zpptr.log b/src/test/ref/zpptr.log index f8b75bbf3..12c36ec1a 100644 --- a/src/test/ref/zpptr.log +++ b/src/test/ref/zpptr.log @@ -383,6 +383,7 @@ main: { //SEG39 [18] return rts } +//SEG40 File Data REGISTER UPLIFT POTENTIAL REGISTERS Statement [8] (byte*) main::zpptr2#0 ← (const byte*) main::zpptr#0 + (byte) main::i#4 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 ] ( main:2 [ main::j#6 main::i#4 main::k#2 main::zpptr2#0 ] ) always clobbers reg byte a @@ -539,6 +540,7 @@ main: { //SEG39 [18] return rts } +//SEG40 File Data ASSEMBLER OPTIMIZATIONS Removing instruction jmp b1 @@ -709,4 +711,5 @@ main: { //SEG39 [18] return rts } +//SEG40 File Data