diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java b/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java index 8651be457..c81c6eaae 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4CodeGeneration.java @@ -424,7 +424,44 @@ public class Pass4CodeGeneration { } /** - * Add data directives for constants declarations + * Add label declarations for all scope variables assigned to memory registers (before the scope code) + * + * @param asm The ASM program + * @param scope The scope + */ + private void addMemLabels(AsmProgram asm, ScopeRef scope) { + Collection scopeVars = program.getScope().getScope(scope).getAllVariables(false); + Set added = new LinkedHashSet<>(); + for(Variable scopeVar : scopeVars) { + Registers.Register register = scopeVar.getAllocation(); + if(register != null) { + if(register.isZp()) { + Registers.RegisterZpMem registerZp = (Registers.RegisterZpMem) register; + String asmName = scopeVar.getAsmName(); + if(asmName != null && !added.contains(asmName)) { + // Add any comments + generateComments(asm, scopeVar.getComments()); + // Add the label declaration + asm.addLabelDecl(AsmFormat.asmFix(asmName), AsmFormat.getAsmNumber(registerZp.getZp())); + added.add(asmName); + } + } else if(register instanceof Registers.RegisterMainMem && scopeVar.getDeclaredMemoryAddress() != null) { + String asmName = scopeVar.getAsmName(); + if(asmName != null && !added.contains(asmName)) { + // Add any comments + generateComments(asm, scopeVar.getComments()); + // Add the label declaration + asm.addLabelDecl(AsmFormat.asmFix(asmName), AsmFormat.getAsmNumber(scopeVar.getDeclaredMemoryAddress())); + added.add(asmName); + } + } + } + } + } + + + /** + * Add data for a scope (after the code) * * @param asm The ASM program * @param scopeRef The scope @@ -470,7 +507,7 @@ public class Pass4CodeGeneration { if(variable.isStoragePhiMaster()) continue; // Skip if already added - String asmName = variable.getAsmName() == null ? variable.getLocalName() : variable.getAsmName(); + String asmName = variable.getAsmName(); if(added.contains(asmName)) { continue; } @@ -486,7 +523,6 @@ public class Pass4CodeGeneration { if(!registerMainMem.getVariableRef().equals(variable.getRef())) { continue; } - // Generate into the data segment // Set segment setCurrentSegment(variable.getDataSegment(), asm); @@ -677,54 +713,6 @@ public class Pass4CodeGeneration { } } - /** - * Add label declarations for all scope variables assigned to memory registers - * - * @param asm The ASM program - * @param scope The scope - */ - private void addMemLabels(AsmProgram asm, ScopeRef scope) { - Collection scopeVars = program.getScope().getScope(scope).getAllVariables(false); - Set added = new LinkedHashSet<>(); - for(Variable scopeVar : scopeVars) { - Registers.Register register = scopeVar.getAllocation(); - if(register != null) - if(register.isZp()) { - Registers.RegisterZpMem registerZp = (Registers.RegisterZpMem) register; - String asmName = scopeVar.getAsmName(); - if(asmName != null && !added.contains(asmName)) { - // Add any comments - generateComments(asm, scopeVar.getComments()); - // Add the label declaration - asm.addLabelDecl(AsmFormat.asmFix(asmName), AsmFormat.getAsmNumber(registerZp.getZp())); - added.add(asmName); - } - } else if(register instanceof Registers.RegisterMainMem && scopeVar.getDeclaredMemoryAddress() != null) { - String asmName = scopeVar.getAsmName(); - if(asmName != null && !added.contains(asmName)) { - // Add any comments - generateComments(asm, scopeVar.getComments()); - // Add the label declaration - asm.addLabelDecl(AsmFormat.asmFix(asmName), AsmFormat.getAsmNumber(scopeVar.getDeclaredMemoryAddress())); - added.add(asmName); - } - } else if(register instanceof Registers.RegisterMainMem && !((Registers.RegisterMainMem) register).getVariableRef().equals(scopeVar.getRef())) { - // Memory variable is not main var in the equivalence class - add a reference - String asmName = scopeVar.getAsmName(); - Registers.RegisterMainMem memAllocation = (Registers.RegisterMainMem) register; - VariableRef memAllocationVarRef = memAllocation.getVariableRef(); - Variable memAllocationVar = getScope().getVariable(memAllocationVarRef); - // Add the label declaration - String asmNameMemAllocVar = AsmFormat.getAsmParamName(memAllocationVar, scope); - if(!asmName.equals(asmNameMemAllocVar)) { - // Add any comments - generateComments(asm, scopeVar.getComments()); - asm.addLabelDecl(AsmFormat.asmFix(asmName), asmNameMemAllocVar); - added.add(asmName); - } - } - } - } private void genStatements(AsmProgram asm, ControlFlowBlock block) { Iterator statementsIt = block.getStatements().iterator(); diff --git a/src/test/ref/bitmap-plot-1.asm b/src/test/ref/bitmap-plot-1.asm index f32cf826d..1d83e62ef 100644 --- a/src/test/ref/bitmap-plot-1.asm +++ b/src/test/ref/bitmap-plot-1.asm @@ -43,8 +43,8 @@ .const PI_HALF_u4f28 = $1921fb54 .label BITMAP = $2000 .label SCREEN = $400 - .label rem16u = $10 - .label frame_cnt = $16 + .label rem16u = $c + .label frame_cnt = $12 __b1: // Counts frames - updated by the IRQ lda #1 @@ -53,18 +53,18 @@ __b1: rts main: { .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f - .label __9 = $c - .label __14 = $c + .label __9 = 8 + .label __14 = 8 .label __25 = $24 .label __26 = $24 .label cos_x = $24 - .label xpos = $c - .label x = $20 + .label xpos = 8 + .label x = $1c .label sin_y = $24 - .label ypos = $c - .label y = $17 + .label ypos = 8 + .label y = $13 .label idx_x = 2 - .label idx_y = $12 + .label idx_y = $e .label __27 = $24 .label __28 = $24 jsr sin16s_gen2 @@ -217,11 +217,11 @@ main: { jmp __b2 } // Plot a single dot in the bitmap -// bitmap_plot(word zeropage($20) x, byte register(X) y) +// bitmap_plot(word zeropage($1c) x, byte register(X) y) bitmap_plot: { - .label __1 = $19 - .label plotter = $17 - .label x = $20 + .label __1 = $15 + .label plotter = $13 + .label x = $1c lda bitmap_plot_yhi,x sta.z plotter+1 lda bitmap_plot_ylo,x @@ -249,15 +249,15 @@ bitmap_plot: { } // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage($17) a, signed word zeropage($24) b) +// mul16s(signed word zeropage($13) a, signed word zeropage($24) b) mul16s: { - .label __9 = $19 + .label __9 = $15 .label __13 = $22 - .label __16 = $19 - .label __17 = $17 - .label m = $c - .label return = $c - .label a = $17 + .label __16 = $15 + .label __17 = $13 + .label m = 8 + .label return = 8 + .label a = $13 .label b = $24 lda.z a sta.z mul16u.a @@ -314,13 +314,13 @@ mul16s: { rts } // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($10) a, word zeropage($19) b) +// mul16u(word zeropage($c) a, word zeropage($15) b) mul16u: { - .label mb = 4 - .label a = $10 - .label res = $c - .label b = $19 - .label return = $c + .label mb = $1e + .label a = $c + .label res = 8 + .label b = $15 + .label return = 8 .label b_1 = 2 lda #0 sta.z res @@ -416,12 +416,12 @@ bitmap_clear: { 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($17) str, byte register(X) c, word zeropage($12) num) +// memset(void* zeropage($13) str, byte register(X) c, word zeropage($e) num) memset: { - .label end = $12 - .label dst = $17 - .label num = $12 - .label str = $17 + .label end = $e + .label dst = $13 + .label num = $e + .label str = $13 lda.z num bne !+ lda.z num+1 @@ -455,7 +455,7 @@ memset: { } // Initialize bitmap plotting tables bitmap_init: { - .label __7 = $1b + .label __7 = $17 .label yoffs = $24 ldx #0 lda #$80 @@ -501,18 +501,18 @@ bitmap_init: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($14) sintab) +// sin16s_gen2(signed word* zeropage($10) sintab) sin16s_gen2: { .label wavelength = $200 .const min = -$1001 .const max = $1001 .const ampl = max-min - .label __6 = $c - .label __9 = $20 - .label step = $1c - .label sintab = $14 - .label x = 8 - .label i = $12 + .label __6 = 8 + .label __9 = $1c + .label step = $18 + .label sintab = $10 + .label x = 4 + .label i = $e jsr div32u16u lda #PI_u4f28>>$10 bcc b1 @@ -634,12 +633,10 @@ sin16s: { lda.z x+3 sbc #>PI_u4f28>>$10 sta.z x+3 - lda #1 - sta.z isUpper + ldy #1 jmp __b1 b1: - lda #0 - sta.z isUpper + ldy #0 __b1: lda.z x+3 cmp #>PI_HALF_u4f28>>$10 @@ -671,14 +668,26 @@ sin16s: { sbc.z x+3 sta.z x+3 __b2: - ldy #3 - !: + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- lda.z __4+2 sta.z x1 lda.z __4+3 @@ -751,8 +760,7 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - lda.z isUpper - cmp #0 + cpy #0 beq __b3 sec lda #0 @@ -766,14 +774,14 @@ sin16s: { } // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($19) v1, word zeropage(2) v2, byte register(X) select) +// mulu16_sel(word zeropage($15) v1, word zeropage(2) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $19 + .label __0 = 8 + .label __1 = 8 + .label v1 = $15 .label v2 = 2 .label return = $24 - .label return_1 = $19 + .label return_1 = $15 lda.z v1 sta.z mul16u.a lda.z v1+1 @@ -806,8 +814,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $24 - .label quotient_lo = $14 - .label return = $1c + .label quotient_lo = $10 + .label return = $18 lda #>$10 sta.z divr16u.dividend lda #>PI2_u4f28>>$10 @@ -839,12 +847,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($12) dividend, word zeropage($10) rem) +// divr16u(word zeropage($e) dividend, word zeropage($c) rem) divr16u: { - .label rem = $10 - .label dividend = $12 - .label quotient = $14 - .label return = $14 + .label rem = $c + .label dividend = $e + .label quotient = $10 + .label return = $10 ldx #0 txa sta.z quotient diff --git a/src/test/ref/bitmap-plot-1.log b/src/test/ref/bitmap-plot-1.log index 4abfb0a6b..47dcc2ae4 100644 --- a/src/test/ref/bitmap-plot-1.log +++ b/src/test/ref/bitmap-plot-1.log @@ -5323,21 +5323,25 @@ sin16s: { __b2: // [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 lda.z x + asl sta.z __4 lda.z x+1 + rol sta.z __4+1 lda.z x+2 + rol sta.z __4+2 lda.z x+3 + rol sta.z __4+3 - ldy #3 - !: asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 // [154] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -5998,8 +6002,7 @@ Statement [147] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [148] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [150] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [151] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:48 [ sin16s::isUpper#2 ] +Statement [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [154] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [155] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [156] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -6123,7 +6126,7 @@ Statement [147] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [148] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [150] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [151] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y +Statement [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [154] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [155] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [156] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:3::sin16s_gen2:6::sin16s:136 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -6192,7 +6195,7 @@ Potential registers zp[2]:38 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_ Potential registers zp[2]:40 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] : zp[2]:40 , Potential registers zp[4]:42 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] : zp[4]:42 , Potential registers zp[2]:46 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] : zp[2]:46 , -Potential registers zp[1]:48 [ sin16s::isUpper#2 ] : zp[1]:48 , reg byte x , +Potential registers zp[1]:48 [ sin16s::isUpper#2 ] : zp[1]:48 , reg byte x , reg byte y , Potential registers zp[4]:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] : zp[4]:49 , Potential registers zp[2]:53 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] : zp[2]:53 , Potential registers zp[2]:55 [ 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[2]:55 , @@ -6288,32 +6291,30 @@ Uplift Scope [bitmap_clear] Uplift Scope [init_irq] Uplift Scope [irq] -Uplifting [mul16u] best 27199 combination zp[4]:20 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:24 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:18 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:14 [ mul16u::b#0 ] zp[2]:16 [ mul16u::b#1 ] zp[4]:122 [ mul16u::return#2 ] zp[4]:197 [ mul16u::return#3 ] -Uplifting [main] best 26959 combination zp[2]:4 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] zp[2]:68 [ main::$25 ] zp[2]:70 [ main::$27 ] zp[2]:72 [ main::cos_x#0 ] zp[4]:78 [ main::xpos#0 ] zp[4]:82 [ main::$9 ] reg byte alu [ main::$10 ] zp[2]:90 [ main::$26 ] zp[2]:92 [ main::$28 ] zp[2]:94 [ main::sin_y#0 ] zp[4]:100 [ main::ypos#0 ] zp[4]:104 [ main::$14 ] reg byte alu [ main::$15 ] zp[2]:2 [ main::idx_x#3 main::idx_x#10 main::idx_x#1 ] zp[2]:110 [ main::y#0 ] zp[2]:88 [ main::x#0 ] -Uplifting [divr16u] best 26749 combination zp[2]:60 [ 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[2]:64 [ 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[2]:62 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:211 [ divr16u::return#2 ] zp[2]:215 [ divr16u::return#3 ] -Uplifting [bitmap_init] best 26239 combination zp[2]:38 [ 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[1]:143 [ bitmap_init::$5 ] zp[1]:144 [ bitmap_init::$6 ] zp[1]:141 [ bitmap_init::$7 ] +Uplifting [mul16u] best 27221 combination zp[4]:20 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:24 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:18 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:14 [ mul16u::b#0 ] zp[2]:16 [ mul16u::b#1 ] zp[4]:122 [ mul16u::return#2 ] zp[4]:197 [ mul16u::return#3 ] +Uplifting [main] best 26981 combination zp[2]:4 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] zp[2]:68 [ main::$25 ] zp[2]:70 [ main::$27 ] zp[2]:72 [ main::cos_x#0 ] zp[4]:78 [ main::xpos#0 ] zp[4]:82 [ main::$9 ] reg byte alu [ main::$10 ] zp[2]:90 [ main::$26 ] zp[2]:92 [ main::$28 ] zp[2]:94 [ main::sin_y#0 ] zp[4]:100 [ main::ypos#0 ] zp[4]:104 [ main::$14 ] reg byte alu [ main::$15 ] zp[2]:2 [ main::idx_x#3 main::idx_x#10 main::idx_x#1 ] zp[2]:110 [ main::y#0 ] zp[2]:88 [ main::x#0 ] +Uplifting [divr16u] best 26771 combination zp[2]:60 [ 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[2]:64 [ 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[2]:62 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:211 [ divr16u::return#2 ] zp[2]:215 [ divr16u::return#3 ] +Uplifting [bitmap_init] best 26261 combination zp[2]:38 [ 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[1]:143 [ bitmap_init::$5 ] zp[1]:144 [ bitmap_init::$6 ] zp[1]:141 [ bitmap_init::$7 ] Limited combination testing to 100 combinations of 15360 possible. -Uplifting [mul16s] best 26239 combination zp[2]:8 [ mul16s::b#3 mul16s::b#2 mul16s::b#1 ] zp[2]:6 [ mul16s::a#3 mul16s::a#0 ] zp[4]:74 [ mul16s::return#3 ] zp[4]:96 [ mul16s::return#4 ] zp[4]:155 [ mul16s::return#2 ] zp[4]:10 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 ] zp[4]:134 [ mul16s::return#0 ] zp[2]:126 [ mul16s::$9 ] zp[2]:128 [ mul16s::$16 ] zp[2]:130 [ mul16s::$13 ] zp[2]:132 [ mul16s::$17 ] -Uplifting [sin16s] best 26239 combination zp[4]:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:153 [ sin16s::return#0 ] zp[2]:53 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:165 [ sin16s::$4 ] zp[2]:173 [ sin16s::x2#0 ] zp[2]:181 [ sin16s::x3_6#0 ] zp[2]:187 [ sin16s::x4#0 ] zp[2]:191 [ sin16s::x5#0 ] zp[2]:193 [ sin16s::x5_128#0 ] zp[2]:177 [ sin16s::x3#0 ] zp[2]:195 [ sin16s::usinx#1 ] zp[2]:169 [ sin16s::x1#0 ] zp[2]:183 [ sin16s::usinx#0 ] zp[1]:48 [ sin16s::isUpper#2 ] -Uplifting [sin16s_gen2] best 26239 combination zp[2]:40 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:159 [ sin16s_gen2::$6 ] zp[4]:42 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:163 [ sin16s_gen2::$9 ] zp[2]:46 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:149 [ sin16s_gen2::step#0 ] -Uplifting [mulu16_sel] best 26223 combination zp[2]:55 [ 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[2]:57 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:171 [ mulu16_sel::return#0 ] zp[2]:175 [ mulu16_sel::return#1 ] zp[2]:179 [ mulu16_sel::return#2 ] zp[2]:185 [ mulu16_sel::return#10 ] zp[2]:189 [ mulu16_sel::return#11 ] zp[4]:201 [ mulu16_sel::$0 ] zp[4]:205 [ mulu16_sel::$1 ] zp[2]:209 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [memset] best 26207 combination zp[2]:33 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:139 [ memset::end#0 ] zp[2]:28 [ memset::num#2 ] reg byte x [ memset::c#4 ] zp[2]:30 [ memset::str#3 ] -Uplifting [] best 26207 combination zp[1]:67 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] zp[2]:225 [ rem16u#1 ] -Uplifting [bitmap_plot] best 26190 combination reg byte x [ bitmap_plot::y#0 ] zp[2]:117 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp[2]:113 [ bitmap_plot::x#0 ] zp[2]:119 [ bitmap_plot::plotter#1 ] zp[2]:115 [ bitmap_plot::plotter#0 ] -Uplifting [div32u16u] best 26190 combination zp[4]:145 [ div32u16u::return#2 ] zp[2]:217 [ div32u16u::quotient_lo#0 ] zp[4]:219 [ div32u16u::return#0 ] zp[2]:213 [ div32u16u::quotient_hi#0 ] -Uplifting [bitmap_clear] best 26190 combination -Uplifting [init_irq] best 26190 combination -Uplifting [irq] best 26190 combination +Uplifting [mul16s] best 26261 combination zp[2]:8 [ mul16s::b#3 mul16s::b#2 mul16s::b#1 ] zp[2]:6 [ mul16s::a#3 mul16s::a#0 ] zp[4]:74 [ mul16s::return#3 ] zp[4]:96 [ mul16s::return#4 ] zp[4]:155 [ mul16s::return#2 ] zp[4]:10 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 ] zp[4]:134 [ mul16s::return#0 ] zp[2]:126 [ mul16s::$9 ] zp[2]:128 [ mul16s::$16 ] zp[2]:130 [ mul16s::$13 ] zp[2]:132 [ mul16s::$17 ] +Uplifting [sin16s] best 26252 combination zp[4]:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:153 [ sin16s::return#0 ] zp[2]:53 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:165 [ sin16s::$4 ] zp[2]:173 [ sin16s::x2#0 ] zp[2]:181 [ sin16s::x3_6#0 ] zp[2]:187 [ sin16s::x4#0 ] zp[2]:191 [ sin16s::x5#0 ] zp[2]:193 [ sin16s::x5_128#0 ] zp[2]:177 [ sin16s::x3#0 ] zp[2]:195 [ sin16s::usinx#1 ] zp[2]:169 [ sin16s::x1#0 ] zp[2]:183 [ sin16s::usinx#0 ] reg byte y [ sin16s::isUpper#2 ] +Uplifting [sin16s_gen2] best 26252 combination zp[2]:40 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:159 [ sin16s_gen2::$6 ] zp[4]:42 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:163 [ sin16s_gen2::$9 ] zp[2]:46 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:149 [ sin16s_gen2::step#0 ] +Uplifting [mulu16_sel] best 26236 combination zp[2]:55 [ 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[2]:57 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:171 [ mulu16_sel::return#0 ] zp[2]:175 [ mulu16_sel::return#1 ] zp[2]:179 [ mulu16_sel::return#2 ] zp[2]:185 [ mulu16_sel::return#10 ] zp[2]:189 [ mulu16_sel::return#11 ] zp[4]:201 [ mulu16_sel::$0 ] zp[4]:205 [ mulu16_sel::$1 ] zp[2]:209 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [memset] best 26220 combination zp[2]:33 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:139 [ memset::end#0 ] zp[2]:28 [ memset::num#2 ] reg byte x [ memset::c#4 ] zp[2]:30 [ memset::str#3 ] +Uplifting [] best 26220 combination zp[1]:67 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] zp[2]:225 [ rem16u#1 ] +Uplifting [bitmap_plot] best 26203 combination reg byte x [ bitmap_plot::y#0 ] zp[2]:117 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp[2]:113 [ bitmap_plot::x#0 ] zp[2]:119 [ bitmap_plot::plotter#1 ] zp[2]:115 [ bitmap_plot::plotter#0 ] +Uplifting [div32u16u] best 26203 combination zp[4]:145 [ div32u16u::return#2 ] zp[2]:217 [ div32u16u::quotient_lo#0 ] zp[4]:219 [ div32u16u::return#0 ] zp[2]:213 [ div32u16u::quotient_hi#0 ] +Uplifting [bitmap_clear] best 26203 combination +Uplifting [init_irq] best 26203 combination +Uplifting [irq] best 26203 combination Attempting to uplift remaining variables inzp[1]:67 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] -Uplifting [] best 26190 combination zp[1]:67 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Uplifting [] best 26203 combination zp[1]:67 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] Attempting to uplift remaining variables inzp[1]:143 [ bitmap_init::$5 ] -Uplifting [bitmap_init] best 26130 combination reg byte a [ bitmap_init::$5 ] +Uplifting [bitmap_init] best 26143 combination reg byte a [ bitmap_init::$5 ] Attempting to uplift remaining variables inzp[1]:144 [ bitmap_init::$6 ] -Uplifting [bitmap_init] best 26070 combination reg byte a [ bitmap_init::$6 ] +Uplifting [bitmap_init] best 26083 combination reg byte a [ bitmap_init::$6 ] Attempting to uplift remaining variables inzp[1]:141 [ bitmap_init::$7 ] -Uplifting [bitmap_init] best 26070 combination zp[1]:141 [ bitmap_init::$7 ] -Attempting to uplift remaining variables inzp[1]:48 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 26070 combination zp[1]:48 [ sin16s::isUpper#2 ] +Uplifting [bitmap_init] best 26083 combination zp[1]:141 [ bitmap_init::$7 ] Coalescing zero page register [ zp[2]:53 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp[2]:195 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register [ zp[2]:55 [ 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[2]:177 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register [ zp[2]:60 [ 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[2]:225 [ rem16u#1 ] ] - score: 2 @@ -6327,7 +6328,6 @@ Coalescing zero page register [ zp[2]:16 [ mul16u::b#1 ] ] with [ zp[2]:57 [ mul Coalescing zero page register [ zp[4]:20 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] ] with [ zp[4]:197 [ mul16u::return#3 ] ] - score: 1 Coalescing zero page register [ zp[2]:28 [ memset::num#2 ] ] with [ zp[2]:139 [ memset::end#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:30 [ memset::str#3 ] ] with [ zp[2]:33 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1 -Coalescing zero page register [ zp[4]:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:165 [ sin16s::$4 ] ] - score: 1 Coalescing zero page register [ zp[2]:55 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 ] ] with [ zp[2]:173 [ sin16s::x2#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:55 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 ] ] with [ zp[2]:187 [ sin16s::x4#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:64 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] ] with [ zp[2]:211 [ divr16u::return#2 ] ] - score: 1 @@ -6367,15 +6367,15 @@ Coalescing zero page register [ zp[2]:16 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_s Coalescing zero page register [ zp[2]:28 [ memset::num#2 memset::end#0 ] ] with [ zp[2]:4 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] ] Coalescing zero page register [ zp[2]:30 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] with [ zp[2]:6 [ mul16s::a#3 mul16s::a#0 mul16s::$17 sin16s::return#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::usinx#0 ] ] Coalescing zero page register [ zp[2]:38 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] ] with [ zp[2]:8 [ mul16s::b#3 mul16s::b#2 mul16s::b#1 main::cos_x#0 main::sin_y#0 main::$25 main::$27 main::$26 main::$28 ] ] -Coalescing zero page register [ zp[4]:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] ] with [ zp[4]:10 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] ] +Coalescing zero page register [ zp[4]:49 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:10 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] ] Coalescing zero page register [ zp[2]:55 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] ] with [ zp[2]:14 [ mul16u::b#0 ] ] Coalescing zero page register [ zp[2]:60 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 ] ] with [ zp[2]:18 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] ] Coalescing zero page register [ zp[2]:62 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] ] with [ zp[2]:40 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] ] Coalescing zero page register [ zp[2]:64 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ] ] with [ zp[2]:46 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] ] Coalescing zero page register [ zp[2]:115 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ] ] with [ zp[2]:110 [ main::y#0 ] ] Coalescing zero page register [ zp[2]:126 [ mul16s::$9 mul16s::$16 ] ] with [ zp[2]:117 [ bitmap_plot::$1 ] ] -Coalescing zero page register [ zp[1]:141 [ bitmap_init::$7 ] ] with [ zp[1]:48 [ sin16s::isUpper#2 ] ] Coalescing zero page register [ zp[2]:163 [ sin16s_gen2::$9 ] ] with [ zp[2]:88 [ main::x#0 bitmap_plot::x#0 ] ] +Coalescing zero page register [ zp[4]:165 [ sin16s::$4 ] ] with [ zp[4]:24 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] ] Coalescing zero page register [ zp[2]:169 [ sin16s::x1#0 ] ] with [ zp[2]:130 [ mul16s::$13 ] ] Coalescing zero page register [ zp[2]:213 [ div32u16u::quotient_hi#0 ] ] with [ zp[2]:171 [ 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 ] ] Coalescing zero page register [ zp[2]:62 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 ] ] with [ zp[2]:28 [ memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] ] @@ -6383,18 +6383,18 @@ Coalescing zero page register [ zp[2]:115 [ bitmap_plot::plotter#0 bitmap_plot:: Coalescing zero page register [ zp[2]:126 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 ] ] with [ zp[2]:55 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] ] Coalescing zero page register [ zp[2]:213 [ div32u16u::quotient_hi#0 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 ] ] with [ zp[2]:38 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#2 mul16s::b#1 main::cos_x#0 main::sin_y#0 main::$25 main::$27 main::$26 main::$28 ] ] Allocated (was zp[2]:16) zp[2]:2 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 main::idx_x#3 main::idx_x#10 main::idx_x#1 ] -Allocated (was zp[4]:24) zp[4]:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -Allocated (was zp[4]:42) zp[4]:8 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -Allocated (was zp[4]:49) zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] -Allocated (was zp[2]:60) zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] -Allocated (was zp[2]:62) zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] -Allocated (was zp[2]:64) zp[2]:20 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] -Allocated (was zp[1]:67) zp[1]:22 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] -Allocated (was zp[2]:115) zp[2]:23 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::y#0 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16s::a#3 mul16s::a#0 mul16s::$17 sin16s::return#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::usinx#0 ] -Allocated (was zp[2]:126) zp[2]:25 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] -Allocated (was zp[1]:141) zp[1]:27 [ bitmap_init::$7 sin16s::isUpper#2 ] -Allocated (was zp[4]:145) zp[4]:28 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -Allocated (was zp[2]:163) zp[2]:32 [ sin16s_gen2::$9 main::x#0 bitmap_plot::x#0 ] +Allocated (was zp[4]:42) zp[4]:4 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +Allocated (was zp[4]:49) zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] +Allocated (was zp[2]:60) zp[2]:12 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +Allocated (was zp[2]:62) zp[2]:14 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] +Allocated (was zp[2]:64) zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +Allocated (was zp[1]:67) zp[1]:18 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +Allocated (was zp[2]:115) zp[2]:19 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::y#0 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16s::a#3 mul16s::a#0 mul16s::$17 sin16s::return#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::usinx#0 ] +Allocated (was zp[2]:126) zp[2]:21 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] +Allocated (was zp[1]:141) zp[1]:23 [ bitmap_init::$7 ] +Allocated (was zp[4]:145) zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +Allocated (was zp[2]:163) zp[2]:28 [ sin16s_gen2::$9 main::x#0 bitmap_plot::x#0 ] +Allocated (was zp[4]:165) zp[4]:30 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] Allocated (was zp[2]:169) zp[2]:34 [ sin16s::x1#0 mul16s::$13 ] Allocated (was zp[2]:213) zp[2]:36 [ div32u16u::quotient_hi#0 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 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#2 mul16s::b#1 main::cos_x#0 main::sin_y#0 main::$25 main::$27 main::$26 main::$28 ] Interrupt procedure irq clobbers ACNZ @@ -6454,8 +6454,8 @@ ASSEMBLER BEFORE OPTIMIZATION .const PI_HALF_u4f28 = $1921fb54 .label BITMAP = $2000 .label SCREEN = $400 - .label rem16u = $10 - .label frame_cnt = $16 + .label rem16u = $c + .label frame_cnt = $12 // @begin __bbegin: jmp __b1 @@ -6482,18 +6482,18 @@ __bend: // main main: { .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f - .label __9 = $c - .label __14 = $c + .label __9 = 8 + .label __14 = 8 .label __25 = $24 .label __26 = $24 .label cos_x = $24 - .label xpos = $c - .label x = $20 + .label xpos = 8 + .label x = $1c .label sin_y = $24 - .label ypos = $c - .label y = $17 + .label ypos = 8 + .label y = $13 .label idx_x = 2 - .label idx_y = $12 + .label idx_y = $e .label __27 = $24 .label __28 = $24 // [6] call sin16s_gen2 @@ -6769,11 +6769,11 @@ main: { } // bitmap_plot // Plot a single dot in the bitmap -// bitmap_plot(word zeropage($20) x, byte register(X) y) +// bitmap_plot(word zeropage($1c) x, byte register(X) y) bitmap_plot: { - .label __1 = $19 - .label plotter = $17 - .label x = $20 + .label __1 = $15 + .label plotter = $13 + .label x = $1c // [48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx lda bitmap_plot_yhi,x sta.z plotter+1 @@ -6812,15 +6812,15 @@ bitmap_plot: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage($17) a, signed word zeropage($24) b) +// mul16s(signed word zeropage($13) a, signed word zeropage($24) b) mul16s: { - .label __9 = $19 + .label __9 = $15 .label __13 = $22 - .label __16 = $19 - .label __17 = $17 - .label m = $c - .label return = $c - .label a = $17 + .label __16 = $15 + .label __17 = $13 + .label m = 8 + .label return = 8 + .label a = $13 .label b = $24 // [55] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3 -- vwuz1=vwuz2 lda.z a @@ -6921,13 +6921,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($10) a, word zeropage($19) b) +// mul16u(word zeropage($c) a, word zeropage($15) b) mul16u: { - .label mb = 4 - .label a = $10 - .label res = $c - .label b = $19 - .label return = $c + .label mb = $1e + .label a = $c + .label res = 8 + .label b = $15 + .label return = 8 .label b_1 = 2 // [73] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] __b1_from_mul16u: @@ -7093,12 +7093,12 @@ bitmap_clear: { } // 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($17) str, byte register(X) c, word zeropage($12) num) +// memset(void* zeropage($13) str, byte register(X) c, word zeropage($e) num) memset: { - .label end = $12 - .label dst = $17 - .label num = $12 - .label str = $17 + .label end = $e + .label dst = $13 + .label num = $e + .label str = $13 // [98] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 lda.z num bne !+ @@ -7152,7 +7152,7 @@ memset: { // bitmap_init // Initialize bitmap plotting tables bitmap_init: { - .label __7 = $1b + .label __7 = $17 .label yoffs = $24 // [107] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] __b1_from_bitmap_init: @@ -7263,18 +7263,18 @@ bitmap_init: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($14) sintab) +// sin16s_gen2(signed word* zeropage($10) sintab) sin16s_gen2: { .label wavelength = $200 .const min = -$1001 .const max = $1001 .const ampl = max-min - .label __6 = $c - .label __9 = $20 - .label step = $1c - .label sintab = $14 - .label x = 8 - .label i = $12 + .label __6 = 8 + .label __9 = $1c + .label step = $18 + .label sintab = $10 + .label x = 4 + .label i = $e // [129] call div32u16u // [196] phi from sin16s_gen2 to div32u16u [phi:sin16s_gen2->div32u16u] div32u16u_from_sin16s_gen2: @@ -7404,21 +7404,20 @@ sin16s_gen2: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($c) x) +// sin16s(dword zeropage(8) x) sin16s: { - .label __4 = $c - .label x = $c - .label return = $17 + .label __4 = $1e + .label x = 8 + .label return = $13 .label x1 = $22 - .label x2 = $19 - .label x3 = $19 + .label x2 = $15 + .label x3 = $15 .label x3_6 = $24 - .label usinx = $17 - .label x4 = $19 + .label usinx = $13 + .label x4 = $15 .label x5 = $24 .label x5_128 = $24 - .label sinx = $17 - .label isUpper = $1b + .label sinx = $13 // [147] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 cmp #>PI_u4f28>>$10 @@ -7455,16 +7454,14 @@ sin16s: { sta.z x+3 // [149] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] __b1_from___b4: - // [149] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [149] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [149] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [149] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] __b1_from_sin16s: - // [149] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [149] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [149] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy jmp __b1 // sin16s::@1 @@ -7510,15 +7507,27 @@ sin16s: { jmp __b2 // sin16s::@2 __b2: - // [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // [154] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -7659,9 +7668,8 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - // [182] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [182] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b12 jmp __b6 // sin16s::@6 @@ -7694,14 +7702,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($19) v1, word zeropage(2) v2, byte register(X) select) +// mulu16_sel(word zeropage($15) v1, word zeropage(2) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $19 + .label __0 = 8 + .label __1 = 8 + .label v1 = $15 .label v2 = 2 .label return = $24 - .label return_1 = $19 + .label return_1 = $15 // [188] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 sta.z mul16u.a @@ -7753,8 +7761,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $24 - .label quotient_lo = $14 - .label return = $1c + .label quotient_lo = $10 + .label return = $18 // [197] call divr16u // [206] phi from div32u16u to divr16u [phi:div32u16u->divr16u] divr16u_from_div32u16u: @@ -7814,12 +7822,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($12) dividend, word zeropage($10) rem) +// divr16u(word zeropage($e) dividend, word zeropage($c) rem) divr16u: { - .label rem = $10 - .label dividend = $12 - .label quotient = $14 - .label return = $14 + .label rem = $c + .label dividend = $e + .label quotient = $10 + .label return = $10 // [207] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] __b1_from_divr16u: // [207] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 @@ -8262,7 +8270,7 @@ FINAL SYMBOL TABLE (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 zp[1]:27 5.5 +(byte~) bitmap_init::$7 zp[1]:23 5.5 (label) bitmap_init::@1 (label) bitmap_init::@2 (label) bitmap_init::@3 @@ -8287,14 +8295,14 @@ FINAL SYMBOL TABLE (byte*) bitmap_init::yoffs#2 yoffs zp[2]:36 6.875 (byte*) bitmap_init::yoffs#4 yoffs zp[2]:36 11.0 (void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) -(word~) bitmap_plot::$1 zp[2]:25 4.0 +(word~) bitmap_plot::$1 zp[2]:21 4.0 (byte~) bitmap_plot::$2 reg byte a 4.0 (label) bitmap_plot::@return (byte*) bitmap_plot::plotter -(word) bitmap_plot::plotter#0 plotter zp[2]:23 1.0 -(byte*) bitmap_plot::plotter#1 plotter zp[2]:23 3.0 +(word) bitmap_plot::plotter#0 plotter zp[2]:19 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp[2]:19 3.0 (word) bitmap_plot::x -(word) bitmap_plot::x#0 x zp[2]:32 3.75 +(word) bitmap_plot::x#0 x zp[2]:28 3.75 (byte) bitmap_plot::y (byte) bitmap_plot::y#0 reg byte x 7.5 (const byte[$100]) bitmap_plot_bit = { fill( $100, 0) } @@ -8311,10 +8319,10 @@ FINAL SYMBOL TABLE (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:36 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:20 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:16 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:28 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:28 4.0 +(dword) div32u16u::return#0 return zp[4]:24 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:24 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -8326,34 +8334,34 @@ FINAL SYMBOL TABLE (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:18 2.75 -(word) divr16u::dividend#3 dividend zp[2]:18 5.0 -(word) divr16u::dividend#5 dividend zp[2]:18 2.0 +(word) divr16u::dividend#0 dividend zp[2]:14 2.75 +(word) divr16u::dividend#3 dividend zp[2]:14 5.0 +(word) divr16u::dividend#5 dividend zp[2]:14 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:20 16.5 -(word) divr16u::quotient#2 quotient zp[2]:20 11.0 -(word) divr16u::quotient#3 quotient zp[2]:20 2.75 +(word) divr16u::quotient#1 quotient zp[2]:16 16.5 +(word) divr16u::quotient#2 quotient zp[2]:16 11.0 +(word) divr16u::quotient#3 quotient zp[2]:16 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:16 8.25 -(word) divr16u::rem#1 rem zp[2]:16 22.0 -(word) divr16u::rem#10 rem zp[2]:16 4.0 -(word) divr16u::rem#11 rem zp[2]:16 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:16 22.0 -(word) divr16u::rem#4 rem zp[2]:16 4.0 -(word) divr16u::rem#5 rem zp[2]:16 24.0 -(word) divr16u::rem#6 rem zp[2]:16 11.0 +(word) divr16u::rem#0 rem zp[2]:12 8.25 +(word) divr16u::rem#1 rem zp[2]:12 22.0 +(word) divr16u::rem#10 rem zp[2]:12 4.0 +(word) divr16u::rem#11 rem zp[2]:12 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:12 22.0 +(word) divr16u::rem#4 rem zp[2]:12 4.0 +(word) divr16u::rem#5 rem zp[2]:12 24.0 +(word) divr16u::rem#6 rem zp[2]:12 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:20 5.285714285714286 -(word) divr16u::return#2 return zp[2]:20 4.0 -(word) divr16u::return#3 return zp[2]:20 4.0 +(word) divr16u::return#0 return zp[2]:16 5.285714285714286 +(word) divr16u::return#2 return zp[2]:16 4.0 +(word) divr16u::return#3 return zp[2]:16 4.0 (byte) frame_cnt -(byte) frame_cnt#0 frame_cnt zp[1]:22 0.6382978723404255 -(byte) frame_cnt#1 frame_cnt zp[1]:22 4.0 -(byte) frame_cnt#10 frame_cnt zp[1]:22 40.0 +(byte) frame_cnt#0 frame_cnt zp[1]:18 0.6382978723404255 +(byte) frame_cnt#1 frame_cnt zp[1]:18 4.0 +(byte) frame_cnt#10 frame_cnt zp[1]:18 40.0 (void()) init_irq() (label) init_irq::@return interrupt(HARDWARE_CLOBBER)(void()) irq() @@ -8362,13 +8370,13 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) irq::@return (void()) main() (word~) main::$10 reg byte alu 22.0 -(signed dword~) main::$14 zp[4]:12 22.0 +(signed dword~) main::$14 zp[4]:8 22.0 (word~) main::$15 reg byte alu 22.0 (word~) main::$25 zp[2]:36 22.0 (word~) main::$26 zp[2]:36 22.0 (signed word*~) main::$27 zp[2]:36 22.0 (signed word*~) main::$28 zp[2]:36 22.0 -(signed dword~) main::$9 zp[4]:12 22.0 +(signed dword~) main::$9 zp[4]:8 22.0 (label) main::@1 (label) main::@10 (label) main::@11 @@ -8389,9 +8397,9 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) main::idx_x#10 idx_x zp[2]:2 3.6666666666666665 (word) main::idx_x#3 idx_x zp[2]:2 1.375 (word) main::idx_y -(word) main::idx_y#1 idx_y zp[2]:18 11.0 -(word) main::idx_y#10 idx_y zp[2]:18 11.0 -(word) main::idx_y#3 idx_y zp[2]:18 1.1785714285714286 +(word) main::idx_y#1 idx_y zp[2]:14 11.0 +(word) main::idx_y#10 idx_y zp[2]:14 11.0 +(word) main::idx_y#3 idx_y zp[2]:14 1.1785714285714286 (signed word) main::sin_y (signed word) main::sin_y#0 sin_y zp[2]:36 22.0 (label) main::toD0181 @@ -8400,13 +8408,13 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x -(word) main::x#0 x zp[2]:32 1.8333333333333333 +(word) main::x#0 x zp[2]:28 1.8333333333333333 (signed dword) main::xpos -(signed dword) main::xpos#0 xpos zp[4]:12 22.0 +(signed dword) main::xpos#0 xpos zp[4]:8 22.0 (word) main::y -(word) main::y#0 y zp[2]:23 11.0 +(word) main::y#0 y zp[2]:19 11.0 (signed dword) main::ypos -(signed dword) main::ypos#0 ypos zp[4]:12 22.0 +(signed dword) main::ypos#0 ypos zp[4]:8 22.0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 @@ -8415,21 +8423,21 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (byte) memset::c (byte) memset::c#4 reg byte x 1.375 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:23 22.0 -(byte*) memset::dst#2 dst zp[2]:23 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:23 4.0 +(byte*) memset::dst#1 dst zp[2]:19 22.0 +(byte*) memset::dst#2 dst zp[2]:19 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:19 4.0 (byte*) memset::end -(byte*) memset::end#0 end zp[2]:18 2.1666666666666665 +(byte*) memset::end#0 end zp[2]:14 2.1666666666666665 (word) memset::num -(word) memset::num#2 num zp[2]:18 2.0 +(word) memset::num#2 num zp[2]:14 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:23 +(void*) memset::str#3 str zp[2]:19 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$13 zp[2]:34 4.0 -(word~) mul16s::$16 zp[2]:25 4.0 -(word~) mul16s::$17 zp[2]:23 4.0 -(word~) mul16s::$9 zp[2]:25 4.0 +(word~) mul16s::$16 zp[2]:21 4.0 +(word~) mul16s::$17 zp[2]:19 4.0 +(word~) mul16s::$9 zp[2]:21 4.0 (label) mul16s::@1 (label) mul16s::@2 (label) mul16s::@3 @@ -8437,23 +8445,23 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16s::@5 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:23 22.0 -(signed word) mul16s::a#3 a zp[2]:23 1.0 +(signed word) mul16s::a#0 a zp[2]:19 22.0 +(signed word) mul16s::a#3 a zp[2]:19 1.0 (signed word) mul16s::b (signed word) mul16s::b#1 b zp[2]:36 22.0 (signed word) mul16s::b#2 b zp[2]:36 22.0 (signed word) mul16s::b#3 b zp[2]:36 2.1818181818181817 (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:12 2.0 -(dword) mul16s::m#1 m zp[4]:12 4.0 -(dword) mul16s::m#2 m zp[4]:12 4.0 -(dword) mul16s::m#4 m zp[4]:12 4.0 -(dword) mul16s::m#5 m zp[4]:12 2.5 +(dword) mul16s::m#0 m zp[4]:8 2.0 +(dword) mul16s::m#1 m zp[4]:8 4.0 +(dword) mul16s::m#2 m zp[4]:8 4.0 +(dword) mul16s::m#4 m zp[4]:8 4.0 +(dword) mul16s::m#5 m zp[4]:8 2.5 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:12 7.000000000000001 -(signed dword) mul16s::return#2 return zp[4]:12 22.0 -(signed dword) mul16s::return#3 return zp[4]:12 22.0 -(signed dword) mul16s::return#4 return zp[4]:12 22.0 +(signed dword) mul16s::return#0 return zp[4]:8 7.000000000000001 +(signed dword) mul16s::return#2 return zp[4]:8 22.0 +(signed dword) mul16s::return#3 return zp[4]:8 22.0 +(signed dword) mul16s::return#4 return zp[4]:8 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -8462,46 +8470,46 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:16 101.0 -(word) mul16u::a#1 a zp[2]:16 2.0 -(word) mul16u::a#2 a zp[2]:16 2.0 -(word) mul16u::a#3 a zp[2]:16 67.66666666666666 -(word) mul16u::a#6 a zp[2]:16 6.0 +(word) mul16u::a#0 a zp[2]:12 101.0 +(word) mul16u::a#1 a zp[2]:12 2.0 +(word) mul16u::a#2 a zp[2]:12 2.0 +(word) mul16u::a#3 a zp[2]:12 67.66666666666666 +(word) mul16u::a#6 a zp[2]:12 6.0 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:25 4.0 +(word) mul16u::b#0 b zp[2]:21 4.0 (word) mul16u::b#1 b_1 zp[2]:2 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:4 6.0 -(dword) mul16u::mb#1 mb zp[4]:4 202.0 -(dword) mul16u::mb#2 mb zp[4]:4 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:30 6.0 +(dword) mul16u::mb#1 mb zp[4]:30 202.0 +(dword) mul16u::mb#2 mb zp[4]:30 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:12 202.0 -(dword) mul16u::res#2 res zp[4]:12 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:12 101.0 +(dword) mul16u::res#1 res zp[4]:8 202.0 +(dword) mul16u::res#2 res zp[4]:8 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:8 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:12 4.0 -(dword) mul16u::return#3 return zp[4]:12 4.0 +(dword) mul16u::return#2 return zp[4]:8 4.0 +(dword) mul16u::return#3 return zp[4]:8 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:12 4.0 -(dword~) mulu16_sel::$1 zp[4]:12 4.0 +(dword~) mulu16_sel::$0 zp[4]:8 4.0 +(dword~) mulu16_sel::$1 zp[4]:8 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:36 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:25 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:25 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:21 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:21 4.0 (word) mulu16_sel::return#11 return zp[2]:36 4.0 (word) mulu16_sel::return#12 return zp[2]:36 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:36 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:25 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:25 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:21 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:21 12.0 (word) mulu16_sel::v2 (word) mulu16_sel::v2#0 v2 zp[2]:2 4.0 (word) mulu16_sel::v2#1 v2 zp[2]:2 4.0 @@ -8510,9 +8518,9 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) mulu16_sel::v2#5 v2 zp[2]:2 5.0 (const byte[$100]) plots_per_frame = { fill( $100, 0) } (word) rem16u -(word) rem16u#1 rem16u zp[2]:16 0.8 +(word) rem16u#1 rem16u zp[2]:12 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:12 4.0 +(dword~) sin16s::$4 zp[4]:30 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -8527,39 +8535,39 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:27 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:23 22.0 -(signed word) sin16s::return#1 return zp[2]:23 5.0 -(signed word~) sin16s::return#5 return zp[2]:23 4.0 +(signed word) sin16s::return#0 return zp[2]:19 22.0 +(signed word) sin16s::return#1 return zp[2]:19 5.0 +(signed word~) sin16s::return#5 return zp[2]:19 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:23 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:19 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:23 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:23 1.0 +(word) sin16s::usinx#0 usinx zp[2]:19 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:19 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:12 8.5 -(dword) sin16s::x#1 x zp[4]:12 4.0 -(dword) sin16s::x#2 x zp[4]:12 4.0 -(dword) sin16s::x#4 x zp[4]:12 5.0 -(dword) sin16s::x#6 x zp[4]:12 6.0 +(dword) sin16s::x#0 x zp[4]:8 8.5 +(dword) sin16s::x#1 x zp[4]:8 4.0 +(dword) sin16s::x#2 x zp[4]:8 4.0 +(dword) sin16s::x#4 x zp[4]:8 5.0 +(dword) sin16s::x#6 x zp[4]:8 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:34 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:25 4.0 +(word) sin16s::x2#0 x2 zp[2]:21 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:25 1.0 +(word) sin16s::x3#0 x3 zp[2]:21 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:36 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:25 4.0 +(word) sin16s::x4#0 x4 zp[2]:21 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:36 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:36 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:12 22.0 -(word~) sin16s_gen2::$9 zp[2]:32 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:8 22.0 +(word~) sin16s_gen2::$9 zp[2]:28 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -8569,51 +8577,52 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (signed word) sin16s_gen2::ampl (const signed word) sin16s_gen2::ampl#0 ampl = (const signed word) sin16s_gen2::max#0-(const signed word) sin16s_gen2::min#0 (word) sin16s_gen2::i -(word) sin16s_gen2::i#1 i zp[2]:18 22.0 -(word) sin16s_gen2::i#2 i zp[2]:18 2.5384615384615383 +(word) sin16s_gen2::i#1 i zp[2]:14 22.0 +(word) sin16s_gen2::i#2 i zp[2]:14 2.5384615384615383 (signed word) sin16s_gen2::max (const signed word) sin16s_gen2::max#0 max = (signed word) $1001 (signed word) sin16s_gen2::min (const signed word) sin16s_gen2::min#0 min = (signed word) -$1001 (signed word) sin16s_gen2::offs (signed word*) sin16s_gen2::sintab -(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:20 7.333333333333333 -(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:20 3.0 +(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:16 7.333333333333333 +(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:16 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:28 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:24 0.8666666666666666 (word) sin16s_gen2::wavelength (const word) sin16s_gen2::wavelength#0 wavelength = (word) $200 (dword) sin16s_gen2::x -(dword) sin16s_gen2::x#1 x zp[4]:8 11.0 -(dword) sin16s_gen2::x#2 x zp[4]:8 2.75 +(dword) sin16s_gen2::x#1 x zp[4]:4 11.0 +(dword) sin16s_gen2::x#2 x zp[4]:4 2.75 zp[2]:2 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 main::idx_x#3 main::idx_x#10 main::idx_x#1 ] -zp[4]:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte x [ memset::c#4 ] 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[4]:8 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] +zp[4]:4 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] -zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] -zp[2]:20 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +zp[2]:12 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[2]:14 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] +zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[1]:22 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +zp[1]:18 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] reg byte alu [ main::$10 ] reg byte alu [ main::$15 ] reg byte x [ bitmap_plot::y#0 ] -zp[2]:23 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::y#0 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16s::a#3 mul16s::a#0 mul16s::$17 sin16s::return#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::usinx#0 ] +zp[2]:19 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::y#0 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16s::a#3 mul16s::a#0 mul16s::$17 sin16s::return#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::usinx#0 ] reg byte a [ bitmap_plot::$2 ] -zp[2]:25 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] +zp[2]:21 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] reg byte a [ mul16u::$1 ] -zp[1]:27 [ bitmap_init::$7 sin16s::isUpper#2 ] +zp[1]:23 [ bitmap_init::$7 ] reg byte a [ bitmap_init::$4 ] reg byte a [ bitmap_init::$5 ] reg byte a [ bitmap_init::$6 ] -zp[4]:28 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:32 [ sin16s_gen2::$9 main::x#0 bitmap_plot::x#0 ] +zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:28 [ sin16s_gen2::$9 main::x#0 bitmap_plot::x#0 ] +zp[4]:30 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:34 [ sin16s::x1#0 mul16s::$13 ] zp[2]:36 [ div32u16u::quotient_hi#0 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 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#2 mul16s::b#1 main::cos_x#0 main::sin_y#0 main::$25 main::$27 main::$26 main::$28 ] reg byte a [ divr16u::$1 ] @@ -8621,7 +8630,7 @@ reg byte a [ divr16u::$2 ] FINAL ASSEMBLER -Score: 20391 +Score: 20428 // File Comments // Tests the simple bitmap plotter - and counts plots per frame in an IRQ @@ -8671,8 +8680,8 @@ Score: 20391 .const PI_HALF_u4f28 = $1921fb54 .label BITMAP = $2000 .label SCREEN = $400 - .label rem16u = $10 - .label frame_cnt = $16 + .label rem16u = $c + .label frame_cnt = $12 // @begin // @1 __b1: @@ -8692,18 +8701,18 @@ __b1: // main main: { .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f - .label __9 = $c - .label __14 = $c + .label __9 = 8 + .label __14 = 8 .label __25 = $24 .label __26 = $24 .label cos_x = $24 - .label xpos = $c - .label x = $20 + .label xpos = 8 + .label x = $1c .label sin_y = $24 - .label ypos = $c - .label y = $17 + .label ypos = 8 + .label y = $13 .label idx_x = 2 - .label idx_y = $12 + .label idx_y = $e .label __27 = $24 .label __28 = $24 // sin16s_gen2(SINUS, 512, -0x1001, 0x1001) @@ -8957,11 +8966,11 @@ main: { } // bitmap_plot // Plot a single dot in the bitmap -// bitmap_plot(word zeropage($20) x, byte register(X) y) +// bitmap_plot(word zeropage($1c) x, byte register(X) y) bitmap_plot: { - .label __1 = $19 - .label plotter = $17 - .label x = $20 + .label __1 = $15 + .label plotter = $13 + .label x = $1c // (byte*) { bitmap_plot_yhi[y], bitmap_plot_ylo[y] } // [48] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx lda bitmap_plot_yhi,x @@ -9003,15 +9012,15 @@ bitmap_plot: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage($17) a, signed word zeropage($24) b) +// mul16s(signed word zeropage($13) a, signed word zeropage($24) b) mul16s: { - .label __9 = $19 + .label __9 = $15 .label __13 = $22 - .label __16 = $19 - .label __17 = $17 - .label m = $c - .label return = $c - .label a = $17 + .label __16 = $15 + .label __17 = $13 + .label m = 8 + .label return = 8 + .label a = $13 .label b = $24 // mul16u((word)a, (word) b) // [55] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3 -- vwuz1=vwuz2 @@ -9108,13 +9117,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($10) a, word zeropage($19) b) +// mul16u(word zeropage($c) a, word zeropage($15) b) mul16u: { - .label mb = 4 - .label a = $10 - .label res = $c - .label b = $19 - .label return = $c + .label mb = $1e + .label a = $c + .label res = 8 + .label b = $15 + .label return = 8 .label b_1 = 2 // [73] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] // [73] phi (dword) mul16u::mb#2 = (dword) mul16u::mb#0 [phi:mul16u->mul16u::@1#0] -- register_copy @@ -9280,12 +9289,12 @@ bitmap_clear: { } // 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($17) str, byte register(X) c, word zeropage($12) num) +// memset(void* zeropage($13) str, byte register(X) c, word zeropage($e) num) memset: { - .label end = $12 - .label dst = $17 - .label num = $12 - .label str = $17 + .label end = $e + .label dst = $13 + .label num = $e + .label str = $13 // if(num>0) // [98] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 lda.z num @@ -9339,7 +9348,7 @@ memset: { // bitmap_init // Initialize bitmap plotting tables bitmap_init: { - .label __7 = $1b + .label __7 = $17 .label yoffs = $24 // [107] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] // [107] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 @@ -9442,18 +9451,18 @@ bitmap_init: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($14) sintab) +// sin16s_gen2(signed word* zeropage($10) sintab) sin16s_gen2: { .label wavelength = $200 .const min = -$1001 .const max = $1001 .const ampl = max-min - .label __6 = $c - .label __9 = $20 - .label step = $1c - .label sintab = $14 - .label x = 8 - .label i = $12 + .label __6 = 8 + .label __9 = $1c + .label step = $18 + .label sintab = $10 + .label x = 4 + .label i = $e // div32u16u(PI2_u4f28, wavelength) // [129] call div32u16u // [196] phi from sin16s_gen2 to div32u16u [phi:sin16s_gen2->div32u16u] @@ -9580,21 +9589,20 @@ sin16s_gen2: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($c) x) +// sin16s(dword zeropage(8) x) sin16s: { - .label __4 = $c - .label x = $c - .label return = $17 + .label __4 = $1e + .label x = 8 + .label return = $13 .label x1 = $22 - .label x2 = $19 - .label x3 = $19 + .label x2 = $15 + .label x3 = $15 .label x3_6 = $24 - .label usinx = $17 - .label x4 = $19 + .label usinx = $13 + .label x4 = $15 .label x5 = $24 .label x5_128 = $24 - .label sinx = $17 - .label isUpper = $1b + .label sinx = $13 // if(x >= PI_u4f28 ) // [147] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 @@ -9630,16 +9638,14 @@ sin16s: { sbc #>PI_u4f28>>$10 sta.z x+3 // [149] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] - // [149] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [149] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [149] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [149] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] b1: - // [149] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [149] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [149] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy // sin16s::@1 __b1: @@ -9682,15 +9688,27 @@ sin16s: { // sin16s::@2 __b2: // x<<3 - // [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [153] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // x1 = >x<<3 // [154] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 @@ -9836,9 +9854,8 @@ sin16s: { adc.z x5_128+1 sta.z usinx+1 // if(isUpper!=0) - // [182] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [182] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b3 // sin16s::@6 // sinx = -(signed word)usinx @@ -9864,14 +9881,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($19) v1, word zeropage(2) v2, byte register(X) select) +// mulu16_sel(word zeropage($15) v1, word zeropage(2) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $19 + .label __0 = 8 + .label __1 = 8 + .label v1 = $15 .label v2 = 2 .label return = $24 - .label return_1 = $19 + .label return_1 = $15 // mul16u(v1, v2) // [188] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 @@ -9923,8 +9940,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $24 - .label quotient_lo = $14 - .label return = $1c + .label quotient_lo = $10 + .label return = $18 // divr16u(>dividend, divisor, 0) // [197] call divr16u // [206] phi from div32u16u to divr16u [phi:div32u16u->divr16u] @@ -9983,12 +10000,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($12) dividend, word zeropage($10) rem) +// divr16u(word zeropage($e) dividend, word zeropage($c) rem) divr16u: { - .label rem = $10 - .label dividend = $12 - .label quotient = $14 - .label return = $14 + .label rem = $c + .label dividend = $e + .label quotient = $10 + .label return = $10 // [207] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] // [207] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 ldx #0 diff --git a/src/test/ref/bitmap-plot-1.sym b/src/test/ref/bitmap-plot-1.sym index 3ea59af4b..833cfa1d1 100644 --- a/src/test/ref/bitmap-plot-1.sym +++ b/src/test/ref/bitmap-plot-1.sym @@ -41,7 +41,7 @@ (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 zp[1]:27 5.5 +(byte~) bitmap_init::$7 zp[1]:23 5.5 (label) bitmap_init::@1 (label) bitmap_init::@2 (label) bitmap_init::@3 @@ -66,14 +66,14 @@ (byte*) bitmap_init::yoffs#2 yoffs zp[2]:36 6.875 (byte*) bitmap_init::yoffs#4 yoffs zp[2]:36 11.0 (void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) -(word~) bitmap_plot::$1 zp[2]:25 4.0 +(word~) bitmap_plot::$1 zp[2]:21 4.0 (byte~) bitmap_plot::$2 reg byte a 4.0 (label) bitmap_plot::@return (byte*) bitmap_plot::plotter -(word) bitmap_plot::plotter#0 plotter zp[2]:23 1.0 -(byte*) bitmap_plot::plotter#1 plotter zp[2]:23 3.0 +(word) bitmap_plot::plotter#0 plotter zp[2]:19 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp[2]:19 3.0 (word) bitmap_plot::x -(word) bitmap_plot::x#0 x zp[2]:32 3.75 +(word) bitmap_plot::x#0 x zp[2]:28 3.75 (byte) bitmap_plot::y (byte) bitmap_plot::y#0 reg byte x 7.5 (const byte[$100]) bitmap_plot_bit = { fill( $100, 0) } @@ -90,10 +90,10 @@ (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:36 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:20 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:16 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:28 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:28 4.0 +(dword) div32u16u::return#0 return zp[4]:24 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:24 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -105,34 +105,34 @@ (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:18 2.75 -(word) divr16u::dividend#3 dividend zp[2]:18 5.0 -(word) divr16u::dividend#5 dividend zp[2]:18 2.0 +(word) divr16u::dividend#0 dividend zp[2]:14 2.75 +(word) divr16u::dividend#3 dividend zp[2]:14 5.0 +(word) divr16u::dividend#5 dividend zp[2]:14 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:20 16.5 -(word) divr16u::quotient#2 quotient zp[2]:20 11.0 -(word) divr16u::quotient#3 quotient zp[2]:20 2.75 +(word) divr16u::quotient#1 quotient zp[2]:16 16.5 +(word) divr16u::quotient#2 quotient zp[2]:16 11.0 +(word) divr16u::quotient#3 quotient zp[2]:16 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:16 8.25 -(word) divr16u::rem#1 rem zp[2]:16 22.0 -(word) divr16u::rem#10 rem zp[2]:16 4.0 -(word) divr16u::rem#11 rem zp[2]:16 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:16 22.0 -(word) divr16u::rem#4 rem zp[2]:16 4.0 -(word) divr16u::rem#5 rem zp[2]:16 24.0 -(word) divr16u::rem#6 rem zp[2]:16 11.0 +(word) divr16u::rem#0 rem zp[2]:12 8.25 +(word) divr16u::rem#1 rem zp[2]:12 22.0 +(word) divr16u::rem#10 rem zp[2]:12 4.0 +(word) divr16u::rem#11 rem zp[2]:12 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:12 22.0 +(word) divr16u::rem#4 rem zp[2]:12 4.0 +(word) divr16u::rem#5 rem zp[2]:12 24.0 +(word) divr16u::rem#6 rem zp[2]:12 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:20 5.285714285714286 -(word) divr16u::return#2 return zp[2]:20 4.0 -(word) divr16u::return#3 return zp[2]:20 4.0 +(word) divr16u::return#0 return zp[2]:16 5.285714285714286 +(word) divr16u::return#2 return zp[2]:16 4.0 +(word) divr16u::return#3 return zp[2]:16 4.0 (byte) frame_cnt -(byte) frame_cnt#0 frame_cnt zp[1]:22 0.6382978723404255 -(byte) frame_cnt#1 frame_cnt zp[1]:22 4.0 -(byte) frame_cnt#10 frame_cnt zp[1]:22 40.0 +(byte) frame_cnt#0 frame_cnt zp[1]:18 0.6382978723404255 +(byte) frame_cnt#1 frame_cnt zp[1]:18 4.0 +(byte) frame_cnt#10 frame_cnt zp[1]:18 40.0 (void()) init_irq() (label) init_irq::@return interrupt(HARDWARE_CLOBBER)(void()) irq() @@ -141,13 +141,13 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) irq::@return (void()) main() (word~) main::$10 reg byte alu 22.0 -(signed dword~) main::$14 zp[4]:12 22.0 +(signed dword~) main::$14 zp[4]:8 22.0 (word~) main::$15 reg byte alu 22.0 (word~) main::$25 zp[2]:36 22.0 (word~) main::$26 zp[2]:36 22.0 (signed word*~) main::$27 zp[2]:36 22.0 (signed word*~) main::$28 zp[2]:36 22.0 -(signed dword~) main::$9 zp[4]:12 22.0 +(signed dword~) main::$9 zp[4]:8 22.0 (label) main::@1 (label) main::@10 (label) main::@11 @@ -168,9 +168,9 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) main::idx_x#10 idx_x zp[2]:2 3.6666666666666665 (word) main::idx_x#3 idx_x zp[2]:2 1.375 (word) main::idx_y -(word) main::idx_y#1 idx_y zp[2]:18 11.0 -(word) main::idx_y#10 idx_y zp[2]:18 11.0 -(word) main::idx_y#3 idx_y zp[2]:18 1.1785714285714286 +(word) main::idx_y#1 idx_y zp[2]:14 11.0 +(word) main::idx_y#10 idx_y zp[2]:14 11.0 +(word) main::idx_y#3 idx_y zp[2]:14 1.1785714285714286 (signed word) main::sin_y (signed word) main::sin_y#0 sin_y zp[2]:36 22.0 (label) main::toD0181 @@ -179,13 +179,13 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x -(word) main::x#0 x zp[2]:32 1.8333333333333333 +(word) main::x#0 x zp[2]:28 1.8333333333333333 (signed dword) main::xpos -(signed dword) main::xpos#0 xpos zp[4]:12 22.0 +(signed dword) main::xpos#0 xpos zp[4]:8 22.0 (word) main::y -(word) main::y#0 y zp[2]:23 11.0 +(word) main::y#0 y zp[2]:19 11.0 (signed dword) main::ypos -(signed dword) main::ypos#0 ypos zp[4]:12 22.0 +(signed dword) main::ypos#0 ypos zp[4]:8 22.0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 @@ -194,21 +194,21 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (byte) memset::c (byte) memset::c#4 reg byte x 1.375 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:23 22.0 -(byte*) memset::dst#2 dst zp[2]:23 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:23 4.0 +(byte*) memset::dst#1 dst zp[2]:19 22.0 +(byte*) memset::dst#2 dst zp[2]:19 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:19 4.0 (byte*) memset::end -(byte*) memset::end#0 end zp[2]:18 2.1666666666666665 +(byte*) memset::end#0 end zp[2]:14 2.1666666666666665 (word) memset::num -(word) memset::num#2 num zp[2]:18 2.0 +(word) memset::num#2 num zp[2]:14 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:23 +(void*) memset::str#3 str zp[2]:19 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$13 zp[2]:34 4.0 -(word~) mul16s::$16 zp[2]:25 4.0 -(word~) mul16s::$17 zp[2]:23 4.0 -(word~) mul16s::$9 zp[2]:25 4.0 +(word~) mul16s::$16 zp[2]:21 4.0 +(word~) mul16s::$17 zp[2]:19 4.0 +(word~) mul16s::$9 zp[2]:21 4.0 (label) mul16s::@1 (label) mul16s::@2 (label) mul16s::@3 @@ -216,23 +216,23 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16s::@5 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:23 22.0 -(signed word) mul16s::a#3 a zp[2]:23 1.0 +(signed word) mul16s::a#0 a zp[2]:19 22.0 +(signed word) mul16s::a#3 a zp[2]:19 1.0 (signed word) mul16s::b (signed word) mul16s::b#1 b zp[2]:36 22.0 (signed word) mul16s::b#2 b zp[2]:36 22.0 (signed word) mul16s::b#3 b zp[2]:36 2.1818181818181817 (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:12 2.0 -(dword) mul16s::m#1 m zp[4]:12 4.0 -(dword) mul16s::m#2 m zp[4]:12 4.0 -(dword) mul16s::m#4 m zp[4]:12 4.0 -(dword) mul16s::m#5 m zp[4]:12 2.5 +(dword) mul16s::m#0 m zp[4]:8 2.0 +(dword) mul16s::m#1 m zp[4]:8 4.0 +(dword) mul16s::m#2 m zp[4]:8 4.0 +(dword) mul16s::m#4 m zp[4]:8 4.0 +(dword) mul16s::m#5 m zp[4]:8 2.5 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:12 7.000000000000001 -(signed dword) mul16s::return#2 return zp[4]:12 22.0 -(signed dword) mul16s::return#3 return zp[4]:12 22.0 -(signed dword) mul16s::return#4 return zp[4]:12 22.0 +(signed dword) mul16s::return#0 return zp[4]:8 7.000000000000001 +(signed dword) mul16s::return#2 return zp[4]:8 22.0 +(signed dword) mul16s::return#3 return zp[4]:8 22.0 +(signed dword) mul16s::return#4 return zp[4]:8 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -241,46 +241,46 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:16 101.0 -(word) mul16u::a#1 a zp[2]:16 2.0 -(word) mul16u::a#2 a zp[2]:16 2.0 -(word) mul16u::a#3 a zp[2]:16 67.66666666666666 -(word) mul16u::a#6 a zp[2]:16 6.0 +(word) mul16u::a#0 a zp[2]:12 101.0 +(word) mul16u::a#1 a zp[2]:12 2.0 +(word) mul16u::a#2 a zp[2]:12 2.0 +(word) mul16u::a#3 a zp[2]:12 67.66666666666666 +(word) mul16u::a#6 a zp[2]:12 6.0 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:25 4.0 +(word) mul16u::b#0 b zp[2]:21 4.0 (word) mul16u::b#1 b_1 zp[2]:2 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:4 6.0 -(dword) mul16u::mb#1 mb zp[4]:4 202.0 -(dword) mul16u::mb#2 mb zp[4]:4 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:30 6.0 +(dword) mul16u::mb#1 mb zp[4]:30 202.0 +(dword) mul16u::mb#2 mb zp[4]:30 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:12 202.0 -(dword) mul16u::res#2 res zp[4]:12 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:12 101.0 +(dword) mul16u::res#1 res zp[4]:8 202.0 +(dword) mul16u::res#2 res zp[4]:8 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:8 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:12 4.0 -(dword) mul16u::return#3 return zp[4]:12 4.0 +(dword) mul16u::return#2 return zp[4]:8 4.0 +(dword) mul16u::return#3 return zp[4]:8 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:12 4.0 -(dword~) mulu16_sel::$1 zp[4]:12 4.0 +(dword~) mulu16_sel::$0 zp[4]:8 4.0 +(dword~) mulu16_sel::$1 zp[4]:8 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:36 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:25 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:25 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:21 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:21 4.0 (word) mulu16_sel::return#11 return zp[2]:36 4.0 (word) mulu16_sel::return#12 return zp[2]:36 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:36 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:25 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:25 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:25 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:21 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:21 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:21 12.0 (word) mulu16_sel::v2 (word) mulu16_sel::v2#0 v2 zp[2]:2 4.0 (word) mulu16_sel::v2#1 v2 zp[2]:2 4.0 @@ -289,9 +289,9 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) mulu16_sel::v2#5 v2 zp[2]:2 5.0 (const byte[$100]) plots_per_frame = { fill( $100, 0) } (word) rem16u -(word) rem16u#1 rem16u zp[2]:16 0.8 +(word) rem16u#1 rem16u zp[2]:12 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:12 4.0 +(dword~) sin16s::$4 zp[4]:30 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -306,39 +306,39 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:27 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:23 22.0 -(signed word) sin16s::return#1 return zp[2]:23 5.0 -(signed word~) sin16s::return#5 return zp[2]:23 4.0 +(signed word) sin16s::return#0 return zp[2]:19 22.0 +(signed word) sin16s::return#1 return zp[2]:19 5.0 +(signed word~) sin16s::return#5 return zp[2]:19 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:23 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:19 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:23 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:23 1.0 +(word) sin16s::usinx#0 usinx zp[2]:19 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:19 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:12 8.5 -(dword) sin16s::x#1 x zp[4]:12 4.0 -(dword) sin16s::x#2 x zp[4]:12 4.0 -(dword) sin16s::x#4 x zp[4]:12 5.0 -(dword) sin16s::x#6 x zp[4]:12 6.0 +(dword) sin16s::x#0 x zp[4]:8 8.5 +(dword) sin16s::x#1 x zp[4]:8 4.0 +(dword) sin16s::x#2 x zp[4]:8 4.0 +(dword) sin16s::x#4 x zp[4]:8 5.0 +(dword) sin16s::x#6 x zp[4]:8 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:34 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:25 4.0 +(word) sin16s::x2#0 x2 zp[2]:21 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:25 1.0 +(word) sin16s::x3#0 x3 zp[2]:21 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:36 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:25 4.0 +(word) sin16s::x4#0 x4 zp[2]:21 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:36 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:36 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:12 22.0 -(word~) sin16s_gen2::$9 zp[2]:32 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:8 22.0 +(word~) sin16s_gen2::$9 zp[2]:28 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -348,51 +348,52 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (signed word) sin16s_gen2::ampl (const signed word) sin16s_gen2::ampl#0 ampl = (const signed word) sin16s_gen2::max#0-(const signed word) sin16s_gen2::min#0 (word) sin16s_gen2::i -(word) sin16s_gen2::i#1 i zp[2]:18 22.0 -(word) sin16s_gen2::i#2 i zp[2]:18 2.5384615384615383 +(word) sin16s_gen2::i#1 i zp[2]:14 22.0 +(word) sin16s_gen2::i#2 i zp[2]:14 2.5384615384615383 (signed word) sin16s_gen2::max (const signed word) sin16s_gen2::max#0 max = (signed word) $1001 (signed word) sin16s_gen2::min (const signed word) sin16s_gen2::min#0 min = (signed word) -$1001 (signed word) sin16s_gen2::offs (signed word*) sin16s_gen2::sintab -(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:20 7.333333333333333 -(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:20 3.0 +(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:16 7.333333333333333 +(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:16 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:28 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:24 0.8666666666666666 (word) sin16s_gen2::wavelength (const word) sin16s_gen2::wavelength#0 wavelength = (word) $200 (dword) sin16s_gen2::x -(dword) sin16s_gen2::x#1 x zp[4]:8 11.0 -(dword) sin16s_gen2::x#2 x zp[4]:8 2.75 +(dword) sin16s_gen2::x#1 x zp[4]:4 11.0 +(dword) sin16s_gen2::x#2 x zp[4]:4 2.75 zp[2]:2 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 main::idx_x#3 main::idx_x#10 main::idx_x#1 ] -zp[4]:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte x [ memset::c#4 ] 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[4]:8 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] +zp[4]:4 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 main::$9 main::$14 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] -zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] -zp[2]:20 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +zp[2]:12 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[2]:14 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] +zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[1]:22 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] +zp[1]:18 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ] reg byte alu [ main::$10 ] reg byte alu [ main::$15 ] reg byte x [ bitmap_plot::y#0 ] -zp[2]:23 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::y#0 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16s::a#3 mul16s::a#0 mul16s::$17 sin16s::return#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::usinx#0 ] +zp[2]:19 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::y#0 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16s::a#3 mul16s::a#0 mul16s::$17 sin16s::return#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::usinx#0 ] reg byte a [ bitmap_plot::$2 ] -zp[2]:25 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] +zp[2]:21 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] reg byte a [ mul16u::$1 ] -zp[1]:27 [ bitmap_init::$7 sin16s::isUpper#2 ] +zp[1]:23 [ bitmap_init::$7 ] reg byte a [ bitmap_init::$4 ] reg byte a [ bitmap_init::$5 ] reg byte a [ bitmap_init::$6 ] -zp[4]:28 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:32 [ sin16s_gen2::$9 main::x#0 bitmap_plot::x#0 ] +zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:28 [ sin16s_gen2::$9 main::x#0 bitmap_plot::x#0 ] +zp[4]:30 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:34 [ sin16s::x1#0 mul16s::$13 ] zp[2]:36 [ div32u16u::quotient_hi#0 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 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#2 mul16s::b#1 main::cos_x#0 main::sin_y#0 main::$25 main::$27 main::$26 main::$28 ] reg byte a [ divr16u::$1 ] diff --git a/src/test/ref/bitmap-plot-2.asm b/src/test/ref/bitmap-plot-2.asm index 7c90e1fe3..f21718264 100644 --- a/src/test/ref/bitmap-plot-2.asm +++ b/src/test/ref/bitmap-plot-2.asm @@ -44,8 +44,8 @@ .const PI_HALF_u4f28 = $1921fb54 .label BITMAP = $2000 .label SCREEN = $400 - .label rem16u = $19 - .label frame_cnt = $16 + .label rem16u = $15 + .label frame_cnt = $12 __b1: // Counts frames - updated by the IRQ lda #1 @@ -54,22 +54,22 @@ __b1: rts main: { .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f - .label __10 = $20 - .label __11 = $20 - .label __16 = $17 - .label __17 = $17 + .label __10 = $1c + .label __11 = $1c + .label __16 = $13 + .label __17 = $13 .label __34 = $24 .label __35 = $24 .label cos_x = $24 - .label xpos = $e - .label x = $20 + .label xpos = $a + .label x = $1c .label sin_y = $24 - .label ypos = $e - .label y = $17 + .label ypos = $a + .label y = $13 .label idx_x = 2 - .label idx_y = $12 - .label r = 8 - .label r_add = $1b + .label idx_y = $e + .label r = 4 + .label r_add = $17 .label __36 = $24 .label __37 = $24 jsr sin16s_gen2 @@ -247,11 +247,11 @@ main: { jmp __b7 } // Plot a single dot in the bitmap -// bitmap_plot(word zeropage($20) x, byte register(X) y) +// bitmap_plot(word zeropage($1c) x, byte register(X) y) bitmap_plot: { - .label __1 = $19 - .label plotter = $17 - .label x = $20 + .label __1 = $15 + .label plotter = $13 + .label x = $1c lda bitmap_plot_yhi,x sta.z plotter+1 lda bitmap_plot_ylo,x @@ -279,15 +279,15 @@ bitmap_plot: { } // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage(8) a, signed word zeropage($24) b) +// mul16s(signed word zeropage(4) a, signed word zeropage($24) b) mul16s: { - .label __9 = $19 + .label __9 = $15 .label __13 = $22 - .label __16 = $19 + .label __16 = $15 .label __17 = $22 - .label m = $e - .label return = $e - .label a = 8 + .label m = $a + .label return = $a + .label a = 4 .label b = $24 lda.z a sta.z mul16u.a @@ -344,13 +344,13 @@ mul16s: { rts } // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($19) a, word zeropage($17) b) +// mul16u(word zeropage($15) a, word zeropage($13) b) mul16u: { - .label mb = 4 - .label a = $19 - .label res = $e - .label b = $17 - .label return = $e + .label mb = $1e + .label a = $15 + .label res = $a + .label b = $13 + .label return = $a .label b_1 = 2 lda #0 sta.z res @@ -446,12 +446,12 @@ bitmap_clear: { rts } // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. -// memset(void* zeropage($12) str, byte register(X) c, word zeropage(8) num) +// memset(void* zeropage($e) str, byte register(X) c, word zeropage(4) num) memset: { - .label end = 8 - .label dst = $12 - .label num = 8 - .label str = $12 + .label end = 4 + .label dst = $e + .label num = 4 + .label str = $e lda.z num bne !+ lda.z num+1 @@ -485,7 +485,7 @@ memset: { } // Initialize bitmap plotting tables bitmap_init: { - .label __7 = $1b + .label __7 = $17 .label yoffs = $24 ldx #0 lda #$80 @@ -531,18 +531,18 @@ bitmap_init: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($14) sintab) +// sin16s_gen2(signed word* zeropage($10) sintab) sin16s_gen2: { .label wavelength = $200 .const min = -$1001 .const max = $1001 .const ampl = max-min - .label __6 = $e - .label __9 = $20 - .label step = $1c - .label sintab = $14 - .label x = $a - .label i = $12 + .label __6 = $a + .label __9 = $1c + .label step = $18 + .label sintab = $10 + .label x = 6 + .label i = $e jsr div32u16u lda #PI_u4f28>>$10 bcc b1 @@ -664,12 +663,10 @@ sin16s: { lda.z x+3 sbc #>PI_u4f28>>$10 sta.z x+3 - lda #1 - sta.z isUpper + ldy #1 jmp __b1 b1: - lda #0 - sta.z isUpper + ldy #0 __b1: lda.z x+3 cmp #>PI_HALF_u4f28>>$10 @@ -701,14 +698,26 @@ sin16s: { sbc.z x+3 sta.z x+3 __b2: - ldy #3 - !: + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- lda.z __4+2 sta.z x1 lda.z __4+3 @@ -781,8 +790,7 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - lda.z isUpper - cmp #0 + cpy #0 beq __b3 sec lda #0 @@ -796,14 +804,14 @@ sin16s: { } // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($17) v1, word zeropage(2) v2, byte register(X) select) +// mulu16_sel(word zeropage($13) v1, word zeropage(2) v2, byte register(X) select) mulu16_sel: { - .label __0 = $e - .label __1 = $e - .label v1 = $17 + .label __0 = $a + .label __1 = $a + .label v1 = $13 .label v2 = 2 .label return = $24 - .label return_1 = $17 + .label return_1 = $13 lda.z v1 sta.z mul16u.a lda.z v1+1 @@ -836,8 +844,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $24 - .label quotient_lo = $14 - .label return = $1c + .label quotient_lo = $10 + .label return = $18 lda #>$10 sta.z divr16u.dividend lda #>PI2_u4f28>>$10 @@ -869,12 +877,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($12) dividend, word zeropage($19) rem) +// divr16u(word zeropage($e) dividend, word zeropage($15) rem) divr16u: { - .label rem = $19 - .label dividend = $12 - .label quotient = $14 - .label return = $14 + .label rem = $15 + .label dividend = $e + .label quotient = $10 + .label return = $10 ldx #0 txa sta.z quotient diff --git a/src/test/ref/bitmap-plot-2.log b/src/test/ref/bitmap-plot-2.log index 747f1481b..fe83076b6 100644 --- a/src/test/ref/bitmap-plot-2.log +++ b/src/test/ref/bitmap-plot-2.log @@ -5604,21 +5604,25 @@ sin16s: { __b2: // [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 lda.z x + asl sta.z __4 lda.z x+1 + rol sta.z __4+1 lda.z x+2 + rol sta.z __4+2 lda.z x+3 + rol sta.z __4+3 - ldy #3 - !: asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 // [163] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -6290,8 +6294,7 @@ Statement [156] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [157] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [159] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [160] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:51 [ sin16s::isUpper#2 ] +Statement [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [163] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [164] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [165] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -6425,7 +6428,7 @@ Statement [156] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [157] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [159] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [160] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y +Statement [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [163] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [164] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [165] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:3::sin16s_gen2:6::sin16s:145 [ frame_cnt#0 sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -6496,7 +6499,7 @@ Potential registers zp[2]:41 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_ Potential registers zp[2]:43 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] : zp[2]:43 , Potential registers zp[4]:45 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] : zp[4]:45 , Potential registers zp[2]:49 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] : zp[2]:49 , -Potential registers zp[1]:51 [ sin16s::isUpper#2 ] : zp[1]:51 , reg byte x , +Potential registers zp[1]:51 [ sin16s::isUpper#2 ] : zp[1]:51 , reg byte x , reg byte y , Potential registers zp[4]:52 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] : zp[4]:52 , Potential registers zp[2]:56 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] : zp[2]:56 , Potential registers zp[2]:58 [ 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[2]:58 , @@ -6592,34 +6595,32 @@ Uplift Scope [bitmap_clear] Uplift Scope [init_irq] Uplift Scope [irq] -Uplifting [mul16u] best 27124 combination zp[4]:23 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:27 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:21 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:17 [ mul16u::b#0 ] zp[2]:19 [ mul16u::b#1 ] zp[4]:121 [ mul16u::return#2 ] zp[4]:196 [ mul16u::return#3 ] -Uplifting [main] best 27124 combination zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] zp[2]:71 [ main::$34 ] zp[2]:73 [ main::$36 ] zp[4]:81 [ main::xpos#0 ] zp[2]:87 [ main::$11 ] zp[2]:91 [ main::$35 ] zp[2]:93 [ main::$37 ] zp[4]:101 [ main::ypos#0 ] zp[2]:107 [ main::$17 ] zp[2]:2 [ main::idx_x#11 main::idx_x#10 main::idx_x#1 ] zp[2]:6 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] zp[2]:75 [ main::cos_x#0 ] zp[2]:85 [ main::$10 ] zp[2]:95 [ main::sin_y#0 ] zp[2]:105 [ main::$16 ] zp[2]:109 [ main::y#0 ] zp[2]:4 [ main::r#10 main::r#1 ] zp[2]:89 [ main::x#0 ] -Uplifting [divr16u] best 26914 combination zp[2]:63 [ 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[2]:67 [ 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[2]:65 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:210 [ divr16u::return#2 ] zp[2]:214 [ divr16u::return#3 ] -Uplifting [mul16s] best 26914 combination zp[2]:9 [ mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 ] zp[2]:11 [ mul16s::b#3 mul16s::b#1 mul16s::b#2 ] zp[4]:77 [ mul16s::return#3 ] zp[4]:97 [ mul16s::return#4 ] zp[4]:154 [ mul16s::return#2 ] zp[4]:13 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 ] zp[4]:133 [ mul16s::return#0 ] zp[2]:125 [ mul16s::$9 ] zp[2]:127 [ mul16s::$16 ] zp[2]:129 [ mul16s::$13 ] zp[2]:131 [ mul16s::$17 ] -Uplifting [bitmap_init] best 26404 combination zp[2]:41 [ 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[1]:142 [ bitmap_init::$5 ] zp[1]:143 [ bitmap_init::$6 ] zp[1]:140 [ bitmap_init::$7 ] +Uplifting [mul16u] best 27146 combination zp[4]:23 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:27 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:21 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:17 [ mul16u::b#0 ] zp[2]:19 [ mul16u::b#1 ] zp[4]:121 [ mul16u::return#2 ] zp[4]:196 [ mul16u::return#3 ] +Uplifting [main] best 27146 combination zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] zp[2]:71 [ main::$34 ] zp[2]:73 [ main::$36 ] zp[4]:81 [ main::xpos#0 ] zp[2]:87 [ main::$11 ] zp[2]:91 [ main::$35 ] zp[2]:93 [ main::$37 ] zp[4]:101 [ main::ypos#0 ] zp[2]:107 [ main::$17 ] zp[2]:2 [ main::idx_x#11 main::idx_x#10 main::idx_x#1 ] zp[2]:6 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] zp[2]:75 [ main::cos_x#0 ] zp[2]:85 [ main::$10 ] zp[2]:95 [ main::sin_y#0 ] zp[2]:105 [ main::$16 ] zp[2]:109 [ main::y#0 ] zp[2]:4 [ main::r#10 main::r#1 ] zp[2]:89 [ main::x#0 ] +Uplifting [divr16u] best 26936 combination zp[2]:63 [ 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[2]:67 [ 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[2]:65 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:210 [ divr16u::return#2 ] zp[2]:214 [ divr16u::return#3 ] +Uplifting [mul16s] best 26936 combination zp[2]:9 [ mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 ] zp[2]:11 [ mul16s::b#3 mul16s::b#1 mul16s::b#2 ] zp[4]:77 [ mul16s::return#3 ] zp[4]:97 [ mul16s::return#4 ] zp[4]:154 [ mul16s::return#2 ] zp[4]:13 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 ] zp[4]:133 [ mul16s::return#0 ] zp[2]:125 [ mul16s::$9 ] zp[2]:127 [ mul16s::$16 ] zp[2]:129 [ mul16s::$13 ] zp[2]:131 [ mul16s::$17 ] +Uplifting [bitmap_init] best 26426 combination zp[2]:41 [ 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[1]:142 [ bitmap_init::$5 ] zp[1]:143 [ bitmap_init::$6 ] zp[1]:140 [ bitmap_init::$7 ] Limited combination testing to 100 combinations of 15360 possible. -Uplifting [sin16s] best 26404 combination zp[4]:52 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:152 [ sin16s::return#0 ] zp[2]:56 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:164 [ sin16s::$4 ] zp[2]:172 [ sin16s::x2#0 ] zp[2]:180 [ sin16s::x3_6#0 ] zp[2]:186 [ sin16s::x4#0 ] zp[2]:190 [ sin16s::x5#0 ] zp[2]:192 [ sin16s::x5_128#0 ] zp[2]:176 [ sin16s::x3#0 ] zp[2]:194 [ sin16s::usinx#1 ] zp[2]:168 [ sin16s::x1#0 ] zp[2]:182 [ sin16s::usinx#0 ] zp[1]:51 [ sin16s::isUpper#2 ] -Uplifting [sin16s_gen2] best 26404 combination zp[2]:43 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:158 [ sin16s_gen2::$6 ] zp[4]:45 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:162 [ sin16s_gen2::$9 ] zp[2]:49 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:148 [ sin16s_gen2::step#0 ] -Uplifting [mulu16_sel] best 26388 combination zp[2]:58 [ 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[2]:60 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:170 [ mulu16_sel::return#0 ] zp[2]:174 [ mulu16_sel::return#1 ] zp[2]:178 [ mulu16_sel::return#2 ] zp[2]:184 [ mulu16_sel::return#10 ] zp[2]:188 [ mulu16_sel::return#11 ] zp[4]:200 [ mulu16_sel::$0 ] zp[4]:204 [ mulu16_sel::$1 ] zp[2]:208 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [memset] best 26372 combination zp[2]:36 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:138 [ memset::end#0 ] zp[2]:31 [ memset::num#2 ] reg byte x [ memset::c#4 ] zp[2]:33 [ memset::str#3 ] -Uplifting [] best 26372 combination zp[1]:70 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] zp[2]:224 [ rem16u#1 ] -Uplifting [bitmap_plot] best 26355 combination reg byte x [ bitmap_plot::y#0 ] zp[2]:116 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp[2]:112 [ bitmap_plot::x#0 ] zp[2]:118 [ bitmap_plot::plotter#1 ] zp[2]:114 [ bitmap_plot::plotter#0 ] -Uplifting [div32u16u] best 26355 combination zp[4]:144 [ div32u16u::return#2 ] zp[2]:216 [ div32u16u::quotient_lo#0 ] zp[4]:218 [ div32u16u::return#0 ] zp[2]:212 [ div32u16u::quotient_hi#0 ] -Uplifting [bitmap_clear] best 26355 combination -Uplifting [init_irq] best 26355 combination -Uplifting [irq] best 26355 combination +Uplifting [sin16s] best 26417 combination zp[4]:52 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:152 [ sin16s::return#0 ] zp[2]:56 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:164 [ sin16s::$4 ] zp[2]:172 [ sin16s::x2#0 ] zp[2]:180 [ sin16s::x3_6#0 ] zp[2]:186 [ sin16s::x4#0 ] zp[2]:190 [ sin16s::x5#0 ] zp[2]:192 [ sin16s::x5_128#0 ] zp[2]:176 [ sin16s::x3#0 ] zp[2]:194 [ sin16s::usinx#1 ] zp[2]:168 [ sin16s::x1#0 ] zp[2]:182 [ sin16s::usinx#0 ] reg byte y [ sin16s::isUpper#2 ] +Uplifting [sin16s_gen2] best 26417 combination zp[2]:43 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:158 [ sin16s_gen2::$6 ] zp[4]:45 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:162 [ sin16s_gen2::$9 ] zp[2]:49 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:148 [ sin16s_gen2::step#0 ] +Uplifting [mulu16_sel] best 26401 combination zp[2]:58 [ 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[2]:60 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:170 [ mulu16_sel::return#0 ] zp[2]:174 [ mulu16_sel::return#1 ] zp[2]:178 [ mulu16_sel::return#2 ] zp[2]:184 [ mulu16_sel::return#10 ] zp[2]:188 [ mulu16_sel::return#11 ] zp[4]:200 [ mulu16_sel::$0 ] zp[4]:204 [ mulu16_sel::$1 ] zp[2]:208 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [memset] best 26385 combination zp[2]:36 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:138 [ memset::end#0 ] zp[2]:31 [ memset::num#2 ] reg byte x [ memset::c#4 ] zp[2]:33 [ memset::str#3 ] +Uplifting [] best 26385 combination zp[1]:70 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] zp[2]:224 [ rem16u#1 ] +Uplifting [bitmap_plot] best 26368 combination reg byte x [ bitmap_plot::y#0 ] zp[2]:116 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp[2]:112 [ bitmap_plot::x#0 ] zp[2]:118 [ bitmap_plot::plotter#1 ] zp[2]:114 [ bitmap_plot::plotter#0 ] +Uplifting [div32u16u] best 26368 combination zp[4]:144 [ div32u16u::return#2 ] zp[2]:216 [ div32u16u::quotient_lo#0 ] zp[4]:218 [ div32u16u::return#0 ] zp[2]:212 [ div32u16u::quotient_hi#0 ] +Uplifting [bitmap_clear] best 26368 combination +Uplifting [init_irq] best 26368 combination +Uplifting [irq] best 26368 combination Attempting to uplift remaining variables inzp[1]:70 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] -Uplifting [] best 26355 combination zp[1]:70 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] +Uplifting [] best 26368 combination zp[1]:70 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] Attempting to uplift remaining variables inzp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] -Uplifting [main] best 26355 combination zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] +Uplifting [main] best 26368 combination zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] Attempting to uplift remaining variables inzp[1]:142 [ bitmap_init::$5 ] -Uplifting [bitmap_init] best 26295 combination reg byte a [ bitmap_init::$5 ] +Uplifting [bitmap_init] best 26308 combination reg byte a [ bitmap_init::$5 ] Attempting to uplift remaining variables inzp[1]:143 [ bitmap_init::$6 ] -Uplifting [bitmap_init] best 26235 combination reg byte a [ bitmap_init::$6 ] +Uplifting [bitmap_init] best 26248 combination reg byte a [ bitmap_init::$6 ] Attempting to uplift remaining variables inzp[1]:140 [ bitmap_init::$7 ] -Uplifting [bitmap_init] best 26235 combination zp[1]:140 [ bitmap_init::$7 ] -Attempting to uplift remaining variables inzp[1]:51 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 26235 combination zp[1]:51 [ sin16s::isUpper#2 ] +Uplifting [bitmap_init] best 26248 combination zp[1]:140 [ bitmap_init::$7 ] Coalescing zero page register [ zp[2]:4 [ main::r#10 main::r#1 ] ] with [ zp[2]:9 [ mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 ] ] - score: 2 Coalescing zero page register [ zp[2]:56 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp[2]:194 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register [ zp[2]:58 [ 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[2]:176 [ sin16s::x3#0 ] ] - score: 2 @@ -6632,7 +6633,6 @@ Coalescing zero page register [ zp[2]:19 [ mul16u::b#1 ] ] with [ zp[2]:60 [ mul Coalescing zero page register [ zp[4]:23 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] ] with [ zp[4]:196 [ mul16u::return#3 ] ] - score: 1 Coalescing zero page register [ zp[2]:31 [ memset::num#2 ] ] with [ zp[2]:138 [ memset::end#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:33 [ memset::str#3 ] ] with [ zp[2]:36 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1 -Coalescing zero page register [ zp[4]:52 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:164 [ sin16s::$4 ] ] - score: 1 Coalescing zero page register [ zp[2]:56 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 ] ] with [ zp[2]:152 [ sin16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:58 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 ] ] with [ zp[2]:172 [ sin16s::x2#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:58 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 ] ] with [ zp[2]:186 [ sin16s::x4#0 ] ] - score: 1 @@ -6676,35 +6676,35 @@ Coalescing zero page register [ zp[2]:19 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_s Coalescing zero page register [ zp[2]:31 [ memset::num#2 memset::end#0 ] ] with [ zp[2]:4 [ main::r#10 main::r#1 mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s::usinx#0 ] ] Coalescing zero page register [ zp[2]:33 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] with [ zp[2]:6 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] ] Coalescing zero page register [ zp[2]:41 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] ] with [ zp[2]:11 [ mul16s::b#3 mul16s::b#1 mul16s::b#2 main::cos_x#0 main::sin_y#0 main::$34 main::$36 main::$35 main::$37 ] ] -Coalescing zero page register [ zp[1]:51 [ sin16s::isUpper#2 ] ] with [ zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] ] -Coalescing zero page register [ zp[4]:52 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] ] with [ zp[4]:13 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] ] +Coalescing zero page register [ zp[4]:52 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:13 [ mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] ] Coalescing zero page register [ zp[2]:58 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] ] with [ zp[2]:17 [ mul16u::b#0 ] ] Coalescing zero page register [ zp[2]:63 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 ] ] with [ zp[2]:21 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] ] Coalescing zero page register [ zp[2]:65 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] ] with [ zp[2]:43 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] ] Coalescing zero page register [ zp[2]:67 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ] ] with [ zp[2]:49 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] ] Coalescing zero page register [ zp[2]:114 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ] ] with [ zp[2]:105 [ main::$16 main::$17 main::y#0 ] ] Coalescing zero page register [ zp[2]:125 [ mul16s::$9 mul16s::$16 ] ] with [ zp[2]:116 [ bitmap_plot::$1 ] ] +Coalescing zero page register [ zp[1]:140 [ bitmap_init::$7 ] ] with [ zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] ] Coalescing zero page register [ zp[2]:162 [ sin16s_gen2::$9 ] ] with [ zp[2]:85 [ main::$10 main::$11 main::x#0 bitmap_plot::x#0 ] ] +Coalescing zero page register [ zp[4]:164 [ sin16s::$4 ] ] with [ zp[4]:27 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] ] Coalescing zero page register [ zp[2]:168 [ sin16s::x1#0 ] ] with [ zp[2]:129 [ mul16s::$13 mul16s::$17 ] ] Coalescing zero page register [ zp[2]:212 [ div32u16u::quotient_hi#0 ] ] with [ zp[2]:170 [ 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 ] ] Coalescing zero page register [ zp[2]:65 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 ] ] with [ zp[2]:33 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] ] Coalescing zero page register [ zp[2]:114 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::$16 main::$17 main::y#0 ] ] with [ zp[2]:58 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] ] Coalescing zero page register [ zp[2]:125 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 ] ] with [ zp[2]:63 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] ] -Coalescing zero page register [ zp[1]:140 [ bitmap_init::$7 ] ] with [ zp[1]:51 [ sin16s::isUpper#2 main::r_add#10 main::r_add#12 main::r_add#1 ] ] Coalescing zero page register [ zp[2]:212 [ div32u16u::quotient_hi#0 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 ] ] with [ zp[2]:41 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#1 mul16s::b#2 main::cos_x#0 main::sin_y#0 main::$34 main::$36 main::$35 main::$37 ] ] Allocated (was zp[2]:19) zp[2]:2 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 main::idx_x#11 main::idx_x#10 main::idx_x#1 ] -Allocated (was zp[4]:27) zp[4]:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -Allocated (was zp[2]:31) zp[2]:8 [ memset::num#2 memset::end#0 main::r#10 main::r#1 mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s::usinx#0 ] -Allocated (was zp[4]:45) zp[4]:10 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -Allocated (was zp[4]:52) zp[4]:14 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] -Allocated (was zp[2]:65) zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] -Allocated (was zp[2]:67) zp[2]:20 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] -Allocated (was zp[1]:70) zp[1]:22 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] -Allocated (was zp[2]:114) zp[2]:23 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::$16 main::$17 main::y#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] -Allocated (was zp[2]:125) zp[2]:25 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] -Allocated (was zp[1]:140) zp[1]:27 [ bitmap_init::$7 sin16s::isUpper#2 main::r_add#10 main::r_add#12 main::r_add#1 ] -Allocated (was zp[4]:144) zp[4]:28 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -Allocated (was zp[2]:162) zp[2]:32 [ sin16s_gen2::$9 main::$10 main::$11 main::x#0 bitmap_plot::x#0 ] +Allocated (was zp[2]:31) zp[2]:4 [ memset::num#2 memset::end#0 main::r#10 main::r#1 mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s::usinx#0 ] +Allocated (was zp[4]:45) zp[4]:6 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +Allocated (was zp[4]:52) zp[4]:10 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +Allocated (was zp[2]:65) zp[2]:14 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] +Allocated (was zp[2]:67) zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +Allocated (was zp[1]:70) zp[1]:18 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] +Allocated (was zp[2]:114) zp[2]:19 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::$16 main::$17 main::y#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] +Allocated (was zp[2]:125) zp[2]:21 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +Allocated (was zp[1]:140) zp[1]:23 [ bitmap_init::$7 main::r_add#10 main::r_add#12 main::r_add#1 ] +Allocated (was zp[4]:144) zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +Allocated (was zp[2]:162) zp[2]:28 [ sin16s_gen2::$9 main::$10 main::$11 main::x#0 bitmap_plot::x#0 ] +Allocated (was zp[4]:164) zp[4]:30 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] Allocated (was zp[2]:168) zp[2]:34 [ sin16s::x1#0 mul16s::$13 mul16s::$17 ] Allocated (was zp[2]:212) zp[2]:36 [ div32u16u::quotient_hi#0 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 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#1 mul16s::b#2 main::cos_x#0 main::sin_y#0 main::$34 main::$36 main::$35 main::$37 ] Interrupt procedure irq clobbers ACNZ @@ -6765,8 +6765,8 @@ ASSEMBLER BEFORE OPTIMIZATION .const PI_HALF_u4f28 = $1921fb54 .label BITMAP = $2000 .label SCREEN = $400 - .label rem16u = $19 - .label frame_cnt = $16 + .label rem16u = $15 + .label frame_cnt = $12 // @begin __bbegin: jmp __b1 @@ -6793,22 +6793,22 @@ __bend: // main main: { .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f - .label __10 = $20 - .label __11 = $20 - .label __16 = $17 - .label __17 = $17 + .label __10 = $1c + .label __11 = $1c + .label __16 = $13 + .label __17 = $13 .label __34 = $24 .label __35 = $24 .label cos_x = $24 - .label xpos = $e - .label x = $20 + .label xpos = $a + .label x = $1c .label sin_y = $24 - .label ypos = $e - .label y = $17 + .label ypos = $a + .label y = $13 .label idx_x = 2 - .label idx_y = $12 - .label r = 8 - .label r_add = $1b + .label idx_y = $e + .label r = 4 + .label r_add = $17 .label __36 = $24 .label __37 = $24 // [6] call sin16s_gen2 @@ -7139,11 +7139,11 @@ main: { } // bitmap_plot // Plot a single dot in the bitmap -// bitmap_plot(word zeropage($20) x, byte register(X) y) +// bitmap_plot(word zeropage($1c) x, byte register(X) y) bitmap_plot: { - .label __1 = $19 - .label plotter = $17 - .label x = $20 + .label __1 = $15 + .label plotter = $13 + .label x = $1c // [57] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx lda bitmap_plot_yhi,x sta.z plotter+1 @@ -7182,15 +7182,15 @@ bitmap_plot: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage(8) a, signed word zeropage($24) b) +// mul16s(signed word zeropage(4) a, signed word zeropage($24) b) mul16s: { - .label __9 = $19 + .label __9 = $15 .label __13 = $22 - .label __16 = $19 + .label __16 = $15 .label __17 = $22 - .label m = $e - .label return = $e - .label a = 8 + .label m = $a + .label return = $a + .label a = 4 .label b = $24 // [64] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3 -- vwuz1=vwuz2 lda.z a @@ -7291,13 +7291,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($19) a, word zeropage($17) b) +// mul16u(word zeropage($15) a, word zeropage($13) b) mul16u: { - .label mb = 4 - .label a = $19 - .label res = $e - .label b = $17 - .label return = $e + .label mb = $1e + .label a = $15 + .label res = $a + .label b = $13 + .label return = $a .label b_1 = 2 // [82] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] __b1_from_mul16u: @@ -7463,12 +7463,12 @@ bitmap_clear: { } // memset // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. -// memset(void* zeropage($12) str, byte register(X) c, word zeropage(8) num) +// memset(void* zeropage($e) str, byte register(X) c, word zeropage(4) num) memset: { - .label end = 8 - .label dst = $12 - .label num = 8 - .label str = $12 + .label end = 4 + .label dst = $e + .label num = 4 + .label str = $e // [107] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 lda.z num bne !+ @@ -7522,7 +7522,7 @@ memset: { // bitmap_init // Initialize bitmap plotting tables bitmap_init: { - .label __7 = $1b + .label __7 = $17 .label yoffs = $24 // [116] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] __b1_from_bitmap_init: @@ -7633,18 +7633,18 @@ bitmap_init: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($14) sintab) +// sin16s_gen2(signed word* zeropage($10) sintab) sin16s_gen2: { .label wavelength = $200 .const min = -$1001 .const max = $1001 .const ampl = max-min - .label __6 = $e - .label __9 = $20 - .label step = $1c - .label sintab = $14 - .label x = $a - .label i = $12 + .label __6 = $a + .label __9 = $1c + .label step = $18 + .label sintab = $10 + .label x = 6 + .label i = $e // [138] call div32u16u // [205] phi from sin16s_gen2 to div32u16u [phi:sin16s_gen2->div32u16u] div32u16u_from_sin16s_gen2: @@ -7774,21 +7774,20 @@ sin16s_gen2: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($e) x) +// sin16s(dword zeropage($a) x) sin16s: { - .label __4 = $e - .label x = $e - .label return = 8 + .label __4 = $1e + .label x = $a + .label return = 4 .label x1 = $22 - .label x2 = $17 - .label x3 = $17 + .label x2 = $13 + .label x3 = $13 .label x3_6 = $24 - .label usinx = 8 - .label x4 = $17 + .label usinx = 4 + .label x4 = $13 .label x5 = $24 .label x5_128 = $24 - .label sinx = 8 - .label isUpper = $1b + .label sinx = 4 // [156] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 cmp #>PI_u4f28>>$10 @@ -7825,16 +7824,14 @@ sin16s: { sta.z x+3 // [158] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] __b1_from___b4: - // [158] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [158] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [158] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [158] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] __b1_from_sin16s: - // [158] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [158] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [158] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy jmp __b1 // sin16s::@1 @@ -7880,15 +7877,27 @@ sin16s: { jmp __b2 // sin16s::@2 __b2: - // [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // [163] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -8029,9 +8038,8 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - // [191] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [191] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b12 jmp __b6 // sin16s::@6 @@ -8064,14 +8072,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($17) v1, word zeropage(2) v2, byte register(X) select) +// mulu16_sel(word zeropage($13) v1, word zeropage(2) v2, byte register(X) select) mulu16_sel: { - .label __0 = $e - .label __1 = $e - .label v1 = $17 + .label __0 = $a + .label __1 = $a + .label v1 = $13 .label v2 = 2 .label return = $24 - .label return_1 = $17 + .label return_1 = $13 // [197] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 sta.z mul16u.a @@ -8123,8 +8131,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $24 - .label quotient_lo = $14 - .label return = $1c + .label quotient_lo = $10 + .label return = $18 // [206] call divr16u // [215] phi from div32u16u to divr16u [phi:div32u16u->divr16u] divr16u_from_div32u16u: @@ -8184,12 +8192,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($12) dividend, word zeropage($19) rem) +// divr16u(word zeropage($e) dividend, word zeropage($15) rem) divr16u: { - .label rem = $19 - .label dividend = $12 - .label quotient = $14 - .label return = $14 + .label rem = $15 + .label dividend = $e + .label quotient = $10 + .label return = $10 // [216] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] __b1_from_divr16u: // [216] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 @@ -8654,7 +8662,7 @@ FINAL SYMBOL TABLE (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 zp[1]:27 5.5 +(byte~) bitmap_init::$7 zp[1]:23 5.5 (label) bitmap_init::@1 (label) bitmap_init::@2 (label) bitmap_init::@3 @@ -8679,14 +8687,14 @@ FINAL SYMBOL TABLE (byte*) bitmap_init::yoffs#2 yoffs zp[2]:36 6.875 (byte*) bitmap_init::yoffs#4 yoffs zp[2]:36 11.0 (void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) -(word~) bitmap_plot::$1 zp[2]:25 4.0 +(word~) bitmap_plot::$1 zp[2]:21 4.0 (byte~) bitmap_plot::$2 reg byte a 4.0 (label) bitmap_plot::@return (byte*) bitmap_plot::plotter -(word) bitmap_plot::plotter#0 plotter zp[2]:23 1.0 -(byte*) bitmap_plot::plotter#1 plotter zp[2]:23 3.0 +(word) bitmap_plot::plotter#0 plotter zp[2]:19 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp[2]:19 3.0 (word) bitmap_plot::x -(word) bitmap_plot::x#0 x zp[2]:32 3.75 +(word) bitmap_plot::x#0 x zp[2]:28 3.75 (byte) bitmap_plot::y (byte) bitmap_plot::y#0 reg byte x 7.5 (const byte[$100]) bitmap_plot_bit = { fill( $100, 0) } @@ -8703,10 +8711,10 @@ FINAL SYMBOL TABLE (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:36 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:20 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:16 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:28 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:28 4.0 +(dword) div32u16u::return#0 return zp[4]:24 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:24 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -8718,34 +8726,34 @@ FINAL SYMBOL TABLE (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:18 2.75 -(word) divr16u::dividend#3 dividend zp[2]:18 5.0 -(word) divr16u::dividend#5 dividend zp[2]:18 2.0 +(word) divr16u::dividend#0 dividend zp[2]:14 2.75 +(word) divr16u::dividend#3 dividend zp[2]:14 5.0 +(word) divr16u::dividend#5 dividend zp[2]:14 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:20 16.5 -(word) divr16u::quotient#2 quotient zp[2]:20 11.0 -(word) divr16u::quotient#3 quotient zp[2]:20 2.75 +(word) divr16u::quotient#1 quotient zp[2]:16 16.5 +(word) divr16u::quotient#2 quotient zp[2]:16 11.0 +(word) divr16u::quotient#3 quotient zp[2]:16 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:25 8.25 -(word) divr16u::rem#1 rem zp[2]:25 22.0 -(word) divr16u::rem#10 rem zp[2]:25 4.0 -(word) divr16u::rem#11 rem zp[2]:25 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:25 22.0 -(word) divr16u::rem#4 rem zp[2]:25 4.0 -(word) divr16u::rem#5 rem zp[2]:25 24.0 -(word) divr16u::rem#6 rem zp[2]:25 11.0 +(word) divr16u::rem#0 rem zp[2]:21 8.25 +(word) divr16u::rem#1 rem zp[2]:21 22.0 +(word) divr16u::rem#10 rem zp[2]:21 4.0 +(word) divr16u::rem#11 rem zp[2]:21 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:21 22.0 +(word) divr16u::rem#4 rem zp[2]:21 4.0 +(word) divr16u::rem#5 rem zp[2]:21 24.0 +(word) divr16u::rem#6 rem zp[2]:21 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:20 5.285714285714286 -(word) divr16u::return#2 return zp[2]:20 4.0 -(word) divr16u::return#3 return zp[2]:20 4.0 +(word) divr16u::return#0 return zp[2]:16 5.285714285714286 +(word) divr16u::return#2 return zp[2]:16 4.0 +(word) divr16u::return#3 return zp[2]:16 4.0 (byte) frame_cnt -(byte) frame_cnt#0 frame_cnt zp[1]:22 0.5454545454545455 -(byte) frame_cnt#1 frame_cnt zp[1]:22 4.0 -(byte) frame_cnt#2 frame_cnt zp[1]:22 40.0 +(byte) frame_cnt#0 frame_cnt zp[1]:18 0.5454545454545455 +(byte) frame_cnt#1 frame_cnt zp[1]:18 4.0 +(byte) frame_cnt#2 frame_cnt zp[1]:18 40.0 (void()) init_irq() (label) init_irq::@return interrupt(HARDWARE_CLOBBER)(void()) irq() @@ -8753,10 +8761,10 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) irq::@2 (label) irq::@return (void()) main() -(word~) main::$10 zp[2]:32 11.0 -(signed word~) main::$11 zp[2]:32 22.0 -(word~) main::$16 zp[2]:23 11.0 -(signed word~) main::$17 zp[2]:23 22.0 +(word~) main::$10 zp[2]:28 11.0 +(signed word~) main::$11 zp[2]:28 22.0 +(word~) main::$16 zp[2]:19 11.0 +(signed word~) main::$17 zp[2]:19 22.0 (word~) main::$34 zp[2]:36 22.0 (word~) main::$35 zp[2]:36 22.0 (signed word*~) main::$36 zp[2]:36 22.0 @@ -8785,16 +8793,16 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) main::idx_x#10 idx_x zp[2]:2 3.0 (word) main::idx_x#11 idx_x zp[2]:2 1.222222222222222 (word) main::idx_y -(word) main::idx_y#1 idx_y zp[2]:18 11.0 -(word) main::idx_y#10 idx_y zp[2]:18 3.142857142857143 -(word) main::idx_y#3 idx_y zp[2]:18 1.064516129032258 +(word) main::idx_y#1 idx_y zp[2]:14 11.0 +(word) main::idx_y#10 idx_y zp[2]:14 3.142857142857143 +(word) main::idx_y#3 idx_y zp[2]:14 1.064516129032258 (signed word) main::r -(signed word) main::r#1 r zp[2]:8 5.5 -(signed word) main::r#10 r zp[2]:8 1.2571428571428571 +(signed word) main::r#1 r zp[2]:4 5.5 +(signed word) main::r#10 r zp[2]:4 1.2571428571428571 (byte) main::r_add -(byte) main::r_add#1 r_add zp[1]:27 22.0 -(byte) main::r_add#10 r_add zp[1]:27 2.026315789473684 -(byte) main::r_add#12 r_add zp[1]:27 16.5 +(byte) main::r_add#1 r_add zp[1]:23 22.0 +(byte) main::r_add#10 r_add zp[1]:23 2.026315789473684 +(byte) main::r_add#12 r_add zp[1]:23 16.5 (signed word) main::sin_y (signed word) main::sin_y#0 sin_y zp[2]:36 11.0 (label) main::toD0181 @@ -8803,13 +8811,13 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x -(signed word) main::x#0 x zp[2]:32 0.8461538461538461 +(signed word) main::x#0 x zp[2]:28 0.8461538461538461 (signed dword) main::xpos -(signed dword) main::xpos#0 xpos zp[4]:14 22.0 +(signed dword) main::xpos#0 xpos zp[4]:10 22.0 (word) main::y -(signed word) main::y#0 y zp[2]:23 11.0 +(signed word) main::y#0 y zp[2]:19 11.0 (signed dword) main::ypos -(signed dword) main::ypos#0 ypos zp[4]:14 22.0 +(signed dword) main::ypos#0 ypos zp[4]:10 22.0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 @@ -8818,21 +8826,21 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (byte) memset::c (byte) memset::c#4 reg byte x 1.375 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:18 22.0 -(byte*) memset::dst#2 dst zp[2]:18 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:18 4.0 +(byte*) memset::dst#1 dst zp[2]:14 22.0 +(byte*) memset::dst#2 dst zp[2]:14 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:14 4.0 (byte*) memset::end -(byte*) memset::end#0 end zp[2]:8 2.1666666666666665 +(byte*) memset::end#0 end zp[2]:4 2.1666666666666665 (word) memset::num -(word) memset::num#2 num zp[2]:8 2.0 +(word) memset::num#2 num zp[2]:4 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:18 +(void*) memset::str#3 str zp[2]:14 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$13 zp[2]:34 4.0 -(word~) mul16s::$16 zp[2]:25 4.0 +(word~) mul16s::$16 zp[2]:21 4.0 (word~) mul16s::$17 zp[2]:34 4.0 -(word~) mul16s::$9 zp[2]:25 4.0 +(word~) mul16s::$9 zp[2]:21 4.0 (label) mul16s::@1 (label) mul16s::@2 (label) mul16s::@3 @@ -8840,25 +8848,25 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16s::@5 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:8 22.0 -(signed word) mul16s::a#1 a zp[2]:8 11.0 -(signed word) mul16s::a#2 a zp[2]:8 11.0 -(signed word) mul16s::a#3 a zp[2]:8 2.692307692307692 +(signed word) mul16s::a#0 a zp[2]:4 22.0 +(signed word) mul16s::a#1 a zp[2]:4 11.0 +(signed word) mul16s::a#2 a zp[2]:4 11.0 +(signed word) mul16s::a#3 a zp[2]:4 2.692307692307692 (signed word) mul16s::b (signed word) mul16s::b#1 b zp[2]:36 22.0 (signed word) mul16s::b#2 b zp[2]:36 22.0 (signed word) mul16s::b#3 b zp[2]:36 2.1818181818181817 (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:14 2.0 -(dword) mul16s::m#1 m zp[4]:14 4.0 -(dword) mul16s::m#2 m zp[4]:14 4.0 -(dword) mul16s::m#4 m zp[4]:14 4.0 -(dword) mul16s::m#5 m zp[4]:14 2.5 +(dword) mul16s::m#0 m zp[4]:10 2.0 +(dword) mul16s::m#1 m zp[4]:10 4.0 +(dword) mul16s::m#2 m zp[4]:10 4.0 +(dword) mul16s::m#4 m zp[4]:10 4.0 +(dword) mul16s::m#5 m zp[4]:10 2.5 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:14 7.000000000000001 -(signed dword) mul16s::return#2 return zp[4]:14 22.0 -(signed dword) mul16s::return#3 return zp[4]:14 22.0 -(signed dword) mul16s::return#4 return zp[4]:14 22.0 +(signed dword) mul16s::return#0 return zp[4]:10 7.000000000000001 +(signed dword) mul16s::return#2 return zp[4]:10 22.0 +(signed dword) mul16s::return#3 return zp[4]:10 22.0 +(signed dword) mul16s::return#4 return zp[4]:10 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -8867,46 +8875,46 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:25 101.0 -(word) mul16u::a#1 a zp[2]:25 2.0 -(word) mul16u::a#2 a zp[2]:25 2.0 -(word) mul16u::a#3 a zp[2]:25 67.66666666666666 -(word) mul16u::a#6 a zp[2]:25 6.0 +(word) mul16u::a#0 a zp[2]:21 101.0 +(word) mul16u::a#1 a zp[2]:21 2.0 +(word) mul16u::a#2 a zp[2]:21 2.0 +(word) mul16u::a#3 a zp[2]:21 67.66666666666666 +(word) mul16u::a#6 a zp[2]:21 6.0 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:23 4.0 +(word) mul16u::b#0 b zp[2]:19 4.0 (word) mul16u::b#1 b_1 zp[2]:2 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:4 6.0 -(dword) mul16u::mb#1 mb zp[4]:4 202.0 -(dword) mul16u::mb#2 mb zp[4]:4 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:30 6.0 +(dword) mul16u::mb#1 mb zp[4]:30 202.0 +(dword) mul16u::mb#2 mb zp[4]:30 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:14 202.0 -(dword) mul16u::res#2 res zp[4]:14 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:14 101.0 +(dword) mul16u::res#1 res zp[4]:10 202.0 +(dword) mul16u::res#2 res zp[4]:10 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:10 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:14 4.0 -(dword) mul16u::return#3 return zp[4]:14 4.0 +(dword) mul16u::return#2 return zp[4]:10 4.0 +(dword) mul16u::return#3 return zp[4]:10 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:14 4.0 -(dword~) mulu16_sel::$1 zp[4]:14 4.0 +(dword~) mulu16_sel::$0 zp[4]:10 4.0 +(dword~) mulu16_sel::$1 zp[4]:10 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:36 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:23 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:19 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:19 4.0 (word) mulu16_sel::return#11 return zp[2]:36 4.0 (word) mulu16_sel::return#12 return zp[2]:36 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:36 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:23 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:23 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:19 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:19 12.0 (word) mulu16_sel::v2 (word) mulu16_sel::v2#0 v2 zp[2]:2 4.0 (word) mulu16_sel::v2#1 v2 zp[2]:2 4.0 @@ -8915,9 +8923,9 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) mulu16_sel::v2#5 v2 zp[2]:2 5.0 (const byte[$100]) plots_per_frame = { fill( $100, 0) } (word) rem16u -(word) rem16u#1 rem16u zp[2]:25 0.8 +(word) rem16u#1 rem16u zp[2]:21 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:14 4.0 +(dword~) sin16s::$4 zp[4]:30 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -8932,39 +8940,39 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:27 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:8 22.0 -(signed word) sin16s::return#1 return zp[2]:8 5.0 -(signed word~) sin16s::return#5 return zp[2]:8 4.0 +(signed word) sin16s::return#0 return zp[2]:4 22.0 +(signed word) sin16s::return#1 return zp[2]:4 5.0 +(signed word~) sin16s::return#5 return zp[2]:4 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:8 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:4 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:8 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:8 1.0 +(word) sin16s::usinx#0 usinx zp[2]:4 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:4 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:14 8.5 -(dword) sin16s::x#1 x zp[4]:14 4.0 -(dword) sin16s::x#2 x zp[4]:14 4.0 -(dword) sin16s::x#4 x zp[4]:14 5.0 -(dword) sin16s::x#6 x zp[4]:14 6.0 +(dword) sin16s::x#0 x zp[4]:10 8.5 +(dword) sin16s::x#1 x zp[4]:10 4.0 +(dword) sin16s::x#2 x zp[4]:10 4.0 +(dword) sin16s::x#4 x zp[4]:10 5.0 +(dword) sin16s::x#6 x zp[4]:10 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:34 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:23 4.0 +(word) sin16s::x2#0 x2 zp[2]:19 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:23 1.0 +(word) sin16s::x3#0 x3 zp[2]:19 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:36 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:23 4.0 +(word) sin16s::x4#0 x4 zp[2]:19 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:36 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:36 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:14 22.0 -(word~) sin16s_gen2::$9 zp[2]:32 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:10 22.0 +(word~) sin16s_gen2::$9 zp[2]:28 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -8974,49 +8982,50 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (signed word) sin16s_gen2::ampl (const signed word) sin16s_gen2::ampl#0 ampl = (const signed word) sin16s_gen2::max#0-(const signed word) sin16s_gen2::min#0 (word) sin16s_gen2::i -(word) sin16s_gen2::i#1 i zp[2]:18 22.0 -(word) sin16s_gen2::i#2 i zp[2]:18 2.5384615384615383 +(word) sin16s_gen2::i#1 i zp[2]:14 22.0 +(word) sin16s_gen2::i#2 i zp[2]:14 2.5384615384615383 (signed word) sin16s_gen2::max (const signed word) sin16s_gen2::max#0 max = (signed word) $1001 (signed word) sin16s_gen2::min (const signed word) sin16s_gen2::min#0 min = (signed word) -$1001 (signed word) sin16s_gen2::offs (signed word*) sin16s_gen2::sintab -(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:20 7.333333333333333 -(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:20 3.0 +(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:16 7.333333333333333 +(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:16 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:28 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:24 0.8666666666666666 (word) sin16s_gen2::wavelength (const word) sin16s_gen2::wavelength#0 wavelength = (word) $200 (dword) sin16s_gen2::x -(dword) sin16s_gen2::x#1 x zp[4]:10 11.0 -(dword) sin16s_gen2::x#2 x zp[4]:10 2.75 +(dword) sin16s_gen2::x#1 x zp[4]:6 11.0 +(dword) sin16s_gen2::x#2 x zp[4]:6 2.75 zp[2]:2 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 main::idx_x#11 main::idx_x#10 main::idx_x#1 ] -zp[4]:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -zp[2]:8 [ memset::num#2 memset::end#0 main::r#10 main::r#1 mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s::usinx#0 ] +zp[2]:4 [ memset::num#2 memset::end#0 main::r#10 main::r#1 mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s::usinx#0 ] reg byte x [ memset::c#4 ] 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[4]:10 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -zp[4]:14 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +zp[4]:6 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:10 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] -zp[2]:20 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +zp[2]:14 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] +zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[1]:22 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] +zp[1]:18 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] reg byte x [ bitmap_plot::y#0 ] -zp[2]:23 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::$16 main::$17 main::y#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] +zp[2]:19 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::$16 main::$17 main::y#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] reg byte a [ bitmap_plot::$2 ] -zp[2]:25 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[2]:21 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] reg byte a [ mul16u::$1 ] -zp[1]:27 [ bitmap_init::$7 sin16s::isUpper#2 main::r_add#10 main::r_add#12 main::r_add#1 ] +zp[1]:23 [ bitmap_init::$7 main::r_add#10 main::r_add#12 main::r_add#1 ] reg byte a [ bitmap_init::$4 ] reg byte a [ bitmap_init::$5 ] reg byte a [ bitmap_init::$6 ] -zp[4]:28 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:32 [ sin16s_gen2::$9 main::$10 main::$11 main::x#0 bitmap_plot::x#0 ] +zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:28 [ sin16s_gen2::$9 main::$10 main::$11 main::x#0 bitmap_plot::x#0 ] +zp[4]:30 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:34 [ sin16s::x1#0 mul16s::$13 mul16s::$17 ] zp[2]:36 [ div32u16u::quotient_hi#0 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 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#1 mul16s::b#2 main::cos_x#0 main::sin_y#0 main::$34 main::$36 main::$35 main::$37 ] reg byte a [ divr16u::$1 ] @@ -9024,7 +9033,7 @@ reg byte a [ divr16u::$2 ] FINAL ASSEMBLER -Score: 20576 +Score: 20613 // File Comments // Tests the simple bitmap plotter - and counts plots per frame in an IRQ @@ -9075,8 +9084,8 @@ Score: 20576 .const PI_HALF_u4f28 = $1921fb54 .label BITMAP = $2000 .label SCREEN = $400 - .label rem16u = $19 - .label frame_cnt = $16 + .label rem16u = $15 + .label frame_cnt = $12 // @begin // @1 __b1: @@ -9096,22 +9105,22 @@ __b1: // main main: { .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f - .label __10 = $20 - .label __11 = $20 - .label __16 = $17 - .label __17 = $17 + .label __10 = $1c + .label __11 = $1c + .label __16 = $13 + .label __17 = $13 .label __34 = $24 .label __35 = $24 .label cos_x = $24 - .label xpos = $e - .label x = $20 + .label xpos = $a + .label x = $1c .label sin_y = $24 - .label ypos = $e - .label y = $17 + .label ypos = $a + .label y = $13 .label idx_x = 2 - .label idx_y = $12 - .label r = 8 - .label r_add = $1b + .label idx_y = $e + .label r = 4 + .label r_add = $17 .label __36 = $24 .label __37 = $24 // sin16s_gen2(SINUS, 512, -0x1001, 0x1001) @@ -9416,11 +9425,11 @@ main: { } // bitmap_plot // Plot a single dot in the bitmap -// bitmap_plot(word zeropage($20) x, byte register(X) y) +// bitmap_plot(word zeropage($1c) x, byte register(X) y) bitmap_plot: { - .label __1 = $19 - .label plotter = $17 - .label x = $20 + .label __1 = $15 + .label plotter = $13 + .label x = $1c // (byte*) { bitmap_plot_yhi[y], bitmap_plot_ylo[y] } // [57] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi + (byte) bitmap_plot::y#0) w= *((const byte[$100]) bitmap_plot_ylo + (byte) bitmap_plot::y#0) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx lda bitmap_plot_yhi,x @@ -9462,15 +9471,15 @@ bitmap_plot: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage(8) a, signed word zeropage($24) b) +// mul16s(signed word zeropage(4) a, signed word zeropage($24) b) mul16s: { - .label __9 = $19 + .label __9 = $15 .label __13 = $22 - .label __16 = $19 + .label __16 = $15 .label __17 = $22 - .label m = $e - .label return = $e - .label a = 8 + .label m = $a + .label return = $a + .label a = 4 .label b = $24 // mul16u((word)a, (word) b) // [64] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#3 -- vwuz1=vwuz2 @@ -9567,13 +9576,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($19) a, word zeropage($17) b) +// mul16u(word zeropage($15) a, word zeropage($13) b) mul16u: { - .label mb = 4 - .label a = $19 - .label res = $e - .label b = $17 - .label return = $e + .label mb = $1e + .label a = $15 + .label res = $a + .label b = $13 + .label return = $a .label b_1 = 2 // [82] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] // [82] phi (dword) mul16u::mb#2 = (dword) mul16u::mb#0 [phi:mul16u->mul16u::@1#0] -- register_copy @@ -9739,12 +9748,12 @@ bitmap_clear: { } // memset // Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str. -// memset(void* zeropage($12) str, byte register(X) c, word zeropage(8) num) +// memset(void* zeropage($e) str, byte register(X) c, word zeropage(4) num) memset: { - .label end = 8 - .label dst = $12 - .label num = 8 - .label str = $12 + .label end = 4 + .label dst = $e + .label num = 4 + .label str = $e // if(num>0) // [107] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 lda.z num @@ -9798,7 +9807,7 @@ memset: { // bitmap_init // Initialize bitmap plotting tables bitmap_init: { - .label __7 = $1b + .label __7 = $17 .label yoffs = $24 // [116] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] // [116] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 @@ -9901,18 +9910,18 @@ bitmap_init: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($14) sintab) +// sin16s_gen2(signed word* zeropage($10) sintab) sin16s_gen2: { .label wavelength = $200 .const min = -$1001 .const max = $1001 .const ampl = max-min - .label __6 = $e - .label __9 = $20 - .label step = $1c - .label sintab = $14 - .label x = $a - .label i = $12 + .label __6 = $a + .label __9 = $1c + .label step = $18 + .label sintab = $10 + .label x = 6 + .label i = $e // div32u16u(PI2_u4f28, wavelength) // [138] call div32u16u // [205] phi from sin16s_gen2 to div32u16u [phi:sin16s_gen2->div32u16u] @@ -10039,21 +10048,20 @@ sin16s_gen2: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($e) x) +// sin16s(dword zeropage($a) x) sin16s: { - .label __4 = $e - .label x = $e - .label return = 8 + .label __4 = $1e + .label x = $a + .label return = 4 .label x1 = $22 - .label x2 = $17 - .label x3 = $17 + .label x2 = $13 + .label x3 = $13 .label x3_6 = $24 - .label usinx = 8 - .label x4 = $17 + .label usinx = 4 + .label x4 = $13 .label x5 = $24 .label x5_128 = $24 - .label sinx = 8 - .label isUpper = $1b + .label sinx = 4 // if(x >= PI_u4f28 ) // [156] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 @@ -10089,16 +10097,14 @@ sin16s: { sbc #>PI_u4f28>>$10 sta.z x+3 // [158] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] - // [158] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [158] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [158] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [158] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] b1: - // [158] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [158] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [158] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy // sin16s::@1 __b1: @@ -10141,15 +10147,27 @@ sin16s: { // sin16s::@2 __b2: // x<<3 - // [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [162] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // x1 = >x<<3 // [163] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 @@ -10295,9 +10313,8 @@ sin16s: { adc.z x5_128+1 sta.z usinx+1 // if(isUpper!=0) - // [191] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [191] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b3 // sin16s::@6 // sinx = -(signed word)usinx @@ -10323,14 +10340,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($17) v1, word zeropage(2) v2, byte register(X) select) +// mulu16_sel(word zeropage($13) v1, word zeropage(2) v2, byte register(X) select) mulu16_sel: { - .label __0 = $e - .label __1 = $e - .label v1 = $17 + .label __0 = $a + .label __1 = $a + .label v1 = $13 .label v2 = 2 .label return = $24 - .label return_1 = $17 + .label return_1 = $13 // mul16u(v1, v2) // [197] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 @@ -10382,8 +10399,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $24 - .label quotient_lo = $14 - .label return = $1c + .label quotient_lo = $10 + .label return = $18 // divr16u(>dividend, divisor, 0) // [206] call divr16u // [215] phi from div32u16u to divr16u [phi:div32u16u->divr16u] @@ -10442,12 +10459,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($12) dividend, word zeropage($19) rem) +// divr16u(word zeropage($e) dividend, word zeropage($15) rem) divr16u: { - .label rem = $19 - .label dividend = $12 - .label quotient = $14 - .label return = $14 + .label rem = $15 + .label dividend = $e + .label quotient = $10 + .label return = $10 // [216] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] // [216] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 ldx #0 diff --git a/src/test/ref/bitmap-plot-2.sym b/src/test/ref/bitmap-plot-2.sym index ec77e083b..71a841f6b 100644 --- a/src/test/ref/bitmap-plot-2.sym +++ b/src/test/ref/bitmap-plot-2.sym @@ -42,7 +42,7 @@ (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 zp[1]:27 5.5 +(byte~) bitmap_init::$7 zp[1]:23 5.5 (label) bitmap_init::@1 (label) bitmap_init::@2 (label) bitmap_init::@3 @@ -67,14 +67,14 @@ (byte*) bitmap_init::yoffs#2 yoffs zp[2]:36 6.875 (byte*) bitmap_init::yoffs#4 yoffs zp[2]:36 11.0 (void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) -(word~) bitmap_plot::$1 zp[2]:25 4.0 +(word~) bitmap_plot::$1 zp[2]:21 4.0 (byte~) bitmap_plot::$2 reg byte a 4.0 (label) bitmap_plot::@return (byte*) bitmap_plot::plotter -(word) bitmap_plot::plotter#0 plotter zp[2]:23 1.0 -(byte*) bitmap_plot::plotter#1 plotter zp[2]:23 3.0 +(word) bitmap_plot::plotter#0 plotter zp[2]:19 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp[2]:19 3.0 (word) bitmap_plot::x -(word) bitmap_plot::x#0 x zp[2]:32 3.75 +(word) bitmap_plot::x#0 x zp[2]:28 3.75 (byte) bitmap_plot::y (byte) bitmap_plot::y#0 reg byte x 7.5 (const byte[$100]) bitmap_plot_bit = { fill( $100, 0) } @@ -91,10 +91,10 @@ (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:36 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:20 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:16 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:28 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:28 4.0 +(dword) div32u16u::return#0 return zp[4]:24 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:24 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -106,34 +106,34 @@ (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:18 2.75 -(word) divr16u::dividend#3 dividend zp[2]:18 5.0 -(word) divr16u::dividend#5 dividend zp[2]:18 2.0 +(word) divr16u::dividend#0 dividend zp[2]:14 2.75 +(word) divr16u::dividend#3 dividend zp[2]:14 5.0 +(word) divr16u::dividend#5 dividend zp[2]:14 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:20 16.5 -(word) divr16u::quotient#2 quotient zp[2]:20 11.0 -(word) divr16u::quotient#3 quotient zp[2]:20 2.75 +(word) divr16u::quotient#1 quotient zp[2]:16 16.5 +(word) divr16u::quotient#2 quotient zp[2]:16 11.0 +(word) divr16u::quotient#3 quotient zp[2]:16 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:25 8.25 -(word) divr16u::rem#1 rem zp[2]:25 22.0 -(word) divr16u::rem#10 rem zp[2]:25 4.0 -(word) divr16u::rem#11 rem zp[2]:25 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:25 22.0 -(word) divr16u::rem#4 rem zp[2]:25 4.0 -(word) divr16u::rem#5 rem zp[2]:25 24.0 -(word) divr16u::rem#6 rem zp[2]:25 11.0 +(word) divr16u::rem#0 rem zp[2]:21 8.25 +(word) divr16u::rem#1 rem zp[2]:21 22.0 +(word) divr16u::rem#10 rem zp[2]:21 4.0 +(word) divr16u::rem#11 rem zp[2]:21 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:21 22.0 +(word) divr16u::rem#4 rem zp[2]:21 4.0 +(word) divr16u::rem#5 rem zp[2]:21 24.0 +(word) divr16u::rem#6 rem zp[2]:21 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:20 5.285714285714286 -(word) divr16u::return#2 return zp[2]:20 4.0 -(word) divr16u::return#3 return zp[2]:20 4.0 +(word) divr16u::return#0 return zp[2]:16 5.285714285714286 +(word) divr16u::return#2 return zp[2]:16 4.0 +(word) divr16u::return#3 return zp[2]:16 4.0 (byte) frame_cnt -(byte) frame_cnt#0 frame_cnt zp[1]:22 0.5454545454545455 -(byte) frame_cnt#1 frame_cnt zp[1]:22 4.0 -(byte) frame_cnt#2 frame_cnt zp[1]:22 40.0 +(byte) frame_cnt#0 frame_cnt zp[1]:18 0.5454545454545455 +(byte) frame_cnt#1 frame_cnt zp[1]:18 4.0 +(byte) frame_cnt#2 frame_cnt zp[1]:18 40.0 (void()) init_irq() (label) init_irq::@return interrupt(HARDWARE_CLOBBER)(void()) irq() @@ -141,10 +141,10 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) irq::@2 (label) irq::@return (void()) main() -(word~) main::$10 zp[2]:32 11.0 -(signed word~) main::$11 zp[2]:32 22.0 -(word~) main::$16 zp[2]:23 11.0 -(signed word~) main::$17 zp[2]:23 22.0 +(word~) main::$10 zp[2]:28 11.0 +(signed word~) main::$11 zp[2]:28 22.0 +(word~) main::$16 zp[2]:19 11.0 +(signed word~) main::$17 zp[2]:19 22.0 (word~) main::$34 zp[2]:36 22.0 (word~) main::$35 zp[2]:36 22.0 (signed word*~) main::$36 zp[2]:36 22.0 @@ -173,16 +173,16 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) main::idx_x#10 idx_x zp[2]:2 3.0 (word) main::idx_x#11 idx_x zp[2]:2 1.222222222222222 (word) main::idx_y -(word) main::idx_y#1 idx_y zp[2]:18 11.0 -(word) main::idx_y#10 idx_y zp[2]:18 3.142857142857143 -(word) main::idx_y#3 idx_y zp[2]:18 1.064516129032258 +(word) main::idx_y#1 idx_y zp[2]:14 11.0 +(word) main::idx_y#10 idx_y zp[2]:14 3.142857142857143 +(word) main::idx_y#3 idx_y zp[2]:14 1.064516129032258 (signed word) main::r -(signed word) main::r#1 r zp[2]:8 5.5 -(signed word) main::r#10 r zp[2]:8 1.2571428571428571 +(signed word) main::r#1 r zp[2]:4 5.5 +(signed word) main::r#10 r zp[2]:4 1.2571428571428571 (byte) main::r_add -(byte) main::r_add#1 r_add zp[1]:27 22.0 -(byte) main::r_add#10 r_add zp[1]:27 2.026315789473684 -(byte) main::r_add#12 r_add zp[1]:27 16.5 +(byte) main::r_add#1 r_add zp[1]:23 22.0 +(byte) main::r_add#10 r_add zp[1]:23 2.026315789473684 +(byte) main::r_add#12 r_add zp[1]:23 16.5 (signed word) main::sin_y (signed word) main::sin_y#0 sin_y zp[2]:36 11.0 (label) main::toD0181 @@ -191,13 +191,13 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const byte*) BITMAP/(byte) 4&(byte) $f (byte*) main::toD0181_screen (word) main::x -(signed word) main::x#0 x zp[2]:32 0.8461538461538461 +(signed word) main::x#0 x zp[2]:28 0.8461538461538461 (signed dword) main::xpos -(signed dword) main::xpos#0 xpos zp[4]:14 22.0 +(signed dword) main::xpos#0 xpos zp[4]:10 22.0 (word) main::y -(signed word) main::y#0 y zp[2]:23 11.0 +(signed word) main::y#0 y zp[2]:19 11.0 (signed dword) main::ypos -(signed dword) main::ypos#0 ypos zp[4]:14 22.0 +(signed dword) main::ypos#0 ypos zp[4]:10 22.0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 (label) memset::@2 @@ -206,21 +206,21 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (byte) memset::c (byte) memset::c#4 reg byte x 1.375 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:18 22.0 -(byte*) memset::dst#2 dst zp[2]:18 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:18 4.0 +(byte*) memset::dst#1 dst zp[2]:14 22.0 +(byte*) memset::dst#2 dst zp[2]:14 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:14 4.0 (byte*) memset::end -(byte*) memset::end#0 end zp[2]:8 2.1666666666666665 +(byte*) memset::end#0 end zp[2]:4 2.1666666666666665 (word) memset::num -(word) memset::num#2 num zp[2]:8 2.0 +(word) memset::num#2 num zp[2]:4 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:18 +(void*) memset::str#3 str zp[2]:14 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$13 zp[2]:34 4.0 -(word~) mul16s::$16 zp[2]:25 4.0 +(word~) mul16s::$16 zp[2]:21 4.0 (word~) mul16s::$17 zp[2]:34 4.0 -(word~) mul16s::$9 zp[2]:25 4.0 +(word~) mul16s::$9 zp[2]:21 4.0 (label) mul16s::@1 (label) mul16s::@2 (label) mul16s::@3 @@ -228,25 +228,25 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16s::@5 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:8 22.0 -(signed word) mul16s::a#1 a zp[2]:8 11.0 -(signed word) mul16s::a#2 a zp[2]:8 11.0 -(signed word) mul16s::a#3 a zp[2]:8 2.692307692307692 +(signed word) mul16s::a#0 a zp[2]:4 22.0 +(signed word) mul16s::a#1 a zp[2]:4 11.0 +(signed word) mul16s::a#2 a zp[2]:4 11.0 +(signed word) mul16s::a#3 a zp[2]:4 2.692307692307692 (signed word) mul16s::b (signed word) mul16s::b#1 b zp[2]:36 22.0 (signed word) mul16s::b#2 b zp[2]:36 22.0 (signed word) mul16s::b#3 b zp[2]:36 2.1818181818181817 (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:14 2.0 -(dword) mul16s::m#1 m zp[4]:14 4.0 -(dword) mul16s::m#2 m zp[4]:14 4.0 -(dword) mul16s::m#4 m zp[4]:14 4.0 -(dword) mul16s::m#5 m zp[4]:14 2.5 +(dword) mul16s::m#0 m zp[4]:10 2.0 +(dword) mul16s::m#1 m zp[4]:10 4.0 +(dword) mul16s::m#2 m zp[4]:10 4.0 +(dword) mul16s::m#4 m zp[4]:10 4.0 +(dword) mul16s::m#5 m zp[4]:10 2.5 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:14 7.000000000000001 -(signed dword) mul16s::return#2 return zp[4]:14 22.0 -(signed dword) mul16s::return#3 return zp[4]:14 22.0 -(signed dword) mul16s::return#4 return zp[4]:14 22.0 +(signed dword) mul16s::return#0 return zp[4]:10 7.000000000000001 +(signed dword) mul16s::return#2 return zp[4]:10 22.0 +(signed dword) mul16s::return#3 return zp[4]:10 22.0 +(signed dword) mul16s::return#4 return zp[4]:10 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -255,46 +255,46 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:25 101.0 -(word) mul16u::a#1 a zp[2]:25 2.0 -(word) mul16u::a#2 a zp[2]:25 2.0 -(word) mul16u::a#3 a zp[2]:25 67.66666666666666 -(word) mul16u::a#6 a zp[2]:25 6.0 +(word) mul16u::a#0 a zp[2]:21 101.0 +(word) mul16u::a#1 a zp[2]:21 2.0 +(word) mul16u::a#2 a zp[2]:21 2.0 +(word) mul16u::a#3 a zp[2]:21 67.66666666666666 +(word) mul16u::a#6 a zp[2]:21 6.0 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:23 4.0 +(word) mul16u::b#0 b zp[2]:19 4.0 (word) mul16u::b#1 b_1 zp[2]:2 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:4 6.0 -(dword) mul16u::mb#1 mb zp[4]:4 202.0 -(dword) mul16u::mb#2 mb zp[4]:4 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:30 6.0 +(dword) mul16u::mb#1 mb zp[4]:30 202.0 +(dword) mul16u::mb#2 mb zp[4]:30 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:14 202.0 -(dword) mul16u::res#2 res zp[4]:14 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:14 101.0 +(dword) mul16u::res#1 res zp[4]:10 202.0 +(dword) mul16u::res#2 res zp[4]:10 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:10 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:14 4.0 -(dword) mul16u::return#3 return zp[4]:14 4.0 +(dword) mul16u::return#2 return zp[4]:10 4.0 +(dword) mul16u::return#3 return zp[4]:10 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:14 4.0 -(dword~) mulu16_sel::$1 zp[4]:14 4.0 +(dword~) mulu16_sel::$0 zp[4]:10 4.0 +(dword~) mulu16_sel::$1 zp[4]:10 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:36 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:23 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:19 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:19 4.0 (word) mulu16_sel::return#11 return zp[2]:36 4.0 (word) mulu16_sel::return#12 return zp[2]:36 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:36 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:23 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:23 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:23 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:19 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:19 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:19 12.0 (word) mulu16_sel::v2 (word) mulu16_sel::v2#0 v2 zp[2]:2 4.0 (word) mulu16_sel::v2#1 v2 zp[2]:2 4.0 @@ -303,9 +303,9 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (word) mulu16_sel::v2#5 v2 zp[2]:2 5.0 (const byte[$100]) plots_per_frame = { fill( $100, 0) } (word) rem16u -(word) rem16u#1 rem16u zp[2]:25 0.8 +(word) rem16u#1 rem16u zp[2]:21 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:14 4.0 +(dword~) sin16s::$4 zp[4]:30 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -320,39 +320,39 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:27 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:8 22.0 -(signed word) sin16s::return#1 return zp[2]:8 5.0 -(signed word~) sin16s::return#5 return zp[2]:8 4.0 +(signed word) sin16s::return#0 return zp[2]:4 22.0 +(signed word) sin16s::return#1 return zp[2]:4 5.0 +(signed word~) sin16s::return#5 return zp[2]:4 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:8 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:4 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:8 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:8 1.0 +(word) sin16s::usinx#0 usinx zp[2]:4 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:4 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:14 8.5 -(dword) sin16s::x#1 x zp[4]:14 4.0 -(dword) sin16s::x#2 x zp[4]:14 4.0 -(dword) sin16s::x#4 x zp[4]:14 5.0 -(dword) sin16s::x#6 x zp[4]:14 6.0 +(dword) sin16s::x#0 x zp[4]:10 8.5 +(dword) sin16s::x#1 x zp[4]:10 4.0 +(dword) sin16s::x#2 x zp[4]:10 4.0 +(dword) sin16s::x#4 x zp[4]:10 5.0 +(dword) sin16s::x#6 x zp[4]:10 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:34 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:23 4.0 +(word) sin16s::x2#0 x2 zp[2]:19 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:23 1.0 +(word) sin16s::x3#0 x3 zp[2]:19 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:36 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:23 4.0 +(word) sin16s::x4#0 x4 zp[2]:19 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:36 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:36 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:14 22.0 -(word~) sin16s_gen2::$9 zp[2]:32 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:10 22.0 +(word~) sin16s_gen2::$9 zp[2]:28 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -362,49 +362,50 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() (signed word) sin16s_gen2::ampl (const signed word) sin16s_gen2::ampl#0 ampl = (const signed word) sin16s_gen2::max#0-(const signed word) sin16s_gen2::min#0 (word) sin16s_gen2::i -(word) sin16s_gen2::i#1 i zp[2]:18 22.0 -(word) sin16s_gen2::i#2 i zp[2]:18 2.5384615384615383 +(word) sin16s_gen2::i#1 i zp[2]:14 22.0 +(word) sin16s_gen2::i#2 i zp[2]:14 2.5384615384615383 (signed word) sin16s_gen2::max (const signed word) sin16s_gen2::max#0 max = (signed word) $1001 (signed word) sin16s_gen2::min (const signed word) sin16s_gen2::min#0 min = (signed word) -$1001 (signed word) sin16s_gen2::offs (signed word*) sin16s_gen2::sintab -(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:20 7.333333333333333 -(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:20 3.0 +(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:16 7.333333333333333 +(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:16 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:28 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:24 0.8666666666666666 (word) sin16s_gen2::wavelength (const word) sin16s_gen2::wavelength#0 wavelength = (word) $200 (dword) sin16s_gen2::x -(dword) sin16s_gen2::x#1 x zp[4]:10 11.0 -(dword) sin16s_gen2::x#2 x zp[4]:10 2.75 +(dword) sin16s_gen2::x#1 x zp[4]:6 11.0 +(dword) sin16s_gen2::x#2 x zp[4]:6 2.75 zp[2]:2 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 main::idx_x#11 main::idx_x#10 main::idx_x#1 ] -zp[4]:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -zp[2]:8 [ memset::num#2 memset::end#0 main::r#10 main::r#1 mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s::usinx#0 ] +zp[2]:4 [ memset::num#2 memset::end#0 main::r#10 main::r#1 mul16s::a#3 mul16s::a#1 mul16s::a#2 mul16s::a#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s::usinx#0 ] reg byte x [ memset::c#4 ] 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[4]:10 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -zp[4]:14 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +zp[4]:6 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:10 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#5 mul16s::m#1 mul16s::m#0 mul16s::m#2 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#3 main::xpos#0 mul16s::return#4 main::ypos#0 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] -zp[2]:20 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +zp[2]:14 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#2 sin16s_gen2::i#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 main::idx_y#3 main::idx_y#10 main::idx_y#1 ] +zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[1]:22 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] +zp[1]:18 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ] reg byte x [ bitmap_plot::y#0 ] -zp[2]:23 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::$16 main::$17 main::y#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] +zp[2]:19 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 main::$16 main::$17 main::y#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 mul16u::b#0 ] reg byte a [ bitmap_plot::$2 ] -zp[2]:25 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[2]:21 [ mul16s::$9 mul16s::$16 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] reg byte a [ mul16u::$1 ] -zp[1]:27 [ bitmap_init::$7 sin16s::isUpper#2 main::r_add#10 main::r_add#12 main::r_add#1 ] +zp[1]:23 [ bitmap_init::$7 main::r_add#10 main::r_add#12 main::r_add#1 ] reg byte a [ bitmap_init::$4 ] reg byte a [ bitmap_init::$5 ] reg byte a [ bitmap_init::$6 ] -zp[4]:28 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:32 [ sin16s_gen2::$9 main::$10 main::$11 main::x#0 bitmap_plot::x#0 ] +zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:28 [ sin16s_gen2::$9 main::$10 main::$11 main::x#0 bitmap_plot::x#0 ] +zp[4]:30 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:34 [ sin16s::x1#0 mul16s::$13 mul16s::$17 ] zp[2]:36 [ div32u16u::quotient_hi#0 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 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 mul16s::b#3 mul16s::b#1 mul16s::b#2 main::cos_x#0 main::sin_y#0 main::$34 main::$36 main::$35 main::$37 ] reg byte a [ divr16u::$1 ] diff --git a/src/test/ref/c64dtv-gfxexplorer.asm b/src/test/ref/c64dtv-gfxexplorer.asm index 4ce4461ca..07157e190 100644 --- a/src/test/ref/c64dtv-gfxexplorer.asm +++ b/src/test/ref/c64dtv-gfxexplorer.asm @@ -1562,21 +1562,21 @@ gfx_init_plane_fill: { .label plane_addr = 2 .label fill = 8 lda.z plane_addr + asl sta.z __0 lda.z plane_addr+1 + rol sta.z __0+1 lda.z plane_addr+2 + rol sta.z __0+2 lda.z plane_addr+3 + rol sta.z __0+3 asl.z __0 rol.z __0+1 rol.z __0+2 rol.z __0+3 - asl.z __0 - rol.z __0+1 - rol.z __0+2 - rol.z __0+3 lda.z __0+2 sta.z __1 lda.z __0+3 diff --git a/src/test/ref/c64dtv-gfxexplorer.log b/src/test/ref/c64dtv-gfxexplorer.log index 9fcc27783..6bbcee56c 100644 --- a/src/test/ref/c64dtv-gfxexplorer.log +++ b/src/test/ref/c64dtv-gfxexplorer.log @@ -18518,21 +18518,21 @@ gfx_init_plane_fill: { .label fill = $3e // [481] (dword~) gfx_init_plane_fill::$0 ← (dword) gfx_init_plane_fill::plane_addr#3 << (byte) 2 -- vduz1=vduz2_rol_2 lda.z plane_addr + asl sta.z __0 lda.z plane_addr+1 + rol sta.z __0+1 lda.z plane_addr+2 + rol sta.z __0+2 lda.z plane_addr+3 + rol sta.z __0+3 asl.z __0 rol.z __0+1 rol.z __0+2 rol.z __0+3 - asl.z __0 - rol.z __0+1 - rol.z __0+2 - rol.z __0+3 // [482] (word~) gfx_init_plane_fill::$1 ← > (dword~) gfx_init_plane_fill::$0 -- vwuz1=_hi_vduz2 lda.z __0+2 sta.z __1 @@ -22028,358 +22028,358 @@ Uplift Scope [gfx_init_plane_vertical2] Uplift Scope [gfx_init_plane_blank] Uplift Scope [gfx_init_plane_full] -Uplifting [keyboard_event_scan] best 15481007 combination reg byte a [ keyboard_event_scan::$15 ] reg byte a [ keyboard_event_scan::$16 ] zp[1]:252 [ keyboard_event_scan::event_type#0 ] zp[1]:253 [ keyboard_event_scan::$23 ] zp[1]:16 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] zp[1]:17 [ 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[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] zp[1]:241 [ keyboard_event_scan::row_scan#0 ] zp[1]:243 [ keyboard_event_scan::$0 ] zp[1]:245 [ keyboard_event_scan::$3 ] zp[1]:247 [ keyboard_event_scan::$6 ] zp[1]:249 [ keyboard_event_scan::$9 ] +Uplifting [keyboard_event_scan] best 15480995 combination reg byte a [ keyboard_event_scan::$15 ] reg byte a [ keyboard_event_scan::$16 ] zp[1]:252 [ keyboard_event_scan::event_type#0 ] zp[1]:253 [ keyboard_event_scan::$23 ] zp[1]:16 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] zp[1]:17 [ 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[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] zp[1]:241 [ keyboard_event_scan::row_scan#0 ] zp[1]:243 [ keyboard_event_scan::$0 ] zp[1]:245 [ keyboard_event_scan::$3 ] zp[1]:247 [ keyboard_event_scan::$6 ] zp[1]:249 [ keyboard_event_scan::$9 ] Limited combination testing to 10 combinations of 5308416 possible. -Uplifting [] best 15480989 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#109 keyboard_events_size#99 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#108 keyboard_events_size#1 keyboard_events_size#2 ] zp[2]:52 [ print_char_cursor#20 print_char_cursor#22 print_char_cursor#73 print_char_cursor#74 print_char_cursor#38 print_char_cursor#1 ] zp[2]:54 [ print_line_cursor#21 print_line_cursor#2 print_set_screen::screen#2 print_line_cursor#22 ] zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ] zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ] reg byte x [ keyboard_modifiers#21 keyboard_modifiers#20 keyboard_modifiers#19 keyboard_modifiers#18 keyboard_modifiers#3 keyboard_modifiers#4 keyboard_modifiers#5 ] +Uplifting [] best 15480977 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#109 keyboard_events_size#99 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#108 keyboard_events_size#1 keyboard_events_size#2 ] zp[2]:52 [ print_char_cursor#20 print_char_cursor#22 print_char_cursor#73 print_char_cursor#74 print_char_cursor#38 print_char_cursor#1 ] zp[2]:54 [ print_line_cursor#21 print_line_cursor#2 print_set_screen::screen#2 print_line_cursor#22 ] zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ] zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ] reg byte x [ keyboard_modifiers#21 keyboard_modifiers#20 keyboard_modifiers#19 keyboard_modifiers#18 keyboard_modifiers#3 keyboard_modifiers#4 keyboard_modifiers#5 ] Limited combination testing to 10 combinations of 16 possible. -Uplifting [keyboard_matrix_read] best 15390986 combination reg byte a [ keyboard_matrix_read::return#2 ] reg byte x [ keyboard_matrix_read::rowid#0 ] zp[1]:258 [ keyboard_matrix_read::return#0 ] +Uplifting [keyboard_matrix_read] best 15390974 combination reg byte a [ keyboard_matrix_read::return#2 ] reg byte x [ keyboard_matrix_read::rowid#0 ] zp[1]:258 [ keyboard_matrix_read::return#0 ] Limited combination testing to 10 combinations of 64 possible. -Uplifting [gfx_init_plane_charset8] best 15375986 combination reg byte a [ gfx_init_plane_charset8::c#2 gfx_init_plane_charset8::c#3 ] reg byte a [ gfx_init_plane_charset8::$7 ] zp[1]:88 [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ] zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ] zp[2]:85 [ gfx_init_plane_charset8::gfxa#2 gfx_init_plane_charset8::gfxa#5 gfx_init_plane_charset8::gfxa#6 gfx_init_plane_charset8::gfxa#1 ] zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ] zp[2]:81 [ gfx_init_plane_charset8::chargen#2 gfx_init_plane_charset8::chargen#3 gfx_init_plane_charset8::chargen#1 ] zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ] zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ] +Uplifting [gfx_init_plane_charset8] best 15375974 combination reg byte a [ gfx_init_plane_charset8::c#2 gfx_init_plane_charset8::c#3 ] reg byte a [ gfx_init_plane_charset8::$7 ] zp[1]:88 [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ] zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ] zp[2]:85 [ gfx_init_plane_charset8::gfxa#2 gfx_init_plane_charset8::gfxa#5 gfx_init_plane_charset8::gfxa#6 gfx_init_plane_charset8::gfxa#1 ] zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ] zp[2]:81 [ gfx_init_plane_charset8::chargen#2 gfx_init_plane_charset8::chargen#3 gfx_init_plane_charset8::chargen#1 ] zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ] zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ] Limited combination testing to 10 combinations of 1152 possible. -Uplifting [print_str_at] best 15375986 combination zp[2]:37 [ print_str_at::str#2 print_str_at::str#1 print_str_at::str#0 ] zp[2]:39 [ print_str_at::at#2 print_str_at::at#0 ] -Uplifting [apply_preset] best 15363653 combination reg byte y [ apply_preset::i#2 apply_preset::i#1 ] zp[2]:43 [ apply_preset::preset#15 ] reg byte a [ apply_preset::idx#0 ] +Uplifting [print_str_at] best 15375974 combination zp[2]:37 [ print_str_at::str#2 print_str_at::str#1 print_str_at::str#0 ] zp[2]:39 [ print_str_at::at#2 print_str_at::at#0 ] +Uplifting [apply_preset] best 15363641 combination reg byte y [ apply_preset::i#2 apply_preset::i#1 ] zp[2]:43 [ apply_preset::preset#15 ] reg byte a [ apply_preset::idx#0 ] Limited combination testing to 10 combinations of 12 possible. -Uplifting [form_render_values] best 15348653 combination reg byte x [ form_render_values::idx#2 form_render_values::idx#1 ] -Uplifting [form_mode] best 15341453 combination reg byte a [ form_mode::$36 ] zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ] reg byte x [ form_mode::i#2 form_mode::i#1 ] +Uplifting [form_render_values] best 15348641 combination reg byte x [ form_render_values::idx#2 form_render_values::idx#1 ] +Uplifting [form_mode] best 15341441 combination reg byte a [ form_mode::$36 ] zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ] reg byte x [ form_mode::i#2 form_mode::i#1 ] Limited combination testing to 10 combinations of 24 possible. -Uplifting [print_str_lines] best 15329453 combination zp[2]:50 [ print_str_lines::str#4 print_str_lines::str#3 print_str_lines::str#5 print_str_lines::str#0 ] reg byte a [ print_str_lines::ch#0 ] -Uplifting [form_field_ptr] best 15326440 combination reg byte x [ form_field_ptr::field_idx#2 form_field_ptr::field_idx#1 form_field_ptr::field_idx#0 ] zp[1]:265 [ form_field_ptr::x#0 ] reg byte a [ form_field_ptr::y#0 ] zp[2]:263 [ form_field_ptr::line#0 ] +Uplifting [print_str_lines] best 15329441 combination zp[2]:50 [ print_str_lines::str#4 print_str_lines::str#3 print_str_lines::str#5 print_str_lines::str#0 ] reg byte a [ print_str_lines::ch#0 ] +Uplifting [form_field_ptr] best 15326428 combination reg byte x [ form_field_ptr::field_idx#2 form_field_ptr::field_idx#1 form_field_ptr::field_idx#0 ] zp[1]:265 [ form_field_ptr::x#0 ] reg byte a [ form_field_ptr::y#0 ] zp[2]:263 [ form_field_ptr::line#0 ] Limited combination testing to 10 combinations of 24 possible. -Uplifting [form_control] best 15319431 combination reg byte a [ form_control::return#0 ] reg byte x [ form_control::return#2 ] zp[1]:266 [ form_control::$13 ] zp[1]:269 [ form_control::$15 ] zp[1]:270 [ form_control::$16 ] zp[1]:271 [ form_control::$24 ] zp[1]:272 [ form_control::$14 ] zp[1]:268 [ form_control::key_event#0 ] +Uplifting [form_control] best 15319419 combination reg byte a [ form_control::return#0 ] reg byte x [ form_control::return#2 ] zp[1]:266 [ form_control::$13 ] zp[1]:269 [ form_control::$15 ] zp[1]:270 [ form_control::$16 ] zp[1]:271 [ form_control::$24 ] zp[1]:272 [ form_control::$14 ] zp[1]:268 [ form_control::key_event#0 ] Limited combination testing to 10 combinations of 65536 possible. -Uplifting [bitmap_plot] best 15317022 combination reg byte y [ bitmap_plot::y#4 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#3 bitmap_plot::y#2 ] reg byte x [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ] zp[2]:313 [ bitmap_plot::plotter_y#0 ] zp[1]:317 [ bitmap_plot::$1 ] zp[2]:311 [ bitmap_plot::plotter_x#0 ] zp[2]:315 [ bitmap_plot::plotter#0 ] +Uplifting [bitmap_plot] best 15317010 combination reg byte y [ bitmap_plot::y#4 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#3 bitmap_plot::y#2 ] reg byte x [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ] zp[2]:313 [ bitmap_plot::plotter_y#0 ] zp[1]:317 [ bitmap_plot::$1 ] zp[2]:311 [ bitmap_plot::plotter_x#0 ] zp[2]:315 [ bitmap_plot::plotter#0 ] Limited combination testing to 10 combinations of 36 possible. -Uplifting [gfx_init_screen2] best 15315822 combination reg byte a [ gfx_init_screen2::$0 ] reg byte a [ gfx_init_screen2::$3 ] zp[1]:336 [ gfx_init_screen2::$4 ] zp[1]:147 [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ] zp[1]:333 [ gfx_init_screen2::col#0 ] zp[2]:148 [ gfx_init_screen2::ch#2 gfx_init_screen2::ch#3 gfx_init_screen2::ch#1 ] zp[1]:334 [ gfx_init_screen2::col2#0 ] zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ] +Uplifting [gfx_init_screen2] best 15315810 combination reg byte a [ gfx_init_screen2::$0 ] reg byte a [ gfx_init_screen2::$3 ] zp[1]:336 [ gfx_init_screen2::$4 ] zp[1]:147 [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ] zp[1]:333 [ gfx_init_screen2::col#0 ] zp[2]:148 [ gfx_init_screen2::ch#2 gfx_init_screen2::ch#3 gfx_init_screen2::ch#1 ] zp[1]:334 [ gfx_init_screen2::col2#0 ] zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ] Limited combination testing to 10 combinations of 2304 possible. -Uplifting [gfx_init_plane_8bppchunky] best 15314592 combination reg byte x [ gfx_init_plane_8bppchunky::gfxbCpuBank#4 gfx_init_plane_8bppchunky::gfxbCpuBank#7 gfx_init_plane_8bppchunky::gfxbCpuBank#8 gfx_init_plane_8bppchunky::gfxbCpuBank#2 ] zp[2]:94 [ gfx_init_plane_8bppchunky::gfxb#4 gfx_init_plane_8bppchunky::gfxb#3 gfx_init_plane_8bppchunky::gfxb#5 gfx_init_plane_8bppchunky::gfxb#1 ] reg byte a [ gfx_init_plane_8bppchunky::c#0 ] zp[2]:91 [ gfx_init_plane_8bppchunky::x#2 gfx_init_plane_8bppchunky::x#1 ] zp[2]:297 [ gfx_init_plane_8bppchunky::$8 ] zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ] +Uplifting [gfx_init_plane_8bppchunky] best 15314580 combination reg byte x [ gfx_init_plane_8bppchunky::gfxbCpuBank#4 gfx_init_plane_8bppchunky::gfxbCpuBank#7 gfx_init_plane_8bppchunky::gfxbCpuBank#8 gfx_init_plane_8bppchunky::gfxbCpuBank#2 ] zp[2]:94 [ gfx_init_plane_8bppchunky::gfxb#4 gfx_init_plane_8bppchunky::gfxb#3 gfx_init_plane_8bppchunky::gfxb#5 gfx_init_plane_8bppchunky::gfxb#1 ] reg byte a [ gfx_init_plane_8bppchunky::c#0 ] zp[2]:91 [ gfx_init_plane_8bppchunky::x#2 gfx_init_plane_8bppchunky::x#1 ] zp[2]:297 [ gfx_init_plane_8bppchunky::$8 ] zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ] Limited combination testing to 10 combinations of 16 possible. -Uplifting [bitmap_line_xdyi] best 15313992 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ] zp[1]:101 [ bitmap_line_xdyi::y#3 bitmap_line_xdyi::y#5 bitmap_line_xdyi::y#0 bitmap_line_xdyi::y#1 bitmap_line_xdyi::y#6 bitmap_line_xdyi::y#2 ] reg byte x [ bitmap_line_xdyi::$6 ] zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#2 ] zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#0 bitmap_line_xdyi::xd#1 ] zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#0 bitmap_line_xdyi::yd#1 ] zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#0 bitmap_line_xdyi::x1#1 ] +Uplifting [bitmap_line_xdyi] best 15313980 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ] zp[1]:101 [ bitmap_line_xdyi::y#3 bitmap_line_xdyi::y#5 bitmap_line_xdyi::y#0 bitmap_line_xdyi::y#1 bitmap_line_xdyi::y#6 bitmap_line_xdyi::y#2 ] reg byte x [ bitmap_line_xdyi::$6 ] zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#2 ] zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#0 bitmap_line_xdyi::xd#1 ] zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#0 bitmap_line_xdyi::yd#1 ] zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#0 bitmap_line_xdyi::x1#1 ] Limited combination testing to 10 combinations of 256 possible. -Uplifting [bitmap_line_xdyd] best 15313392 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ] zp[1]:115 [ bitmap_line_xdyd::y#3 bitmap_line_xdyd::y#5 bitmap_line_xdyd::y#0 bitmap_line_xdyd::y#1 bitmap_line_xdyd::y#6 bitmap_line_xdyd::y#2 ] reg byte x [ bitmap_line_xdyd::$6 ] zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#2 ] zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#0 bitmap_line_xdyd::xd#1 ] zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#0 bitmap_line_xdyd::yd#1 ] zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#0 bitmap_line_xdyd::x1#1 ] +Uplifting [bitmap_line_xdyd] best 15313380 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ] zp[1]:115 [ bitmap_line_xdyd::y#3 bitmap_line_xdyd::y#5 bitmap_line_xdyd::y#0 bitmap_line_xdyd::y#1 bitmap_line_xdyd::y#6 bitmap_line_xdyd::y#2 ] reg byte x [ bitmap_line_xdyd::$6 ] zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#2 ] zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#0 bitmap_line_xdyd::xd#1 ] zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#0 bitmap_line_xdyd::yd#1 ] zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#0 bitmap_line_xdyd::x1#1 ] Limited combination testing to 10 combinations of 256 possible. -Uplifting [bitmap_line_ydxi] best 15312386 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ] reg byte x [ bitmap_line_ydxi::x#3 bitmap_line_ydxi::x#5 bitmap_line_ydxi::x#1 bitmap_line_ydxi::x#0 bitmap_line_ydxi::x#6 bitmap_line_ydxi::x#2 ] reg byte a [ bitmap_line_ydxi::$6 ] zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ] zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ] zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ] zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ] +Uplifting [bitmap_line_ydxi] best 15312374 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ] reg byte x [ bitmap_line_ydxi::x#3 bitmap_line_ydxi::x#5 bitmap_line_ydxi::x#1 bitmap_line_ydxi::x#0 bitmap_line_ydxi::x#6 bitmap_line_ydxi::x#2 ] reg byte a [ bitmap_line_ydxi::$6 ] zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ] zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ] zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ] zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ] Limited combination testing to 10 combinations of 256 possible. -Uplifting [bitmap_line_ydxd] best 15311380 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ] reg byte x [ bitmap_line_ydxd::x#3 bitmap_line_ydxd::x#5 bitmap_line_ydxd::x#0 bitmap_line_ydxd::x#1 bitmap_line_ydxd::x#6 bitmap_line_ydxd::x#2 ] reg byte a [ bitmap_line_ydxd::$6 ] zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ] zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ] zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ] zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ] +Uplifting [bitmap_line_ydxd] best 15311368 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ] reg byte x [ bitmap_line_ydxd::x#3 bitmap_line_ydxd::x#5 bitmap_line_ydxd::x#0 bitmap_line_ydxd::x#1 bitmap_line_ydxd::x#6 bitmap_line_ydxd::x#2 ] reg byte a [ bitmap_line_ydxd::$6 ] zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ] zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ] zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ] zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ] Limited combination testing to 10 combinations of 256 possible. -Uplifting [gfx_init_screen0] best 15310180 combination reg byte a [ gfx_init_screen0::$0 ] reg byte a [ gfx_init_screen0::$2 ] zp[1]:342 [ gfx_init_screen0::$3 ] zp[1]:155 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] zp[2]:156 [ gfx_init_screen0::ch#2 gfx_init_screen0::ch#3 gfx_init_screen0::ch#1 ] zp[1]:340 [ gfx_init_screen0::$1 ] zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ] +Uplifting [gfx_init_screen0] best 15310168 combination reg byte a [ gfx_init_screen0::$0 ] reg byte a [ gfx_init_screen0::$2 ] zp[1]:342 [ gfx_init_screen0::$3 ] zp[1]:155 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] zp[2]:156 [ gfx_init_screen0::ch#2 gfx_init_screen0::ch#3 gfx_init_screen0::ch#1 ] zp[1]:340 [ gfx_init_screen0::$1 ] zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ] Limited combination testing to 10 combinations of 768 possible. -Uplifting [gfx_init_screen3] best 15308980 combination reg byte a [ gfx_init_screen3::$0 ] reg byte a [ gfx_init_screen3::$2 ] zp[1]:331 [ gfx_init_screen3::$3 ] zp[1]:143 [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ] zp[2]:144 [ gfx_init_screen3::ch#2 gfx_init_screen3::ch#3 gfx_init_screen3::ch#1 ] zp[1]:329 [ gfx_init_screen3::$1 ] zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ] +Uplifting [gfx_init_screen3] best 15308968 combination reg byte a [ gfx_init_screen3::$0 ] reg byte a [ gfx_init_screen3::$2 ] zp[1]:331 [ gfx_init_screen3::$3 ] zp[1]:143 [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ] zp[2]:144 [ gfx_init_screen3::ch#2 gfx_init_screen3::ch#3 gfx_init_screen3::ch#1 ] zp[1]:329 [ gfx_init_screen3::$1 ] zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ] Limited combination testing to 10 combinations of 768 possible. -Uplifting [gfx_init_plane_horisontal] best 15307480 combination zp[2]:77 [ gfx_init_plane_horisontal::gfxa#3 gfx_init_plane_horisontal::gfxa#6 gfx_init_plane_horisontal::gfxa#7 gfx_init_plane_horisontal::gfxa#1 gfx_init_plane_horisontal::gfxa#2 ] reg byte a [ gfx_init_plane_horisontal::$7 ] reg byte x [ gfx_init_plane_horisontal::ax#2 gfx_init_plane_horisontal::ax#1 ] zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ] +Uplifting [gfx_init_plane_horisontal] best 15307468 combination zp[2]:77 [ gfx_init_plane_horisontal::gfxa#3 gfx_init_plane_horisontal::gfxa#6 gfx_init_plane_horisontal::gfxa#7 gfx_init_plane_horisontal::gfxa#1 gfx_init_plane_horisontal::gfxa#2 ] reg byte a [ gfx_init_plane_horisontal::$7 ] reg byte x [ gfx_init_plane_horisontal::ax#2 gfx_init_plane_horisontal::ax#1 ] zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ] Limited combination testing to 10 combinations of 16 possible. -Uplifting [gfx_init_screen1] best 15305880 combination reg byte x [ gfx_init_screen1::cx#2 gfx_init_screen1::cx#1 ] reg byte a [ gfx_init_screen1::$0 ] zp[1]:338 [ gfx_init_screen1::$1 ] zp[2]:152 [ gfx_init_screen1::ch#2 gfx_init_screen1::ch#3 gfx_init_screen1::ch#1 ] zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ] +Uplifting [gfx_init_screen1] best 15305868 combination reg byte x [ gfx_init_screen1::cx#2 gfx_init_screen1::cx#1 ] reg byte a [ gfx_init_screen1::$0 ] zp[1]:338 [ gfx_init_screen1::$1 ] zp[2]:152 [ gfx_init_screen1::ch#2 gfx_init_screen1::ch#3 gfx_init_screen1::ch#1 ] zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ] Limited combination testing to 10 combinations of 64 possible. -Uplifting [form_set_screen] best 15303780 combination reg byte x [ form_set_screen::y#2 form_set_screen::y#1 ] reg byte a [ form_set_screen::$0 ] zp[1]:274 [ form_set_screen::$1 ] zp[2]:47 [ form_set_screen::line#2 form_set_screen::line#1 ] +Uplifting [form_set_screen] best 15303768 combination reg byte x [ form_set_screen::y#2 form_set_screen::y#1 ] reg byte a [ form_set_screen::$0 ] zp[1]:274 [ form_set_screen::$1 ] zp[2]:47 [ form_set_screen::line#2 form_set_screen::line#1 ] Limited combination testing to 10 combinations of 48 possible. -Uplifting [gfx_init_plane_horisontal2] best 15302780 combination reg byte a [ gfx_init_plane_horisontal2::$7 ] reg byte a [ gfx_init_plane_horisontal2::row#0 ] zp[1]:71 [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ] zp[2]:69 [ gfx_init_plane_horisontal2::gfxa#2 gfx_init_plane_horisontal2::gfxa#3 gfx_init_plane_horisontal2::gfxa#1 ] zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ] +Uplifting [gfx_init_plane_horisontal2] best 15302768 combination reg byte a [ gfx_init_plane_horisontal2::$7 ] reg byte a [ gfx_init_plane_horisontal2::row#0 ] zp[1]:71 [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ] zp[2]:69 [ gfx_init_plane_horisontal2::gfxa#2 gfx_init_plane_horisontal2::gfxa#3 gfx_init_plane_horisontal2::gfxa#1 ] zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ] Limited combination testing to 10 combinations of 64 possible. -Uplifting [gfx_init_charset] best 15301880 combination zp[2]:135 [ gfx_init_charset::charset#2 gfx_init_charset::charset#3 gfx_init_charset::charset#1 ] reg byte x [ gfx_init_charset::l#2 gfx_init_charset::l#1 ] zp[2]:133 [ gfx_init_charset::chargen#2 gfx_init_charset::chargen#3 gfx_init_charset::chargen#1 ] zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ] -Uplifting [gfx_init_plane_fill] best 15300974 combination zp[2]:64 [ gfx_init_plane_fill::gfxb#2 gfx_init_plane_fill::gfxb#3 gfx_init_plane_fill::gfxb#1 gfx_init_plane_fill::gfxb#6 ] reg byte x [ gfx_init_plane_fill::bx#2 gfx_init_plane_fill::bx#1 ] zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ] zp[1]:62 [ gfx_init_plane_fill::fill#6 ] zp[4]:280 [ gfx_init_plane_fill::$0 ] zp[2]:284 [ gfx_init_plane_fill::$1 ] reg byte a [ gfx_init_plane_fill::gfxbCpuBank#0 ] zp[2]:287 [ gfx_init_plane_fill::$4 ] zp[2]:289 [ gfx_init_plane_fill::$5 ] zp[2]:291 [ gfx_init_plane_fill::gfxb#0 ] zp[4]:58 [ gfx_init_plane_fill::plane_addr#3 ] +Uplifting [gfx_init_charset] best 15301868 combination zp[2]:135 [ gfx_init_charset::charset#2 gfx_init_charset::charset#3 gfx_init_charset::charset#1 ] reg byte x [ gfx_init_charset::l#2 gfx_init_charset::l#1 ] zp[2]:133 [ gfx_init_charset::chargen#2 gfx_init_charset::chargen#3 gfx_init_charset::chargen#1 ] zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ] +Uplifting [gfx_init_plane_fill] best 15300962 combination zp[2]:64 [ gfx_init_plane_fill::gfxb#2 gfx_init_plane_fill::gfxb#3 gfx_init_plane_fill::gfxb#1 gfx_init_plane_fill::gfxb#6 ] reg byte x [ gfx_init_plane_fill::bx#2 gfx_init_plane_fill::bx#1 ] zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ] zp[1]:62 [ gfx_init_plane_fill::fill#6 ] zp[4]:280 [ gfx_init_plane_fill::$0 ] zp[2]:284 [ gfx_init_plane_fill::$1 ] reg byte a [ gfx_init_plane_fill::gfxbCpuBank#0 ] zp[2]:287 [ gfx_init_plane_fill::$4 ] zp[2]:289 [ gfx_init_plane_fill::$5 ] zp[2]:291 [ gfx_init_plane_fill::gfxb#0 ] zp[4]:58 [ gfx_init_plane_fill::plane_addr#3 ] Limited combination testing to 10 combinations of 32 possible. -Uplifting [bitmap_clear] best 15300074 combination zp[2]:124 [ 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[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] zp[2]:321 [ bitmap_clear::bitmap#0 ] -Uplifting [gfx_init_screen4] best 15299174 combination zp[2]:139 [ gfx_init_screen4::ch#2 gfx_init_screen4::ch#3 gfx_init_screen4::ch#1 ] reg byte x [ gfx_init_screen4::cx#2 gfx_init_screen4::cx#1 ] zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ] -Uplifting [gfx_init_plane_vertical] best 15298274 combination zp[2]:73 [ gfx_init_plane_vertical::gfxb#2 gfx_init_plane_vertical::gfxb#3 gfx_init_plane_vertical::gfxb#1 ] reg byte x [ gfx_init_plane_vertical::bx#2 gfx_init_plane_vertical::bx#1 ] zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ] -Uplifting [memset] best 15298274 combination zp[2]:56 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:278 [ memset::end#0 ] zp[2]:276 [ memset::str#0 ] -Uplifting [dtvSetCpuBankSegment1] best 15298135 combination reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#13 dtvSetCpuBankSegment1::cpuBankIdx#1 dtvSetCpuBankSegment1::cpuBankIdx#11 ] -Uplifting [keyboard_event_get] best 15297226 combination reg byte a [ keyboard_event_get::return#3 ] reg byte a [ keyboard_event_get::return#2 keyboard_event_get::return#1 ] zp[1]:267 [ keyboard_event_get::return#4 ] +Uplifting [bitmap_clear] best 15300062 combination zp[2]:124 [ 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[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] zp[2]:321 [ bitmap_clear::bitmap#0 ] +Uplifting [gfx_init_screen4] best 15299162 combination zp[2]:139 [ gfx_init_screen4::ch#2 gfx_init_screen4::ch#3 gfx_init_screen4::ch#1 ] reg byte x [ gfx_init_screen4::cx#2 gfx_init_screen4::cx#1 ] zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ] +Uplifting [gfx_init_plane_vertical] best 15298262 combination zp[2]:73 [ gfx_init_plane_vertical::gfxb#2 gfx_init_plane_vertical::gfxb#3 gfx_init_plane_vertical::gfxb#1 ] reg byte x [ gfx_init_plane_vertical::bx#2 gfx_init_plane_vertical::bx#1 ] zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ] +Uplifting [memset] best 15298262 combination zp[2]:56 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:278 [ memset::end#0 ] zp[2]:276 [ memset::str#0 ] +Uplifting [dtvSetCpuBankSegment1] best 15298123 combination reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#13 dtvSetCpuBankSegment1::cpuBankIdx#1 dtvSetCpuBankSegment1::cpuBankIdx#11 ] +Uplifting [keyboard_event_get] best 15297214 combination reg byte a [ keyboard_event_get::return#3 ] reg byte a [ keyboard_event_get::return#2 keyboard_event_get::return#1 ] zp[1]:267 [ keyboard_event_get::return#4 ] Limited combination testing to 10 combinations of 64 possible. -Uplifting [render_preset_name] best 15296890 combination reg byte a [ render_preset_name::idx#10 render_preset_name::idx#0 render_preset_name::idx#1 ] zp[2]:35 [ render_preset_name::name#13 ] -Uplifting [bitmap_init] best 15296590 combination zp[2]:130 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte y [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] zp[1]:129 [ bitmap_init::y#2 bitmap_init::y#1 ] zp[1]:323 [ bitmap_init::$0 ] zp[1]:325 [ bitmap_init::$7 ] zp[1]:326 [ bitmap_init::$8 ] zp[1]:327 [ bitmap_init::$9 ] zp[1]:324 [ bitmap_init::$10 ] +Uplifting [render_preset_name] best 15296878 combination reg byte a [ render_preset_name::idx#10 render_preset_name::idx#0 render_preset_name::idx#1 ] zp[2]:35 [ render_preset_name::name#13 ] +Uplifting [bitmap_init] best 15296578 combination zp[2]:130 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte y [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] zp[1]:129 [ bitmap_init::y#2 bitmap_init::y#1 ] zp[1]:323 [ bitmap_init::$0 ] zp[1]:325 [ bitmap_init::$7 ] zp[1]:326 [ bitmap_init::$8 ] zp[1]:327 [ bitmap_init::$9 ] zp[1]:324 [ bitmap_init::$10 ] Limited combination testing to 10 combinations of 34560 possible. -Uplifting [gfx_init_vic_bitmap] best 15296590 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ] -Uplifting [keyboard_event_pressed] best 15296578 combination reg byte a [ keyboard_event_pressed::return#0 ] reg byte a [ keyboard_event_pressed::return#1 ] zp[1]:246 [ keyboard_event_pressed::return#2 ] zp[1]:248 [ keyboard_event_pressed::return#3 ] zp[1]:254 [ keyboard_event_pressed::$0 ] zp[1]:256 [ keyboard_event_pressed::$1 ] zp[1]:255 [ keyboard_event_pressed::row_bits#0 ] zp[1]:257 [ keyboard_event_pressed::return#10 ] zp[1]:19 [ keyboard_event_pressed::keycode#4 ] +Uplifting [gfx_init_vic_bitmap] best 15296578 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ] +Uplifting [keyboard_event_pressed] best 15296566 combination reg byte a [ keyboard_event_pressed::return#0 ] reg byte a [ keyboard_event_pressed::return#1 ] zp[1]:246 [ keyboard_event_pressed::return#2 ] zp[1]:248 [ keyboard_event_pressed::return#3 ] zp[1]:254 [ keyboard_event_pressed::$0 ] zp[1]:256 [ keyboard_event_pressed::$1 ] zp[1]:255 [ keyboard_event_pressed::row_bits#0 ] zp[1]:257 [ keyboard_event_pressed::return#10 ] zp[1]:19 [ keyboard_event_pressed::keycode#4 ] Limited combination testing to 10 combinations of 147456 possible. -Uplifting [get_vic_screen] best 15296557 combination reg byte a [ get_vic_screen::idx#2 get_vic_screen::idx#0 get_vic_screen::idx#1 ] zp[2]:208 [ get_vic_screen::return#10 ] zp[2]:227 [ get_vic_screen::return#11 ] zp[2]:21 [ get_vic_screen::return#5 ] -Uplifting [get_plane] best 15296509 combination reg byte a [ get_plane::idx#10 get_plane::idx#1 get_plane::idx#0 ] zp[4]:160 [ get_plane::return#16 ] zp[4]:185 [ get_plane::return#17 ] zp[4]:26 [ get_plane::return#14 ] -Uplifting [bitmap_line] best 15296463 combination zp[1]:303 [ bitmap_line::y1#0 ] zp[1]:302 [ bitmap_line::y0#0 ] reg byte x [ bitmap_line::x1#0 ] zp[1]:300 [ bitmap_line::x0#0 ] zp[1]:305 [ bitmap_line::yd#2 ] zp[1]:306 [ bitmap_line::yd#1 ] zp[1]:308 [ bitmap_line::yd#10 ] zp[1]:309 [ bitmap_line::yd#11 ] zp[1]:304 [ bitmap_line::xd#2 ] zp[1]:307 [ bitmap_line::xd#1 ] +Uplifting [get_vic_screen] best 15296545 combination reg byte a [ get_vic_screen::idx#2 get_vic_screen::idx#0 get_vic_screen::idx#1 ] zp[2]:208 [ get_vic_screen::return#10 ] zp[2]:227 [ get_vic_screen::return#11 ] zp[2]:21 [ get_vic_screen::return#5 ] +Uplifting [get_plane] best 15296497 combination reg byte a [ get_plane::idx#10 get_plane::idx#1 get_plane::idx#0 ] zp[4]:160 [ get_plane::return#16 ] zp[4]:185 [ get_plane::return#17 ] zp[4]:26 [ get_plane::return#14 ] +Uplifting [bitmap_line] best 15296451 combination zp[1]:303 [ bitmap_line::y1#0 ] zp[1]:302 [ bitmap_line::y0#0 ] reg byte x [ bitmap_line::x1#0 ] zp[1]:300 [ bitmap_line::x0#0 ] zp[1]:305 [ bitmap_line::yd#2 ] zp[1]:306 [ bitmap_line::yd#1 ] zp[1]:308 [ bitmap_line::yd#10 ] zp[1]:309 [ bitmap_line::yd#11 ] zp[1]:304 [ bitmap_line::xd#2 ] zp[1]:307 [ bitmap_line::xd#1 ] Limited combination testing to 10 combinations of 186624 possible. -Uplifting [get_vic_charset] best 15296454 combination zp[2]:218 [ get_vic_charset::return#4 ] reg byte a [ get_vic_charset::idx#0 ] zp[2]:23 [ get_vic_charset::return#2 ] -Uplifting [RADIX] best 15296454 combination -Uplifting [print_ln] best 15296454 combination -Uplifting [print_cls] best 15296454 combination -Uplifting [print_set_screen] best 15296454 combination -Uplifting [keyboard_init] best 15296454 combination -Uplifting [main] best 15296454 combination -Uplifting [gfx_init] best 15296454 combination -Uplifting [gfx_init_plane_vertical2] best 15296454 combination -Uplifting [gfx_init_plane_blank] best 15296454 combination -Uplifting [gfx_init_plane_full] best 15296454 combination +Uplifting [get_vic_charset] best 15296442 combination zp[2]:218 [ get_vic_charset::return#4 ] reg byte a [ get_vic_charset::idx#0 ] zp[2]:23 [ get_vic_charset::return#2 ] +Uplifting [RADIX] best 15296442 combination +Uplifting [print_ln] best 15296442 combination +Uplifting [print_cls] best 15296442 combination +Uplifting [print_set_screen] best 15296442 combination +Uplifting [keyboard_init] best 15296442 combination +Uplifting [main] best 15296442 combination +Uplifting [gfx_init] best 15296442 combination +Uplifting [gfx_init_plane_vertical2] best 15296442 combination +Uplifting [gfx_init_plane_blank] best 15296442 combination +Uplifting [gfx_init_plane_full] best 15296442 combination Attempting to uplift remaining variables inzp[1]:18 [ keyboard_events_size#18 keyboard_events_size#109 keyboard_events_size#99 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#108 keyboard_events_size#1 keyboard_events_size#2 ] -Uplifting [] best 15296454 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#109 keyboard_events_size#99 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#108 keyboard_events_size#1 keyboard_events_size#2 ] +Uplifting [] best 15296442 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#109 keyboard_events_size#99 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#108 keyboard_events_size#1 keyboard_events_size#2 ] Attempting to uplift remaining variables inzp[1]:252 [ keyboard_event_scan::event_type#0 ] -Uplifting [keyboard_event_scan] best 14696454 combination reg byte a [ keyboard_event_scan::event_type#0 ] +Uplifting [keyboard_event_scan] best 14696442 combination reg byte a [ keyboard_event_scan::event_type#0 ] Attempting to uplift remaining variables inzp[1]:253 [ keyboard_event_scan::$23 ] -Uplifting [keyboard_event_scan] best 14096454 combination reg byte a [ keyboard_event_scan::$23 ] +Uplifting [keyboard_event_scan] best 14096442 combination reg byte a [ keyboard_event_scan::$23 ] Attempting to uplift remaining variables inzp[1]:16 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] -Uplifting [keyboard_event_scan] best 12596454 combination reg byte x [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] +Uplifting [keyboard_event_scan] best 12596442 combination reg byte x [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] Attempting to uplift remaining variables inzp[1]:17 [ 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 12596454 combination zp[1]:17 [ 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 12596442 combination zp[1]:17 [ 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[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] -Uplifting [keyboard_event_scan] best 12596454 combination zp[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] +Uplifting [keyboard_event_scan] best 12596442 combination zp[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] Attempting to uplift remaining variables inzp[1]:241 [ keyboard_event_scan::row_scan#0 ] -Uplifting [keyboard_event_scan] best 12596454 combination zp[1]:241 [ keyboard_event_scan::row_scan#0 ] +Uplifting [keyboard_event_scan] best 12596442 combination zp[1]:241 [ keyboard_event_scan::row_scan#0 ] Attempting to uplift remaining variables inzp[1]:258 [ keyboard_matrix_read::return#0 ] -Uplifting [keyboard_matrix_read] best 12566451 combination reg byte a [ keyboard_matrix_read::return#0 ] +Uplifting [keyboard_matrix_read] best 12566439 combination reg byte a [ keyboard_matrix_read::return#0 ] Attempting to uplift remaining variables inzp[1]:10 [ gfx_mode::cx#2 gfx_mode::cx#1 ] -Uplifting [gfx_mode] best 12557451 combination reg byte x [ gfx_mode::cx#2 gfx_mode::cx#1 ] +Uplifting [gfx_mode] best 12557439 combination reg byte x [ gfx_mode::cx#2 gfx_mode::cx#1 ] Attempting to uplift remaining variables inzp[1]:88 [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ] -Uplifting [gfx_init_plane_charset8] best 12548451 combination reg byte x [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ] +Uplifting [gfx_init_plane_charset8] best 12548439 combination reg byte x [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ] Attempting to uplift remaining variables inzp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ] -Uplifting [gfx_init_plane_charset8] best 12548451 combination zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ] +Uplifting [gfx_init_plane_charset8] best 12548439 combination zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ] Attempting to uplift remaining variables inzp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ] -Uplifting [gfx_init_plane_charset8] best 12548451 combination zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ] +Uplifting [gfx_init_plane_charset8] best 12548439 combination zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ] Attempting to uplift remaining variables inzp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ] -Uplifting [bitmap_line_xdyi] best 12548451 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ] +Uplifting [bitmap_line_xdyi] best 12548439 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ] Attempting to uplift remaining variables inzp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ] -Uplifting [bitmap_line_ydxi] best 12548451 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ] +Uplifting [bitmap_line_ydxi] best 12548439 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ] Attempting to uplift remaining variables inzp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ] -Uplifting [bitmap_line_xdyd] best 12548451 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ] +Uplifting [bitmap_line_xdyd] best 12548439 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ] Attempting to uplift remaining variables inzp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ] -Uplifting [bitmap_line_ydxd] best 12548451 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ] +Uplifting [bitmap_line_ydxd] best 12548439 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ] Attempting to uplift remaining variables inzp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ] -Uplifting [form_mode] best 12548451 combination zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ] +Uplifting [form_mode] best 12548439 combination zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ] Attempting to uplift remaining variables inzp[1]:11 [ gfx_mode::j#2 gfx_mode::j#1 ] -Uplifting [gfx_mode] best 12547251 combination reg byte x [ gfx_mode::j#2 gfx_mode::j#1 ] +Uplifting [gfx_mode] best 12547239 combination reg byte x [ gfx_mode::j#2 gfx_mode::j#1 ] Attempting to uplift remaining variables inzp[1]:12 [ gfx_mode::i#2 gfx_mode::i#1 ] -Uplifting [gfx_mode] best 12546051 combination reg byte x [ gfx_mode::i#2 gfx_mode::i#1 ] +Uplifting [gfx_mode] best 12546039 combination reg byte x [ gfx_mode::i#2 gfx_mode::i#1 ] Attempting to uplift remaining variables inzp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ] -Uplifting [] best 12546051 combination zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ] +Uplifting [] best 12546039 combination zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ] Attempting to uplift remaining variables inzp[1]:101 [ bitmap_line_xdyi::y#3 bitmap_line_xdyi::y#5 bitmap_line_xdyi::y#0 bitmap_line_xdyi::y#1 bitmap_line_xdyi::y#6 bitmap_line_xdyi::y#2 ] -Uplifting [bitmap_line_xdyi] best 12546051 combination zp[1]:101 [ bitmap_line_xdyi::y#3 bitmap_line_xdyi::y#5 bitmap_line_xdyi::y#0 bitmap_line_xdyi::y#1 bitmap_line_xdyi::y#6 bitmap_line_xdyi::y#2 ] +Uplifting [bitmap_line_xdyi] best 12546039 combination zp[1]:101 [ bitmap_line_xdyi::y#3 bitmap_line_xdyi::y#5 bitmap_line_xdyi::y#0 bitmap_line_xdyi::y#1 bitmap_line_xdyi::y#6 bitmap_line_xdyi::y#2 ] Attempting to uplift remaining variables inzp[1]:115 [ bitmap_line_xdyd::y#3 bitmap_line_xdyd::y#5 bitmap_line_xdyd::y#0 bitmap_line_xdyd::y#1 bitmap_line_xdyd::y#6 bitmap_line_xdyd::y#2 ] -Uplifting [bitmap_line_xdyd] best 12546051 combination zp[1]:115 [ bitmap_line_xdyd::y#3 bitmap_line_xdyd::y#5 bitmap_line_xdyd::y#0 bitmap_line_xdyd::y#1 bitmap_line_xdyd::y#6 bitmap_line_xdyd::y#2 ] +Uplifting [bitmap_line_xdyd] best 12546039 combination zp[1]:115 [ bitmap_line_xdyd::y#3 bitmap_line_xdyd::y#5 bitmap_line_xdyd::y#0 bitmap_line_xdyd::y#1 bitmap_line_xdyd::y#6 bitmap_line_xdyd::y#2 ] Attempting to uplift remaining variables inzp[1]:238 [ gfx_mode::keyboard_event#0 ] -Uplifting [gfx_mode] best 12545451 combination reg byte a [ gfx_mode::keyboard_event#0 ] +Uplifting [gfx_mode] best 12545439 combination reg byte a [ gfx_mode::keyboard_event#0 ] Attempting to uplift remaining variables inzp[1]:274 [ form_set_screen::$1 ] -Uplifting [form_set_screen] best 12544851 combination reg byte a [ form_set_screen::$1 ] +Uplifting [form_set_screen] best 12544839 combination reg byte a [ form_set_screen::$1 ] Attempting to uplift remaining variables inzp[1]:331 [ gfx_init_screen3::$3 ] -Uplifting [gfx_init_screen3] best 12544251 combination reg byte a [ gfx_init_screen3::$3 ] +Uplifting [gfx_init_screen3] best 12544239 combination reg byte a [ gfx_init_screen3::$3 ] Attempting to uplift remaining variables inzp[1]:336 [ gfx_init_screen2::$4 ] -Uplifting [gfx_init_screen2] best 12543651 combination reg byte a [ gfx_init_screen2::$4 ] +Uplifting [gfx_init_screen2] best 12543639 combination reg byte a [ gfx_init_screen2::$4 ] Attempting to uplift remaining variables inzp[1]:338 [ gfx_init_screen1::$1 ] -Uplifting [gfx_init_screen1] best 12543051 combination reg byte a [ gfx_init_screen1::$1 ] +Uplifting [gfx_init_screen1] best 12543039 combination reg byte a [ gfx_init_screen1::$1 ] Attempting to uplift remaining variables inzp[1]:342 [ gfx_init_screen0::$3 ] -Uplifting [gfx_init_screen0] best 12542451 combination reg byte a [ gfx_init_screen0::$3 ] +Uplifting [gfx_init_screen0] best 12542439 combination reg byte a [ gfx_init_screen0::$3 ] Attempting to uplift remaining variables inzp[1]:143 [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ] -Uplifting [gfx_init_screen3] best 12541451 combination reg byte x [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ] +Uplifting [gfx_init_screen3] best 12541439 combination reg byte x [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ] Attempting to uplift remaining variables inzp[1]:155 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] -Uplifting [gfx_init_screen0] best 12540451 combination reg byte x [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] +Uplifting [gfx_init_screen0] best 12540439 combination reg byte x [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] Attempting to uplift remaining variables inzp[1]:71 [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ] -Uplifting [gfx_init_plane_horisontal2] best 12539551 combination reg byte x [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ] +Uplifting [gfx_init_plane_horisontal2] best 12539539 combination reg byte x [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ] Attempting to uplift remaining variables inzp[1]:147 [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ] -Uplifting [gfx_init_screen2] best 12538551 combination reg byte x [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ] +Uplifting [gfx_init_screen2] best 12538539 combination reg byte x [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ] Attempting to uplift remaining variables inzp[1]:5 [ gfx_mode::cy#4 gfx_mode::cy#1 ] -Uplifting [gfx_mode] best 12538551 combination zp[1]:5 [ gfx_mode::cy#4 gfx_mode::cy#1 ] +Uplifting [gfx_mode] best 12538539 combination zp[1]:5 [ gfx_mode::cy#4 gfx_mode::cy#1 ] Attempting to uplift remaining variables inzp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ] -Uplifting [gfx_init_plane_charset8] best 12538551 combination zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ] +Uplifting [gfx_init_plane_charset8] best 12538539 combination zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ] Attempting to uplift remaining variables inzp[1]:333 [ gfx_init_screen2::col#0 ] -Uplifting [gfx_init_screen2] best 12538451 combination reg byte y [ gfx_init_screen2::col#0 ] +Uplifting [gfx_init_screen2] best 12538439 combination reg byte y [ gfx_init_screen2::col#0 ] Attempting to uplift remaining variables inzp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#2 ] -Uplifting [bitmap_line_xdyi] best 12538451 combination zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#2 ] +Uplifting [bitmap_line_xdyi] best 12538439 combination zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#2 ] Attempting to uplift remaining variables inzp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ] -Uplifting [bitmap_line_ydxi] best 12538451 combination zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ] +Uplifting [bitmap_line_ydxi] best 12538439 combination zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ] Attempting to uplift remaining variables inzp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#2 ] -Uplifting [bitmap_line_xdyd] best 12538451 combination zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#2 ] +Uplifting [bitmap_line_xdyd] best 12538439 combination zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#2 ] Attempting to uplift remaining variables inzp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ] -Uplifting [bitmap_line_ydxd] best 12538451 combination zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ] +Uplifting [bitmap_line_ydxd] best 12538439 combination zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ] Attempting to uplift remaining variables inzp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ] -Uplifting [] best 12538451 combination zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ] +Uplifting [] best 12538439 combination zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ] Attempting to uplift remaining variables inzp[1]:329 [ gfx_init_screen3::$1 ] -Uplifting [gfx_init_screen3] best 12538451 combination zp[1]:329 [ gfx_init_screen3::$1 ] +Uplifting [gfx_init_screen3] best 12538439 combination zp[1]:329 [ gfx_init_screen3::$1 ] Attempting to uplift remaining variables inzp[1]:334 [ gfx_init_screen2::col2#0 ] -Uplifting [gfx_init_screen2] best 12538451 combination zp[1]:334 [ gfx_init_screen2::col2#0 ] +Uplifting [gfx_init_screen2] best 12538439 combination zp[1]:334 [ gfx_init_screen2::col2#0 ] Attempting to uplift remaining variables inzp[1]:340 [ gfx_init_screen0::$1 ] -Uplifting [gfx_init_screen0] best 12538451 combination zp[1]:340 [ gfx_init_screen0::$1 ] +Uplifting [gfx_init_screen0] best 12538439 combination zp[1]:340 [ gfx_init_screen0::$1 ] Attempting to uplift remaining variables inzp[1]:2 [ gfx_mode::dtv_control#12 gfx_mode::dtv_control#6 gfx_mode::dtv_control#13 gfx_mode::dtv_control#5 gfx_mode::dtv_control#11 gfx_mode::dtv_control#4 gfx_mode::dtv_control#10 gfx_mode::dtv_control#3 gfx_mode::dtv_control#15 gfx_mode::dtv_control#14 gfx_mode::dtv_control#2 ] -Uplifting [gfx_mode] best 12538432 combination reg byte x [ gfx_mode::dtv_control#12 gfx_mode::dtv_control#6 gfx_mode::dtv_control#13 gfx_mode::dtv_control#5 gfx_mode::dtv_control#11 gfx_mode::dtv_control#4 gfx_mode::dtv_control#10 gfx_mode::dtv_control#3 gfx_mode::dtv_control#15 gfx_mode::dtv_control#14 gfx_mode::dtv_control#2 ] +Uplifting [gfx_mode] best 12538420 combination reg byte x [ gfx_mode::dtv_control#12 gfx_mode::dtv_control#6 gfx_mode::dtv_control#13 gfx_mode::dtv_control#5 gfx_mode::dtv_control#11 gfx_mode::dtv_control#4 gfx_mode::dtv_control#10 gfx_mode::dtv_control#3 gfx_mode::dtv_control#15 gfx_mode::dtv_control#14 gfx_mode::dtv_control#2 ] Attempting to uplift remaining variables inzp[1]:265 [ form_field_ptr::x#0 ] -Uplifting [form_field_ptr] best 12538432 combination zp[1]:265 [ form_field_ptr::x#0 ] +Uplifting [form_field_ptr] best 12538420 combination zp[1]:265 [ form_field_ptr::x#0 ] Attempting to uplift remaining variables inzp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ] -Uplifting [gfx_init_vic_bitmap] best 12538432 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ] +Uplifting [gfx_init_vic_bitmap] best 12538420 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ] Attempting to uplift remaining variables inzp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ] -Uplifting [gfx_init_plane_horisontal2] best 12538432 combination zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ] +Uplifting [gfx_init_plane_horisontal2] best 12538420 combination zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ] Attempting to uplift remaining variables inzp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ] -Uplifting [gfx_init_screen1] best 12538432 combination zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ] +Uplifting [gfx_init_screen1] best 12538420 combination zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ] Attempting to uplift remaining variables inzp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ] -Uplifting [gfx_init_screen3] best 12538432 combination zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ] +Uplifting [gfx_init_screen3] best 12538420 combination zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ] Attempting to uplift remaining variables inzp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ] -Uplifting [gfx_init_screen0] best 12538432 combination zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ] +Uplifting [gfx_init_screen0] best 12538420 combination zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ] Attempting to uplift remaining variables inzp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ] -Uplifting [gfx_init_plane_horisontal] best 12538432 combination zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ] +Uplifting [gfx_init_plane_horisontal] best 12538420 combination zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ] Attempting to uplift remaining variables inzp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ] -Uplifting [gfx_init_screen2] best 12538432 combination zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ] +Uplifting [gfx_init_screen2] best 12538420 combination zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ] Attempting to uplift remaining variables inzp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ] -Uplifting [gfx_init_plane_8bppchunky] best 12538432 combination zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ] +Uplifting [gfx_init_plane_8bppchunky] best 12538420 combination zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ] Attempting to uplift remaining variables inzp[1]:129 [ bitmap_init::y#2 bitmap_init::y#1 ] -Uplifting [bitmap_init] best 12538252 combination reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] +Uplifting [bitmap_init] best 12538240 combination reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] Attempting to uplift remaining variables inzp[1]:323 [ bitmap_init::$0 ] -Uplifting [bitmap_init] best 12538212 combination reg byte a [ bitmap_init::$0 ] +Uplifting [bitmap_init] best 12538200 combination reg byte a [ bitmap_init::$0 ] Attempting to uplift remaining variables inzp[1]:325 [ bitmap_init::$7 ] -Uplifting [bitmap_init] best 12538152 combination reg byte a [ bitmap_init::$7 ] +Uplifting [bitmap_init] best 12538140 combination reg byte a [ bitmap_init::$7 ] Attempting to uplift remaining variables inzp[1]:326 [ bitmap_init::$8 ] -Uplifting [bitmap_init] best 12538092 combination reg byte a [ bitmap_init::$8 ] +Uplifting [bitmap_init] best 12538080 combination reg byte a [ bitmap_init::$8 ] Attempting to uplift remaining variables inzp[1]:327 [ bitmap_init::$9 ] -Uplifting [bitmap_init] best 12538032 combination reg byte a [ bitmap_init::$9 ] +Uplifting [bitmap_init] best 12538020 combination reg byte a [ bitmap_init::$9 ] Attempting to uplift remaining variables inzp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ] -Uplifting [gfx_init_plane_fill] best 12538032 combination zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ] +Uplifting [gfx_init_plane_fill] best 12538020 combination zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ] Attempting to uplift remaining variables inzp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ] -Uplifting [gfx_init_plane_vertical] best 12538032 combination zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ] +Uplifting [gfx_init_plane_vertical] best 12538020 combination zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ] Attempting to uplift remaining variables inzp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] -Uplifting [bitmap_clear] best 12538032 combination zp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] +Uplifting [bitmap_clear] best 12538020 combination zp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] Attempting to uplift remaining variables inzp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ] -Uplifting [gfx_init_screen4] best 12538032 combination zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ] +Uplifting [gfx_init_screen4] best 12538020 combination zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ] Attempting to uplift remaining variables inzp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ] -Uplifting [gfx_init_charset] best 12538032 combination zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ] +Uplifting [gfx_init_charset] best 12538020 combination zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ] Attempting to uplift remaining variables inzp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#0 bitmap_line_xdyi::xd#1 ] -Uplifting [bitmap_line_xdyi] best 12538032 combination zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#0 bitmap_line_xdyi::xd#1 ] +Uplifting [bitmap_line_xdyi] best 12538020 combination zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#0 bitmap_line_xdyi::xd#1 ] Attempting to uplift remaining variables inzp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ] -Uplifting [bitmap_line_ydxi] best 12538032 combination zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ] +Uplifting [bitmap_line_ydxi] best 12538020 combination zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ] Attempting to uplift remaining variables inzp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#0 bitmap_line_xdyd::xd#1 ] -Uplifting [bitmap_line_xdyd] best 12538032 combination zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#0 bitmap_line_xdyd::xd#1 ] +Uplifting [bitmap_line_xdyd] best 12538020 combination zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#0 bitmap_line_xdyd::xd#1 ] Attempting to uplift remaining variables inzp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ] -Uplifting [bitmap_line_ydxd] best 12538032 combination zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ] +Uplifting [bitmap_line_ydxd] best 12538020 combination zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ] Attempting to uplift remaining variables inzp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ] -Uplifting [gfx_init_plane_charset8] best 12538032 combination zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ] +Uplifting [gfx_init_plane_charset8] best 12538020 combination zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ] Attempting to uplift remaining variables inzp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#0 bitmap_line_xdyi::yd#1 ] -Uplifting [bitmap_line_xdyi] best 12538032 combination zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#0 bitmap_line_xdyi::yd#1 ] +Uplifting [bitmap_line_xdyi] best 12538020 combination zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#0 bitmap_line_xdyi::yd#1 ] Attempting to uplift remaining variables inzp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ] -Uplifting [bitmap_line_ydxi] best 12538032 combination zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ] +Uplifting [bitmap_line_ydxi] best 12538020 combination zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ] Attempting to uplift remaining variables inzp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#0 bitmap_line_xdyd::yd#1 ] -Uplifting [bitmap_line_xdyd] best 12538032 combination zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#0 bitmap_line_xdyd::yd#1 ] +Uplifting [bitmap_line_xdyd] best 12538020 combination zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#0 bitmap_line_xdyd::yd#1 ] Attempting to uplift remaining variables inzp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ] -Uplifting [bitmap_line_ydxd] best 12538032 combination zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ] +Uplifting [bitmap_line_ydxd] best 12538020 combination zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ] Attempting to uplift remaining variables inzp[1]:3 [ gfx_mode::vic_control#4 gfx_mode::vic_control#2 gfx_mode::vic_control#5 ] -Uplifting [gfx_mode] best 12538021 combination reg byte x [ gfx_mode::vic_control#4 gfx_mode::vic_control#2 gfx_mode::vic_control#5 ] +Uplifting [gfx_mode] best 12538009 combination reg byte x [ gfx_mode::vic_control#4 gfx_mode::vic_control#2 gfx_mode::vic_control#5 ] Attempting to uplift remaining variables inzp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#0 bitmap_line_xdyi::x1#1 ] -Uplifting [bitmap_line_xdyi] best 12538021 combination zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#0 bitmap_line_xdyi::x1#1 ] +Uplifting [bitmap_line_xdyi] best 12538009 combination zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#0 bitmap_line_xdyi::x1#1 ] Attempting to uplift remaining variables inzp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ] -Uplifting [bitmap_line_ydxi] best 12538021 combination zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ] +Uplifting [bitmap_line_ydxi] best 12538009 combination zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ] Attempting to uplift remaining variables inzp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#0 bitmap_line_xdyd::x1#1 ] -Uplifting [bitmap_line_xdyd] best 12538021 combination zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#0 bitmap_line_xdyd::x1#1 ] +Uplifting [bitmap_line_xdyd] best 12538009 combination zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#0 bitmap_line_xdyd::x1#1 ] Attempting to uplift remaining variables inzp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ] -Uplifting [bitmap_line_ydxd] best 12538021 combination zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ] +Uplifting [bitmap_line_ydxd] best 12538009 combination zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ] Attempting to uplift remaining variables inzp[1]:62 [ gfx_init_plane_fill::fill#6 ] -Uplifting [gfx_init_plane_fill] best 12538021 combination zp[1]:62 [ gfx_init_plane_fill::fill#6 ] +Uplifting [gfx_init_plane_fill] best 12538009 combination zp[1]:62 [ gfx_init_plane_fill::fill#6 ] Attempting to uplift remaining variables inzp[1]:324 [ bitmap_init::$10 ] -Uplifting [bitmap_init] best 12538021 combination zp[1]:324 [ bitmap_init::$10 ] +Uplifting [bitmap_init] best 12538009 combination zp[1]:324 [ bitmap_init::$10 ] Attempting to uplift remaining variables inzp[1]:158 [ gfx_mode::$20 ] -Uplifting [gfx_mode] best 12538015 combination reg byte a [ gfx_mode::$20 ] +Uplifting [gfx_mode] best 12538003 combination reg byte a [ gfx_mode::$20 ] Attempting to uplift remaining variables inzp[1]:174 [ gfx_mode::$25 ] -Uplifting [gfx_mode] best 12538009 combination reg byte a [ gfx_mode::$25 ] +Uplifting [gfx_mode] best 12537997 combination reg byte a [ gfx_mode::$25 ] Attempting to uplift remaining variables inzp[1]:175 [ gfx_mode::$27 ] -Uplifting [gfx_mode] best 12538003 combination reg byte a [ gfx_mode::$27 ] +Uplifting [gfx_mode] best 12537991 combination reg byte a [ gfx_mode::$27 ] Attempting to uplift remaining variables inzp[1]:178 [ gfx_mode::$29 ] -Uplifting [gfx_mode] best 12537997 combination reg byte a [ gfx_mode::$29 ] +Uplifting [gfx_mode] best 12537985 combination reg byte a [ gfx_mode::$29 ] Attempting to uplift remaining variables inzp[1]:179 [ gfx_mode::$30 ] -Uplifting [gfx_mode] best 12537991 combination reg byte a [ gfx_mode::$30 ] +Uplifting [gfx_mode] best 12537979 combination reg byte a [ gfx_mode::$30 ] Attempting to uplift remaining variables inzp[1]:180 [ gfx_mode::$31 ] -Uplifting [gfx_mode] best 12537985 combination reg byte a [ gfx_mode::$31 ] +Uplifting [gfx_mode] best 12537973 combination reg byte a [ gfx_mode::$31 ] Attempting to uplift remaining variables inzp[1]:181 [ gfx_mode::$32 ] -Uplifting [gfx_mode] best 12537979 combination reg byte a [ gfx_mode::$32 ] +Uplifting [gfx_mode] best 12537967 combination reg byte a [ gfx_mode::$32 ] Attempting to uplift remaining variables inzp[1]:182 [ gfx_mode::$33 ] -Uplifting [gfx_mode] best 12537973 combination reg byte a [ gfx_mode::$33 ] +Uplifting [gfx_mode] best 12537961 combination reg byte a [ gfx_mode::$33 ] Attempting to uplift remaining variables inzp[1]:183 [ gfx_mode::$34 ] -Uplifting [gfx_mode] best 12537967 combination reg byte a [ gfx_mode::$34 ] +Uplifting [gfx_mode] best 12537955 combination reg byte a [ gfx_mode::$34 ] Attempting to uplift remaining variables inzp[1]:199 [ gfx_mode::$39 ] -Uplifting [gfx_mode] best 12537961 combination reg byte a [ gfx_mode::$39 ] +Uplifting [gfx_mode] best 12537949 combination reg byte a [ gfx_mode::$39 ] Attempting to uplift remaining variables inzp[1]:200 [ gfx_mode::$41 ] -Uplifting [gfx_mode] best 12537955 combination reg byte a [ gfx_mode::$41 ] +Uplifting [gfx_mode] best 12537943 combination reg byte a [ gfx_mode::$41 ] Attempting to uplift remaining variables inzp[1]:203 [ gfx_mode::$43 ] -Uplifting [gfx_mode] best 12537949 combination reg byte a [ gfx_mode::$43 ] +Uplifting [gfx_mode] best 12537937 combination reg byte a [ gfx_mode::$43 ] Attempting to uplift remaining variables inzp[1]:204 [ gfx_mode::$44 ] -Uplifting [gfx_mode] best 12537943 combination reg byte a [ gfx_mode::$44 ] +Uplifting [gfx_mode] best 12537931 combination reg byte a [ gfx_mode::$44 ] Attempting to uplift remaining variables inzp[1]:205 [ gfx_mode::$45 ] -Uplifting [gfx_mode] best 12537937 combination reg byte a [ gfx_mode::$45 ] +Uplifting [gfx_mode] best 12537925 combination reg byte a [ gfx_mode::$45 ] Attempting to uplift remaining variables inzp[1]:206 [ gfx_mode::$46 ] -Uplifting [gfx_mode] best 12537931 combination reg byte a [ gfx_mode::$46 ] +Uplifting [gfx_mode] best 12537919 combination reg byte a [ gfx_mode::$46 ] Attempting to uplift remaining variables inzp[1]:207 [ gfx_mode::$47 ] -Uplifting [gfx_mode] best 12537925 combination reg byte a [ gfx_mode::$47 ] +Uplifting [gfx_mode] best 12537913 combination reg byte a [ gfx_mode::$47 ] Attempting to uplift remaining variables inzp[1]:224 [ gfx_mode::$60 ] -Uplifting [gfx_mode] best 12537919 combination reg byte a [ gfx_mode::$60 ] +Uplifting [gfx_mode] best 12537907 combination reg byte a [ gfx_mode::$60 ] Attempting to uplift remaining variables inzp[1]:225 [ gfx_mode::$61 ] -Uplifting [gfx_mode] best 12537913 combination reg byte a [ gfx_mode::$61 ] +Uplifting [gfx_mode] best 12537901 combination reg byte a [ gfx_mode::$61 ] Attempting to uplift remaining variables inzp[1]:226 [ gfx_mode::$62 ] -Uplifting [gfx_mode] best 12537907 combination reg byte a [ gfx_mode::$62 ] +Uplifting [gfx_mode] best 12537895 combination reg byte a [ gfx_mode::$62 ] Attempting to uplift remaining variables inzp[1]:229 [ gfx_mode::$64 ] -Uplifting [gfx_mode] best 12537901 combination reg byte a [ gfx_mode::$64 ] +Uplifting [gfx_mode] best 12537889 combination reg byte a [ gfx_mode::$64 ] Attempting to uplift remaining variables inzp[1]:230 [ gfx_mode::$65 ] -Uplifting [gfx_mode] best 12537895 combination reg byte a [ gfx_mode::$65 ] +Uplifting [gfx_mode] best 12537883 combination reg byte a [ gfx_mode::$65 ] Attempting to uplift remaining variables inzp[1]:231 [ gfx_mode::$66 ] -Uplifting [gfx_mode] best 12537889 combination reg byte a [ gfx_mode::$66 ] +Uplifting [gfx_mode] best 12537877 combination reg byte a [ gfx_mode::$66 ] Attempting to uplift remaining variables inzp[1]:232 [ gfx_mode::$67 ] -Uplifting [gfx_mode] best 12537883 combination reg byte a [ gfx_mode::$67 ] +Uplifting [gfx_mode] best 12537871 combination reg byte a [ gfx_mode::$67 ] Attempting to uplift remaining variables inzp[1]:233 [ gfx_mode::$68 ] -Uplifting [gfx_mode] best 12537877 combination reg byte a [ gfx_mode::$68 ] +Uplifting [gfx_mode] best 12537865 combination reg byte a [ gfx_mode::$68 ] Attempting to uplift remaining variables inzp[1]:234 [ gfx_mode::$69 ] -Uplifting [gfx_mode] best 12537871 combination reg byte a [ gfx_mode::$69 ] +Uplifting [gfx_mode] best 12537859 combination reg byte a [ gfx_mode::$69 ] Attempting to uplift remaining variables inzp[1]:235 [ gfx_mode::$70 ] -Uplifting [gfx_mode] best 12537865 combination reg byte a [ gfx_mode::$70 ] +Uplifting [gfx_mode] best 12537853 combination reg byte a [ gfx_mode::$70 ] Attempting to uplift remaining variables inzp[1]:236 [ gfx_mode::$71 ] -Uplifting [gfx_mode] best 12537859 combination reg byte a [ gfx_mode::$71 ] +Uplifting [gfx_mode] best 12537847 combination reg byte a [ gfx_mode::$71 ] Attempting to uplift remaining variables inzp[1]:243 [ keyboard_event_scan::$0 ] -Uplifting [keyboard_event_scan] best 12537853 combination reg byte a [ keyboard_event_scan::$0 ] +Uplifting [keyboard_event_scan] best 12537841 combination reg byte a [ keyboard_event_scan::$0 ] Attempting to uplift remaining variables inzp[1]:245 [ keyboard_event_scan::$3 ] -Uplifting [keyboard_event_scan] best 12537847 combination reg byte a [ keyboard_event_scan::$3 ] +Uplifting [keyboard_event_scan] best 12537835 combination reg byte a [ keyboard_event_scan::$3 ] Attempting to uplift remaining variables inzp[1]:246 [ keyboard_event_pressed::return#2 ] -Uplifting [keyboard_event_pressed] best 12537841 combination reg byte a [ keyboard_event_pressed::return#2 ] +Uplifting [keyboard_event_pressed] best 12537829 combination reg byte a [ keyboard_event_pressed::return#2 ] Attempting to uplift remaining variables inzp[1]:247 [ keyboard_event_scan::$6 ] -Uplifting [keyboard_event_scan] best 12537835 combination reg byte a [ keyboard_event_scan::$6 ] +Uplifting [keyboard_event_scan] best 12537823 combination reg byte a [ keyboard_event_scan::$6 ] Attempting to uplift remaining variables inzp[1]:248 [ keyboard_event_pressed::return#3 ] -Uplifting [keyboard_event_pressed] best 12537829 combination reg byte a [ keyboard_event_pressed::return#3 ] +Uplifting [keyboard_event_pressed] best 12537817 combination reg byte a [ keyboard_event_pressed::return#3 ] Attempting to uplift remaining variables inzp[1]:249 [ keyboard_event_scan::$9 ] -Uplifting [keyboard_event_scan] best 12537823 combination reg byte a [ keyboard_event_scan::$9 ] +Uplifting [keyboard_event_scan] best 12537811 combination reg byte a [ keyboard_event_scan::$9 ] Attempting to uplift remaining variables inzp[1]:254 [ keyboard_event_pressed::$0 ] -Uplifting [keyboard_event_pressed] best 12537819 combination reg byte a [ keyboard_event_pressed::$0 ] +Uplifting [keyboard_event_pressed] best 12537807 combination reg byte a [ keyboard_event_pressed::$0 ] Attempting to uplift remaining variables inzp[1]:256 [ keyboard_event_pressed::$1 ] -Uplifting [keyboard_event_pressed] best 12537815 combination reg byte a [ keyboard_event_pressed::$1 ] +Uplifting [keyboard_event_pressed] best 12537803 combination reg byte a [ keyboard_event_pressed::$1 ] Attempting to uplift remaining variables inzp[1]:266 [ form_control::$13 ] -Uplifting [form_control] best 12537809 combination reg byte a [ form_control::$13 ] +Uplifting [form_control] best 12537797 combination reg byte a [ form_control::$13 ] Attempting to uplift remaining variables inzp[1]:267 [ keyboard_event_get::return#4 ] -Uplifting [keyboard_event_get] best 12537803 combination reg byte a [ keyboard_event_get::return#4 ] +Uplifting [keyboard_event_get] best 12537791 combination reg byte a [ keyboard_event_get::return#4 ] Attempting to uplift remaining variables inzp[1]:269 [ form_control::$15 ] -Uplifting [form_control] best 12537797 combination reg byte a [ form_control::$15 ] +Uplifting [form_control] best 12537785 combination reg byte a [ form_control::$15 ] Attempting to uplift remaining variables inzp[1]:270 [ form_control::$16 ] -Uplifting [form_control] best 12537793 combination reg byte a [ form_control::$16 ] +Uplifting [form_control] best 12537781 combination reg byte a [ form_control::$16 ] Attempting to uplift remaining variables inzp[1]:271 [ form_control::$24 ] -Uplifting [form_control] best 12537789 combination reg byte a [ form_control::$24 ] +Uplifting [form_control] best 12537777 combination reg byte a [ form_control::$24 ] Attempting to uplift remaining variables inzp[1]:272 [ form_control::$14 ] -Uplifting [form_control] best 12537783 combination reg byte a [ form_control::$14 ] +Uplifting [form_control] best 12537771 combination reg byte a [ form_control::$14 ] Attempting to uplift remaining variables inzp[1]:317 [ bitmap_plot::$1 ] -Uplifting [bitmap_plot] best 12537777 combination reg byte a [ bitmap_plot::$1 ] +Uplifting [bitmap_plot] best 12537765 combination reg byte a [ bitmap_plot::$1 ] Attempting to uplift remaining variables inzp[1]:268 [ form_control::key_event#0 ] -Uplifting [form_control] best 12537765 combination reg byte a [ form_control::key_event#0 ] +Uplifting [form_control] best 12537753 combination reg byte a [ form_control::key_event#0 ] Attempting to uplift remaining variables inzp[1]:4 [ gfx_mode::vic_control2#2 ] -Uplifting [gfx_mode] best 12537756 combination reg byte a [ gfx_mode::vic_control2#2 ] +Uplifting [gfx_mode] best 12537744 combination reg byte a [ gfx_mode::vic_control2#2 ] Attempting to uplift remaining variables inzp[1]:255 [ keyboard_event_pressed::row_bits#0 ] -Uplifting [keyboard_event_pressed] best 12537756 combination zp[1]:255 [ keyboard_event_pressed::row_bits#0 ] +Uplifting [keyboard_event_pressed] best 12537744 combination zp[1]:255 [ keyboard_event_pressed::row_bits#0 ] Attempting to uplift remaining variables inzp[1]:303 [ bitmap_line::y1#0 ] -Uplifting [bitmap_line] best 12537756 combination zp[1]:303 [ bitmap_line::y1#0 ] +Uplifting [bitmap_line] best 12537744 combination zp[1]:303 [ bitmap_line::y1#0 ] Attempting to uplift remaining variables inzp[1]:302 [ bitmap_line::y0#0 ] -Uplifting [bitmap_line] best 12537756 combination zp[1]:302 [ bitmap_line::y0#0 ] +Uplifting [bitmap_line] best 12537744 combination zp[1]:302 [ bitmap_line::y0#0 ] Attempting to uplift remaining variables inzp[1]:257 [ keyboard_event_pressed::return#10 ] -Uplifting [keyboard_event_pressed] best 12537741 combination reg byte a [ keyboard_event_pressed::return#10 ] +Uplifting [keyboard_event_pressed] best 12537729 combination reg byte a [ keyboard_event_pressed::return#10 ] Attempting to uplift remaining variables inzp[1]:19 [ keyboard_event_pressed::keycode#4 ] -Uplifting [keyboard_event_pressed] best 12537741 combination zp[1]:19 [ keyboard_event_pressed::keycode#4 ] +Uplifting [keyboard_event_pressed] best 12537729 combination zp[1]:19 [ keyboard_event_pressed::keycode#4 ] Attempting to uplift remaining variables inzp[1]:300 [ bitmap_line::x0#0 ] -Uplifting [bitmap_line] best 12537741 combination zp[1]:300 [ bitmap_line::x0#0 ] +Uplifting [bitmap_line] best 12537729 combination zp[1]:300 [ bitmap_line::x0#0 ] Attempting to uplift remaining variables inzp[1]:305 [ bitmap_line::yd#2 ] -Uplifting [bitmap_line] best 12537731 combination reg byte y [ bitmap_line::yd#2 ] +Uplifting [bitmap_line] best 12537719 combination reg byte y [ bitmap_line::yd#2 ] Attempting to uplift remaining variables inzp[1]:306 [ bitmap_line::yd#1 ] -Uplifting [bitmap_line] best 12537721 combination reg byte y [ bitmap_line::yd#1 ] +Uplifting [bitmap_line] best 12537709 combination reg byte y [ bitmap_line::yd#1 ] Attempting to uplift remaining variables inzp[1]:308 [ bitmap_line::yd#10 ] -Uplifting [bitmap_line] best 12537711 combination reg byte y [ bitmap_line::yd#10 ] +Uplifting [bitmap_line] best 12537699 combination reg byte y [ bitmap_line::yd#10 ] Attempting to uplift remaining variables inzp[1]:309 [ bitmap_line::yd#11 ] -Uplifting [bitmap_line] best 12537701 combination reg byte y [ bitmap_line::yd#11 ] +Uplifting [bitmap_line] best 12537689 combination reg byte y [ bitmap_line::yd#11 ] Attempting to uplift remaining variables inzp[1]:159 [ gfx_mode::plane_a_offs#0 ] -Uplifting [gfx_mode] best 12537699 combination reg byte x [ gfx_mode::plane_a_offs#0 ] +Uplifting [gfx_mode] best 12537687 combination reg byte x [ gfx_mode::plane_a_offs#0 ] Attempting to uplift remaining variables inzp[1]:184 [ gfx_mode::plane_b_offs#0 ] -Uplifting [gfx_mode] best 12537697 combination reg byte x [ gfx_mode::plane_b_offs#0 ] +Uplifting [gfx_mode] best 12537685 combination reg byte x [ gfx_mode::plane_b_offs#0 ] Attempting to uplift remaining variables inzp[1]:304 [ bitmap_line::xd#2 ] -Uplifting [bitmap_line] best 12537697 combination zp[1]:304 [ bitmap_line::xd#2 ] +Uplifting [bitmap_line] best 12537685 combination zp[1]:304 [ bitmap_line::xd#2 ] Attempting to uplift remaining variables inzp[1]:307 [ bitmap_line::xd#1 ] -Uplifting [bitmap_line] best 12537697 combination zp[1]:307 [ bitmap_line::xd#1 ] +Uplifting [bitmap_line] best 12537685 combination zp[1]:307 [ bitmap_line::xd#1 ] Attempting to uplift remaining variables inzp[1]:216 [ gfx_mode::$56 ] -Uplifting [gfx_mode] best 12537697 combination zp[1]:216 [ gfx_mode::$56 ] +Uplifting [gfx_mode] best 12537685 combination zp[1]:216 [ gfx_mode::$56 ] Coalescing zero page register [ zp[2]:6 [ gfx_mode::vic_colors#2 gfx_mode::vic_colors#3 gfx_mode::vic_colors#1 gfx_mode::vic_colors#0 ] ] with [ zp[2]:227 [ get_vic_screen::return#11 ] ] - score: 1 Coalescing zero page register [ zp[2]:21 [ get_vic_screen::return#5 ] ] with [ zp[2]:208 [ get_vic_screen::return#10 ] ] - score: 1 Coalescing zero page register [ zp[2]:23 [ get_vic_charset::return#2 ] ] with [ zp[2]:218 [ get_vic_charset::return#4 ] ] - score: 1 @@ -25555,21 +25555,21 @@ gfx_init_plane_fill: { .label fill = 8 // [481] (dword~) gfx_init_plane_fill::$0 ← (dword) gfx_init_plane_fill::plane_addr#3 << (byte) 2 -- vduz1=vduz2_rol_2 lda.z plane_addr + asl sta.z __0 lda.z plane_addr+1 + rol sta.z __0+1 lda.z plane_addr+2 + rol sta.z __0+2 lda.z plane_addr+3 + rol sta.z __0+3 asl.z __0 rol.z __0+1 rol.z __0+2 rol.z __0+3 - asl.z __0 - rol.z __0+1 - rol.z __0+2 - rol.z __0+3 // [482] (word~) gfx_init_plane_fill::$1 ← > (dword~) gfx_init_plane_fill::$0 -- vwuz1=_hi_vduz2 lda.z __0+2 sta.z __1 @@ -30172,7 +30172,7 @@ reg byte a [ gfx_init_screen0::$3 ] FINAL ASSEMBLER -Score: 10133397 +Score: 10133385 // File Comments // Interactive Explorer for C64DTV Screen Modes @@ -33028,21 +33028,21 @@ gfx_init_plane_fill: { // plane_addr*4 // [481] (dword~) gfx_init_plane_fill::$0 ← (dword) gfx_init_plane_fill::plane_addr#3 << (byte) 2 -- vduz1=vduz2_rol_2 lda.z plane_addr + asl sta.z __0 lda.z plane_addr+1 + rol sta.z __0+1 lda.z plane_addr+2 + rol sta.z __0+2 lda.z plane_addr+3 + rol sta.z __0+3 asl.z __0 rol.z __0+1 rol.z __0+2 rol.z __0+3 - asl.z __0 - rol.z __0+1 - rol.z __0+2 - rol.z __0+3 // >(plane_addr*4) // [482] (word~) gfx_init_plane_fill::$1 ← > (dword~) gfx_init_plane_fill::$0 -- vwuz1=_hi_vduz2 lda.z __0+2 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.asm b/src/test/ref/examples/scrolllogo/scrolllogo.asm index c3ade05bc..54af9893e 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.asm +++ b/src/test/ref/examples/scrolllogo/scrolllogo.asm @@ -25,7 +25,7 @@ .label SCREEN = $400 .label LOGO = $2000 .const XSIN_SIZE = $200 - .label rem16u = $10 + .label rem16u = $c .label xsin_idx = $23 main: { .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f @@ -65,9 +65,9 @@ main: { rts } loop: { - .label __2 = $16 - .label __7 = $16 - .label xpos = $16 + .label __2 = $12 + .label __7 = $12 + .label xpos = $12 lda #<0 sta.z xsin_idx sta.z xsin_idx+1 @@ -117,13 +117,13 @@ loop: { dec BORDERCOL jmp __b1 } -// render_logo(signed word zeropage($16) xpos) +// render_logo(signed word zeropage($12) xpos) render_logo: { - .label __3 = $1d - .label xpos = $16 - .label x_char = $18 - .label logo_idx = $b - .label logo_idx_1 = 2 + .label __3 = $19 + .label xpos = $12 + .label x_char = $14 + .label logo_idx = 2 + .label logo_idx_1 = 3 lda.z xpos and #7 ora #VIC_MCM @@ -248,16 +248,16 @@ render_logo: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($10) sintab) +// sin16s_gen2(signed word* zeropage($c) sintab) sin16s_gen2: { .const min = -$140 .const max = $140 .label ampl = max-min - .label __6 = $c - .label __9 = $1d - .label step = $19 - .label sintab = $10 - .label x = 3 + .label __6 = 8 + .label __9 = $19 + .label step = $15 + .label sintab = $c + .label x = 4 .label i = $23 jsr div32u16u lda #PI_u4f28>>$10 bcc b1 @@ -464,12 +463,10 @@ sin16s: { lda.z x+3 sbc #>PI_u4f28>>$10 sta.z x+3 - lda #1 - sta.z isUpper + ldy #1 jmp __b1 b1: - lda #0 - sta.z isUpper + ldy #0 __b1: lda.z x+3 cmp #>PI_HALF_u4f28>>$10 @@ -501,14 +498,26 @@ sin16s: { sbc.z x+3 sta.z x+3 __b2: - ldy #3 - !: + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- lda.z __4+2 sta.z x1 lda.z __4+3 @@ -581,8 +590,7 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - lda.z isUpper - cmp #0 + cpy #0 beq __b3 sec lda #0 @@ -596,14 +604,14 @@ sin16s: { } // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($16) v1, word zeropage($1d) v2, byte register(X) select) +// mulu16_sel(word zeropage($12) v1, word zeropage($19) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $16 - .label v2 = $1d + .label __0 = 8 + .label __1 = 8 + .label v1 = $12 + .label v2 = $19 .label return = $21 - .label return_1 = $16 + .label return_1 = $12 lda.z v1 sta.z mul16u.a lda.z v1+1 @@ -636,8 +644,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $21 - .label quotient_lo = $12 - .label return = $19 + .label quotient_lo = $e + .label return = $15 lda #>$10 sta.z divr16u.dividend lda #>PI2_u4f28>>$10 @@ -669,12 +677,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($1d) dividend, word zeropage($10) rem) +// divr16u(word zeropage($19) dividend, word zeropage($c) rem) divr16u: { - .label rem = $10 - .label dividend = $1d - .label quotient = $12 - .label return = $12 + .label rem = $c + .label dividend = $19 + .label quotient = $e + .label return = $e ldx #0 txa sta.z quotient @@ -720,11 +728,11 @@ divr16u: { 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($14) str, byte register(X) c) +// memset(void* zeropage($10) str, byte register(X) c) memset: { .label end = $23 - .label dst = $14 - .label str = $14 + .label dst = $10 + .label str = $10 lda.z str clc adc #<$3e8 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.log b/src/test/ref/examples/scrolllogo/scrolllogo.log index e6eaab90b..9e9e74ee4 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.log +++ b/src/test/ref/examples/scrolllogo/scrolllogo.log @@ -5384,21 +5384,25 @@ sin16s: { __b2: // [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 lda.z x + asl sta.z __4 lda.z x+1 + rol sta.z __4+1 lda.z x+2 + rol sta.z __4+2 lda.z x+3 + rol sta.z __4+3 - ldy #3 - !: asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 // [144] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -6051,8 +6055,7 @@ Statement [137] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [138] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [140] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [141] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:33 [ sin16s::isUpper#2 ] +Statement [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [144] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [145] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [146] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -6159,7 +6162,7 @@ Statement [137] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [138] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [140] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [141] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y +Statement [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [144] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [145] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [146] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:3::sin16s_gen2:21::sin16s:105 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -6220,7 +6223,7 @@ Potential registers zp[2]:21 [ mul16u::b#1 ] : zp[2]:21 , Potential registers zp[2]:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] : zp[2]:23 , Potential registers zp[4]:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] : zp[4]:25 , Potential registers zp[4]:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] : zp[4]:29 , -Potential registers zp[1]:33 [ sin16s::isUpper#2 ] : zp[1]:33 , reg byte x , +Potential registers zp[1]:33 [ sin16s::isUpper#2 ] : zp[1]:33 , reg byte x , reg byte y , Potential registers zp[4]:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] : zp[4]:34 , Potential registers zp[2]:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] : zp[2]:38 , Potential registers zp[2]: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[2]:40 , @@ -6308,57 +6311,55 @@ Uplift Scope [main] 38.5: zp[1]:2 [ main::ch#2 main::ch#1 ] Uplift Scope [] 26.12: zp[2]:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] 0.8: zp[2]:177 [ rem16u#1 ] Uplift Scope [div32u16u] 4: zp[4]:82 [ div32u16u::return#2 ] 4: zp[2]:169 [ div32u16u::quotient_lo#0 ] 1.33: zp[4]:171 [ div32u16u::return#0 ] 0.8: zp[2]:165 [ div32u16u::quotient_hi#0 ] -Uplifting [mul16u] best 75052 combination zp[4]:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:21 [ mul16u::b#1 ] zp[4]:104 [ mul16u::return#2 ] zp[4]:149 [ mul16u::return#3 ] -Uplifting [divr16u] best 74842 combination zp[2]: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[2]: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[2]:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:163 [ divr16u::return#2 ] zp[2]:167 [ divr16u::return#3 ] -Uplifting [sin16s] best 74842 combination zp[4]:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:90 [ sin16s::return#0 ] zp[2]:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:117 [ sin16s::$4 ] zp[2]:125 [ sin16s::x2#0 ] zp[2]:133 [ sin16s::x3_6#0 ] zp[2]:139 [ sin16s::x4#0 ] zp[2]:143 [ sin16s::x5#0 ] zp[2]:145 [ sin16s::x5_128#0 ] zp[2]:129 [ sin16s::x3#0 ] zp[2]:147 [ sin16s::usinx#1 ] zp[2]:121 [ sin16s::x1#0 ] zp[2]:135 [ sin16s::usinx#0 ] zp[1]:33 [ sin16s::isUpper#2 ] -Uplifting [sin16s_gen2] best 74842 combination zp[2]:9 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:98 [ sin16s_gen2::$6 ] zp[4]:11 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:102 [ sin16s_gen2::$9 ] zp[2]:15 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:86 [ sin16s_gen2::step#0 ] -Uplifting [mulu16_sel] best 74826 combination zp[2]: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[2]:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:123 [ mulu16_sel::return#0 ] zp[2]:127 [ mulu16_sel::return#1 ] zp[2]:131 [ mulu16_sel::return#2 ] zp[2]:137 [ mulu16_sel::return#10 ] zp[2]:141 [ mulu16_sel::return#11 ] zp[4]:153 [ mulu16_sel::$0 ] zp[4]:157 [ mulu16_sel::$1 ] zp[2]:161 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [loop] best 74826 combination zp[2]:57 [ loop::$7 ] zp[2]:59 [ loop::$2 ] zp[2]:61 [ loop::xpos#0 ] -Uplifting [mul16s] best 74826 combination zp[4]:94 [ mul16s::return#2 ] zp[4]:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp[4]:112 [ mul16s::return#0 ] zp[2]:108 [ mul16s::$9 ] zp[2]:110 [ mul16s::$16 ] zp[2]:92 [ mul16s::a#0 ] -Uplifting [memset] best 74810 combination zp[2]:55 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:179 [ memset::end#0 ] reg byte x [ memset::c#4 ] zp[2]:52 [ memset::str#3 ] -Uplifting [main] best 74690 combination reg byte x [ main::ch#2 main::ch#1 ] -Uplifting [] best 74690 combination zp[2]:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp[2]:177 [ rem16u#1 ] -Uplifting [div32u16u] best 74690 combination zp[4]:82 [ div32u16u::return#2 ] zp[2]:169 [ div32u16u::quotient_lo#0 ] zp[4]:171 [ div32u16u::return#0 ] zp[2]:165 [ div32u16u::quotient_hi#0 ] +Uplifting [mul16u] best 75074 combination zp[4]:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:21 [ mul16u::b#1 ] zp[4]:104 [ mul16u::return#2 ] zp[4]:149 [ mul16u::return#3 ] +Uplifting [divr16u] best 74864 combination zp[2]: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[2]: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[2]:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:163 [ divr16u::return#2 ] zp[2]:167 [ divr16u::return#3 ] +Uplifting [sin16s] best 74855 combination zp[4]:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:90 [ sin16s::return#0 ] zp[2]:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:117 [ sin16s::$4 ] zp[2]:125 [ sin16s::x2#0 ] zp[2]:133 [ sin16s::x3_6#0 ] zp[2]:139 [ sin16s::x4#0 ] zp[2]:143 [ sin16s::x5#0 ] zp[2]:145 [ sin16s::x5_128#0 ] zp[2]:129 [ sin16s::x3#0 ] zp[2]:147 [ sin16s::usinx#1 ] zp[2]:121 [ sin16s::x1#0 ] zp[2]:135 [ sin16s::usinx#0 ] reg byte y [ sin16s::isUpper#2 ] +Uplifting [sin16s_gen2] best 74855 combination zp[2]:9 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:98 [ sin16s_gen2::$6 ] zp[4]:11 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:102 [ sin16s_gen2::$9 ] zp[2]:15 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:86 [ sin16s_gen2::step#0 ] +Uplifting [mulu16_sel] best 74839 combination zp[2]: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[2]:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:123 [ mulu16_sel::return#0 ] zp[2]:127 [ mulu16_sel::return#1 ] zp[2]:131 [ mulu16_sel::return#2 ] zp[2]:137 [ mulu16_sel::return#10 ] zp[2]:141 [ mulu16_sel::return#11 ] zp[4]:153 [ mulu16_sel::$0 ] zp[4]:157 [ mulu16_sel::$1 ] zp[2]:161 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [loop] best 74839 combination zp[2]:57 [ loop::$7 ] zp[2]:59 [ loop::$2 ] zp[2]:61 [ loop::xpos#0 ] +Uplifting [mul16s] best 74839 combination zp[4]:94 [ mul16s::return#2 ] zp[4]:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp[4]:112 [ mul16s::return#0 ] zp[2]:108 [ mul16s::$9 ] zp[2]:110 [ mul16s::$16 ] zp[2]:92 [ mul16s::a#0 ] +Uplifting [memset] best 74823 combination zp[2]:55 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:179 [ memset::end#0 ] reg byte x [ memset::c#4 ] zp[2]:52 [ memset::str#3 ] +Uplifting [main] best 74703 combination reg byte x [ main::ch#2 main::ch#1 ] +Uplifting [] best 74703 combination zp[2]:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] zp[2]:177 [ rem16u#1 ] +Uplifting [div32u16u] best 74703 combination zp[4]:82 [ div32u16u::return#2 ] zp[2]:169 [ div32u16u::quotient_lo#0 ] zp[4]:171 [ div32u16u::return#0 ] zp[2]:165 [ div32u16u::quotient_hi#0 ] Attempting to uplift remaining variables inzp[1]: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 69590 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 69603 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[1]: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 64790 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 64803 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[1]:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] -Uplifting [render_logo] best 64790 combination zp[1]:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] +Uplifting [render_logo] best 64803 combination zp[1]:7 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] Attempting to uplift remaining variables inzp[1]:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] -Uplifting [render_logo] best 64790 combination zp[1]:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] +Uplifting [render_logo] best 64803 combination zp[1]:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] Attempting to uplift remaining variables inzp[1]:71 [ render_logo::$33 ] -Uplifting [render_logo] best 64390 combination reg byte a [ render_logo::$33 ] +Uplifting [render_logo] best 64403 combination reg byte a [ render_logo::$33 ] Attempting to uplift remaining variables inzp[1]:72 [ render_logo::$36 ] -Uplifting [render_logo] best 63990 combination reg byte a [ render_logo::$36 ] +Uplifting [render_logo] best 64003 combination reg byte a [ render_logo::$36 ] Attempting to uplift remaining variables inzp[1]:73 [ render_logo::$39 ] -Uplifting [render_logo] best 63590 combination reg byte a [ render_logo::$39 ] +Uplifting [render_logo] best 63603 combination reg byte a [ render_logo::$39 ] Attempting to uplift remaining variables inzp[1]:74 [ render_logo::$42 ] -Uplifting [render_logo] best 63190 combination reg byte a [ render_logo::$42 ] +Uplifting [render_logo] best 63203 combination reg byte a [ render_logo::$42 ] Attempting to uplift remaining variables inzp[1]:75 [ render_logo::$45 ] -Uplifting [render_logo] best 62790 combination reg byte a [ render_logo::$45 ] +Uplifting [render_logo] best 62803 combination reg byte a [ render_logo::$45 ] Attempting to uplift remaining variables inzp[1]:77 [ render_logo::$73 ] -Uplifting [render_logo] best 62390 combination reg byte a [ render_logo::$73 ] +Uplifting [render_logo] best 62403 combination reg byte a [ render_logo::$73 ] Attempting to uplift remaining variables inzp[1]:78 [ render_logo::$76 ] -Uplifting [render_logo] best 61990 combination reg byte a [ render_logo::$76 ] +Uplifting [render_logo] best 62003 combination reg byte a [ render_logo::$76 ] Attempting to uplift remaining variables inzp[1]:79 [ render_logo::$79 ] -Uplifting [render_logo] best 61590 combination reg byte a [ render_logo::$79 ] +Uplifting [render_logo] best 61603 combination reg byte a [ render_logo::$79 ] Attempting to uplift remaining variables inzp[1]:80 [ render_logo::$82 ] -Uplifting [render_logo] best 61190 combination reg byte a [ render_logo::$82 ] +Uplifting [render_logo] best 61203 combination reg byte a [ render_logo::$82 ] Attempting to uplift remaining variables inzp[1]:81 [ render_logo::$85 ] -Uplifting [render_logo] best 60790 combination reg byte a [ render_logo::$85 ] +Uplifting [render_logo] best 60803 combination reg byte a [ render_logo::$85 ] Attempting to uplift remaining variables inzp[1]:65 [ render_logo::$0 ] -Uplifting [render_logo] best 60784 combination reg byte a [ render_logo::$0 ] +Uplifting [render_logo] best 60797 combination reg byte a [ render_logo::$0 ] Attempting to uplift remaining variables inzp[1]:66 [ render_logo::$1 ] -Uplifting [render_logo] best 60778 combination reg byte a [ render_logo::$1 ] +Uplifting [render_logo] best 60791 combination reg byte a [ render_logo::$1 ] Attempting to uplift remaining variables inzp[1]:67 [ render_logo::$2 ] -Uplifting [render_logo] best 60772 combination reg byte a [ render_logo::$2 ] +Uplifting [render_logo] best 60785 combination reg byte a [ render_logo::$2 ] Attempting to uplift remaining variables inzp[1]:76 [ render_logo::logo_idx#1 ] -Uplifting [render_logo] best 60766 combination reg byte a [ render_logo::logo_idx#1 ] +Uplifting [render_logo] best 60779 combination reg byte a [ render_logo::logo_idx#1 ] Attempting to uplift remaining variables inzp[1]:70 [ render_logo::x_char#0 ] -Uplifting [render_logo] best 60766 combination zp[1]:70 [ render_logo::x_char#0 ] -Attempting to uplift remaining variables inzp[1]:33 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 60766 combination zp[1]:33 [ sin16s::isUpper#2 ] +Uplifting [render_logo] best 60779 combination zp[1]:70 [ render_logo::x_char#0 ] Coalescing zero page register [ zp[2]:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp[2]:147 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:129 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:177 [ rem16u#1 ] ] - score: 2 @@ -6366,7 +6367,6 @@ Coalescing zero page register [ zp[4]:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] Coalescing zero page register [ zp[4]:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 ] ] with [ zp[4]:112 [ mul16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:21 [ mul16u::b#1 ] ] with [ zp[2]:42 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] ] - score: 1 Coalescing zero page register [ zp[4]:25 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] ] with [ zp[4]:149 [ mul16u::return#3 ] ] - score: 1 -Coalescing zero page register [ zp[4]:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:117 [ sin16s::$4 ] ] - score: 1 Coalescing zero page register [ zp[2]:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 ] ] with [ zp[2]:90 [ sin16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]: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 sin16s::x3#0 ] ] with [ zp[2]:125 [ sin16s::x2#0 ] ] - score: 1 Coalescing zero page register [ zp[2]: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 sin16s::x3#0 sin16s::x2#0 ] ] with [ zp[2]:139 [ sin16s::x4#0 ] ] - score: 1 @@ -6396,30 +6396,30 @@ Coalescing zero page register [ zp[2]:123 [ mulu16_sel::return#0 mulu16_sel::ret Coalescing zero page register [ zp[4]:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 ] ] with [ zp[4]:153 [ mulu16_sel::$0 mulu16_sel::$1 ] ] - score: 1 Coalescing zero page register [ zp[2]:123 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 ] ] with [ zp[2]:145 [ sin16s::x5_128#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:9 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] ] with [ zp[2]:3 [ xsin_idx#11 xsin_idx#19 xsin_idx#3 ] ] -Coalescing zero page register [ zp[1]:33 [ sin16s::isUpper#2 ] ] with [ zp[1]:6 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] ] -Coalescing zero page register [ zp[4]:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] ] with [ zp[4]:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] ] +Coalescing zero page register [ zp[4]:34 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:17 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] ] Coalescing zero page register [ zp[2]: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 rem16u#1 ] ] with [ zp[2]:15 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] ] Coalescing zero page register [ zp[2]:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] ] with [ zp[2]:21 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] ] Coalescing zero page register [ zp[2]:49 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ] ] with [ zp[2]:23 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] ] Coalescing zero page register [ zp[2]:52 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] with [ zp[2]:38 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] ] Coalescing zero page register [ zp[2]:57 [ loop::$7 loop::$2 loop::xpos#0 render_logo::xpos#0 ] ] with [ zp[2]: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 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] ] Coalescing zero page register [ zp[2]:102 [ sin16s_gen2::$9 ] ] with [ zp[2]:68 [ render_logo::$3 ] ] +Coalescing zero page register [ zp[4]:117 [ sin16s::$4 ] ] with [ zp[4]:29 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] ] Coalescing zero page register [ zp[2]:121 [ sin16s::x1#0 ] ] with [ zp[2]:108 [ mul16s::$9 mul16s::$16 ] ] Coalescing zero page register [ zp[2]:165 [ div32u16u::quotient_hi#0 ] ] with [ zp[2]:123 [ 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 ] ] Coalescing zero page register [ zp[2]:102 [ sin16s_gen2::$9 render_logo::$3 ] ] with [ zp[2]:47 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] ] Coalescing zero page register [ zp[2]:179 [ memset::end#0 ] ] with [ zp[2]:9 [ sin16s_gen2::i#2 sin16s_gen2::i#1 xsin_idx#11 xsin_idx#19 xsin_idx#3 ] ] -Allocated (was zp[1]:7) zp[1]:2 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] -Allocated (was zp[4]:11) zp[4]:3 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -Allocated (was zp[4]:29) zp[4]:7 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -Allocated (was zp[1]:33) zp[1]:11 [ sin16s::isUpper#2 render_logo::logo_idx#10 render_logo::logo_idx#3 ] -Allocated (was zp[4]:34) zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] -Allocated (was zp[2]:45) zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] -Allocated (was zp[2]:49) zp[2]:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] -Allocated (was zp[2]:52) zp[2]:20 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] -Allocated (was zp[2]:57) zp[2]:22 [ loop::$7 loop::$2 loop::xpos#0 render_logo::xpos#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] -Allocated (was zp[1]:70) zp[1]:24 [ render_logo::x_char#0 ] -Allocated (was zp[4]:82) zp[4]:25 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -Allocated (was zp[2]:102) zp[2]:29 [ sin16s_gen2::$9 render_logo::$3 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] +Allocated (was zp[1]:6) zp[1]:2 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] +Allocated (was zp[1]:7) zp[1]:3 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] +Allocated (was zp[4]:11) zp[4]:4 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +Allocated (was zp[4]:34) zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +Allocated (was zp[2]:45) zp[2]:12 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +Allocated (was zp[2]:49) zp[2]:14 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +Allocated (was zp[2]:52) zp[2]:16 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] +Allocated (was zp[2]:57) zp[2]:18 [ loop::$7 loop::$2 loop::xpos#0 render_logo::xpos#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +Allocated (was zp[1]:70) zp[1]:20 [ render_logo::x_char#0 ] +Allocated (was zp[4]:82) zp[4]:21 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +Allocated (was zp[2]:102) zp[2]:25 [ sin16s_gen2::$9 render_logo::$3 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] +Allocated (was zp[4]:117) zp[4]:27 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] Allocated (was zp[2]:121) zp[2]:31 [ sin16s::x1#0 mul16s::$9 mul16s::$16 ] Allocated (was zp[2]:165) zp[2]:33 [ div32u16u::quotient_hi#0 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[2]:179) zp[2]:35 [ memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 xsin_idx#11 xsin_idx#19 xsin_idx#3 ] @@ -6455,7 +6455,7 @@ ASSEMBLER BEFORE OPTIMIZATION .label SCREEN = $400 .label LOGO = $2000 .const XSIN_SIZE = $200 - .label rem16u = $10 + .label rem16u = $c .label xsin_idx = $23 // @begin __bbegin: @@ -6578,9 +6578,9 @@ main: { } // loop loop: { - .label __2 = $16 - .label __7 = $16 - .label xpos = $16 + .label __2 = $12 + .label __7 = $12 + .label xpos = $12 // [26] phi from loop to loop::@1 [phi:loop->loop::@1] __b1_from_loop: // [26] phi (word) xsin_idx#11 = (byte) 0 [phi:loop->loop::@1#0] -- vwuz1=vbuc1 @@ -6673,13 +6673,13 @@ loop: { jmp __b1 } // render_logo -// render_logo(signed word zeropage($16) xpos) +// render_logo(signed word zeropage($12) xpos) render_logo: { - .label __3 = $1d - .label xpos = $16 - .label x_char = $18 - .label logo_idx = $b - .label logo_idx_1 = 2 + .label __3 = $19 + .label xpos = $12 + .label x_char = $14 + .label logo_idx = 2 + .label logo_idx_1 = 3 // [39] (byte~) render_logo::$0 ← (byte)(signed word) render_logo::xpos#0 -- vbuaa=_byte_vwsz1 lda.z xpos // [40] (byte~) render_logo::$1 ← (byte~) render_logo::$0 & (byte) 7 -- vbuaa=vbuaa_band_vbuc1 @@ -6983,16 +6983,16 @@ render_logo: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($10) sintab) +// sin16s_gen2(signed word* zeropage($c) sintab) sin16s_gen2: { .const min = -$140 .const max = $140 .label ampl = max-min - .label __6 = $c - .label __9 = $1d - .label step = $19 - .label sintab = $10 - .label x = 3 + .label __6 = 8 + .label __9 = $19 + .label step = $15 + .label sintab = $c + .label x = 4 .label i = $23 // [98] call div32u16u // [186] phi from sin16s_gen2 to div32u16u [phi:sin16s_gen2->div32u16u] @@ -7114,13 +7114,13 @@ sin16s_gen2: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage($14) a) +// mul16s(signed word zeropage($10) a) mul16s: { .label __9 = $1f .label __16 = $1f - .label m = $c - .label return = $c - .label a = $14 + .label m = 8 + .label return = 8 + .label a = $10 // [116] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#0 -- vwuz1=vwuz2 lda.z a sta.z mul16u.a @@ -7188,13 +7188,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($12) a, word zeropage($1d) b) +// mul16u(word zeropage($e) a, word zeropage($19) b) mul16u: { - .label mb = 7 - .label a = $12 - .label res = $c - .label return = $c - .label b = $1d + .label mb = $1b + .label a = $e + .label res = 8 + .label return = 8 + .label b = $19 // [128] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] __b1_from_mul16u: // [128] phi (dword) mul16u::mb#2 = (dword) mul16u::mb#0 [phi:mul16u->mul16u::@1#0] -- register_copy @@ -7270,21 +7270,20 @@ mul16u: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($c) x) +// sin16s(dword zeropage(8) x) sin16s: { - .label __4 = $c - .label x = $c - .label return = $14 + .label __4 = $1b + .label x = 8 + .label return = $10 .label x1 = $1f - .label x2 = $16 - .label x3 = $16 + .label x2 = $12 + .label x3 = $12 .label x3_6 = $21 - .label usinx = $14 - .label x4 = $16 + .label usinx = $10 + .label x4 = $12 .label x5 = $21 .label x5_128 = $21 - .label sinx = $14 - .label isUpper = $b + .label sinx = $10 // [137] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 cmp #>PI_u4f28>>$10 @@ -7321,16 +7320,14 @@ sin16s: { sta.z x+3 // [139] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] __b1_from___b4: - // [139] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [139] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [139] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [139] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] __b1_from_sin16s: - // [139] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [139] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [139] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy jmp __b1 // sin16s::@1 @@ -7376,15 +7373,27 @@ sin16s: { jmp __b2 // sin16s::@2 __b2: - // [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // [144] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -7525,9 +7534,8 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - // [172] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [172] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b12 jmp __b6 // sin16s::@6 @@ -7560,14 +7568,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($16) v1, word zeropage($1d) v2, byte register(X) select) +// mulu16_sel(word zeropage($12) v1, word zeropage($19) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $16 - .label v2 = $1d + .label __0 = 8 + .label __1 = 8 + .label v1 = $12 + .label v2 = $19 .label return = $21 - .label return_1 = $16 + .label return_1 = $12 // [178] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 sta.z mul16u.a @@ -7619,8 +7627,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $21 - .label quotient_lo = $12 - .label return = $19 + .label quotient_lo = $e + .label return = $15 // [187] call divr16u // [196] phi from div32u16u to divr16u [phi:div32u16u->divr16u] divr16u_from_div32u16u: @@ -7680,12 +7688,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($1d) dividend, word zeropage($10) rem) +// divr16u(word zeropage($19) dividend, word zeropage($c) rem) divr16u: { - .label rem = $10 - .label dividend = $1d - .label quotient = $12 - .label return = $12 + .label rem = $c + .label dividend = $19 + .label quotient = $e + .label return = $e // [197] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] __b1_from_divr16u: // [197] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 @@ -7787,11 +7795,11 @@ divr16u: { } // 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($14) str, byte register(X) c) +// memset(void* zeropage($10) str, byte register(X) c) memset: { .label end = $23 - .label dst = $14 - .label str = $14 + .label dst = $10 + .label str = $10 jmp __b1 // memset::@1 __b1: @@ -8152,10 +8160,10 @@ FINAL SYMBOL TABLE (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:33 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:18 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:14 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:25 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:25 4.0 +(dword) div32u16u::return#0 return zp[4]:21 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:21 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -8167,33 +8175,33 @@ FINAL SYMBOL TABLE (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:29 2.75 -(word) divr16u::dividend#3 dividend zp[2]:29 5.0 -(word) divr16u::dividend#5 dividend zp[2]:29 2.0 +(word) divr16u::dividend#0 dividend zp[2]:25 2.75 +(word) divr16u::dividend#3 dividend zp[2]:25 5.0 +(word) divr16u::dividend#5 dividend zp[2]:25 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:18 16.5 -(word) divr16u::quotient#2 quotient zp[2]:18 11.0 -(word) divr16u::quotient#3 quotient zp[2]:18 2.75 +(word) divr16u::quotient#1 quotient zp[2]:14 16.5 +(word) divr16u::quotient#2 quotient zp[2]:14 11.0 +(word) divr16u::quotient#3 quotient zp[2]:14 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:16 8.25 -(word) divr16u::rem#1 rem zp[2]:16 22.0 -(word) divr16u::rem#10 rem zp[2]:16 4.0 -(word) divr16u::rem#11 rem zp[2]:16 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:16 22.0 -(word) divr16u::rem#4 rem zp[2]:16 4.0 -(word) divr16u::rem#5 rem zp[2]:16 24.0 -(word) divr16u::rem#6 rem zp[2]:16 11.0 +(word) divr16u::rem#0 rem zp[2]:12 8.25 +(word) divr16u::rem#1 rem zp[2]:12 22.0 +(word) divr16u::rem#10 rem zp[2]:12 4.0 +(word) divr16u::rem#11 rem zp[2]:12 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:12 22.0 +(word) divr16u::rem#4 rem zp[2]:12 4.0 +(word) divr16u::rem#5 rem zp[2]:12 24.0 +(word) divr16u::rem#6 rem zp[2]:12 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:18 5.285714285714286 -(word) divr16u::return#2 return zp[2]:18 4.0 -(word) divr16u::return#3 return zp[2]:18 4.0 +(word) divr16u::return#0 return zp[2]:14 5.285714285714286 +(word) divr16u::return#2 return zp[2]:14 4.0 +(word) divr16u::return#3 return zp[2]:14 4.0 (void()) loop() -(signed word*~) loop::$2 zp[2]:22 22.0 -(word~) loop::$7 zp[2]:22 22.0 +(signed word*~) loop::$2 zp[2]:18 22.0 +(word~) loop::$7 zp[2]:18 22.0 (label) loop::@1 (label) loop::@2 (label) loop::@3 @@ -8201,7 +8209,7 @@ FINAL SYMBOL TABLE (label) loop::@5 (label) loop::@6 (signed word) loop::xpos -(signed word) loop::xpos#0 xpos zp[2]:22 22.0 +(signed word) loop::xpos#0 xpos zp[2]:18 22.0 (void()) main() (label) main::@1 (label) main::@2 @@ -8225,15 +8233,15 @@ FINAL SYMBOL TABLE (byte) memset::c (byte) memset::c#4 reg byte x 1.5714285714285714 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:20 22.0 -(byte*) memset::dst#2 dst zp[2]:20 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:20 4.0 +(byte*) memset::dst#1 dst zp[2]:16 22.0 +(byte*) memset::dst#2 dst zp[2]:16 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:16 4.0 (byte*) memset::end (byte*) memset::end#0 end zp[2]:35 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:20 +(void*) memset::str#3 str zp[2]:16 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 zp[2]:31 4.0 (word~) mul16s::$9 zp[2]:31 4.0 @@ -8243,15 +8251,15 @@ FINAL SYMBOL TABLE (label) mul16s::@4 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:20 2.6 +(signed word) mul16s::a#0 a zp[2]:16 2.6 (signed word) mul16s::b (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:12 2.0 -(dword) mul16s::m#1 m zp[4]:12 4.0 -(dword) mul16s::m#4 m zp[4]:12 4.0 +(dword) mul16s::m#0 m zp[4]:8 2.0 +(dword) mul16s::m#1 m zp[4]:8 4.0 +(dword) mul16s::m#4 m zp[4]:8 4.0 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:12 4.333333333333333 -(signed dword) mul16s::return#2 return zp[4]:12 22.0 +(signed dword) mul16s::return#0 return zp[4]:8 4.333333333333333 +(signed dword) mul16s::return#2 return zp[4]:8 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -8260,58 +8268,58 @@ FINAL SYMBOL TABLE (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:18 101.0 -(word) mul16u::a#1 a zp[2]:18 4.0 -(word) mul16u::a#2 a zp[2]:18 2.0 -(word) mul16u::a#3 a zp[2]:18 67.66666666666666 -(word) mul16u::a#6 a zp[2]:18 6.0 +(word) mul16u::a#0 a zp[2]:14 101.0 +(word) mul16u::a#1 a zp[2]:14 4.0 +(word) mul16u::a#2 a zp[2]:14 2.0 +(word) mul16u::a#3 a zp[2]:14 67.66666666666666 +(word) mul16u::a#6 a zp[2]:14 6.0 (word) mul16u::b -(word) mul16u::b#1 b zp[2]:29 4.0 +(word) mul16u::b#1 b zp[2]:25 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:7 4.0 -(dword) mul16u::mb#1 mb zp[4]:7 202.0 -(dword) mul16u::mb#2 mb zp[4]:7 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:27 4.0 +(dword) mul16u::mb#1 mb zp[4]:27 202.0 +(dword) mul16u::mb#2 mb zp[4]:27 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:12 202.0 -(dword) mul16u::res#2 res zp[4]:12 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:12 101.0 +(dword) mul16u::res#1 res zp[4]:8 202.0 +(dword) mul16u::res#2 res zp[4]:8 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:8 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:12 4.0 -(dword) mul16u::return#3 return zp[4]:12 4.0 +(dword) mul16u::return#2 return zp[4]:8 4.0 +(dword) mul16u::return#3 return zp[4]:8 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:12 4.0 -(dword~) mulu16_sel::$1 zp[4]:12 4.0 +(dword~) mulu16_sel::$0 zp[4]:8 4.0 +(dword~) mulu16_sel::$1 zp[4]:8 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:33 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:22 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:22 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:18 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:18 4.0 (word) mulu16_sel::return#11 return zp[2]:33 4.0 (word) mulu16_sel::return#12 return zp[2]:33 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:33 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:22 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:22 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:18 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:18 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:29 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:25 5.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:16 0.8 +(word) rem16u#1 rem16u zp[2]:12 0.8 (void()) render_logo((signed word) render_logo::xpos) (byte~) render_logo::$0 reg byte a 4.0 (byte~) render_logo::$1 reg byte a 4.0 (byte~) render_logo::$2 reg byte a 4.0 -(signed word~) render_logo::$3 zp[2]:29 2.0 +(signed word~) render_logo::$3 zp[2]:25 2.0 (byte~) render_logo::$33 reg byte a 202.0 (byte~) render_logo::$36 reg byte a 202.0 (byte~) render_logo::$39 reg byte a 202.0 @@ -8359,11 +8367,11 @@ FINAL SYMBOL TABLE (byte) render_logo::line (byte) render_logo::logo_idx (signed byte) render_logo::logo_idx#1 reg byte a 2.0 -(byte) render_logo::logo_idx#10 logo_idx zp[1]:11 57.714285714285715 -(byte) render_logo::logo_idx#11 logo_idx_1 zp[1]:2 65.07142857142857 -(byte~) render_logo::logo_idx#14 logo_idx_1 zp[1]:2 4.0 -(byte) render_logo::logo_idx#3 logo_idx zp[1]:11 202.0 -(byte) render_logo::logo_idx#4 logo_idx_1 zp[1]:2 202.0 +(byte) render_logo::logo_idx#10 logo_idx zp[1]:2 57.714285714285715 +(byte) render_logo::logo_idx#11 logo_idx_1 zp[1]:3 65.07142857142857 +(byte~) render_logo::logo_idx#14 logo_idx_1 zp[1]:3 4.0 +(byte) render_logo::logo_idx#3 logo_idx zp[1]:2 202.0 +(byte) render_logo::logo_idx#4 logo_idx_1 zp[1]:3 202.0 (byte) render_logo::logo_start (byte) render_logo::screen_idx (byte) render_logo::screen_idx#10 reg byte y 77.6923076923077 @@ -8375,11 +8383,11 @@ FINAL SYMBOL TABLE (byte) render_logo::screen_idx#5 reg byte y 101.0 (byte) render_logo::screen_idx#6 reg byte y 202.0 (signed byte) render_logo::x_char -(signed byte) render_logo::x_char#0 x_char zp[1]:24 0.36363636363636365 +(signed byte) render_logo::x_char#0 x_char zp[1]:20 0.36363636363636365 (signed word) render_logo::xpos -(signed word) render_logo::xpos#0 xpos zp[2]:22 2.142857142857143 +(signed word) render_logo::xpos#0 xpos zp[2]:18 2.142857142857143 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:12 4.0 +(dword~) sin16s::$4 zp[4]:27 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -8394,39 +8402,39 @@ FINAL SYMBOL TABLE (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:11 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:20 22.0 -(signed word) sin16s::return#1 return zp[2]:20 5.0 -(signed word~) sin16s::return#5 return zp[2]:20 4.0 +(signed word) sin16s::return#0 return zp[2]:16 22.0 +(signed word) sin16s::return#1 return zp[2]:16 5.0 +(signed word~) sin16s::return#5 return zp[2]:16 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:20 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:16 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:20 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:20 1.0 +(word) sin16s::usinx#0 usinx zp[2]:16 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:16 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:12 8.5 -(dword) sin16s::x#1 x zp[4]:12 4.0 -(dword) sin16s::x#2 x zp[4]:12 4.0 -(dword) sin16s::x#4 x zp[4]:12 5.0 -(dword) sin16s::x#6 x zp[4]:12 6.0 +(dword) sin16s::x#0 x zp[4]:8 8.5 +(dword) sin16s::x#1 x zp[4]:8 4.0 +(dword) sin16s::x#2 x zp[4]:8 4.0 +(dword) sin16s::x#4 x zp[4]:8 5.0 +(dword) sin16s::x#6 x zp[4]:8 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:31 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:22 4.0 +(word) sin16s::x2#0 x2 zp[2]:18 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:22 1.0 +(word) sin16s::x3#0 x3 zp[2]:18 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:33 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:22 4.0 +(word) sin16s::x4#0 x4 zp[2]:18 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:33 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:33 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:12 22.0 -(word~) sin16s_gen2::$9 zp[2]:29 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:8 22.0 +(word~) sin16s_gen2::$9 zp[2]:25 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -8444,14 +8452,14 @@ FINAL SYMBOL TABLE (const signed word) sin16s_gen2::min#0 min = (signed word) -$140 (signed word) sin16s_gen2::offs (signed word*) sin16s_gen2::sintab -(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:16 7.333333333333333 -(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:16 3.0 +(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:12 7.333333333333333 +(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:12 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:25 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:21 0.8666666666666666 (word) sin16s_gen2::wavelength (dword) sin16s_gen2::x -(dword) sin16s_gen2::x#1 x zp[4]:3 11.0 -(dword) sin16s_gen2::x#2 x zp[4]:3 2.75 +(dword) sin16s_gen2::x#1 x zp[4]:4 11.0 +(dword) sin16s_gen2::x#2 x zp[4]:4 2.75 (const signed word[XSIN_SIZE]) xsin = { fill( XSIN_SIZE, 0) } (word) xsin_idx (word) xsin_idx#11 xsin_idx zp[2]:35 4.125 @@ -8460,23 +8468,23 @@ FINAL SYMBOL TABLE reg byte x [ main::ch#2 main::ch#1 ] reg byte y [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] -zp[1]:2 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] +zp[1]:2 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] +zp[1]:3 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] reg byte y [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] -zp[4]:3 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -zp[4]:7 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -zp[1]:11 [ sin16s::isUpper#2 render_logo::logo_idx#10 render_logo::logo_idx#3 ] -zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +zp[4]:4 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] -zp[2]:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[2]:12 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +zp[2]:14 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[2]:20 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] +zp[2]:16 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] reg byte x [ memset::c#4 ] -zp[2]:22 [ loop::$7 loop::$2 loop::xpos#0 render_logo::xpos#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +zp[2]:18 [ loop::$7 loop::$2 loop::xpos#0 render_logo::xpos#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] reg byte a [ render_logo::$0 ] reg byte a [ render_logo::$1 ] reg byte a [ render_logo::$2 ] -zp[1]:24 [ render_logo::x_char#0 ] +zp[1]:20 [ render_logo::x_char#0 ] reg byte a [ render_logo::$33 ] reg byte a [ render_logo::$36 ] reg byte a [ render_logo::$39 ] @@ -8488,9 +8496,10 @@ reg byte a [ render_logo::$76 ] reg byte a [ render_logo::$79 ] reg byte a [ render_logo::$82 ] reg byte a [ render_logo::$85 ] -zp[4]:25 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:29 [ sin16s_gen2::$9 render_logo::$3 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] +zp[4]:21 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:25 [ sin16s_gen2::$9 render_logo::$3 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] reg byte a [ mul16u::$1 ] +zp[4]:27 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:31 [ sin16s::x1#0 mul16s::$9 mul16s::$16 ] zp[2]:33 [ div32u16u::quotient_hi#0 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 ] reg byte a [ divr16u::$1 ] @@ -8499,7 +8508,7 @@ zp[2]:35 [ memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 xsin_idx#11 xsin_idx# FINAL ASSEMBLER -Score: 46444 +Score: 46481 // File Comments // Upstart @@ -8531,7 +8540,7 @@ Score: 46444 .label SCREEN = $400 .label LOGO = $2000 .const XSIN_SIZE = $200 - .label rem16u = $10 + .label rem16u = $c .label xsin_idx = $23 // @begin // @1 @@ -8634,9 +8643,9 @@ main: { } // loop loop: { - .label __2 = $16 - .label __7 = $16 - .label xpos = $16 + .label __2 = $12 + .label __7 = $12 + .label xpos = $12 // [26] phi from loop to loop::@1 [phi:loop->loop::@1] // [26] phi (word) xsin_idx#11 = (byte) 0 [phi:loop->loop::@1#0] -- vwuz1=vbuc1 lda #<0 @@ -8719,13 +8728,13 @@ loop: { jmp __b1 } // render_logo -// render_logo(signed word zeropage($16) xpos) +// render_logo(signed word zeropage($12) xpos) render_logo: { - .label __3 = $1d - .label xpos = $16 - .label x_char = $18 - .label logo_idx = $b - .label logo_idx_1 = 2 + .label __3 = $19 + .label xpos = $12 + .label x_char = $14 + .label logo_idx = 2 + .label logo_idx_1 = 3 // (byte)xpos // [39] (byte~) render_logo::$0 ← (byte)(signed word) render_logo::xpos#0 -- vbuaa=_byte_vwsz1 lda.z xpos @@ -9000,16 +9009,16 @@ render_logo: { // Generate signed word sinus table - with values in the range min-max. // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen2(signed word* zeropage($10) sintab) +// sin16s_gen2(signed word* zeropage($c) sintab) sin16s_gen2: { .const min = -$140 .const max = $140 .label ampl = max-min - .label __6 = $c - .label __9 = $1d - .label step = $19 - .label sintab = $10 - .label x = 3 + .label __6 = 8 + .label __9 = $19 + .label step = $15 + .label sintab = $c + .label x = 4 .label i = $23 // div32u16u(PI2_u4f28, wavelength) // [98] call div32u16u @@ -9128,13 +9137,13 @@ sin16s_gen2: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage($14) a) +// mul16s(signed word zeropage($10) a) mul16s: { .label __9 = $1f .label __16 = $1f - .label m = $c - .label return = $c - .label a = $14 + .label m = 8 + .label return = 8 + .label a = $10 // mul16u((word)a, (word) b) // [116] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#0 -- vwuz1=vwuz2 lda.z a @@ -9198,13 +9207,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($12) a, word zeropage($1d) b) +// mul16u(word zeropage($e) a, word zeropage($19) b) mul16u: { - .label mb = 7 - .label a = $12 - .label res = $c - .label return = $c - .label b = $1d + .label mb = $1b + .label a = $e + .label res = 8 + .label return = 8 + .label b = $19 // [128] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] // [128] phi (dword) mul16u::mb#2 = (dword) mul16u::mb#0 [phi:mul16u->mul16u::@1#0] -- register_copy // [128] phi (dword) mul16u::res#2 = (byte) 0 [phi:mul16u->mul16u::@1#1] -- vduz1=vbuc1 @@ -9276,21 +9285,20 @@ mul16u: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($c) x) +// sin16s(dword zeropage(8) x) sin16s: { - .label __4 = $c - .label x = $c - .label return = $14 + .label __4 = $1b + .label x = 8 + .label return = $10 .label x1 = $1f - .label x2 = $16 - .label x3 = $16 + .label x2 = $12 + .label x3 = $12 .label x3_6 = $21 - .label usinx = $14 - .label x4 = $16 + .label usinx = $10 + .label x4 = $12 .label x5 = $21 .label x5_128 = $21 - .label sinx = $14 - .label isUpper = $b + .label sinx = $10 // if(x >= PI_u4f28 ) // [137] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 @@ -9326,16 +9334,14 @@ sin16s: { sbc #>PI_u4f28>>$10 sta.z x+3 // [139] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] - // [139] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [139] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [139] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [139] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] b1: - // [139] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [139] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [139] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy // sin16s::@1 __b1: @@ -9378,15 +9384,27 @@ sin16s: { // sin16s::@2 __b2: // x<<3 - // [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [143] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // x1 = >x<<3 // [144] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 @@ -9532,9 +9550,8 @@ sin16s: { adc.z x5_128+1 sta.z usinx+1 // if(isUpper!=0) - // [172] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [172] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b3 // sin16s::@6 // sinx = -(signed word)usinx @@ -9560,14 +9577,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($16) v1, word zeropage($1d) v2, byte register(X) select) +// mulu16_sel(word zeropage($12) v1, word zeropage($19) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $16 - .label v2 = $1d + .label __0 = 8 + .label __1 = 8 + .label v1 = $12 + .label v2 = $19 .label return = $21 - .label return_1 = $16 + .label return_1 = $12 // mul16u(v1, v2) // [178] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 @@ -9619,8 +9636,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $21 - .label quotient_lo = $12 - .label return = $19 + .label quotient_lo = $e + .label return = $15 // divr16u(>dividend, divisor, 0) // [187] call divr16u // [196] phi from div32u16u to divr16u [phi:div32u16u->divr16u] @@ -9679,12 +9696,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($1d) dividend, word zeropage($10) rem) +// divr16u(word zeropage($19) dividend, word zeropage($c) rem) divr16u: { - .label rem = $10 - .label dividend = $1d - .label quotient = $12 - .label return = $12 + .label rem = $c + .label dividend = $19 + .label quotient = $e + .label return = $e // [197] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] // [197] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 ldx #0 @@ -9780,11 +9797,11 @@ divr16u: { } // 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($14) str, byte register(X) c) +// memset(void* zeropage($10) str, byte register(X) c) memset: { .label end = $23 - .label dst = $14 - .label str = $14 + .label dst = $10 + .label str = $10 // memset::@1 // end = (char*)str + num // [215] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) $3e8 -- pbuz1=pbuz2_plus_vwuc1 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.sym b/src/test/ref/examples/scrolllogo/scrolllogo.sym index b4882af4d..e60acabe6 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.sym +++ b/src/test/ref/examples/scrolllogo/scrolllogo.sym @@ -31,10 +31,10 @@ (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:33 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:18 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:14 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:25 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:25 4.0 +(dword) div32u16u::return#0 return zp[4]:21 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:21 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -46,33 +46,33 @@ (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:29 2.75 -(word) divr16u::dividend#3 dividend zp[2]:29 5.0 -(word) divr16u::dividend#5 dividend zp[2]:29 2.0 +(word) divr16u::dividend#0 dividend zp[2]:25 2.75 +(word) divr16u::dividend#3 dividend zp[2]:25 5.0 +(word) divr16u::dividend#5 dividend zp[2]:25 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:18 16.5 -(word) divr16u::quotient#2 quotient zp[2]:18 11.0 -(word) divr16u::quotient#3 quotient zp[2]:18 2.75 +(word) divr16u::quotient#1 quotient zp[2]:14 16.5 +(word) divr16u::quotient#2 quotient zp[2]:14 11.0 +(word) divr16u::quotient#3 quotient zp[2]:14 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:16 8.25 -(word) divr16u::rem#1 rem zp[2]:16 22.0 -(word) divr16u::rem#10 rem zp[2]:16 4.0 -(word) divr16u::rem#11 rem zp[2]:16 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:16 22.0 -(word) divr16u::rem#4 rem zp[2]:16 4.0 -(word) divr16u::rem#5 rem zp[2]:16 24.0 -(word) divr16u::rem#6 rem zp[2]:16 11.0 +(word) divr16u::rem#0 rem zp[2]:12 8.25 +(word) divr16u::rem#1 rem zp[2]:12 22.0 +(word) divr16u::rem#10 rem zp[2]:12 4.0 +(word) divr16u::rem#11 rem zp[2]:12 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:12 22.0 +(word) divr16u::rem#4 rem zp[2]:12 4.0 +(word) divr16u::rem#5 rem zp[2]:12 24.0 +(word) divr16u::rem#6 rem zp[2]:12 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:18 5.285714285714286 -(word) divr16u::return#2 return zp[2]:18 4.0 -(word) divr16u::return#3 return zp[2]:18 4.0 +(word) divr16u::return#0 return zp[2]:14 5.285714285714286 +(word) divr16u::return#2 return zp[2]:14 4.0 +(word) divr16u::return#3 return zp[2]:14 4.0 (void()) loop() -(signed word*~) loop::$2 zp[2]:22 22.0 -(word~) loop::$7 zp[2]:22 22.0 +(signed word*~) loop::$2 zp[2]:18 22.0 +(word~) loop::$7 zp[2]:18 22.0 (label) loop::@1 (label) loop::@2 (label) loop::@3 @@ -80,7 +80,7 @@ (label) loop::@5 (label) loop::@6 (signed word) loop::xpos -(signed word) loop::xpos#0 xpos zp[2]:22 22.0 +(signed word) loop::xpos#0 xpos zp[2]:18 22.0 (void()) main() (label) main::@1 (label) main::@2 @@ -104,15 +104,15 @@ (byte) memset::c (byte) memset::c#4 reg byte x 1.5714285714285714 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:20 22.0 -(byte*) memset::dst#2 dst zp[2]:20 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:20 4.0 +(byte*) memset::dst#1 dst zp[2]:16 22.0 +(byte*) memset::dst#2 dst zp[2]:16 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:16 4.0 (byte*) memset::end (byte*) memset::end#0 end zp[2]:35 2.1666666666666665 (word) memset::num (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:20 +(void*) memset::str#3 str zp[2]:16 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 zp[2]:31 4.0 (word~) mul16s::$9 zp[2]:31 4.0 @@ -122,15 +122,15 @@ (label) mul16s::@4 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:20 2.6 +(signed word) mul16s::a#0 a zp[2]:16 2.6 (signed word) mul16s::b (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:12 2.0 -(dword) mul16s::m#1 m zp[4]:12 4.0 -(dword) mul16s::m#4 m zp[4]:12 4.0 +(dword) mul16s::m#0 m zp[4]:8 2.0 +(dword) mul16s::m#1 m zp[4]:8 4.0 +(dword) mul16s::m#4 m zp[4]:8 4.0 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:12 4.333333333333333 -(signed dword) mul16s::return#2 return zp[4]:12 22.0 +(signed dword) mul16s::return#0 return zp[4]:8 4.333333333333333 +(signed dword) mul16s::return#2 return zp[4]:8 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -139,58 +139,58 @@ (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:18 101.0 -(word) mul16u::a#1 a zp[2]:18 4.0 -(word) mul16u::a#2 a zp[2]:18 2.0 -(word) mul16u::a#3 a zp[2]:18 67.66666666666666 -(word) mul16u::a#6 a zp[2]:18 6.0 +(word) mul16u::a#0 a zp[2]:14 101.0 +(word) mul16u::a#1 a zp[2]:14 4.0 +(word) mul16u::a#2 a zp[2]:14 2.0 +(word) mul16u::a#3 a zp[2]:14 67.66666666666666 +(word) mul16u::a#6 a zp[2]:14 6.0 (word) mul16u::b -(word) mul16u::b#1 b zp[2]:29 4.0 +(word) mul16u::b#1 b zp[2]:25 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:7 4.0 -(dword) mul16u::mb#1 mb zp[4]:7 202.0 -(dword) mul16u::mb#2 mb zp[4]:7 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:27 4.0 +(dword) mul16u::mb#1 mb zp[4]:27 202.0 +(dword) mul16u::mb#2 mb zp[4]:27 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:12 202.0 -(dword) mul16u::res#2 res zp[4]:12 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:12 101.0 +(dword) mul16u::res#1 res zp[4]:8 202.0 +(dword) mul16u::res#2 res zp[4]:8 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:8 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:12 4.0 -(dword) mul16u::return#3 return zp[4]:12 4.0 +(dword) mul16u::return#2 return zp[4]:8 4.0 +(dword) mul16u::return#3 return zp[4]:8 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:12 4.0 -(dword~) mulu16_sel::$1 zp[4]:12 4.0 +(dword~) mulu16_sel::$0 zp[4]:8 4.0 +(dword~) mulu16_sel::$1 zp[4]:8 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:33 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:22 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:22 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:18 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:18 4.0 (word) mulu16_sel::return#11 return zp[2]:33 4.0 (word) mulu16_sel::return#12 return zp[2]:33 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:33 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:22 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:22 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:22 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:18 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:18 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:18 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:29 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:29 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:25 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:25 5.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:16 0.8 +(word) rem16u#1 rem16u zp[2]:12 0.8 (void()) render_logo((signed word) render_logo::xpos) (byte~) render_logo::$0 reg byte a 4.0 (byte~) render_logo::$1 reg byte a 4.0 (byte~) render_logo::$2 reg byte a 4.0 -(signed word~) render_logo::$3 zp[2]:29 2.0 +(signed word~) render_logo::$3 zp[2]:25 2.0 (byte~) render_logo::$33 reg byte a 202.0 (byte~) render_logo::$36 reg byte a 202.0 (byte~) render_logo::$39 reg byte a 202.0 @@ -238,11 +238,11 @@ (byte) render_logo::line (byte) render_logo::logo_idx (signed byte) render_logo::logo_idx#1 reg byte a 2.0 -(byte) render_logo::logo_idx#10 logo_idx zp[1]:11 57.714285714285715 -(byte) render_logo::logo_idx#11 logo_idx_1 zp[1]:2 65.07142857142857 -(byte~) render_logo::logo_idx#14 logo_idx_1 zp[1]:2 4.0 -(byte) render_logo::logo_idx#3 logo_idx zp[1]:11 202.0 -(byte) render_logo::logo_idx#4 logo_idx_1 zp[1]:2 202.0 +(byte) render_logo::logo_idx#10 logo_idx zp[1]:2 57.714285714285715 +(byte) render_logo::logo_idx#11 logo_idx_1 zp[1]:3 65.07142857142857 +(byte~) render_logo::logo_idx#14 logo_idx_1 zp[1]:3 4.0 +(byte) render_logo::logo_idx#3 logo_idx zp[1]:2 202.0 +(byte) render_logo::logo_idx#4 logo_idx_1 zp[1]:3 202.0 (byte) render_logo::logo_start (byte) render_logo::screen_idx (byte) render_logo::screen_idx#10 reg byte y 77.6923076923077 @@ -254,11 +254,11 @@ (byte) render_logo::screen_idx#5 reg byte y 101.0 (byte) render_logo::screen_idx#6 reg byte y 202.0 (signed byte) render_logo::x_char -(signed byte) render_logo::x_char#0 x_char zp[1]:24 0.36363636363636365 +(signed byte) render_logo::x_char#0 x_char zp[1]:20 0.36363636363636365 (signed word) render_logo::xpos -(signed word) render_logo::xpos#0 xpos zp[2]:22 2.142857142857143 +(signed word) render_logo::xpos#0 xpos zp[2]:18 2.142857142857143 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:12 4.0 +(dword~) sin16s::$4 zp[4]:27 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -273,39 +273,39 @@ (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:11 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:20 22.0 -(signed word) sin16s::return#1 return zp[2]:20 5.0 -(signed word~) sin16s::return#5 return zp[2]:20 4.0 +(signed word) sin16s::return#0 return zp[2]:16 22.0 +(signed word) sin16s::return#1 return zp[2]:16 5.0 +(signed word~) sin16s::return#5 return zp[2]:16 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:20 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:16 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:20 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:20 1.0 +(word) sin16s::usinx#0 usinx zp[2]:16 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:16 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:12 8.5 -(dword) sin16s::x#1 x zp[4]:12 4.0 -(dword) sin16s::x#2 x zp[4]:12 4.0 -(dword) sin16s::x#4 x zp[4]:12 5.0 -(dword) sin16s::x#6 x zp[4]:12 6.0 +(dword) sin16s::x#0 x zp[4]:8 8.5 +(dword) sin16s::x#1 x zp[4]:8 4.0 +(dword) sin16s::x#2 x zp[4]:8 4.0 +(dword) sin16s::x#4 x zp[4]:8 5.0 +(dword) sin16s::x#6 x zp[4]:8 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:31 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:22 4.0 +(word) sin16s::x2#0 x2 zp[2]:18 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:22 1.0 +(word) sin16s::x3#0 x3 zp[2]:18 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:33 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:22 4.0 +(word) sin16s::x4#0 x4 zp[2]:18 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:33 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:33 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:12 22.0 -(word~) sin16s_gen2::$9 zp[2]:29 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:8 22.0 +(word~) sin16s_gen2::$9 zp[2]:25 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -323,14 +323,14 @@ (const signed word) sin16s_gen2::min#0 min = (signed word) -$140 (signed word) sin16s_gen2::offs (signed word*) sin16s_gen2::sintab -(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:16 7.333333333333333 -(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:16 3.0 +(signed word*) sin16s_gen2::sintab#0 sintab zp[2]:12 7.333333333333333 +(signed word*) sin16s_gen2::sintab#2 sintab zp[2]:12 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:25 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:21 0.8666666666666666 (word) sin16s_gen2::wavelength (dword) sin16s_gen2::x -(dword) sin16s_gen2::x#1 x zp[4]:3 11.0 -(dword) sin16s_gen2::x#2 x zp[4]:3 2.75 +(dword) sin16s_gen2::x#1 x zp[4]:4 11.0 +(dword) sin16s_gen2::x#2 x zp[4]:4 2.75 (const signed word[XSIN_SIZE]) xsin = { fill( XSIN_SIZE, 0) } (word) xsin_idx (word) xsin_idx#11 xsin_idx zp[2]:35 4.125 @@ -339,23 +339,23 @@ reg byte x [ main::ch#2 main::ch#1 ] reg byte y [ render_logo::screen_idx#10 render_logo::screen_idx#4 render_logo::screen_idx#18 render_logo::screen_idx#3 ] -zp[1]:2 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] +zp[1]:2 [ render_logo::logo_idx#10 render_logo::logo_idx#3 ] +zp[1]:3 [ render_logo::logo_idx#11 render_logo::logo_idx#14 render_logo::logo_idx#4 ] reg byte y [ render_logo::screen_idx#15 render_logo::screen_idx#21 render_logo::screen_idx#5 render_logo::screen_idx#6 ] -zp[4]:3 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] -zp[4]:7 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -zp[1]:11 [ sin16s::isUpper#2 render_logo::logo_idx#10 render_logo::logo_idx#3 ] -zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +zp[4]:4 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] -zp[2]:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[2]:12 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] +zp[2]:14 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[2]:20 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] +zp[2]:16 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] reg byte x [ memset::c#4 ] -zp[2]:22 [ loop::$7 loop::$2 loop::xpos#0 render_logo::xpos#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +zp[2]:18 [ loop::$7 loop::$2 loop::xpos#0 render_logo::xpos#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] reg byte a [ render_logo::$0 ] reg byte a [ render_logo::$1 ] reg byte a [ render_logo::$2 ] -zp[1]:24 [ render_logo::x_char#0 ] +zp[1]:20 [ render_logo::x_char#0 ] reg byte a [ render_logo::$33 ] reg byte a [ render_logo::$36 ] reg byte a [ render_logo::$39 ] @@ -367,9 +367,10 @@ reg byte a [ render_logo::$76 ] reg byte a [ render_logo::$79 ] reg byte a [ render_logo::$82 ] reg byte a [ render_logo::$85 ] -zp[4]:25 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:29 [ sin16s_gen2::$9 render_logo::$3 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] +zp[4]:21 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:25 [ sin16s_gen2::$9 render_logo::$3 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] reg byte a [ mul16u::$1 ] +zp[4]:27 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:31 [ sin16s::x1#0 mul16s::$9 mul16s::$16 ] zp[2]:33 [ div32u16u::quotient_hi#0 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 ] reg byte a [ divr16u::$1 ] diff --git a/src/test/ref/examples/sinplotter/sine-plotter.asm b/src/test/ref/examples/sinplotter/sine-plotter.asm index d9b9bca49..59aeb0c70 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.asm +++ b/src/test/ref/examples/sinplotter/sine-plotter.asm @@ -33,7 +33,7 @@ .label SCREEN = $400 .label BITMAP = $2000 .const SIN_SIZE = $200 - .label rem16u = $1c + .label rem16u = $18 main: { .const vicSelectGfxBank1_toDd001_return = 3 .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f @@ -63,14 +63,14 @@ main: { jmp __b1 } render_sine: { - .label __1 = $16 - .label __4 = $16 - .label __10 = $16 - .label __11 = $16 - .label sin_val = $16 - .label sin2_val = $16 + .label __1 = $12 + .label __4 = $12 + .label __10 = $12 + .label __11 = $12 + .label sin_val = $12 + .label sin2_val = $12 .label xpos = 6 - .label sin_idx = $14 + .label sin_idx = $10 lda #<0 sta.z xpos sta.z xpos+1 @@ -165,8 +165,8 @@ render_sine: { // Plot a single dot in the bitmap // bitmap_plot(word zeropage(6) x, byte register(X) y) bitmap_plot: { - .label __1 = $1c - .label plotter = $16 + .label __1 = $18 + .label plotter = $12 .label x = 6 lda bitmap_plot_yhi,x sta.z plotter+1 @@ -193,9 +193,9 @@ bitmap_plot: { sta (plotter),y rts } -// wrap_y(signed word zeropage($16) y) +// wrap_y(signed word zeropage($12) y) wrap_y: { - .label y = $16 + .label y = $12 __b1: lda.z y cmp #<$c8 @@ -237,12 +237,12 @@ sin16s_gen2: { .const min = -$140 .const max = $140 .label ampl = max-min - .label __6 = $c - .label __9 = $1c - .label step = $18 + .label __6 = 8 + .label __9 = $18 + .label step = $14 .label sintab = 6 .label x = 2 - .label i = $14 + .label i = $10 jsr div32u16u lda #PI_u4f28>>$10 bcc b1 @@ -448,12 +447,10 @@ sin16s: { lda.z x+3 sbc #>PI_u4f28>>$10 sta.z x+3 - lda #1 - sta.z isUpper + ldy #1 jmp __b1 b1: - lda #0 - sta.z isUpper + ldy #0 __b1: lda.z x+3 cmp #>PI_HALF_u4f28>>$10 @@ -485,14 +482,26 @@ sin16s: { sbc.z x+3 sta.z x+3 __b2: - ldy #3 - !: + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- lda.z __4+2 sta.z x1 lda.z __4+3 @@ -565,8 +574,7 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - lda.z isUpper - cmp #0 + cpy #0 beq __b3 sec lda #0 @@ -580,14 +588,14 @@ sin16s: { } // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($12) v1, word zeropage($16) v2, byte register(X) select) +// mulu16_sel(word zeropage($e) v1, word zeropage($12) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $12 - .label v2 = $16 + .label __0 = 8 + .label __1 = 8 + .label v1 = $e + .label v2 = $12 .label return = $20 - .label return_1 = $12 + .label return_1 = $e lda.z v1 sta.z mul16u.a lda.z v1+1 @@ -620,8 +628,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $20 - .label quotient_lo = $12 - .label return = $18 + .label quotient_lo = $e + .label return = $14 lda #>$10 sta.z divr16u.dividend lda #>PI2_u4f28>>$10 @@ -653,12 +661,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($10) dividend, word zeropage($1c) rem) +// divr16u(word zeropage($c) dividend, word zeropage($18) rem) divr16u: { - .label rem = $1c - .label dividend = $10 - .label quotient = $12 - .label return = $12 + .label rem = $18 + .label dividend = $c + .label quotient = $e + .label return = $e ldx #0 txa sta.z quotient @@ -731,12 +739,12 @@ bitmap_clear: { 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($16) str, byte register(X) c, word zeropage($14) num) +// memset(void* zeropage($12) str, byte register(X) c, word zeropage($10) num) memset: { - .label end = $14 - .label dst = $16 - .label num = $14 - .label str = $16 + .label end = $10 + .label dst = $12 + .label num = $10 + .label str = $12 lda.z num bne !+ lda.z num+1 @@ -771,7 +779,7 @@ memset: { // Initialize bitmap plotting tables bitmap_init: { .label __7 = $22 - .label yoffs = $14 + .label yoffs = $10 ldx #0 lda #$80 __b1: diff --git a/src/test/ref/examples/sinplotter/sine-plotter.log b/src/test/ref/examples/sinplotter/sine-plotter.log index 655892cc1..f00372103 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.log +++ b/src/test/ref/examples/sinplotter/sine-plotter.log @@ -4907,21 +4907,25 @@ sin16s: { __b2: // [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 lda.z x + asl sta.z __4 lda.z x+1 + rol sta.z __4+1 lda.z x+2 + rol sta.z __4+2 lda.z x+3 + rol sta.z __4+3 - ldy #3 - !: asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 // [114] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -5767,8 +5771,7 @@ Statement [107] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [108] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [110] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [111] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:35 [ sin16s::isUpper#2 ] +Statement [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [114] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [115] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [116] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -5877,7 +5880,7 @@ Statement [107] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [108] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [110] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [111] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y +Statement [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [114] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [115] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [116] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:2::sin16s_gen2:18::sin16s:75 [ sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -5940,7 +5943,7 @@ Potential registers zp[2]:23 [ mul16u::b#1 ] : zp[2]:23 , Potential registers zp[2]:25 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] : zp[2]:25 , Potential registers zp[4]:27 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] : zp[4]:27 , Potential registers zp[4]:31 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] : zp[4]:31 , -Potential registers zp[1]:35 [ sin16s::isUpper#2 ] : zp[1]:35 , reg byte x , +Potential registers zp[1]:35 [ sin16s::isUpper#2 ] : zp[1]:35 , reg byte x , reg byte y , Potential registers zp[4]:36 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] : zp[4]:36 , Potential registers zp[2]:40 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] : zp[2]:40 , Potential registers zp[2]:42 [ 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[2]:42 , @@ -6035,30 +6038,28 @@ Uplift Scope [] 0.8: zp[2]:185 [ rem16u#1 ] Uplift Scope [bitmap_clear] Uplift Scope [main] -Uplifting [mul16u] best 30951 combination zp[4]:27 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:31 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:25 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:23 [ mul16u::b#1 ] zp[4]:112 [ mul16u::return#2 ] zp[4]:157 [ mul16u::return#3 ] -Uplifting [wrap_y] best 30768 combination zp[2]:9 [ wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 ] reg byte a [ wrap_y::return#0 ] reg byte a [ wrap_y::return#1 ] reg byte a [ wrap_y::return#2 ] -Uplifting [divr16u] best 30558 combination zp[2]: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[2]: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[2]:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:171 [ divr16u::return#2 ] zp[2]:175 [ divr16u::return#3 ] -Uplifting [render_sine] best 30478 combination zp[2]:2 [ render_sine::sin_idx#2 render_sine::sin_idx#1 ] zp[2]:4 [ render_sine::xpos#3 render_sine::xpos#9 render_sine::xpos#1 ] zp[2]:66 [ render_sine::$10 ] zp[2]:68 [ render_sine::$1 ] zp[2]:70 [ render_sine::sin_val#0 ] zp[2]:74 [ render_sine::$11 ] zp[2]:76 [ render_sine::$4 ] zp[2]:78 [ render_sine::sin2_val#0 ] reg byte x [ render_sine::ypos#0 ] reg byte x [ render_sine::ypos2#0 ] -Uplifting [bitmap_init] best 29968 combination zp[2]:64 [ 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[1]:191 [ bitmap_init::$5 ] zp[1]:192 [ bitmap_init::$6 ] zp[1]:189 [ bitmap_init::$7 ] +Uplifting [mul16u] best 30973 combination zp[4]:27 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:31 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:25 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] zp[2]:23 [ mul16u::b#1 ] zp[4]:112 [ mul16u::return#2 ] zp[4]:157 [ mul16u::return#3 ] +Uplifting [wrap_y] best 30790 combination zp[2]:9 [ wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 ] reg byte a [ wrap_y::return#0 ] reg byte a [ wrap_y::return#1 ] reg byte a [ wrap_y::return#2 ] +Uplifting [divr16u] best 30580 combination zp[2]: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[2]: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[2]:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:171 [ divr16u::return#2 ] zp[2]:175 [ divr16u::return#3 ] +Uplifting [render_sine] best 30500 combination zp[2]:2 [ render_sine::sin_idx#2 render_sine::sin_idx#1 ] zp[2]:4 [ render_sine::xpos#3 render_sine::xpos#9 render_sine::xpos#1 ] zp[2]:66 [ render_sine::$10 ] zp[2]:68 [ render_sine::$1 ] zp[2]:70 [ render_sine::sin_val#0 ] zp[2]:74 [ render_sine::$11 ] zp[2]:76 [ render_sine::$4 ] zp[2]:78 [ render_sine::sin2_val#0 ] reg byte x [ render_sine::ypos#0 ] reg byte x [ render_sine::ypos2#0 ] +Uplifting [bitmap_init] best 29990 combination zp[2]:64 [ 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[1]:191 [ bitmap_init::$5 ] zp[1]:192 [ bitmap_init::$6 ] zp[1]:189 [ bitmap_init::$7 ] Limited combination testing to 100 combinations of 15360 possible. -Uplifting [bitmap_plot] best 29901 combination reg byte x [ bitmap_plot::y#2 bitmap_plot::y#1 bitmap_plot::y#0 ] zp[2]:7 [ bitmap_plot::x#2 bitmap_plot::x#1 bitmap_plot::x#0 ] zp[2]:84 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp[2]:86 [ bitmap_plot::plotter#1 ] zp[2]:82 [ bitmap_plot::plotter#0 ] -Uplifting [sin16s] best 29901 combination zp[4]:36 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:98 [ sin16s::return#0 ] zp[2]:40 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:125 [ sin16s::$4 ] zp[2]:133 [ sin16s::x2#0 ] zp[2]:141 [ sin16s::x3_6#0 ] zp[2]:147 [ sin16s::x4#0 ] zp[2]:151 [ sin16s::x5#0 ] zp[2]:153 [ sin16s::x5_128#0 ] zp[2]:137 [ sin16s::x3#0 ] zp[2]:155 [ sin16s::usinx#1 ] zp[2]:129 [ sin16s::x1#0 ] zp[2]:143 [ sin16s::usinx#0 ] zp[1]:35 [ sin16s::isUpper#2 ] -Uplifting [sin16s_gen2] best 29901 combination zp[2]:11 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:106 [ sin16s_gen2::$6 ] zp[4]:13 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:110 [ sin16s_gen2::$9 ] zp[2]:17 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:94 [ sin16s_gen2::step#0 ] -Uplifting [mulu16_sel] best 29885 combination zp[2]:42 [ 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[2]:44 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:131 [ mulu16_sel::return#0 ] zp[2]:135 [ mulu16_sel::return#1 ] zp[2]:139 [ mulu16_sel::return#2 ] zp[2]:145 [ mulu16_sel::return#10 ] zp[2]:149 [ mulu16_sel::return#11 ] zp[4]:161 [ mulu16_sel::$0 ] zp[4]:165 [ mulu16_sel::$1 ] zp[2]:169 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [mul16s] best 29885 combination zp[4]:102 [ mul16s::return#2 ] zp[4]:19 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp[4]:120 [ mul16s::return#0 ] zp[2]:116 [ mul16s::$9 ] zp[2]:118 [ mul16s::$16 ] zp[2]:100 [ mul16s::a#0 ] -Uplifting [memset] best 29869 combination zp[2]:59 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:187 [ memset::end#0 ] zp[2]:54 [ memset::num#2 ] reg byte x [ memset::c#4 ] zp[2]:56 [ memset::str#3 ] -Uplifting [div32u16u] best 29869 combination zp[4]:90 [ div32u16u::return#2 ] zp[2]:177 [ div32u16u::quotient_lo#0 ] zp[4]:179 [ div32u16u::return#0 ] zp[2]:173 [ div32u16u::quotient_hi#0 ] -Uplifting [] best 29869 combination zp[2]:185 [ rem16u#1 ] -Uplifting [bitmap_clear] best 29869 combination -Uplifting [main] best 29869 combination +Uplifting [bitmap_plot] best 29923 combination reg byte x [ bitmap_plot::y#2 bitmap_plot::y#1 bitmap_plot::y#0 ] zp[2]:7 [ bitmap_plot::x#2 bitmap_plot::x#1 bitmap_plot::x#0 ] zp[2]:84 [ bitmap_plot::$1 ] reg byte a [ bitmap_plot::$2 ] zp[2]:86 [ bitmap_plot::plotter#1 ] zp[2]:82 [ bitmap_plot::plotter#0 ] +Uplifting [sin16s] best 29914 combination zp[4]:36 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:98 [ sin16s::return#0 ] zp[2]:40 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:125 [ sin16s::$4 ] zp[2]:133 [ sin16s::x2#0 ] zp[2]:141 [ sin16s::x3_6#0 ] zp[2]:147 [ sin16s::x4#0 ] zp[2]:151 [ sin16s::x5#0 ] zp[2]:153 [ sin16s::x5_128#0 ] zp[2]:137 [ sin16s::x3#0 ] zp[2]:155 [ sin16s::usinx#1 ] zp[2]:129 [ sin16s::x1#0 ] zp[2]:143 [ sin16s::usinx#0 ] reg byte y [ sin16s::isUpper#2 ] +Uplifting [sin16s_gen2] best 29914 combination zp[2]:11 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] zp[4]:106 [ sin16s_gen2::$6 ] zp[4]:13 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:110 [ sin16s_gen2::$9 ] zp[2]:17 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] zp[4]:94 [ sin16s_gen2::step#0 ] +Uplifting [mulu16_sel] best 29898 combination zp[2]:42 [ 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[2]:44 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:131 [ mulu16_sel::return#0 ] zp[2]:135 [ mulu16_sel::return#1 ] zp[2]:139 [ mulu16_sel::return#2 ] zp[2]:145 [ mulu16_sel::return#10 ] zp[2]:149 [ mulu16_sel::return#11 ] zp[4]:161 [ mulu16_sel::$0 ] zp[4]:165 [ mulu16_sel::$1 ] zp[2]:169 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [mul16s] best 29898 combination zp[4]:102 [ mul16s::return#2 ] zp[4]:19 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] zp[4]:120 [ mul16s::return#0 ] zp[2]:116 [ mul16s::$9 ] zp[2]:118 [ mul16s::$16 ] zp[2]:100 [ mul16s::a#0 ] +Uplifting [memset] best 29882 combination zp[2]:59 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:187 [ memset::end#0 ] zp[2]:54 [ memset::num#2 ] reg byte x [ memset::c#4 ] zp[2]:56 [ memset::str#3 ] +Uplifting [div32u16u] best 29882 combination zp[4]:90 [ div32u16u::return#2 ] zp[2]:177 [ div32u16u::quotient_lo#0 ] zp[4]:179 [ div32u16u::return#0 ] zp[2]:173 [ div32u16u::quotient_hi#0 ] +Uplifting [] best 29882 combination zp[2]:185 [ rem16u#1 ] +Uplifting [bitmap_clear] best 29882 combination +Uplifting [main] best 29882 combination Attempting to uplift remaining variables inzp[1]:191 [ bitmap_init::$5 ] -Uplifting [bitmap_init] best 29809 combination reg byte a [ bitmap_init::$5 ] +Uplifting [bitmap_init] best 29822 combination reg byte a [ bitmap_init::$5 ] Attempting to uplift remaining variables inzp[1]:192 [ bitmap_init::$6 ] -Uplifting [bitmap_init] best 29749 combination reg byte a [ bitmap_init::$6 ] +Uplifting [bitmap_init] best 29762 combination reg byte a [ bitmap_init::$6 ] Attempting to uplift remaining variables inzp[1]:189 [ bitmap_init::$7 ] -Uplifting [bitmap_init] best 29749 combination zp[1]:189 [ bitmap_init::$7 ] -Attempting to uplift remaining variables inzp[1]:35 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 29749 combination zp[1]:35 [ sin16s::isUpper#2 ] +Uplifting [bitmap_init] best 29762 combination zp[1]:189 [ bitmap_init::$7 ] Coalescing zero page register [ zp[2]:4 [ render_sine::xpos#3 render_sine::xpos#9 render_sine::xpos#1 ] ] with [ zp[2]:7 [ bitmap_plot::x#2 bitmap_plot::x#1 bitmap_plot::x#0 ] ] - score: 2 Coalescing zero page register [ zp[2]:40 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp[2]:155 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register [ zp[2]:42 [ 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[2]:137 [ sin16s::x3#0 ] ] - score: 2 @@ -6069,7 +6070,6 @@ Coalescing zero page register [ zp[4]:19 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 ] Coalescing zero page register [ zp[4]:19 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 ] ] with [ zp[4]:120 [ mul16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:23 [ mul16u::b#1 ] ] with [ zp[2]:44 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] ] - score: 1 Coalescing zero page register [ zp[4]:27 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] ] with [ zp[4]:157 [ mul16u::return#3 ] ] - score: 1 -Coalescing zero page register [ zp[4]:36 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:125 [ sin16s::$4 ] ] - score: 1 Coalescing zero page register [ zp[2]:40 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 ] ] with [ zp[2]:98 [ sin16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:42 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 ] ] with [ zp[2]:133 [ sin16s::x2#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:42 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 ] ] with [ zp[2]:147 [ sin16s::x4#0 ] ] - score: 1 @@ -6104,32 +6104,32 @@ Coalescing zero page register [ zp[2]:131 [ mulu16_sel::return#0 mulu16_sel::ret Coalescing zero page register [ zp[2]:11 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ] ] with [ zp[2]:2 [ render_sine::sin_idx#2 render_sine::sin_idx#1 ] ] Coalescing zero page register [ zp[2]:17 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 ] ] with [ zp[2]:4 [ render_sine::xpos#3 render_sine::xpos#9 render_sine::xpos#1 bitmap_plot::x#2 bitmap_plot::x#1 bitmap_plot::x#0 ] ] Coalescing zero page register [ zp[2]:23 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] ] with [ zp[2]:9 [ wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] ] -Coalescing zero page register [ zp[4]:36 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] ] with [ zp[4]:19 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] ] +Coalescing zero page register [ zp[4]:36 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:19 [ mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] ] Coalescing zero page register [ zp[2]: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 rem16u#1 ] ] with [ zp[2]:25 [ mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] ] Coalescing zero page register [ zp[2]:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] ] with [ zp[2]:40 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] ] Coalescing zero page register [ zp[2]:51 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ] ] with [ zp[2]:42 [ mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] ] Coalescing zero page register [ zp[2]:64 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] ] with [ zp[2]:54 [ memset::num#2 memset::end#0 ] ] Coalescing zero page register [ zp[2]:82 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 ] ] with [ zp[2]:56 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] Coalescing zero page register [ zp[2]:110 [ sin16s_gen2::$9 ] ] with [ zp[2]:84 [ bitmap_plot::$1 ] ] +Coalescing zero page register [ zp[4]:125 [ sin16s::$4 ] ] with [ zp[4]:31 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] ] Coalescing zero page register [ zp[2]:129 [ sin16s::x1#0 ] ] with [ zp[2]:116 [ mul16s::$9 mul16s::$16 ] ] Coalescing zero page register [ zp[2]:173 [ div32u16u::quotient_hi#0 ] ] with [ zp[2]:131 [ 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 ] ] -Coalescing zero page register [ zp[1]:189 [ bitmap_init::$7 ] ] with [ zp[1]:35 [ sin16s::isUpper#2 ] ] Coalescing zero page register [ zp[2]:64 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 memset::num#2 memset::end#0 ] ] with [ zp[2]:11 [ sin16s_gen2::i#2 sin16s_gen2::i#1 render_sine::sin_idx#2 render_sine::sin_idx#1 ] ] Coalescing zero page register [ zp[2]:82 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] with [ zp[2]:23 [ mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] ] Coalescing zero page register [ zp[2]:110 [ sin16s_gen2::$9 bitmap_plot::$1 ] ] with [ zp[2]: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 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] ] Allocated (was zp[4]:13) zp[4]:2 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] Allocated (was zp[2]:17) zp[2]:6 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 render_sine::xpos#3 render_sine::xpos#9 render_sine::xpos#1 bitmap_plot::x#2 bitmap_plot::x#1 bitmap_plot::x#0 ] -Allocated (was zp[4]:31) zp[4]:8 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -Allocated (was zp[4]:36) zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] -Allocated (was zp[2]:49) zp[2]:16 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] -Allocated (was zp[2]:51) zp[2]:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] -Allocated (was zp[2]:64) zp[2]:20 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 memset::num#2 memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 render_sine::sin_idx#2 render_sine::sin_idx#1 ] -Allocated (was zp[2]:82) zp[2]:22 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] -Allocated (was zp[4]:90) zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -Allocated (was zp[2]:110) zp[2]:28 [ sin16s_gen2::$9 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +Allocated (was zp[4]:36) zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +Allocated (was zp[2]:49) zp[2]:12 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] +Allocated (was zp[2]:51) zp[2]:14 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +Allocated (was zp[2]:64) zp[2]:16 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 memset::num#2 memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 render_sine::sin_idx#2 render_sine::sin_idx#1 ] +Allocated (was zp[2]:82) zp[2]:18 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] +Allocated (was zp[4]:90) zp[4]:20 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +Allocated (was zp[2]:110) zp[2]:24 [ sin16s_gen2::$9 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +Allocated (was zp[4]:125) zp[4]:26 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] Allocated (was zp[2]:129) zp[2]:30 [ sin16s::x1#0 mul16s::$9 mul16s::$16 ] Allocated (was zp[2]:173) zp[2]:32 [ div32u16u::quotient_hi#0 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[1]:189) zp[1]:34 [ bitmap_init::$7 sin16s::isUpper#2 ] +Allocated (was zp[1]:189) zp[1]:34 [ bitmap_init::$7 ] ASSEMBLER BEFORE OPTIMIZATION // File Comments @@ -6170,7 +6170,7 @@ ASSEMBLER BEFORE OPTIMIZATION .label SCREEN = $400 .label BITMAP = $2000 .const SIN_SIZE = $200 - .label rem16u = $1c + .label rem16u = $18 // @begin __bbegin: // [1] phi from @begin to @1 [phi:@begin->@1] @@ -6276,14 +6276,14 @@ main: { } // render_sine render_sine: { - .label __1 = $16 - .label __4 = $16 - .label __10 = $16 - .label __11 = $16 - .label sin_val = $16 - .label sin2_val = $16 + .label __1 = $12 + .label __4 = $12 + .label __10 = $12 + .label __11 = $12 + .label sin_val = $12 + .label sin2_val = $12 .label xpos = 6 - .label sin_idx = $14 + .label sin_idx = $10 // [23] phi from render_sine to render_sine::@1 [phi:render_sine->render_sine::@1] __b1_from_render_sine: // [23] phi (word) render_sine::xpos#3 = (byte) 0 [phi:render_sine->render_sine::@1#0] -- vwuz1=vbuc1 @@ -6462,8 +6462,8 @@ render_sine: { // Plot a single dot in the bitmap // bitmap_plot(word zeropage(6) x, byte register(X) y) bitmap_plot: { - .label __1 = $1c - .label plotter = $16 + .label __1 = $18 + .label plotter = $12 .label x = 6 // [52] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi + (byte) bitmap_plot::y#2) w= *((const byte[$100]) bitmap_plot_ylo + (byte) bitmap_plot::y#2) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx lda bitmap_plot_yhi,x @@ -6501,9 +6501,9 @@ bitmap_plot: { rts } // wrap_y -// wrap_y(signed word zeropage($16) y) +// wrap_y(signed word zeropage($12) y) wrap_y: { - .label y = $16 + .label y = $12 // [59] phi from wrap_y wrap_y::@2 to wrap_y::@1 [phi:wrap_y/wrap_y::@2->wrap_y::@1] __b1_from_wrap_y: __b1_from___b2: @@ -6572,12 +6572,12 @@ sin16s_gen2: { .const min = -$140 .const max = $140 .label ampl = max-min - .label __6 = $c - .label __9 = $1c - .label step = $18 + .label __6 = 8 + .label __9 = $18 + .label step = $14 .label sintab = 6 .label x = 2 - .label i = $14 + .label i = $10 // [68] call div32u16u // [156] phi from sin16s_gen2 to div32u16u [phi:sin16s_gen2->div32u16u] div32u16u_from_sin16s_gen2: @@ -6698,13 +6698,13 @@ sin16s_gen2: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage($10) a) +// mul16s(signed word zeropage($c) a) mul16s: { .label __9 = $1e .label __16 = $1e - .label m = $c - .label return = $c - .label a = $10 + .label m = 8 + .label return = 8 + .label a = $c // [86] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#0 -- vwuz1=vwuz2 lda.z a sta.z mul16u.a @@ -6772,13 +6772,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1c) a, word zeropage($16) b) +// mul16u(word zeropage($18) a, word zeropage($12) b) mul16u: { - .label mb = 8 - .label a = $1c - .label res = $c - .label return = $c - .label b = $16 + .label mb = $1a + .label a = $18 + .label res = 8 + .label return = 8 + .label b = $12 // [98] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] __b1_from_mul16u: // [98] phi (dword) mul16u::mb#2 = (dword) mul16u::mb#0 [phi:mul16u->mul16u::@1#0] -- register_copy @@ -6854,21 +6854,20 @@ mul16u: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($c) x) +// sin16s(dword zeropage(8) x) sin16s: { - .label __4 = $c - .label x = $c - .label return = $10 + .label __4 = $1a + .label x = 8 + .label return = $c .label x1 = $1e - .label x2 = $12 - .label x3 = $12 + .label x2 = $e + .label x3 = $e .label x3_6 = $20 - .label usinx = $10 - .label x4 = $12 + .label usinx = $c + .label x4 = $e .label x5 = $20 .label x5_128 = $20 - .label sinx = $10 - .label isUpper = $22 + .label sinx = $c // [107] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 cmp #>PI_u4f28>>$10 @@ -6905,16 +6904,14 @@ sin16s: { sta.z x+3 // [109] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] __b1_from___b4: - // [109] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [109] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [109] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [109] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] __b1_from_sin16s: - // [109] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [109] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [109] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy jmp __b1 // sin16s::@1 @@ -6960,15 +6957,27 @@ sin16s: { jmp __b2 // sin16s::@2 __b2: - // [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // [114] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -7109,9 +7118,8 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - // [142] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [142] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b12 jmp __b6 // sin16s::@6 @@ -7144,14 +7152,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($12) v1, word zeropage($16) v2, byte register(X) select) +// mulu16_sel(word zeropage($e) v1, word zeropage($12) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $12 - .label v2 = $16 + .label __0 = 8 + .label __1 = 8 + .label v1 = $e + .label v2 = $12 .label return = $20 - .label return_1 = $12 + .label return_1 = $e // [148] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 sta.z mul16u.a @@ -7203,8 +7211,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $20 - .label quotient_lo = $12 - .label return = $18 + .label quotient_lo = $e + .label return = $14 // [157] call divr16u // [166] phi from div32u16u to divr16u [phi:div32u16u->divr16u] divr16u_from_div32u16u: @@ -7264,12 +7272,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($10) dividend, word zeropage($1c) rem) +// divr16u(word zeropage($c) dividend, word zeropage($18) rem) divr16u: { - .label rem = $1c - .label dividend = $10 - .label quotient = $12 - .label return = $12 + .label rem = $18 + .label dividend = $c + .label quotient = $e + .label return = $e // [167] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] __b1_from_divr16u: // [167] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 @@ -7420,12 +7428,12 @@ bitmap_clear: { } // 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($16) str, byte register(X) c, word zeropage($14) num) +// memset(void* zeropage($12) str, byte register(X) c, word zeropage($10) num) memset: { - .label end = $14 - .label dst = $16 - .label num = $14 - .label str = $16 + .label end = $10 + .label dst = $12 + .label num = $10 + .label str = $12 // [190] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 lda.z num bne !+ @@ -7480,7 +7488,7 @@ memset: { // Initialize bitmap plotting tables bitmap_init: { .label __7 = $22 - .label yoffs = $14 + .label yoffs = $10 // [199] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] __b1_from_bitmap_init: // [199] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 @@ -7912,16 +7920,16 @@ FINAL SYMBOL TABLE (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[2]:20 22.0 -(byte*) bitmap_init::yoffs#2 yoffs zp[2]:20 6.875 -(byte*) bitmap_init::yoffs#4 yoffs zp[2]:20 11.0 +(byte*) bitmap_init::yoffs#1 yoffs zp[2]:16 22.0 +(byte*) bitmap_init::yoffs#2 yoffs zp[2]:16 6.875 +(byte*) bitmap_init::yoffs#4 yoffs zp[2]:16 11.0 (void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) -(word~) bitmap_plot::$1 zp[2]:28 4.0 +(word~) bitmap_plot::$1 zp[2]:24 4.0 (byte~) bitmap_plot::$2 reg byte a 4.0 (label) bitmap_plot::@return (byte*) bitmap_plot::plotter -(word) bitmap_plot::plotter#0 plotter zp[2]:22 1.0 -(byte*) bitmap_plot::plotter#1 plotter zp[2]:22 3.0 +(word) bitmap_plot::plotter#0 plotter zp[2]:18 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp[2]:18 3.0 (word) bitmap_plot::x (word) bitmap_plot::x#0 x zp[2]:6 11.0 (word) bitmap_plot::x#1 x zp[2]:6 11.0 @@ -7944,10 +7952,10 @@ FINAL SYMBOL TABLE (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:32 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:18 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:14 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:24 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:24 4.0 +(dword) div32u16u::return#0 return zp[4]:20 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:20 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -7959,30 +7967,30 @@ FINAL SYMBOL TABLE (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:16 2.75 -(word) divr16u::dividend#3 dividend zp[2]:16 5.0 -(word) divr16u::dividend#5 dividend zp[2]:16 2.0 +(word) divr16u::dividend#0 dividend zp[2]:12 2.75 +(word) divr16u::dividend#3 dividend zp[2]:12 5.0 +(word) divr16u::dividend#5 dividend zp[2]:12 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:18 16.5 -(word) divr16u::quotient#2 quotient zp[2]:18 11.0 -(word) divr16u::quotient#3 quotient zp[2]:18 2.75 +(word) divr16u::quotient#1 quotient zp[2]:14 16.5 +(word) divr16u::quotient#2 quotient zp[2]:14 11.0 +(word) divr16u::quotient#3 quotient zp[2]:14 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:28 8.25 -(word) divr16u::rem#1 rem zp[2]:28 22.0 -(word) divr16u::rem#10 rem zp[2]:28 4.0 -(word) divr16u::rem#11 rem zp[2]:28 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:28 22.0 -(word) divr16u::rem#4 rem zp[2]:28 4.0 -(word) divr16u::rem#5 rem zp[2]:28 24.0 -(word) divr16u::rem#6 rem zp[2]:28 11.0 +(word) divr16u::rem#0 rem zp[2]:24 8.25 +(word) divr16u::rem#1 rem zp[2]:24 22.0 +(word) divr16u::rem#10 rem zp[2]:24 4.0 +(word) divr16u::rem#11 rem zp[2]:24 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:24 22.0 +(word) divr16u::rem#4 rem zp[2]:24 4.0 +(word) divr16u::rem#5 rem zp[2]:24 24.0 +(word) divr16u::rem#6 rem zp[2]:24 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:18 5.285714285714286 -(word) divr16u::return#2 return zp[2]:18 4.0 -(word) divr16u::return#3 return zp[2]:18 4.0 +(word) divr16u::return#0 return zp[2]:14 5.285714285714286 +(word) divr16u::return#2 return zp[2]:14 4.0 +(word) divr16u::return#3 return zp[2]:14 4.0 (void()) main() (label) main::@1 (label) main::@2 @@ -8010,16 +8018,16 @@ FINAL SYMBOL TABLE (byte) memset::c (byte) memset::c#4 reg byte x 1.375 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:22 22.0 -(byte*) memset::dst#2 dst zp[2]:22 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:22 4.0 +(byte*) memset::dst#1 dst zp[2]:18 22.0 +(byte*) memset::dst#2 dst zp[2]:18 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:18 4.0 (byte*) memset::end -(byte*) memset::end#0 end zp[2]:20 2.1666666666666665 +(byte*) memset::end#0 end zp[2]:16 2.1666666666666665 (word) memset::num -(word) memset::num#2 num zp[2]:20 2.0 +(word) memset::num#2 num zp[2]:16 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:22 +(void*) memset::str#3 str zp[2]:18 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 zp[2]:30 4.0 (word~) mul16s::$9 zp[2]:30 4.0 @@ -8029,15 +8037,15 @@ FINAL SYMBOL TABLE (label) mul16s::@4 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:16 2.6 +(signed word) mul16s::a#0 a zp[2]:12 2.6 (signed word) mul16s::b (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:12 2.0 -(dword) mul16s::m#1 m zp[4]:12 4.0 -(dword) mul16s::m#4 m zp[4]:12 4.0 +(dword) mul16s::m#0 m zp[4]:8 2.0 +(dword) mul16s::m#1 m zp[4]:8 4.0 +(dword) mul16s::m#4 m zp[4]:8 4.0 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:12 4.333333333333333 -(signed dword) mul16s::return#2 return zp[4]:12 22.0 +(signed dword) mul16s::return#0 return zp[4]:8 4.333333333333333 +(signed dword) mul16s::return#2 return zp[4]:8 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -8046,58 +8054,58 @@ FINAL SYMBOL TABLE (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:28 101.0 -(word) mul16u::a#1 a zp[2]:28 4.0 -(word) mul16u::a#2 a zp[2]:28 2.0 -(word) mul16u::a#3 a zp[2]:28 67.66666666666666 -(word) mul16u::a#6 a zp[2]:28 6.0 +(word) mul16u::a#0 a zp[2]:24 101.0 +(word) mul16u::a#1 a zp[2]:24 4.0 +(word) mul16u::a#2 a zp[2]:24 2.0 +(word) mul16u::a#3 a zp[2]:24 67.66666666666666 +(word) mul16u::a#6 a zp[2]:24 6.0 (word) mul16u::b -(word) mul16u::b#1 b zp[2]:22 4.0 +(word) mul16u::b#1 b zp[2]:18 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:8 4.0 -(dword) mul16u::mb#1 mb zp[4]:8 202.0 -(dword) mul16u::mb#2 mb zp[4]:8 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:26 4.0 +(dword) mul16u::mb#1 mb zp[4]:26 202.0 +(dword) mul16u::mb#2 mb zp[4]:26 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:12 202.0 -(dword) mul16u::res#2 res zp[4]:12 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:12 101.0 +(dword) mul16u::res#1 res zp[4]:8 202.0 +(dword) mul16u::res#2 res zp[4]:8 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:8 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:12 4.0 -(dword) mul16u::return#3 return zp[4]:12 4.0 +(dword) mul16u::return#2 return zp[4]:8 4.0 +(dword) mul16u::return#3 return zp[4]:8 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:12 4.0 -(dword~) mulu16_sel::$1 zp[4]:12 4.0 +(dword~) mulu16_sel::$0 zp[4]:8 4.0 +(dword~) mulu16_sel::$1 zp[4]:8 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:32 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:18 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:18 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:14 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:14 4.0 (word) mulu16_sel::return#11 return zp[2]:32 4.0 (word) mulu16_sel::return#12 return zp[2]:32 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:32 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:18 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:18 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:14 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:14 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:22 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:18 5.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:28 0.8 +(word) rem16u#1 rem16u zp[2]:24 0.8 (void()) render_sine() -(signed word*~) render_sine::$1 zp[2]:22 22.0 -(word~) render_sine::$10 zp[2]:22 22.0 -(word~) render_sine::$11 zp[2]:22 22.0 -(signed word*~) render_sine::$4 zp[2]:22 22.0 +(signed word*~) render_sine::$1 zp[2]:18 22.0 +(word~) render_sine::$10 zp[2]:18 22.0 +(word~) render_sine::$11 zp[2]:18 22.0 +(signed word*~) render_sine::$4 zp[2]:18 22.0 (label) render_sine::@1 (label) render_sine::@2 (label) render_sine::@3 @@ -8108,12 +8116,12 @@ FINAL SYMBOL TABLE (label) render_sine::@8 (label) render_sine::@return (signed word) render_sine::sin2_val -(signed word) render_sine::sin2_val#0 sin2_val zp[2]:22 22.0 +(signed word) render_sine::sin2_val#0 sin2_val zp[2]:18 22.0 (word) render_sine::sin_idx -(word) render_sine::sin_idx#1 sin_idx zp[2]:20 22.0 -(word) render_sine::sin_idx#2 sin_idx zp[2]:20 2.1153846153846154 +(word) render_sine::sin_idx#1 sin_idx zp[2]:16 22.0 +(word) render_sine::sin_idx#2 sin_idx zp[2]:16 2.1153846153846154 (signed word) render_sine::sin_val -(signed word) render_sine::sin_val#0 sin_val zp[2]:22 22.0 +(signed word) render_sine::sin_val#0 sin_val zp[2]:18 22.0 (word) render_sine::xpos (word) render_sine::xpos#1 xpos zp[2]:6 11.0 (word) render_sine::xpos#3 xpos zp[2]:6 2.0 @@ -8124,7 +8132,7 @@ FINAL SYMBOL TABLE (byte) render_sine::ypos2#0 reg byte x 11.0 (const signed word[$200]) sin = { fill( $200, 0) } (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:12 4.0 +(dword~) sin16s::$4 zp[4]:26 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -8139,39 +8147,39 @@ FINAL SYMBOL TABLE (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:34 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:16 22.0 -(signed word) sin16s::return#1 return zp[2]:16 5.0 -(signed word~) sin16s::return#5 return zp[2]:16 4.0 +(signed word) sin16s::return#0 return zp[2]:12 22.0 +(signed word) sin16s::return#1 return zp[2]:12 5.0 +(signed word~) sin16s::return#5 return zp[2]:12 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:16 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:12 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:16 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:16 1.0 +(word) sin16s::usinx#0 usinx zp[2]:12 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:12 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:12 8.5 -(dword) sin16s::x#1 x zp[4]:12 4.0 -(dword) sin16s::x#2 x zp[4]:12 4.0 -(dword) sin16s::x#4 x zp[4]:12 5.0 -(dword) sin16s::x#6 x zp[4]:12 6.0 +(dword) sin16s::x#0 x zp[4]:8 8.5 +(dword) sin16s::x#1 x zp[4]:8 4.0 +(dword) sin16s::x#2 x zp[4]:8 4.0 +(dword) sin16s::x#4 x zp[4]:8 5.0 +(dword) sin16s::x#6 x zp[4]:8 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:30 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:18 4.0 +(word) sin16s::x2#0 x2 zp[2]:14 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:18 1.0 +(word) sin16s::x3#0 x3 zp[2]:14 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:32 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:18 4.0 +(word) sin16s::x4#0 x4 zp[2]:14 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:32 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:32 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:12 22.0 -(word~) sin16s_gen2::$9 zp[2]:28 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:8 22.0 +(word~) sin16s_gen2::$9 zp[2]:24 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -8181,8 +8189,8 @@ FINAL SYMBOL TABLE (signed word) sin16s_gen2::ampl (const signed word) sin16s_gen2::ampl#0 ampl = (const signed word) sin16s_gen2::max#0-(const signed word) sin16s_gen2::min#0 (word) sin16s_gen2::i -(word) sin16s_gen2::i#1 i zp[2]:20 22.0 -(word) sin16s_gen2::i#2 i zp[2]:20 2.5384615384615383 +(word) sin16s_gen2::i#1 i zp[2]:16 22.0 +(word) sin16s_gen2::i#2 i zp[2]:16 2.5384615384615383 (signed word) sin16s_gen2::max (const signed word) sin16s_gen2::max#0 max = (signed word) $140 (signed word) sin16s_gen2::min @@ -8192,7 +8200,7 @@ FINAL SYMBOL TABLE (signed word*) sin16s_gen2::sintab#0 sintab zp[2]:6 7.333333333333333 (signed word*) sin16s_gen2::sintab#2 sintab zp[2]:6 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:24 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:20 0.8666666666666666 (word) sin16s_gen2::wavelength (dword) sin16s_gen2::x (dword) sin16s_gen2::x#1 x zp[4]:2 11.0 @@ -8213,50 +8221,51 @@ FINAL SYMBOL TABLE (byte) wrap_y::return#1 reg byte a 22.0 (byte) wrap_y::return#2 reg byte a 6.0 (signed word) wrap_y::y -(signed word) wrap_y::y#0 y zp[2]:22 22.0 -(signed word) wrap_y::y#1 y zp[2]:22 22.0 -(signed word) wrap_y::y#2 y zp[2]:22 202.0 -(signed word) wrap_y::y#3 y zp[2]:22 202.0 -(signed word) wrap_y::y#4 y zp[2]:22 203.0 -(signed word) wrap_y::y#6 y zp[2]:22 202.0 -(signed word) wrap_y::y#9 y zp[2]:22 24.0 +(signed word) wrap_y::y#0 y zp[2]:18 22.0 +(signed word) wrap_y::y#1 y zp[2]:18 22.0 +(signed word) wrap_y::y#2 y zp[2]:18 202.0 +(signed word) wrap_y::y#3 y zp[2]:18 202.0 +(signed word) wrap_y::y#4 y zp[2]:18 203.0 +(signed word) wrap_y::y#6 y zp[2]:18 202.0 +(signed word) wrap_y::y#9 y zp[2]:18 24.0 reg byte x [ bitmap_plot::y#2 bitmap_plot::y#1 bitmap_plot::y#0 ] zp[4]:2 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:6 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 render_sine::xpos#3 render_sine::xpos#9 render_sine::xpos#1 bitmap_plot::x#2 bitmap_plot::x#1 bitmap_plot::x#0 ] -zp[4]:8 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:16 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] -zp[2]:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +zp[2]:12 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] +zp[2]:14 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] reg byte x [ memset::c#4 ] 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[2]:20 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 memset::num#2 memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 render_sine::sin_idx#2 render_sine::sin_idx#1 ] +zp[2]:16 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 memset::num#2 memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 render_sine::sin_idx#2 render_sine::sin_idx#1 ] reg byte a [ wrap_y::return#0 ] reg byte x [ render_sine::ypos#0 ] reg byte a [ wrap_y::return#1 ] reg byte x [ render_sine::ypos2#0 ] -zp[2]:22 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] +zp[2]:18 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] reg byte a [ bitmap_plot::$2 ] reg byte a [ wrap_y::return#2 ] -zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:28 [ sin16s_gen2::$9 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[4]:20 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:24 [ sin16s_gen2::$9 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] reg byte a [ mul16u::$1 ] +zp[4]:26 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:30 [ sin16s::x1#0 mul16s::$9 mul16s::$16 ] zp[2]:32 [ div32u16u::quotient_hi#0 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 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] -zp[1]:34 [ bitmap_init::$7 sin16s::isUpper#2 ] +zp[1]:34 [ bitmap_init::$7 ] reg byte a [ bitmap_init::$4 ] reg byte a [ bitmap_init::$5 ] reg byte a [ bitmap_init::$6 ] FINAL ASSEMBLER -Score: 24749 +Score: 24786 // File Comments // Generate a big sinus and plot it on a bitmap @@ -8296,7 +8305,7 @@ Score: 24749 .label SCREEN = $400 .label BITMAP = $2000 .const SIN_SIZE = $200 - .label rem16u = $1c + .label rem16u = $18 // @begin // [1] phi from @begin to @1 [phi:@begin->@1] // @1 @@ -8379,14 +8388,14 @@ main: { } // render_sine render_sine: { - .label __1 = $16 - .label __4 = $16 - .label __10 = $16 - .label __11 = $16 - .label sin_val = $16 - .label sin2_val = $16 + .label __1 = $12 + .label __4 = $12 + .label __10 = $12 + .label __11 = $12 + .label sin_val = $12 + .label sin2_val = $12 .label xpos = 6 - .label sin_idx = $14 + .label sin_idx = $10 // [23] phi from render_sine to render_sine::@1 [phi:render_sine->render_sine::@1] // [23] phi (word) render_sine::xpos#3 = (byte) 0 [phi:render_sine->render_sine::@1#0] -- vwuz1=vbuc1 lda #<0 @@ -8554,8 +8563,8 @@ render_sine: { // Plot a single dot in the bitmap // bitmap_plot(word zeropage(6) x, byte register(X) y) bitmap_plot: { - .label __1 = $1c - .label plotter = $16 + .label __1 = $18 + .label plotter = $12 .label x = 6 // (byte*) { bitmap_plot_yhi[y], bitmap_plot_ylo[y] } // [52] (word) bitmap_plot::plotter#0 ← *((const byte[$100]) bitmap_plot_yhi + (byte) bitmap_plot::y#2) w= *((const byte[$100]) bitmap_plot_ylo + (byte) bitmap_plot::y#2) -- vwuz1=pbuc1_derefidx_vbuxx_word_pbuc2_derefidx_vbuxx @@ -8596,9 +8605,9 @@ bitmap_plot: { rts } // wrap_y -// wrap_y(signed word zeropage($16) y) +// wrap_y(signed word zeropage($12) y) wrap_y: { - .label y = $16 + .label y = $12 // [59] phi from wrap_y wrap_y::@2 to wrap_y::@1 [phi:wrap_y/wrap_y::@2->wrap_y::@1] // [59] phi (signed word) wrap_y::y#4 = (signed word) wrap_y::y#9 [phi:wrap_y/wrap_y::@2->wrap_y::@1#0] -- register_copy // wrap_y::@1 @@ -8663,12 +8672,12 @@ sin16s_gen2: { .const min = -$140 .const max = $140 .label ampl = max-min - .label __6 = $c - .label __9 = $1c - .label step = $18 + .label __6 = 8 + .label __9 = $18 + .label step = $14 .label sintab = 6 .label x = 2 - .label i = $14 + .label i = $10 // div32u16u(PI2_u4f28, wavelength) // [68] call div32u16u // [156] phi from sin16s_gen2 to div32u16u [phi:sin16s_gen2->div32u16u] @@ -8786,13 +8795,13 @@ sin16s_gen2: { // mul16s // Multiply of two signed words to a signed double word // Fixes offsets introduced by using unsigned multiplication -// mul16s(signed word zeropage($10) a) +// mul16s(signed word zeropage($c) a) mul16s: { .label __9 = $1e .label __16 = $1e - .label m = $c - .label return = $c - .label a = $10 + .label m = 8 + .label return = 8 + .label a = $c // mul16u((word)a, (word) b) // [86] (word) mul16u::a#1 ← (word)(signed word) mul16s::a#0 -- vwuz1=vwuz2 lda.z a @@ -8856,13 +8865,13 @@ mul16s: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1c) a, word zeropage($16) b) +// mul16u(word zeropage($18) a, word zeropage($12) b) mul16u: { - .label mb = 8 - .label a = $1c - .label res = $c - .label return = $c - .label b = $16 + .label mb = $1a + .label a = $18 + .label res = 8 + .label return = 8 + .label b = $12 // [98] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] // [98] phi (dword) mul16u::mb#2 = (dword) mul16u::mb#0 [phi:mul16u->mul16u::@1#0] -- register_copy // [98] phi (dword) mul16u::res#2 = (byte) 0 [phi:mul16u->mul16u::@1#1] -- vduz1=vbuc1 @@ -8934,21 +8943,20 @@ mul16u: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($c) x) +// sin16s(dword zeropage(8) x) sin16s: { - .label __4 = $c - .label x = $c - .label return = $10 + .label __4 = $1a + .label x = 8 + .label return = $c .label x1 = $1e - .label x2 = $12 - .label x3 = $12 + .label x2 = $e + .label x3 = $e .label x3_6 = $20 - .label usinx = $10 - .label x4 = $12 + .label usinx = $c + .label x4 = $e .label x5 = $20 .label x5_128 = $20 - .label sinx = $10 - .label isUpper = $22 + .label sinx = $c // if(x >= PI_u4f28 ) // [107] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 @@ -8984,16 +8992,14 @@ sin16s: { sbc #>PI_u4f28>>$10 sta.z x+3 // [109] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] - // [109] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [109] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [109] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [109] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] b1: - // [109] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [109] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [109] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy // sin16s::@1 __b1: @@ -9036,15 +9042,27 @@ sin16s: { // sin16s::@2 __b2: // x<<3 - // [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [113] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // x1 = >x<<3 // [114] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 @@ -9190,9 +9208,8 @@ sin16s: { adc.z x5_128+1 sta.z usinx+1 // if(isUpper!=0) - // [142] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [142] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b3 // sin16s::@6 // sinx = -(signed word)usinx @@ -9218,14 +9235,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($12) v1, word zeropage($16) v2, byte register(X) select) +// mulu16_sel(word zeropage($e) v1, word zeropage($12) v2, byte register(X) select) mulu16_sel: { - .label __0 = $c - .label __1 = $c - .label v1 = $12 - .label v2 = $16 + .label __0 = 8 + .label __1 = 8 + .label v1 = $e + .label v2 = $12 .label return = $20 - .label return_1 = $12 + .label return_1 = $e // mul16u(v1, v2) // [148] (word) mul16u::a#2 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 @@ -9277,8 +9294,8 @@ mulu16_sel: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $20 - .label quotient_lo = $12 - .label return = $18 + .label quotient_lo = $e + .label return = $14 // divr16u(>dividend, divisor, 0) // [157] call divr16u // [166] phi from div32u16u to divr16u [phi:div32u16u->divr16u] @@ -9337,12 +9354,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($10) dividend, word zeropage($1c) rem) +// divr16u(word zeropage($c) dividend, word zeropage($18) rem) divr16u: { - .label rem = $1c - .label dividend = $10 - .label quotient = $12 - .label return = $12 + .label rem = $18 + .label dividend = $c + .label quotient = $e + .label return = $e // [167] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] // [167] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 ldx #0 @@ -9483,12 +9500,12 @@ bitmap_clear: { } // 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($16) str, byte register(X) c, word zeropage($14) num) +// memset(void* zeropage($12) str, byte register(X) c, word zeropage($10) num) memset: { - .label end = $14 - .label dst = $16 - .label num = $14 - .label str = $16 + .label end = $10 + .label dst = $12 + .label num = $10 + .label str = $12 // if(num>0) // [190] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1 lda.z num @@ -9543,7 +9560,7 @@ memset: { // Initialize bitmap plotting tables bitmap_init: { .label __7 = $22 - .label yoffs = $14 + .label yoffs = $10 // [199] phi from bitmap_init to bitmap_init::@1 [phi:bitmap_init->bitmap_init::@1] // [199] phi (byte) bitmap_init::x#2 = (byte) 0 [phi:bitmap_init->bitmap_init::@1#0] -- vbuxx=vbuc1 ldx #0 diff --git a/src/test/ref/examples/sinplotter/sine-plotter.sym b/src/test/ref/examples/sinplotter/sine-plotter.sym index b3d9fd707..f8afb3aa9 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.sym +++ b/src/test/ref/examples/sinplotter/sine-plotter.sym @@ -56,16 +56,16 @@ (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[2]:20 22.0 -(byte*) bitmap_init::yoffs#2 yoffs zp[2]:20 6.875 -(byte*) bitmap_init::yoffs#4 yoffs zp[2]:20 11.0 +(byte*) bitmap_init::yoffs#1 yoffs zp[2]:16 22.0 +(byte*) bitmap_init::yoffs#2 yoffs zp[2]:16 6.875 +(byte*) bitmap_init::yoffs#4 yoffs zp[2]:16 11.0 (void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y) -(word~) bitmap_plot::$1 zp[2]:28 4.0 +(word~) bitmap_plot::$1 zp[2]:24 4.0 (byte~) bitmap_plot::$2 reg byte a 4.0 (label) bitmap_plot::@return (byte*) bitmap_plot::plotter -(word) bitmap_plot::plotter#0 plotter zp[2]:22 1.0 -(byte*) bitmap_plot::plotter#1 plotter zp[2]:22 3.0 +(word) bitmap_plot::plotter#0 plotter zp[2]:18 1.0 +(byte*) bitmap_plot::plotter#1 plotter zp[2]:18 3.0 (word) bitmap_plot::x (word) bitmap_plot::x#0 x zp[2]:6 11.0 (word) bitmap_plot::x#1 x zp[2]:6 11.0 @@ -88,10 +88,10 @@ (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:32 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:18 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:14 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:24 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:24 4.0 +(dword) div32u16u::return#0 return zp[4]:20 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:20 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -103,30 +103,30 @@ (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:16 2.75 -(word) divr16u::dividend#3 dividend zp[2]:16 5.0 -(word) divr16u::dividend#5 dividend zp[2]:16 2.0 +(word) divr16u::dividend#0 dividend zp[2]:12 2.75 +(word) divr16u::dividend#3 dividend zp[2]:12 5.0 +(word) divr16u::dividend#5 dividend zp[2]:12 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:18 16.5 -(word) divr16u::quotient#2 quotient zp[2]:18 11.0 -(word) divr16u::quotient#3 quotient zp[2]:18 2.75 +(word) divr16u::quotient#1 quotient zp[2]:14 16.5 +(word) divr16u::quotient#2 quotient zp[2]:14 11.0 +(word) divr16u::quotient#3 quotient zp[2]:14 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:28 8.25 -(word) divr16u::rem#1 rem zp[2]:28 22.0 -(word) divr16u::rem#10 rem zp[2]:28 4.0 -(word) divr16u::rem#11 rem zp[2]:28 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:28 22.0 -(word) divr16u::rem#4 rem zp[2]:28 4.0 -(word) divr16u::rem#5 rem zp[2]:28 24.0 -(word) divr16u::rem#6 rem zp[2]:28 11.0 +(word) divr16u::rem#0 rem zp[2]:24 8.25 +(word) divr16u::rem#1 rem zp[2]:24 22.0 +(word) divr16u::rem#10 rem zp[2]:24 4.0 +(word) divr16u::rem#11 rem zp[2]:24 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:24 22.0 +(word) divr16u::rem#4 rem zp[2]:24 4.0 +(word) divr16u::rem#5 rem zp[2]:24 24.0 +(word) divr16u::rem#6 rem zp[2]:24 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:18 5.285714285714286 -(word) divr16u::return#2 return zp[2]:18 4.0 -(word) divr16u::return#3 return zp[2]:18 4.0 +(word) divr16u::return#0 return zp[2]:14 5.285714285714286 +(word) divr16u::return#2 return zp[2]:14 4.0 +(word) divr16u::return#3 return zp[2]:14 4.0 (void()) main() (label) main::@1 (label) main::@2 @@ -154,16 +154,16 @@ (byte) memset::c (byte) memset::c#4 reg byte x 1.375 (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:22 22.0 -(byte*) memset::dst#2 dst zp[2]:22 15.333333333333332 -(byte*~) memset::dst#4 dst zp[2]:22 4.0 +(byte*) memset::dst#1 dst zp[2]:18 22.0 +(byte*) memset::dst#2 dst zp[2]:18 15.333333333333332 +(byte*~) memset::dst#4 dst zp[2]:18 4.0 (byte*) memset::end -(byte*) memset::end#0 end zp[2]:20 2.1666666666666665 +(byte*) memset::end#0 end zp[2]:16 2.1666666666666665 (word) memset::num -(word) memset::num#2 num zp[2]:20 2.0 +(word) memset::num#2 num zp[2]:16 2.0 (void*) memset::return (void*) memset::str -(void*) memset::str#3 str zp[2]:22 +(void*) memset::str#3 str zp[2]:18 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 zp[2]:30 4.0 (word~) mul16s::$9 zp[2]:30 4.0 @@ -173,15 +173,15 @@ (label) mul16s::@4 (label) mul16s::@return (signed word) mul16s::a -(signed word) mul16s::a#0 a zp[2]:16 2.6 +(signed word) mul16s::a#0 a zp[2]:12 2.6 (signed word) mul16s::b (dword) mul16s::m -(dword) mul16s::m#0 m zp[4]:12 2.0 -(dword) mul16s::m#1 m zp[4]:12 4.0 -(dword) mul16s::m#4 m zp[4]:12 4.0 +(dword) mul16s::m#0 m zp[4]:8 2.0 +(dword) mul16s::m#1 m zp[4]:8 4.0 +(dword) mul16s::m#4 m zp[4]:8 4.0 (signed dword) mul16s::return -(signed dword) mul16s::return#0 return zp[4]:12 4.333333333333333 -(signed dword) mul16s::return#2 return zp[4]:12 22.0 +(signed dword) mul16s::return#0 return zp[4]:8 4.333333333333333 +(signed dword) mul16s::return#2 return zp[4]:8 22.0 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (byte~) mul16u::$1 reg byte a 202.0 (label) mul16u::@1 @@ -190,58 +190,58 @@ (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:28 101.0 -(word) mul16u::a#1 a zp[2]:28 4.0 -(word) mul16u::a#2 a zp[2]:28 2.0 -(word) mul16u::a#3 a zp[2]:28 67.66666666666666 -(word) mul16u::a#6 a zp[2]:28 6.0 +(word) mul16u::a#0 a zp[2]:24 101.0 +(word) mul16u::a#1 a zp[2]:24 4.0 +(word) mul16u::a#2 a zp[2]:24 2.0 +(word) mul16u::a#3 a zp[2]:24 67.66666666666666 +(word) mul16u::a#6 a zp[2]:24 6.0 (word) mul16u::b -(word) mul16u::b#1 b zp[2]:22 4.0 +(word) mul16u::b#1 b zp[2]:18 4.0 (dword) mul16u::mb -(dword) mul16u::mb#0 mb zp[4]:8 4.0 -(dword) mul16u::mb#1 mb zp[4]:8 202.0 -(dword) mul16u::mb#2 mb zp[4]:8 43.57142857142858 +(dword) mul16u::mb#0 mb zp[4]:26 4.0 +(dword) mul16u::mb#1 mb zp[4]:26 202.0 +(dword) mul16u::mb#2 mb zp[4]:26 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:12 202.0 -(dword) mul16u::res#2 res zp[4]:12 43.85714285714286 -(dword) mul16u::res#6 res zp[4]:12 101.0 +(dword) mul16u::res#1 res zp[4]:8 202.0 +(dword) mul16u::res#2 res zp[4]:8 43.85714285714286 +(dword) mul16u::res#6 res zp[4]:8 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:12 4.0 -(dword) mul16u::return#3 return zp[4]:12 4.0 +(dword) mul16u::return#2 return zp[4]:8 4.0 +(dword) mul16u::return#3 return zp[4]:8 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:12 4.0 -(dword~) mulu16_sel::$1 zp[4]:12 4.0 +(dword~) mulu16_sel::$0 zp[4]:8 4.0 +(dword~) mulu16_sel::$1 zp[4]:8 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:32 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:18 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:18 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:14 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:14 4.0 (word) mulu16_sel::return#11 return zp[2]:32 4.0 (word) mulu16_sel::return#12 return zp[2]:32 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:32 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:18 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:18 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:18 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:14 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:14 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:14 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:22 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:22 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:18 5.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:28 0.8 +(word) rem16u#1 rem16u zp[2]:24 0.8 (void()) render_sine() -(signed word*~) render_sine::$1 zp[2]:22 22.0 -(word~) render_sine::$10 zp[2]:22 22.0 -(word~) render_sine::$11 zp[2]:22 22.0 -(signed word*~) render_sine::$4 zp[2]:22 22.0 +(signed word*~) render_sine::$1 zp[2]:18 22.0 +(word~) render_sine::$10 zp[2]:18 22.0 +(word~) render_sine::$11 zp[2]:18 22.0 +(signed word*~) render_sine::$4 zp[2]:18 22.0 (label) render_sine::@1 (label) render_sine::@2 (label) render_sine::@3 @@ -252,12 +252,12 @@ (label) render_sine::@8 (label) render_sine::@return (signed word) render_sine::sin2_val -(signed word) render_sine::sin2_val#0 sin2_val zp[2]:22 22.0 +(signed word) render_sine::sin2_val#0 sin2_val zp[2]:18 22.0 (word) render_sine::sin_idx -(word) render_sine::sin_idx#1 sin_idx zp[2]:20 22.0 -(word) render_sine::sin_idx#2 sin_idx zp[2]:20 2.1153846153846154 +(word) render_sine::sin_idx#1 sin_idx zp[2]:16 22.0 +(word) render_sine::sin_idx#2 sin_idx zp[2]:16 2.1153846153846154 (signed word) render_sine::sin_val -(signed word) render_sine::sin_val#0 sin_val zp[2]:22 22.0 +(signed word) render_sine::sin_val#0 sin_val zp[2]:18 22.0 (word) render_sine::xpos (word) render_sine::xpos#1 xpos zp[2]:6 11.0 (word) render_sine::xpos#3 xpos zp[2]:6 2.0 @@ -268,7 +268,7 @@ (byte) render_sine::ypos2#0 reg byte x 11.0 (const signed word[$200]) sin = { fill( $200, 0) } (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:12 4.0 +(dword~) sin16s::$4 zp[4]:26 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -283,39 +283,39 @@ (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:34 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:16 22.0 -(signed word) sin16s::return#1 return zp[2]:16 5.0 -(signed word~) sin16s::return#5 return zp[2]:16 4.0 +(signed word) sin16s::return#0 return zp[2]:12 22.0 +(signed word) sin16s::return#1 return zp[2]:12 5.0 +(signed word~) sin16s::return#5 return zp[2]:12 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:16 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:12 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:16 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:16 1.0 +(word) sin16s::usinx#0 usinx zp[2]:12 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:12 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:12 8.5 -(dword) sin16s::x#1 x zp[4]:12 4.0 -(dword) sin16s::x#2 x zp[4]:12 4.0 -(dword) sin16s::x#4 x zp[4]:12 5.0 -(dword) sin16s::x#6 x zp[4]:12 6.0 +(dword) sin16s::x#0 x zp[4]:8 8.5 +(dword) sin16s::x#1 x zp[4]:8 4.0 +(dword) sin16s::x#2 x zp[4]:8 4.0 +(dword) sin16s::x#4 x zp[4]:8 5.0 +(dword) sin16s::x#6 x zp[4]:8 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:30 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:18 4.0 +(word) sin16s::x2#0 x2 zp[2]:14 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:18 1.0 +(word) sin16s::x3#0 x3 zp[2]:14 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:32 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:18 4.0 +(word) sin16s::x4#0 x4 zp[2]:14 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:32 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:32 4.0 (void()) sin16s_gen2((signed word*) sin16s_gen2::sintab , (word) sin16s_gen2::wavelength , (signed word) sin16s_gen2::min , (signed word) sin16s_gen2::max) -(signed dword~) sin16s_gen2::$6 zp[4]:12 22.0 -(word~) sin16s_gen2::$9 zp[2]:28 11.0 +(signed dword~) sin16s_gen2::$6 zp[4]:8 22.0 +(word~) sin16s_gen2::$9 zp[2]:24 11.0 (label) sin16s_gen2::@1 (label) sin16s_gen2::@2 (label) sin16s_gen2::@3 @@ -325,8 +325,8 @@ (signed word) sin16s_gen2::ampl (const signed word) sin16s_gen2::ampl#0 ampl = (const signed word) sin16s_gen2::max#0-(const signed word) sin16s_gen2::min#0 (word) sin16s_gen2::i -(word) sin16s_gen2::i#1 i zp[2]:20 22.0 -(word) sin16s_gen2::i#2 i zp[2]:20 2.5384615384615383 +(word) sin16s_gen2::i#1 i zp[2]:16 22.0 +(word) sin16s_gen2::i#2 i zp[2]:16 2.5384615384615383 (signed word) sin16s_gen2::max (const signed word) sin16s_gen2::max#0 max = (signed word) $140 (signed word) sin16s_gen2::min @@ -336,7 +336,7 @@ (signed word*) sin16s_gen2::sintab#0 sintab zp[2]:6 7.333333333333333 (signed word*) sin16s_gen2::sintab#2 sintab zp[2]:6 3.0 (dword) sin16s_gen2::step -(dword) sin16s_gen2::step#0 step zp[4]:24 0.8666666666666666 +(dword) sin16s_gen2::step#0 step zp[4]:20 0.8666666666666666 (word) sin16s_gen2::wavelength (dword) sin16s_gen2::x (dword) sin16s_gen2::x#1 x zp[4]:2 11.0 @@ -357,43 +357,44 @@ (byte) wrap_y::return#1 reg byte a 22.0 (byte) wrap_y::return#2 reg byte a 6.0 (signed word) wrap_y::y -(signed word) wrap_y::y#0 y zp[2]:22 22.0 -(signed word) wrap_y::y#1 y zp[2]:22 22.0 -(signed word) wrap_y::y#2 y zp[2]:22 202.0 -(signed word) wrap_y::y#3 y zp[2]:22 202.0 -(signed word) wrap_y::y#4 y zp[2]:22 203.0 -(signed word) wrap_y::y#6 y zp[2]:22 202.0 -(signed word) wrap_y::y#9 y zp[2]:22 24.0 +(signed word) wrap_y::y#0 y zp[2]:18 22.0 +(signed word) wrap_y::y#1 y zp[2]:18 22.0 +(signed word) wrap_y::y#2 y zp[2]:18 202.0 +(signed word) wrap_y::y#3 y zp[2]:18 202.0 +(signed word) wrap_y::y#4 y zp[2]:18 203.0 +(signed word) wrap_y::y#6 y zp[2]:18 202.0 +(signed word) wrap_y::y#9 y zp[2]:18 24.0 reg byte x [ bitmap_plot::y#2 bitmap_plot::y#1 bitmap_plot::y#0 ] zp[4]:2 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ] zp[2]:6 [ sin16s_gen2::sintab#2 sin16s_gen2::sintab#0 render_sine::xpos#3 render_sine::xpos#9 render_sine::xpos#1 bitmap_plot::x#2 bitmap_plot::x#1 bitmap_plot::x#0 ] -zp[4]:8 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] -zp[4]:12 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:8 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16s::m#4 mul16s::m#1 mul16s::m#0 mul16u::return#2 mul16s::return#0 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#3 mul16s::return#2 sin16s_gen2::$6 mulu16_sel::$0 mulu16_sel::$1 ] reg byte x [ mulu16_sel::select#5 ] -zp[2]:16 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] -zp[2]:18 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +zp[2]:12 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 mul16s::a#0 sin16s::usinx#0 ] +zp[2]:14 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] reg byte x [ memset::c#4 ] 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[2]:20 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 memset::num#2 memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 render_sine::sin_idx#2 render_sine::sin_idx#1 ] +zp[2]:16 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 memset::num#2 memset::end#0 sin16s_gen2::i#2 sin16s_gen2::i#1 render_sine::sin_idx#2 render_sine::sin_idx#1 ] reg byte a [ wrap_y::return#0 ] reg byte x [ render_sine::ypos#0 ] reg byte a [ wrap_y::return#1 ] reg byte x [ render_sine::ypos2#0 ] -zp[2]:22 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] +zp[2]:18 [ bitmap_plot::plotter#0 bitmap_plot::plotter#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 wrap_y::y#6 wrap_y::y#4 wrap_y::y#9 wrap_y::y#1 wrap_y::y#0 wrap_y::y#2 wrap_y::y#3 render_sine::sin_val#0 render_sine::sin2_val#0 render_sine::$10 render_sine::$1 render_sine::$11 render_sine::$4 ] reg byte a [ bitmap_plot::$2 ] reg byte a [ wrap_y::return#2 ] -zp[4]:24 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] -zp[2]:28 [ sin16s_gen2::$9 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] +zp[4]:20 [ div32u16u::return#2 sin16s_gen2::step#0 div32u16u::return#0 ] +zp[2]:24 [ sin16s_gen2::$9 bitmap_plot::$1 divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mul16u::a#3 mul16u::a#6 mul16u::a#1 mul16u::a#2 mul16u::a#0 ] reg byte a [ mul16u::$1 ] +zp[4]:26 [ sin16s::$4 mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ] zp[2]:30 [ sin16s::x1#0 mul16s::$9 mul16s::$16 ] zp[2]:32 [ div32u16u::quotient_hi#0 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 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] -zp[1]:34 [ bitmap_init::$7 sin16s::isUpper#2 ] +zp[1]:34 [ 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/sinusgen16.asm b/src/test/ref/sinusgen16.asm index cbe512cce..513bed4b7 100644 --- a/src/test/ref/sinusgen16.asm +++ b/src/test/ref/sinusgen16.asm @@ -10,12 +10,12 @@ // PI/2 in u[4.28] format .const PI_HALF_u4f28 = $1921fb54 .label print_line_cursor = $400 - .label rem16u = $15 - .label print_char_cursor = $b + .label rem16u = $10 + .label print_char_cursor = $a main: { .label wavelength = $78 .label sw = 8 - .label st1 = $15 + .label st1 = $10 jsr sin16s_gen jsr print_cls lda #str @@ -196,8 +196,8 @@ memset: { // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) // sin16s_gen(signed word* zeropage(8) sintab) sin16s_gen: { - .label __2 = $b - .label step = $19 + .label __2 = $a + .label step = $14 .label sintab = 8 .label x = 4 .label i = 2 @@ -269,21 +269,20 @@ sin16s_gen: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($d) x) +// sin16s(dword zeropage($c) x) sin16s: { - .label __4 = $d - .label x = $d - .label return = $b - .label x1 = $1f - .label x2 = $15 - .label x3 = $15 - .label x3_6 = $1d - .label usinx = $b - .label x4 = $15 - .label x5 = $1d - .label x5_128 = $1d - .label sinx = $b - .label isUpper = $a + .label __4 = $18 + .label x = $c + .label return = $a + .label x1 = $1e + .label x2 = $10 + .label x3 = $10 + .label x3_6 = $1c + .label usinx = $a + .label x4 = $10 + .label x5 = $1c + .label x5_128 = $1c + .label sinx = $a lda.z x+3 cmp #>PI_u4f28>>$10 bcc b1 @@ -313,12 +312,10 @@ sin16s: { lda.z x+3 sbc #>PI_u4f28>>$10 sta.z x+3 - lda #1 - sta.z isUpper + ldy #1 jmp __b1 b1: - lda #0 - sta.z isUpper + ldy #0 __b1: lda.z x+3 cmp #>PI_HALF_u4f28>>$10 @@ -350,14 +347,26 @@ sin16s: { sbc.z x+3 sta.z x+3 __b2: - ldy #3 - !: + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- lda.z __4+2 sta.z x1 lda.z __4+3 @@ -430,8 +439,7 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - lda.z isUpper - cmp #0 + cpy #0 beq __b3 sec lda #0 @@ -445,14 +453,14 @@ sin16s: { } // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($15) v1, word zeropage($17) v2, byte register(X) select) +// mulu16_sel(word zeropage($10) v1, word zeropage($12) v2, byte register(X) select) mulu16_sel: { - .label __0 = $d - .label __1 = $d - .label v1 = $15 - .label v2 = $17 - .label return = $1d - .label return_1 = $15 + .label __0 = $c + .label __1 = $c + .label v1 = $10 + .label v2 = $12 + .label return = $1c + .label return_1 = $10 lda.z v1 sta.z mul16u.a lda.z v1+1 @@ -475,13 +483,13 @@ mulu16_sel: { rts } // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1d) a, word zeropage($17) b) +// mul16u(word zeropage($1c) a, word zeropage($12) b) mul16u: { - .label a = $1d - .label mb = $11 - .label res = $d - .label b = $17 - .label return = $d + .label a = $1c + .label mb = $18 + .label res = $c + .label b = $12 + .label return = $c lda.z b sta.z mb lda.z b+1 @@ -529,9 +537,9 @@ mul16u: { // Divide unsigned 32-bit dword dividend with a 16-bit word divisor // The 16-bit word remainder can be found in rem16u after the division div32u16u: { - .label quotient_hi = $1f - .label quotient_lo = $1d - .label return = $19 + .label quotient_hi = $1e + .label quotient_lo = $1c + .label return = $14 lda #>$10 sta.z divr16u.dividend lda #>PI2_u4f28>>$10 @@ -563,12 +571,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($17) dividend, word zeropage($15) rem) +// divr16u(word zeropage($12) dividend, word zeropage($10) rem) divr16u: { - .label rem = $15 - .label dividend = $17 - .label quotient = $1d - .label return = $1d + .label rem = $10 + .label dividend = $12 + .label quotient = $1c + .label return = $1c ldx #0 txa sta.z quotient diff --git a/src/test/ref/sinusgen16.log b/src/test/ref/sinusgen16.log index 97a814c26..a53a8b16e 100644 --- a/src/test/ref/sinusgen16.log +++ b/src/test/ref/sinusgen16.log @@ -3526,21 +3526,25 @@ sin16s: { __b2: // [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 lda.z x + asl sta.z __4 lda.z x+1 + rol sta.z __4+1 lda.z x+2 + rol sta.z __4+2 lda.z x+3 + rol sta.z __4+3 - ldy #3 - !: asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 // [86] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -4181,8 +4185,7 @@ Statement [80] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4 Statement [82] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:22 [ sin16s::isUpper#2 ] Statement [83] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:22 [ sin16s::isUpper#2 ] +Statement [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [86] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [87] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [88] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -4260,7 +4263,7 @@ Statement [79] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [80] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [82] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [83] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y +Statement [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [86] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [87] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [88] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:2::sin16s_gen:5::sin16s:72 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -4316,7 +4319,7 @@ Potential registers zp[2]:12 [ memset::dst#2 memset::dst#1 ] : zp[2]:12 , Potential registers zp[2]:14 [ sin16s_gen::i#2 sin16s_gen::i#1 ] : zp[2]:14 , Potential registers zp[4]:16 [ sin16s_gen::x#2 sin16s_gen::x#1 ] : zp[4]:16 , Potential registers zp[2]:20 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] : zp[2]:20 , -Potential registers zp[1]:22 [ sin16s::isUpper#2 ] : zp[1]:22 , reg byte x , +Potential registers zp[1]:22 [ sin16s::isUpper#2 ] : zp[1]:22 , reg byte x , reg byte y , Potential registers zp[4]:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] : zp[4]:23 , Potential registers zp[2]:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] : zp[2]:27 , Potential registers zp[2]: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[2]:29 , @@ -4385,30 +4388,27 @@ Uplift Scope [print_word] 2: zp[2]:55 [ print_word::w#0 ] Uplift Scope [RADIX] Uplift Scope [print_cls] -Uplifting [mul16u] best 26903 combination zp[4]:36 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:40 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:34 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp[4]:103 [ mul16u::return#2 ] zp[2]:44 [ mul16u::b#0 ] -Uplifting [print_str] best 26903 combination zp[2]:4 [ print_str::str#3 print_str::str#5 print_str::str#0 ] -Uplifting [divr16u] best 26693 combination zp[2]: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[2]: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[2]:48 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:118 [ divr16u::return#2 ] zp[2]:122 [ divr16u::return#3 ] -Uplifting [] best 26693 combination zp[2]:9 [ print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] zp[2]:132 [ rem16u#1 ] -Uplifting [sin16s] best 26693 combination zp[4]:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:67 [ sin16s::return#0 ] zp[2]:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:71 [ sin16s::$4 ] zp[2]:79 [ sin16s::x2#0 ] zp[2]:87 [ sin16s::x3_6#0 ] zp[2]:93 [ sin16s::x4#0 ] zp[2]:97 [ sin16s::x5#0 ] zp[2]:99 [ sin16s::x5_128#0 ] zp[2]:83 [ sin16s::x3#0 ] zp[2]:101 [ sin16s::usinx#1 ] zp[2]:75 [ sin16s::x1#0 ] zp[2]:89 [ sin16s::usinx#0 ] zp[1]:22 [ sin16s::isUpper#2 ] -Uplifting [sin16s_gen] best 26693 combination zp[2]:14 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp[2]:69 [ sin16s_gen::$2 ] zp[4]:16 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:20 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp[4]:63 [ sin16s_gen::step#0 ] -Uplifting [mulu16_sel] best 26677 combination zp[2]: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[2]:31 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:77 [ mulu16_sel::return#0 ] zp[2]:81 [ mulu16_sel::return#1 ] zp[2]:85 [ mulu16_sel::return#2 ] zp[2]:91 [ mulu16_sel::return#10 ] zp[2]:95 [ mulu16_sel::return#11 ] zp[4]:107 [ mulu16_sel::$0 ] zp[4]:111 [ mulu16_sel::$1 ] zp[2]:115 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [memset] best 26677 combination zp[2]:12 [ memset::dst#2 memset::dst#1 ] -Uplifting [main] best 26677 combination zp[2]:2 [ main::st1#2 main::st1#1 ] zp[2]:53 [ main::sw#0 ] -Uplifting [print_byte] best 26663 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 26648 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] -Uplifting [print_sword] best 26648 combination zp[2]:6 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] -Uplifting [div32u16u] best 26648 combination zp[4]:59 [ div32u16u::return#2 ] zp[2]:124 [ div32u16u::quotient_lo#0 ] zp[4]:126 [ div32u16u::return#0 ] zp[2]:120 [ div32u16u::quotient_hi#0 ] -Uplifting [print_word] best 26648 combination zp[2]:55 [ print_word::w#0 ] -Uplifting [RADIX] best 26648 combination -Uplifting [print_cls] best 26648 combination -Attempting to uplift remaining variables inzp[1]:22 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 26648 combination zp[1]:22 [ sin16s::isUpper#2 ] +Uplifting [mul16u] best 26925 combination zp[4]:36 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:40 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:34 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp[4]:103 [ mul16u::return#2 ] zp[2]:44 [ mul16u::b#0 ] +Uplifting [print_str] best 26925 combination zp[2]:4 [ print_str::str#3 print_str::str#5 print_str::str#0 ] +Uplifting [divr16u] best 26715 combination zp[2]: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[2]: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[2]:48 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:118 [ divr16u::return#2 ] zp[2]:122 [ divr16u::return#3 ] +Uplifting [] best 26715 combination zp[2]:9 [ print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] zp[2]:132 [ rem16u#1 ] +Uplifting [sin16s] best 26706 combination zp[4]:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:67 [ sin16s::return#0 ] zp[2]:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:71 [ sin16s::$4 ] zp[2]:79 [ sin16s::x2#0 ] zp[2]:87 [ sin16s::x3_6#0 ] zp[2]:93 [ sin16s::x4#0 ] zp[2]:97 [ sin16s::x5#0 ] zp[2]:99 [ sin16s::x5_128#0 ] zp[2]:83 [ sin16s::x3#0 ] zp[2]:101 [ sin16s::usinx#1 ] zp[2]:75 [ sin16s::x1#0 ] zp[2]:89 [ sin16s::usinx#0 ] reg byte y [ sin16s::isUpper#2 ] +Uplifting [sin16s_gen] best 26706 combination zp[2]:14 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp[2]:69 [ sin16s_gen::$2 ] zp[4]:16 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:20 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp[4]:63 [ sin16s_gen::step#0 ] +Uplifting [mulu16_sel] best 26690 combination zp[2]: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[2]:31 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:77 [ mulu16_sel::return#0 ] zp[2]:81 [ mulu16_sel::return#1 ] zp[2]:85 [ mulu16_sel::return#2 ] zp[2]:91 [ mulu16_sel::return#10 ] zp[2]:95 [ mulu16_sel::return#11 ] zp[4]:107 [ mulu16_sel::$0 ] zp[4]:111 [ mulu16_sel::$1 ] zp[2]:115 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [memset] best 26690 combination zp[2]:12 [ memset::dst#2 memset::dst#1 ] +Uplifting [main] best 26690 combination zp[2]:2 [ main::st1#2 main::st1#1 ] zp[2]:53 [ main::sw#0 ] +Uplifting [print_byte] best 26676 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 26661 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] +Uplifting [print_sword] best 26661 combination zp[2]:6 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] +Uplifting [div32u16u] best 26661 combination zp[4]:59 [ div32u16u::return#2 ] zp[2]:124 [ div32u16u::quotient_lo#0 ] zp[4]:126 [ div32u16u::return#0 ] zp[2]:120 [ div32u16u::quotient_hi#0 ] +Uplifting [print_word] best 26661 combination zp[2]:55 [ print_word::w#0 ] +Uplifting [RADIX] best 26661 combination +Uplifting [print_cls] best 26661 combination Coalescing zero page register [ zp[2]:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp[2]:101 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:83 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:132 [ rem16u#1 ] ] - score: 2 Coalescing zero page register [ zp[2]:6 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] ] with [ zp[2]:53 [ main::sw#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:6 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 ] ] with [ zp[2]:55 [ print_word::w#0 ] ] - score: 1 -Coalescing zero page register [ zp[4]:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:71 [ sin16s::$4 ] ] - score: 1 Coalescing zero page register [ zp[2]:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 ] ] with [ zp[2]:67 [ sin16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]: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 sin16s::x3#0 ] ] with [ zp[2]:79 [ sin16s::x2#0 ] ] - score: 1 Coalescing zero page register [ zp[2]: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 sin16s::x3#0 sin16s::x2#0 ] ] with [ zp[2]:93 [ sin16s::x4#0 ] ] - score: 1 @@ -4435,25 +4435,25 @@ Coalescing zero page register [ zp[2]:12 [ memset::dst#2 memset::dst#1 ] ] with Coalescing zero page register [ zp[2]:14 [ sin16s_gen::i#2 sin16s_gen::i#1 ] ] with [ zp[2]:4 [ print_str::str#3 print_str::str#5 print_str::str#0 ] ] Coalescing zero page register [ zp[2]:20 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] ] with [ zp[2]:6 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] ] Coalescing zero page register [ zp[2]:27 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] ] with [ zp[2]:9 [ print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] ] -Coalescing zero page register [ zp[4]:36 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] ] with [ zp[4]:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] ] +Coalescing zero page register [ zp[4]:36 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] ] with [ zp[4]:23 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] Coalescing zero page register [ zp[2]: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 rem16u#1 ] ] with [ zp[2]: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 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] ] Coalescing zero page register [ zp[2]:48 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] ] with [ zp[2]:31 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] ] Coalescing zero page register [ zp[2]:50 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ] ] with [ zp[2]:34 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] ] +Coalescing zero page register [ zp[4]:71 [ sin16s::$4 ] ] with [ zp[4]:40 [ mul16u::mb#2 mul16u::mb#1 ] ] Coalescing zero page register [ zp[2]:120 [ div32u16u::quotient_hi#0 ] ] with [ zp[2]:75 [ sin16s::x1#0 ] ] Coalescing zero page register [ zp[2]: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 rem16u#1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] ] with [ zp[2]:12 [ memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] ] Coalescing zero page register [ zp[2]:77 [ 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 ] ] with [ zp[2]:50 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] ] Allocated (was zp[2]:14) zp[2]:2 [ sin16s_gen::i#2 sin16s_gen::i#1 print_str::str#3 print_str::str#5 print_str::str#0 ] Allocated (was zp[4]:16) zp[4]:4 [ sin16s_gen::x#2 sin16s_gen::x#1 ] Allocated (was zp[2]:20) zp[2]:8 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] -Allocated (was zp[1]:22) zp[1]:10 [ sin16s::isUpper#2 ] -Allocated (was zp[2]:27) zp[2]:11 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] -Allocated (was zp[4]:36) zp[4]:13 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] -Allocated (was zp[4]:40) zp[4]:17 [ mul16u::mb#2 mul16u::mb#1 ] -Allocated (was zp[2]:46) zp[2]:21 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] -Allocated (was zp[2]:48) zp[2]:23 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] -Allocated (was zp[4]:59) zp[4]:25 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] -Allocated (was zp[2]:77) zp[2]:29 [ 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 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] -Allocated (was zp[2]:120) zp[2]:31 [ div32u16u::quotient_hi#0 sin16s::x1#0 ] +Allocated (was zp[2]:27) zp[2]:10 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] +Allocated (was zp[4]:36) zp[4]:12 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] +Allocated (was zp[2]:46) zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] +Allocated (was zp[2]:48) zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +Allocated (was zp[4]:59) zp[4]:20 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +Allocated (was zp[4]:71) zp[4]:24 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] +Allocated (was zp[2]:77) zp[2]:28 [ 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 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] +Allocated (was zp[2]:120) zp[2]:30 [ div32u16u::quotient_hi#0 sin16s::x1#0 ] ASSEMBLER BEFORE OPTIMIZATION // File Comments @@ -4471,8 +4471,8 @@ ASSEMBLER BEFORE OPTIMIZATION // PI/2 in u[4.28] format .const PI_HALF_u4f28 = $1921fb54 .label print_line_cursor = $400 - .label rem16u = $15 - .label print_char_cursor = $b + .label rem16u = $10 + .label print_char_cursor = $a // @begin __bbegin: // [1] phi from @begin to @1 [phi:@begin->@1] @@ -4493,7 +4493,7 @@ __bend: main: { .label wavelength = $78 .label sw = 8 - .label st1 = $15 + .label st1 = $10 // [5] call sin16s_gen // [64] phi from main to sin16s_gen [phi:main->sin16s_gen] sin16s_gen_from_main: @@ -4819,7 +4819,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = $15 + .label dst = $10 // [59] phi from memset to memset::@1 [phi:memset->memset::@1] __b1_from_memset: // [59] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 @@ -4864,8 +4864,8 @@ memset: { // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) // sin16s_gen(signed word* zeropage(8) sintab) sin16s_gen: { - .label __2 = $b - .label step = $19 + .label __2 = $a + .label step = $14 .label sintab = 8 .label x = 4 .label i = 2 @@ -4978,21 +4978,20 @@ sin16s_gen: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($d) x) +// sin16s(dword zeropage($c) x) sin16s: { - .label __4 = $d - .label x = $d - .label return = $b - .label x1 = $1f - .label x2 = $15 - .label x3 = $15 - .label x3_6 = $1d - .label usinx = $b - .label x4 = $15 - .label x5 = $1d - .label x5_128 = $1d - .label sinx = $b - .label isUpper = $a + .label __4 = $18 + .label x = $c + .label return = $a + .label x1 = $1e + .label x2 = $10 + .label x3 = $10 + .label x3_6 = $1c + .label usinx = $a + .label x4 = $10 + .label x5 = $1c + .label x5_128 = $1c + .label sinx = $a // [79] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 cmp #>PI_u4f28>>$10 @@ -5029,16 +5028,14 @@ sin16s: { sta.z x+3 // [81] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] __b1_from___b4: - // [81] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [81] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [81] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [81] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] __b1_from_sin16s: - // [81] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [81] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [81] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy jmp __b1 // sin16s::@1 @@ -5084,15 +5081,27 @@ sin16s: { jmp __b2 // sin16s::@2 __b2: - // [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // [86] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -5233,9 +5242,8 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - // [114] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [114] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b12 jmp __b6 // sin16s::@6 @@ -5268,14 +5276,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($15) v1, word zeropage($17) v2, byte register(X) select) +// mulu16_sel(word zeropage($10) v1, word zeropage($12) v2, byte register(X) select) mulu16_sel: { - .label __0 = $d - .label __1 = $d - .label v1 = $15 - .label v2 = $17 - .label return = $1d - .label return_1 = $15 + .label __0 = $c + .label __1 = $c + .label v1 = $10 + .label v2 = $12 + .label return = $1c + .label return_1 = $10 // [120] (word) mul16u::a#1 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 sta.z mul16u.a @@ -5315,13 +5323,13 @@ mulu16_sel: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1d) a, word zeropage($17) b) +// mul16u(word zeropage($1c) a, word zeropage($12) b) mul16u: { - .label a = $1d - .label mb = $11 - .label res = $d - .label b = $17 - .label return = $d + .label a = $1c + .label mb = $18 + .label res = $c + .label b = $12 + .label return = $c // [129] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] __b1_from_mul16u: // [129] phi (dword) mul16u::mb#2 = (word) mul16u::b#0 [phi:mul16u->mul16u::@1#0] -- vduz1=vwuz2 @@ -5404,9 +5412,9 @@ mul16u: { // Divide unsigned 32-bit dword dividend with a 16-bit word divisor // The 16-bit word remainder can be found in rem16u after the division div32u16u: { - .label quotient_hi = $1f - .label quotient_lo = $1d - .label return = $19 + .label quotient_hi = $1e + .label quotient_lo = $1c + .label return = $14 // [139] call divr16u // [148] phi from div32u16u to divr16u [phi:div32u16u->divr16u] divr16u_from_div32u16u: @@ -5466,12 +5474,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($17) dividend, word zeropage($15) rem) +// divr16u(word zeropage($12) dividend, word zeropage($10) rem) divr16u: { - .label rem = $15 - .label dividend = $17 - .label quotient = $1d - .label return = $1d + .label rem = $10 + .label dividend = $12 + .label quotient = $1c + .label return = $1c // [149] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] __b1_from_divr16u: // [149] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 @@ -5792,12 +5800,12 @@ FINAL SYMBOL TABLE (word) div32u16u::divisor (dword) div32u16u::quotient (word) div32u16u::quotient_hi -(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:31 0.8 +(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:30 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:29 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:28 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:25 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:25 4.0 +(dword) div32u16u::return#0 return zp[4]:20 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:20 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -5809,30 +5817,30 @@ FINAL SYMBOL TABLE (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:23 2.75 -(word) divr16u::dividend#3 dividend zp[2]:23 5.0 -(word) divr16u::dividend#5 dividend zp[2]:23 2.0 +(word) divr16u::dividend#0 dividend zp[2]:18 2.75 +(word) divr16u::dividend#3 dividend zp[2]:18 5.0 +(word) divr16u::dividend#5 dividend zp[2]:18 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:29 16.5 -(word) divr16u::quotient#2 quotient zp[2]:29 11.0 -(word) divr16u::quotient#3 quotient zp[2]:29 2.75 +(word) divr16u::quotient#1 quotient zp[2]:28 16.5 +(word) divr16u::quotient#2 quotient zp[2]:28 11.0 +(word) divr16u::quotient#3 quotient zp[2]:28 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:21 8.25 -(word) divr16u::rem#1 rem zp[2]:21 22.0 -(word) divr16u::rem#10 rem zp[2]:21 4.0 -(word) divr16u::rem#11 rem zp[2]:21 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:21 22.0 -(word) divr16u::rem#4 rem zp[2]:21 4.0 -(word) divr16u::rem#5 rem zp[2]:21 24.0 -(word) divr16u::rem#6 rem zp[2]:21 11.0 +(word) divr16u::rem#0 rem zp[2]:16 8.25 +(word) divr16u::rem#1 rem zp[2]:16 22.0 +(word) divr16u::rem#10 rem zp[2]:16 4.0 +(word) divr16u::rem#11 rem zp[2]:16 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:16 22.0 +(word) divr16u::rem#4 rem zp[2]:16 4.0 +(word) divr16u::rem#5 rem zp[2]:16 24.0 +(word) divr16u::rem#6 rem zp[2]:16 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:29 5.285714285714286 -(word) divr16u::return#2 return zp[2]:29 4.0 -(word) divr16u::return#3 return zp[2]:29 4.0 +(word) divr16u::return#0 return zp[2]:28 5.285714285714286 +(word) divr16u::return#2 return zp[2]:28 4.0 +(word) divr16u::return#3 return zp[2]:28 4.0 (void()) main() (label) main::@1 (label) main::@2 @@ -5844,8 +5852,8 @@ FINAL SYMBOL TABLE (label) main::@return (const signed word[$78]) main::sintab1 = { fill( $78, 0) } (signed word*) main::st1 -(signed word*) main::st1#1 st1 zp[2]:21 22.0 -(signed word*) main::st1#2 st1 zp[2]:21 4.0 +(signed word*) main::st1#1 st1 zp[2]:16 22.0 +(signed word*) main::st1#2 st1 zp[2]:16 4.0 (const string) main::str = (string) " " (const string) main::str1 = (string) " " (signed word) main::sw @@ -5858,8 +5866,8 @@ FINAL SYMBOL TABLE (byte) memset::c (const byte) memset::c#0 c = (byte) ' ' (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:21 22.0 -(byte*) memset::dst#2 dst zp[2]:21 14.666666666666666 +(byte*) memset::dst#1 dst zp[2]:16 22.0 +(byte*) memset::dst#2 dst zp[2]:16 14.666666666666666 (byte*) memset::end (const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 (word) memset::num @@ -5875,47 +5883,47 @@ FINAL SYMBOL TABLE (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:29 101.0 -(word) mul16u::a#1 a zp[2]:29 1.3333333333333333 -(word) mul16u::a#2 a zp[2]:29 67.66666666666666 +(word) mul16u::a#0 a zp[2]:28 101.0 +(word) mul16u::a#1 a zp[2]:28 1.3333333333333333 +(word) mul16u::a#2 a zp[2]:28 67.66666666666666 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:23 2.0 +(word) mul16u::b#0 b zp[2]:18 2.0 (dword) mul16u::mb -(dword) mul16u::mb#1 mb zp[4]:17 202.0 -(dword) mul16u::mb#2 mb zp[4]:17 43.57142857142858 +(dword) mul16u::mb#1 mb zp[4]:24 202.0 +(dword) mul16u::mb#2 mb zp[4]:24 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:13 202.0 -(dword) mul16u::res#2 res zp[4]:13 50.83333333333333 -(dword) mul16u::res#6 res zp[4]:13 101.0 +(dword) mul16u::res#1 res zp[4]:12 202.0 +(dword) mul16u::res#2 res zp[4]:12 50.83333333333333 +(dword) mul16u::res#6 res zp[4]:12 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:13 4.0 +(dword) mul16u::return#2 return zp[4]:12 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:13 4.0 -(dword~) mulu16_sel::$1 zp[4]:13 4.0 +(dword~) mulu16_sel::$0 zp[4]:12 4.0 +(dword~) mulu16_sel::$1 zp[4]:12 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return -(word) mulu16_sel::return#0 return zp[2]:29 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:21 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:21 4.0 -(word) mulu16_sel::return#11 return zp[2]:29 4.0 -(word) mulu16_sel::return#12 return zp[2]:29 1.714285714285714 -(word) mulu16_sel::return#2 return zp[2]:29 4.0 +(word) mulu16_sel::return#0 return zp[2]:28 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:16 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:16 4.0 +(word) mulu16_sel::return#11 return zp[2]:28 4.0 +(word) mulu16_sel::return#12 return zp[2]:28 1.714285714285714 +(word) mulu16_sel::return#2 return zp[2]:28 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:21 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:21 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:16 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:16 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:23 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:18 5.0 (void()) print_byte((byte) print_byte::b) (byte~) print_byte::$0 reg byte a 4.0 (byte~) print_byte::$2 reg byte x 4.0 @@ -5932,13 +5940,13 @@ FINAL SYMBOL TABLE (byte) print_char::ch#3 reg byte a 4.0 (byte) print_char::ch#4 reg byte a 6.0 (byte*) print_char_cursor -(byte*) print_char_cursor#1 print_char_cursor zp[2]:11 101.0 -(byte*) print_char_cursor#13 print_char_cursor zp[2]:11 0.7083333333333334 -(byte*) print_char_cursor#2 print_char_cursor zp[2]:11 46.714285714285715 -(byte*) print_char_cursor#21 print_char_cursor zp[2]:11 6.6000000000000005 -(byte*) print_char_cursor#35 print_char_cursor zp[2]:11 6.0 -(byte*) print_char_cursor#51 print_char_cursor zp[2]:11 5.200000000000001 -(byte*) print_char_cursor#55 print_char_cursor zp[2]:11 24.0 +(byte*) print_char_cursor#1 print_char_cursor zp[2]:10 101.0 +(byte*) print_char_cursor#13 print_char_cursor zp[2]:10 0.7083333333333334 +(byte*) print_char_cursor#2 print_char_cursor zp[2]:10 46.714285714285715 +(byte*) print_char_cursor#21 print_char_cursor zp[2]:10 6.6000000000000005 +(byte*) print_char_cursor#35 print_char_cursor zp[2]:10 6.0 +(byte*) print_char_cursor#51 print_char_cursor zp[2]:10 5.200000000000001 +(byte*) print_char_cursor#55 print_char_cursor zp[2]:10 24.0 (void()) print_cls() (label) print_cls::@return (const byte[]) print_hextab = (string) "0123456789abcdef"z @@ -5969,9 +5977,9 @@ FINAL SYMBOL TABLE (word) print_word::w (word) print_word::w#0 w zp[2]:8 2.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:21 0.8 +(word) rem16u#1 rem16u zp[2]:16 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:13 4.0 +(dword~) sin16s::$4 zp[4]:24 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -5986,38 +5994,38 @@ FINAL SYMBOL TABLE (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:10 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:11 22.0 -(signed word) sin16s::return#1 return zp[2]:11 5.0 -(signed word~) sin16s::return#5 return zp[2]:11 4.0 +(signed word) sin16s::return#0 return zp[2]:10 22.0 +(signed word) sin16s::return#1 return zp[2]:10 5.0 +(signed word~) sin16s::return#5 return zp[2]:10 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:11 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:10 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:11 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:11 1.0 +(word) sin16s::usinx#0 usinx zp[2]:10 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:10 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:13 8.5 -(dword) sin16s::x#1 x zp[4]:13 4.0 -(dword) sin16s::x#2 x zp[4]:13 4.0 -(dword) sin16s::x#4 x zp[4]:13 5.0 -(dword) sin16s::x#6 x zp[4]:13 6.0 +(dword) sin16s::x#0 x zp[4]:12 8.5 +(dword) sin16s::x#1 x zp[4]:12 4.0 +(dword) sin16s::x#2 x zp[4]:12 4.0 +(dword) sin16s::x#4 x zp[4]:12 5.0 +(dword) sin16s::x#6 x zp[4]:12 6.0 (word) sin16s::x1 -(word) sin16s::x1#0 x1 zp[2]:31 0.6363636363636365 +(word) sin16s::x1#0 x1 zp[2]:30 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:21 4.0 +(word) sin16s::x2#0 x2 zp[2]:16 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:21 1.0 +(word) sin16s::x3#0 x3 zp[2]:16 1.0 (word) sin16s::x3_6 -(word) sin16s::x3_6#0 x3_6 zp[2]:29 4.0 +(word) sin16s::x3_6#0 x3_6 zp[2]:28 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:21 4.0 +(word) sin16s::x4#0 x4 zp[2]:16 4.0 (word) sin16s::x5 -(word) sin16s::x5#0 x5 zp[2]:29 4.0 +(word) sin16s::x5#0 x5 zp[2]:28 4.0 (word) sin16s::x5_128 -(word) sin16s::x5_128#0 x5_128 zp[2]:29 4.0 +(word) sin16s::x5_128#0 x5_128 zp[2]:28 4.0 (void()) sin16s_gen((signed word*) sin16s_gen::sintab , (word) sin16s_gen::wavelength) -(signed word~) sin16s_gen::$2 zp[2]:11 22.0 +(signed word~) sin16s_gen::$2 zp[2]:10 22.0 (label) sin16s_gen::@1 (label) sin16s_gen::@2 (label) sin16s_gen::@3 @@ -6030,7 +6038,7 @@ FINAL SYMBOL TABLE (signed word*) sin16s_gen::sintab#0 sintab zp[2]:8 7.333333333333333 (signed word*) sin16s_gen::sintab#2 sintab zp[2]:8 4.714285714285714 (dword) sin16s_gen::step -(dword) sin16s_gen::step#0 step zp[4]:25 1.1818181818181819 +(dword) sin16s_gen::step#0 step zp[4]:20 1.1818181818181819 (word) sin16s_gen::wavelength (dword) sin16s_gen::x (dword) sin16s_gen::x#1 x zp[4]:4 11.0 @@ -6041,26 +6049,26 @@ reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] zp[2]:2 [ sin16s_gen::i#2 sin16s_gen::i#1 print_str::str#3 print_str::str#5 print_str::str#0 ] zp[4]:4 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:8 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] -zp[1]:10 [ sin16s::isUpper#2 ] -zp[2]:11 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[2]:10 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] reg byte x [ mulu16_sel::select#5 ] -zp[4]:13 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] -zp[4]:17 [ mul16u::mb#2 mul16u::mb#1 ] -zp[2]:21 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] -zp[2]:23 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +zp[4]:12 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] +zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] +zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] -zp[4]:25 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] -zp[2]:29 [ 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 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] +zp[4]:20 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +zp[4]:24 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] +zp[2]:28 [ 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 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] reg byte a [ mul16u::$1 ] -zp[2]:31 [ div32u16u::quotient_hi#0 sin16s::x1#0 ] +zp[2]:30 [ div32u16u::quotient_hi#0 sin16s::x1#0 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] FINAL ASSEMBLER -Score: 22750 +Score: 22787 // File Comments // Generates a 16-bit signed sinus @@ -6077,8 +6085,8 @@ Score: 22750 // PI/2 in u[4.28] format .const PI_HALF_u4f28 = $1921fb54 .label print_line_cursor = $400 - .label rem16u = $15 - .label print_char_cursor = $b + .label rem16u = $10 + .label print_char_cursor = $a // @begin // [1] phi from @begin to @1 [phi:@begin->@1] // @1 @@ -6090,7 +6098,7 @@ Score: 22750 main: { .label wavelength = $78 .label sw = 8 - .label st1 = $15 + .label st1 = $10 // sin16s_gen(sintab1, wavelength) // [5] call sin16s_gen // [64] phi from main to sin16s_gen [phi:main->sin16s_gen] @@ -6388,7 +6396,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = $15 + .label dst = $10 // [59] phi from memset to memset::@1 [phi:memset->memset::@1] // [59] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 lda #= PI_u4f28 ) // [79] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 @@ -6593,16 +6600,14 @@ sin16s: { sbc #>PI_u4f28>>$10 sta.z x+3 // [81] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] - // [81] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [81] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [81] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [81] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] b1: - // [81] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [81] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [81] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy // sin16s::@1 __b1: @@ -6645,15 +6650,27 @@ sin16s: { // sin16s::@2 __b2: // x<<3 - // [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [85] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // x1 = >x<<3 // [86] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 @@ -6799,9 +6816,8 @@ sin16s: { adc.z x5_128+1 sta.z usinx+1 // if(isUpper!=0) - // [114] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [114] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b3 // sin16s::@6 // sinx = -(signed word)usinx @@ -6827,14 +6843,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($15) v1, word zeropage($17) v2, byte register(X) select) +// mulu16_sel(word zeropage($10) v1, word zeropage($12) v2, byte register(X) select) mulu16_sel: { - .label __0 = $d - .label __1 = $d - .label v1 = $15 - .label v2 = $17 - .label return = $1d - .label return_1 = $15 + .label __0 = $c + .label __1 = $c + .label v1 = $10 + .label v2 = $12 + .label return = $1c + .label return_1 = $10 // mul16u(v1, v2) // [120] (word) mul16u::a#1 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 @@ -6874,13 +6890,13 @@ mulu16_sel: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1d) a, word zeropage($17) b) +// mul16u(word zeropage($1c) a, word zeropage($12) b) mul16u: { - .label a = $1d - .label mb = $11 - .label res = $d - .label b = $17 - .label return = $d + .label a = $1c + .label mb = $18 + .label res = $c + .label b = $12 + .label return = $c // [129] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] // [129] phi (dword) mul16u::mb#2 = (word) mul16u::b#0 [phi:mul16u->mul16u::@1#0] -- vduz1=vwuz2 lda.z b @@ -6958,9 +6974,9 @@ mul16u: { // Divide unsigned 32-bit dword dividend with a 16-bit word divisor // The 16-bit word remainder can be found in rem16u after the division div32u16u: { - .label quotient_hi = $1f - .label quotient_lo = $1d - .label return = $19 + .label quotient_hi = $1e + .label quotient_lo = $1c + .label return = $14 // divr16u(>dividend, divisor, 0) // [139] call divr16u // [148] phi from div32u16u to divr16u [phi:div32u16u->divr16u] @@ -7019,12 +7035,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($17) dividend, word zeropage($15) rem) +// divr16u(word zeropage($12) dividend, word zeropage($10) rem) divr16u: { - .label rem = $15 - .label dividend = $17 - .label quotient = $1d - .label return = $1d + .label rem = $10 + .label dividend = $12 + .label quotient = $1c + .label return = $1c // [149] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] // [149] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 ldx #0 diff --git a/src/test/ref/sinusgen16.sym b/src/test/ref/sinusgen16.sym index 3c781995a..2e78c8579 100644 --- a/src/test/ref/sinusgen16.sym +++ b/src/test/ref/sinusgen16.sym @@ -17,12 +17,12 @@ (word) div32u16u::divisor (dword) div32u16u::quotient (word) div32u16u::quotient_hi -(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:31 0.8 +(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:30 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:29 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:28 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:25 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:25 4.0 +(dword) div32u16u::return#0 return zp[4]:20 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:20 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -34,30 +34,30 @@ (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:23 2.75 -(word) divr16u::dividend#3 dividend zp[2]:23 5.0 -(word) divr16u::dividend#5 dividend zp[2]:23 2.0 +(word) divr16u::dividend#0 dividend zp[2]:18 2.75 +(word) divr16u::dividend#3 dividend zp[2]:18 5.0 +(word) divr16u::dividend#5 dividend zp[2]:18 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:29 16.5 -(word) divr16u::quotient#2 quotient zp[2]:29 11.0 -(word) divr16u::quotient#3 quotient zp[2]:29 2.75 +(word) divr16u::quotient#1 quotient zp[2]:28 16.5 +(word) divr16u::quotient#2 quotient zp[2]:28 11.0 +(word) divr16u::quotient#3 quotient zp[2]:28 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:21 8.25 -(word) divr16u::rem#1 rem zp[2]:21 22.0 -(word) divr16u::rem#10 rem zp[2]:21 4.0 -(word) divr16u::rem#11 rem zp[2]:21 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:21 22.0 -(word) divr16u::rem#4 rem zp[2]:21 4.0 -(word) divr16u::rem#5 rem zp[2]:21 24.0 -(word) divr16u::rem#6 rem zp[2]:21 11.0 +(word) divr16u::rem#0 rem zp[2]:16 8.25 +(word) divr16u::rem#1 rem zp[2]:16 22.0 +(word) divr16u::rem#10 rem zp[2]:16 4.0 +(word) divr16u::rem#11 rem zp[2]:16 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:16 22.0 +(word) divr16u::rem#4 rem zp[2]:16 4.0 +(word) divr16u::rem#5 rem zp[2]:16 24.0 +(word) divr16u::rem#6 rem zp[2]:16 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:29 5.285714285714286 -(word) divr16u::return#2 return zp[2]:29 4.0 -(word) divr16u::return#3 return zp[2]:29 4.0 +(word) divr16u::return#0 return zp[2]:28 5.285714285714286 +(word) divr16u::return#2 return zp[2]:28 4.0 +(word) divr16u::return#3 return zp[2]:28 4.0 (void()) main() (label) main::@1 (label) main::@2 @@ -69,8 +69,8 @@ (label) main::@return (const signed word[$78]) main::sintab1 = { fill( $78, 0) } (signed word*) main::st1 -(signed word*) main::st1#1 st1 zp[2]:21 22.0 -(signed word*) main::st1#2 st1 zp[2]:21 4.0 +(signed word*) main::st1#1 st1 zp[2]:16 22.0 +(signed word*) main::st1#2 st1 zp[2]:16 4.0 (const string) main::str = (string) " " (const string) main::str1 = (string) " " (signed word) main::sw @@ -83,8 +83,8 @@ (byte) memset::c (const byte) memset::c#0 c = (byte) ' ' (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:21 22.0 -(byte*) memset::dst#2 dst zp[2]:21 14.666666666666666 +(byte*) memset::dst#1 dst zp[2]:16 22.0 +(byte*) memset::dst#2 dst zp[2]:16 14.666666666666666 (byte*) memset::end (const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 (word) memset::num @@ -100,47 +100,47 @@ (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:29 101.0 -(word) mul16u::a#1 a zp[2]:29 1.3333333333333333 -(word) mul16u::a#2 a zp[2]:29 67.66666666666666 +(word) mul16u::a#0 a zp[2]:28 101.0 +(word) mul16u::a#1 a zp[2]:28 1.3333333333333333 +(word) mul16u::a#2 a zp[2]:28 67.66666666666666 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:23 2.0 +(word) mul16u::b#0 b zp[2]:18 2.0 (dword) mul16u::mb -(dword) mul16u::mb#1 mb zp[4]:17 202.0 -(dword) mul16u::mb#2 mb zp[4]:17 43.57142857142858 +(dword) mul16u::mb#1 mb zp[4]:24 202.0 +(dword) mul16u::mb#2 mb zp[4]:24 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:13 202.0 -(dword) mul16u::res#2 res zp[4]:13 50.83333333333333 -(dword) mul16u::res#6 res zp[4]:13 101.0 +(dword) mul16u::res#1 res zp[4]:12 202.0 +(dword) mul16u::res#2 res zp[4]:12 50.83333333333333 +(dword) mul16u::res#6 res zp[4]:12 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:13 4.0 +(dword) mul16u::return#2 return zp[4]:12 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:13 4.0 -(dword~) mulu16_sel::$1 zp[4]:13 4.0 +(dword~) mulu16_sel::$0 zp[4]:12 4.0 +(dword~) mulu16_sel::$1 zp[4]:12 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return -(word) mulu16_sel::return#0 return zp[2]:29 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:21 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:21 4.0 -(word) mulu16_sel::return#11 return zp[2]:29 4.0 -(word) mulu16_sel::return#12 return zp[2]:29 1.714285714285714 -(word) mulu16_sel::return#2 return zp[2]:29 4.0 +(word) mulu16_sel::return#0 return zp[2]:28 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:16 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:16 4.0 +(word) mulu16_sel::return#11 return zp[2]:28 4.0 +(word) mulu16_sel::return#12 return zp[2]:28 1.714285714285714 +(word) mulu16_sel::return#2 return zp[2]:28 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:21 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:21 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:21 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:16 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:16 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:16 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:23 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:23 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:18 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:18 5.0 (void()) print_byte((byte) print_byte::b) (byte~) print_byte::$0 reg byte a 4.0 (byte~) print_byte::$2 reg byte x 4.0 @@ -157,13 +157,13 @@ (byte) print_char::ch#3 reg byte a 4.0 (byte) print_char::ch#4 reg byte a 6.0 (byte*) print_char_cursor -(byte*) print_char_cursor#1 print_char_cursor zp[2]:11 101.0 -(byte*) print_char_cursor#13 print_char_cursor zp[2]:11 0.7083333333333334 -(byte*) print_char_cursor#2 print_char_cursor zp[2]:11 46.714285714285715 -(byte*) print_char_cursor#21 print_char_cursor zp[2]:11 6.6000000000000005 -(byte*) print_char_cursor#35 print_char_cursor zp[2]:11 6.0 -(byte*) print_char_cursor#51 print_char_cursor zp[2]:11 5.200000000000001 -(byte*) print_char_cursor#55 print_char_cursor zp[2]:11 24.0 +(byte*) print_char_cursor#1 print_char_cursor zp[2]:10 101.0 +(byte*) print_char_cursor#13 print_char_cursor zp[2]:10 0.7083333333333334 +(byte*) print_char_cursor#2 print_char_cursor zp[2]:10 46.714285714285715 +(byte*) print_char_cursor#21 print_char_cursor zp[2]:10 6.6000000000000005 +(byte*) print_char_cursor#35 print_char_cursor zp[2]:10 6.0 +(byte*) print_char_cursor#51 print_char_cursor zp[2]:10 5.200000000000001 +(byte*) print_char_cursor#55 print_char_cursor zp[2]:10 24.0 (void()) print_cls() (label) print_cls::@return (const byte[]) print_hextab = (string) "0123456789abcdef"z @@ -194,9 +194,9 @@ (word) print_word::w (word) print_word::w#0 w zp[2]:8 2.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:21 0.8 +(word) rem16u#1 rem16u zp[2]:16 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:13 4.0 +(dword~) sin16s::$4 zp[4]:24 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -211,38 +211,38 @@ (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:10 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:11 22.0 -(signed word) sin16s::return#1 return zp[2]:11 5.0 -(signed word~) sin16s::return#5 return zp[2]:11 4.0 +(signed word) sin16s::return#0 return zp[2]:10 22.0 +(signed word) sin16s::return#1 return zp[2]:10 5.0 +(signed word~) sin16s::return#5 return zp[2]:10 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:11 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:10 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:11 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:11 1.0 +(word) sin16s::usinx#0 usinx zp[2]:10 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:10 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:13 8.5 -(dword) sin16s::x#1 x zp[4]:13 4.0 -(dword) sin16s::x#2 x zp[4]:13 4.0 -(dword) sin16s::x#4 x zp[4]:13 5.0 -(dword) sin16s::x#6 x zp[4]:13 6.0 +(dword) sin16s::x#0 x zp[4]:12 8.5 +(dword) sin16s::x#1 x zp[4]:12 4.0 +(dword) sin16s::x#2 x zp[4]:12 4.0 +(dword) sin16s::x#4 x zp[4]:12 5.0 +(dword) sin16s::x#6 x zp[4]:12 6.0 (word) sin16s::x1 -(word) sin16s::x1#0 x1 zp[2]:31 0.6363636363636365 +(word) sin16s::x1#0 x1 zp[2]:30 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:21 4.0 +(word) sin16s::x2#0 x2 zp[2]:16 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:21 1.0 +(word) sin16s::x3#0 x3 zp[2]:16 1.0 (word) sin16s::x3_6 -(word) sin16s::x3_6#0 x3_6 zp[2]:29 4.0 +(word) sin16s::x3_6#0 x3_6 zp[2]:28 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:21 4.0 +(word) sin16s::x4#0 x4 zp[2]:16 4.0 (word) sin16s::x5 -(word) sin16s::x5#0 x5 zp[2]:29 4.0 +(word) sin16s::x5#0 x5 zp[2]:28 4.0 (word) sin16s::x5_128 -(word) sin16s::x5_128#0 x5_128 zp[2]:29 4.0 +(word) sin16s::x5_128#0 x5_128 zp[2]:28 4.0 (void()) sin16s_gen((signed word*) sin16s_gen::sintab , (word) sin16s_gen::wavelength) -(signed word~) sin16s_gen::$2 zp[2]:11 22.0 +(signed word~) sin16s_gen::$2 zp[2]:10 22.0 (label) sin16s_gen::@1 (label) sin16s_gen::@2 (label) sin16s_gen::@3 @@ -255,7 +255,7 @@ (signed word*) sin16s_gen::sintab#0 sintab zp[2]:8 7.333333333333333 (signed word*) sin16s_gen::sintab#2 sintab zp[2]:8 4.714285714285714 (dword) sin16s_gen::step -(dword) sin16s_gen::step#0 step zp[4]:25 1.1818181818181819 +(dword) sin16s_gen::step#0 step zp[4]:20 1.1818181818181819 (word) sin16s_gen::wavelength (dword) sin16s_gen::x (dword) sin16s_gen::x#1 x zp[4]:4 11.0 @@ -266,19 +266,19 @@ reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] zp[2]:2 [ sin16s_gen::i#2 sin16s_gen::i#1 print_str::str#3 print_str::str#5 print_str::str#0 ] zp[4]:4 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:8 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] -zp[1]:10 [ sin16s::isUpper#2 ] -zp[2]:11 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[2]:10 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 print_char_cursor#35 print_char_cursor#55 print_char_cursor#13 print_char_cursor#51 print_char_cursor#21 print_char_cursor#2 print_char_cursor#1 ] reg byte x [ mulu16_sel::select#5 ] -zp[4]:13 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] -zp[4]:17 [ mul16u::mb#2 mul16u::mb#1 ] -zp[2]:21 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] -zp[2]:23 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +zp[4]:12 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] +zp[2]:16 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] +zp[2]:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ] -zp[4]:25 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] -zp[2]:29 [ 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 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] +zp[4]:20 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +zp[4]:24 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] +zp[2]:28 [ 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 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] reg byte a [ mul16u::$1 ] -zp[2]:31 [ div32u16u::quotient_hi#0 sin16s::x1#0 ] +zp[2]:30 [ div32u16u::quotient_hi#0 sin16s::x1#0 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] diff --git a/src/test/ref/sinusgen16b.asm b/src/test/ref/sinusgen16b.asm index 89a2bb4df..804804db2 100644 --- a/src/test/ref/sinusgen16b.asm +++ b/src/test/ref/sinusgen16b.asm @@ -14,13 +14,13 @@ // PI/2 in u[4.12] format .const PI_HALF_u4f12 = $1922 .label print_line_cursor = $400 - .label rem16u = 6 + .label rem16u = 3 .label print_char_cursor = $1f main: { .label wavelength = $78 - .label sw = $1d - .label st1 = 6 - .label st2 = $e + .label sw = $19 + .label st1 = 3 + .label st2 = $b jsr sin16s_gen jsr sin16s_genb jsr print_cls @@ -86,9 +86,9 @@ main: { sintab2: .fill 2*$78, 0 } // Print a zero-terminated string -// print_str(byte* zeropage($15) str) +// print_str(byte* zeropage($11) str) print_str: { - .label str = $15 + .label str = $11 __b1: ldy #0 lda (str),y @@ -110,9 +110,9 @@ print_str: { jmp __b1 } // Print a signed word as HEX -// print_sword(signed word zeropage($1d) w) +// print_sword(signed word zeropage($19) w) print_sword: { - .label w = $1d + .label w = $19 lda.z w+1 bmi __b1 lda #' ' @@ -144,9 +144,9 @@ print_char: { rts } // Print a word as HEX -// print_word(word zeropage($1d) w) +// print_word(word zeropage($19) w) print_word: { - .label w = $1d + .label w = $19 lda.z w+1 sta.z print_byte.b jsr print_byte @@ -156,9 +156,9 @@ print_word: { rts } // Print a byte as HEX -// print_byte(byte zeropage($10) b) +// print_byte(byte zeropage(2) b) print_byte: { - .label b = $10 + .label b = 2 lda.z b lsr lsr @@ -185,7 +185,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = 6 + .label dst = 3 lda #str @@ -211,13 +211,13 @@ memset: { // Generate signed (large) word sinus table - on the full -$7fff - $7fff range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_genb(signed word* zeropage($15) sintab) +// sin16s_genb(signed word* zeropage($11) sintab) sin16s_genb: { .label __3 = $1f - .label step = $17 - .label sintab = $15 - .label x = $a - .label i = $e + .label step = $13 + .label sintab = $11 + .label x = 7 + .label i = $b jsr div32u16u lda #PI_u4f12 @@ -419,14 +419,14 @@ sin16sb: { } // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage(6) v1, word zeropage(8) v2, byte register(X) select) +// mulu16_sel(word zeropage(3) v1, word zeropage(5) v2, byte register(X) select) mulu16_sel: { - .label __0 = $11 - .label __1 = $11 - .label v1 = 6 - .label v2 = 8 - .label return = 6 - .label return_1 = $1b + .label __0 = $d + .label __1 = $d + .label v1 = 3 + .label v2 = 5 + .label return = 3 + .label return_1 = $17 lda.z v1 sta.z mul16u.a lda.z v1+1 @@ -449,13 +449,13 @@ mulu16_sel: { rts } // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1b) a, word zeropage(8) b) +// mul16u(word zeropage($17) a, word zeropage(5) b) mul16u: { - .label a = $1b - .label mb = 2 - .label res = $11 - .label b = 8 - .label return = $11 + .label a = $17 + .label mb = $1b + .label res = $d + .label b = 5 + .label return = $d lda.z b sta.z mb lda.z b+1 @@ -503,9 +503,9 @@ mul16u: { // Divide unsigned 32-bit dword dividend with a 16-bit word divisor // The 16-bit word remainder can be found in rem16u after the division div32u16u: { - .label quotient_hi = $1d - .label quotient_lo = $1b - .label return = $17 + .label quotient_hi = $19 + .label quotient_lo = $17 + .label return = $13 lda #>$10 sta.z divr16u.dividend lda #>PI2_u4f28>>$10 @@ -537,12 +537,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage(8) dividend, word zeropage(6) rem) +// divr16u(word zeropage(5) dividend, word zeropage(3) rem) divr16u: { - .label rem = 6 - .label dividend = 8 - .label quotient = $1b - .label return = $1b + .label rem = 3 + .label dividend = 5 + .label quotient = $17 + .label return = $17 ldx #0 txa sta.z quotient @@ -590,13 +590,13 @@ divr16u: { // Generate signed (large) word sinus table - on the full -$7fff - $7fff range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen(signed word* zeropage($e) sintab) +// sin16s_gen(signed word* zeropage($b) sintab) sin16s_gen: { - .label __2 = $15 - .label step = $17 - .label sintab = $e - .label x = $a - .label i = $1d + .label __2 = $11 + .label step = $13 + .label sintab = $b + .label x = 7 + .label i = $19 jsr div32u16u lda #PI_u4f28>>$10 bcc b1 @@ -709,12 +708,10 @@ sin16s: { lda.z x+3 sbc #>PI_u4f28>>$10 sta.z x+3 - lda #1 - sta.z isUpper + ldy #1 jmp __b1 b1: - lda #0 - sta.z isUpper + ldy #0 __b1: lda.z x+3 cmp #>PI_HALF_u4f28>>$10 @@ -746,14 +743,26 @@ sin16s: { sbc.z x+3 sta.z x+3 __b2: - ldy #3 - !: + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- lda.z __4+2 sta.z x1 lda.z __4+3 @@ -826,8 +835,7 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - lda.z isUpper - cmp #0 + cpy #0 beq __b3 sec lda #0 diff --git a/src/test/ref/sinusgen16b.log b/src/test/ref/sinusgen16b.log index 77566a88b..faa26b3d3 100644 --- a/src/test/ref/sinusgen16b.log +++ b/src/test/ref/sinusgen16b.log @@ -5266,21 +5266,25 @@ sin16s: { __b2: // [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 lda.z x + asl sta.z __4 lda.z x+1 + rol sta.z __4+1 lda.z x+2 + rol sta.z __4+2 lda.z x+3 + rol sta.z __4+3 - ldy #3 - !: asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 // [191] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -5610,8 +5614,7 @@ Statement [184] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [185] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [187] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [188] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:62 [ sin16s::isUpper#2 ] +Statement [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [191] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [192] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ mulu16_sel::v1#0 sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 mulu16_sel::v1#0 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [193] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ mulu16_sel::v1#0 mulu16_sel::v2#0 sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 mulu16_sel::v1#0 mulu16_sel::v2#0 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a @@ -5725,7 +5728,7 @@ Statement [184] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [185] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [187] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [188] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y +Statement [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [191] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [192] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ mulu16_sel::v1#0 sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 mulu16_sel::v1#0 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [193] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ mulu16_sel::v1#0 mulu16_sel::v2#0 sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:5::sin16s:177 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 mulu16_sel::v1#0 mulu16_sel::v2#0 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a @@ -5780,7 +5783,7 @@ Potential registers zp[1]:53 [ divr16u::i#2 divr16u::i#1 ] : zp[1]:53 , reg byte Potential registers zp[2]:54 [ sin16s_gen::i#2 sin16s_gen::i#1 ] : zp[2]:54 , Potential registers zp[4]:56 [ sin16s_gen::x#2 sin16s_gen::x#1 ] : zp[4]:56 , Potential registers zp[2]:60 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] : zp[2]:60 , -Potential registers zp[1]:62 [ sin16s::isUpper#2 ] : zp[1]:62 , reg byte x , +Potential registers zp[1]:62 [ sin16s::isUpper#2 ] : zp[1]:62 , reg byte x , reg byte y , Potential registers zp[4]:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] : zp[4]:63 , Potential registers zp[2]:67 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] : zp[2]:67 , Potential registers zp[2]:69 [ main::sw#0 ] : zp[2]:69 , @@ -5858,28 +5861,26 @@ Uplift Scope [print_word] 2: zp[2]:71 [ print_word::w#0 ] Uplift Scope [RADIX] Uplift Scope [print_cls] -Uplifting [mul16u] best 29962 combination zp[4]:37 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:41 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:35 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp[4]:115 [ mul16u::return#2 ] zp[2]:45 [ mul16u::b#0 ] -Uplifting [print_str] best 29962 combination zp[2]:7 [ print_str::str#3 print_str::str#5 print_str::str#0 ] -Uplifting [divr16u] best 29752 combination zp[2]: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[2]: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[2]:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:130 [ divr16u::return#2 ] zp[2]:134 [ divr16u::return#3 ] -Uplifting [] best 29752 combination zp[2]:12 [ print_char_cursor#35 print_char_cursor#54 print_char_cursor#51 print_char_cursor#52 print_char_cursor#2 print_char_cursor#13 print_char_cursor#1 ] zp[2]:144 [ rem16u#1 ] -Uplifting [mulu16_sel] best 29721 combination zp[2]: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[2]: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[2]:89 [ mulu16_sel::return#18 ] zp[2]:93 [ mulu16_sel::return#19 ] zp[2]:97 [ mulu16_sel::return#20 ] zp[2]:103 [ mulu16_sel::return#10 ] zp[2]:107 [ mulu16_sel::return#11 ] zp[4]:119 [ mulu16_sel::$0 ] zp[4]:123 [ mulu16_sel::$1 ] zp[2]:164 [ mulu16_sel::return#0 ] zp[2]:168 [ mulu16_sel::return#1 ] zp[2]:172 [ mulu16_sel::return#14 ] zp[2]:178 [ mulu16_sel::return#15 ] zp[2]:182 [ mulu16_sel::return#16 ] zp[2]:127 [ mulu16_sel::return#17 ] reg byte x [ mulu16_sel::select#10 ] -Uplifting [sin16s] best 29721 combination zp[4]:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:154 [ sin16s::return#0 ] zp[2]:67 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:158 [ sin16s::$4 ] zp[2]:166 [ sin16s::x2#0 ] zp[2]:174 [ sin16s::x3_6#0 ] zp[2]:180 [ sin16s::x4#0 ] zp[2]:184 [ sin16s::x5#0 ] zp[2]:186 [ sin16s::x5_128#0 ] zp[2]:170 [ sin16s::x3#0 ] zp[2]:188 [ sin16s::usinx#1 ] zp[2]:162 [ sin16s::x1#0 ] zp[2]:176 [ sin16s::usinx#0 ] zp[1]:62 [ sin16s::isUpper#2 ] -Uplifting [sin16sb] best 29712 combination zp[2]:26 [ sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 ] zp[2]:83 [ sin16sb::return#0 ] zp[2]:28 [ sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 ] zp[2]:91 [ sin16sb::x2#0 ] zp[2]:99 [ sin16sb::x3_6#0 ] zp[2]:105 [ sin16sb::x4#0 ] zp[2]:109 [ sin16sb::x5#0 ] zp[2]:111 [ sin16sb::x5_128#0 ] zp[2]:95 [ sin16sb::x3#0 ] zp[2]:113 [ sin16sb::usinx#1 ] zp[2]:87 [ sin16sb::x1#0 ] zp[2]:101 [ sin16sb::usinx#0 ] reg byte y [ sin16sb::isUpper#2 ] -Uplifting [sin16s_gen] best 29712 combination zp[2]:54 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp[2]:156 [ sin16s_gen::$2 ] zp[4]:56 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:60 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp[4]:150 [ sin16s_gen::step#0 ] -Uplifting [sin16s_genb] best 29712 combination zp[2]:17 [ sin16s_genb::i#2 sin16s_genb::i#1 ] zp[2]:85 [ sin16s_genb::$3 ] zp[4]:19 [ sin16s_genb::x#2 sin16s_genb::x#1 ] zp[2]:23 [ sin16s_genb::sintab#2 sin16s_genb::sintab#0 ] zp[4]:79 [ sin16s_genb::step#0 ] -Uplifting [main] best 29622 combination reg byte x [ main::i#2 main::i#1 ] zp[2]:4 [ main::st2#2 main::st2#1 ] zp[2]:2 [ main::st1#2 main::st1#1 ] zp[2]:69 [ main::sw#0 ] -Uplifting [memset] best 29622 combination zp[2]:15 [ memset::dst#2 memset::dst#1 ] -Uplifting [print_byte] best 29614 combination zp[1]:14 [ 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 29614 combination zp[4]:75 [ div32u16u::return#3 ] zp[2]:136 [ div32u16u::quotient_lo#0 ] zp[4]:146 [ div32u16u::return#2 ] zp[4]:138 [ div32u16u::return#0 ] zp[2]:132 [ div32u16u::quotient_hi#0 ] -Uplifting [print_char] best 29599 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] -Uplifting [print_sword] best 29599 combination zp[2]:9 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] -Uplifting [print_word] best 29599 combination zp[2]:71 [ print_word::w#0 ] -Uplifting [RADIX] best 29599 combination -Uplifting [print_cls] best 29599 combination +Uplifting [mul16u] best 29984 combination zp[4]:37 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:41 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:35 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp[4]:115 [ mul16u::return#2 ] zp[2]:45 [ mul16u::b#0 ] +Uplifting [print_str] best 29984 combination zp[2]:7 [ print_str::str#3 print_str::str#5 print_str::str#0 ] +Uplifting [divr16u] best 29774 combination zp[2]: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[2]: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[2]:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] zp[2]:130 [ divr16u::return#2 ] zp[2]:134 [ divr16u::return#3 ] +Uplifting [] best 29774 combination zp[2]:12 [ print_char_cursor#35 print_char_cursor#54 print_char_cursor#51 print_char_cursor#52 print_char_cursor#2 print_char_cursor#13 print_char_cursor#1 ] zp[2]:144 [ rem16u#1 ] +Uplifting [mulu16_sel] best 29743 combination zp[2]: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[2]: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[2]:89 [ mulu16_sel::return#18 ] zp[2]:93 [ mulu16_sel::return#19 ] zp[2]:97 [ mulu16_sel::return#20 ] zp[2]:103 [ mulu16_sel::return#10 ] zp[2]:107 [ mulu16_sel::return#11 ] zp[4]:119 [ mulu16_sel::$0 ] zp[4]:123 [ mulu16_sel::$1 ] zp[2]:164 [ mulu16_sel::return#0 ] zp[2]:168 [ mulu16_sel::return#1 ] zp[2]:172 [ mulu16_sel::return#14 ] zp[2]:178 [ mulu16_sel::return#15 ] zp[2]:182 [ mulu16_sel::return#16 ] zp[2]:127 [ mulu16_sel::return#17 ] reg byte x [ mulu16_sel::select#10 ] +Uplifting [sin16s] best 29734 combination zp[4]:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:154 [ sin16s::return#0 ] zp[2]:67 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:158 [ sin16s::$4 ] zp[2]:166 [ sin16s::x2#0 ] zp[2]:174 [ sin16s::x3_6#0 ] zp[2]:180 [ sin16s::x4#0 ] zp[2]:184 [ sin16s::x5#0 ] zp[2]:186 [ sin16s::x5_128#0 ] zp[2]:170 [ sin16s::x3#0 ] zp[2]:188 [ sin16s::usinx#1 ] zp[2]:162 [ sin16s::x1#0 ] zp[2]:176 [ sin16s::usinx#0 ] reg byte y [ sin16s::isUpper#2 ] +Uplifting [sin16sb] best 29725 combination zp[2]:26 [ sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 ] zp[2]:83 [ sin16sb::return#0 ] zp[2]:28 [ sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 ] zp[2]:91 [ sin16sb::x2#0 ] zp[2]:99 [ sin16sb::x3_6#0 ] zp[2]:105 [ sin16sb::x4#0 ] zp[2]:109 [ sin16sb::x5#0 ] zp[2]:111 [ sin16sb::x5_128#0 ] zp[2]:95 [ sin16sb::x3#0 ] zp[2]:113 [ sin16sb::usinx#1 ] zp[2]:87 [ sin16sb::x1#0 ] zp[2]:101 [ sin16sb::usinx#0 ] reg byte y [ sin16sb::isUpper#2 ] +Uplifting [sin16s_gen] best 29725 combination zp[2]:54 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp[2]:156 [ sin16s_gen::$2 ] zp[4]:56 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:60 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp[4]:150 [ sin16s_gen::step#0 ] +Uplifting [sin16s_genb] best 29725 combination zp[2]:17 [ sin16s_genb::i#2 sin16s_genb::i#1 ] zp[2]:85 [ sin16s_genb::$3 ] zp[4]:19 [ sin16s_genb::x#2 sin16s_genb::x#1 ] zp[2]:23 [ sin16s_genb::sintab#2 sin16s_genb::sintab#0 ] zp[4]:79 [ sin16s_genb::step#0 ] +Uplifting [main] best 29635 combination reg byte x [ main::i#2 main::i#1 ] zp[2]:4 [ main::st2#2 main::st2#1 ] zp[2]:2 [ main::st1#2 main::st1#1 ] zp[2]:69 [ main::sw#0 ] +Uplifting [memset] best 29635 combination zp[2]:15 [ memset::dst#2 memset::dst#1 ] +Uplifting [print_byte] best 29627 combination zp[1]:14 [ 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 29627 combination zp[4]:75 [ div32u16u::return#3 ] zp[2]:136 [ div32u16u::quotient_lo#0 ] zp[4]:146 [ div32u16u::return#2 ] zp[4]:138 [ div32u16u::return#0 ] zp[2]:132 [ div32u16u::quotient_hi#0 ] +Uplifting [print_char] best 29612 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] +Uplifting [print_sword] best 29612 combination zp[2]:9 [ print_sword::w#4 print_sword::w#0 print_sword::w#1 ] +Uplifting [print_word] best 29612 combination zp[2]:71 [ print_word::w#0 ] +Uplifting [RADIX] best 29612 combination +Uplifting [print_cls] best 29612 combination Attempting to uplift remaining variables inzp[1]:14 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Uplifting [print_byte] best 29599 combination zp[1]:14 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Attempting to uplift remaining variables inzp[1]:62 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 29599 combination zp[1]:62 [ sin16s::isUpper#2 ] +Uplifting [print_byte] best 29612 combination zp[1]:14 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] Coalescing zero page register [ zp[2]:28 [ sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 ] ] with [ zp[2]:113 [ sin16sb::usinx#1 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:95 [ sin16sb::x3#0 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:170 [ sin16s::x3#0 ] ] - score: 2 @@ -5897,7 +5898,6 @@ Coalescing zero page register [ zp[2]:32 [ mulu16_sel::v2#10 mulu16_sel::v2#3 mu Coalescing zero page register [ zp[4]:37 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] ] with [ zp[4]:115 [ mul16u::return#2 ] ] - score: 1 Coalescing zero page register [ zp[2]:51 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 ] ] with [ zp[2]:130 [ divr16u::return#2 ] ] - score: 1 Coalescing zero page register [ zp[2]:51 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 ] ] with [ zp[2]:134 [ divr16u::return#3 ] ] - score: 1 -Coalescing zero page register [ zp[4]:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:158 [ sin16s::$4 ] ] - score: 1 Coalescing zero page register [ zp[2]:67 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 ] ] with [ zp[2]:154 [ sin16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[4]:75 [ div32u16u::return#3 ] ] with [ zp[4]:79 [ sin16s_genb::step#0 ] ] - score: 1 Coalescing zero page register [ zp[4]:75 [ div32u16u::return#3 sin16s_genb::step#0 ] ] with [ zp[4]:138 [ div32u16u::return#0 ] ] - score: 1 @@ -5935,26 +5935,26 @@ Coalescing zero page register [ zp[2]:47 [ divr16u::rem#5 divr16u::rem#10 divr16 Coalescing zero page register [ zp[2]:49 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 ] ] with [ zp[2]: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 mul16u::b#0 ] ] Coalescing zero page register [ zp[2]:51 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 ] ] with [ zp[2]:35 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] ] Coalescing zero page register [ zp[4]:56 [ sin16s_gen::x#2 sin16s_gen::x#1 ] ] with [ zp[4]:19 [ sin16s_genb::x#2 sin16s_genb::x#1 ] ] -Coalescing zero page register [ zp[1]:62 [ sin16s::isUpper#2 ] ] with [ zp[1]:14 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] ] -Coalescing zero page register [ zp[4]:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] ] with [ zp[4]:37 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] ] +Coalescing zero page register [ zp[4]:63 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:37 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] ] Coalescing zero page register [ zp[2]:132 [ div32u16u::quotient_hi#0 ] ] with [ zp[2]:54 [ sin16s_gen::i#2 sin16s_gen::i#1 ] ] +Coalescing zero page register [ zp[4]:158 [ sin16s::$4 ] ] with [ zp[4]:41 [ mul16u::mb#2 mul16u::mb#1 ] ] Coalescing zero page register [ zp[2]: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 rem16u#1 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 sin16s::x3#0 sin16sb::x2#0 sin16sb::x4#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#19 mulu16_sel::return#10 mulu16_sel::return#0 mulu16_sel::return#1 mulu16_sel::return#15 ] ] with [ zp[2]:15 [ memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] ] Coalescing zero page register [ zp[2]:60 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] ] with [ zp[2]:17 [ sin16s_genb::i#2 sin16s_genb::i#1 main::st2#2 main::st2#1 ] ] Coalescing zero page register [ zp[2]:67 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] ] with [ zp[2]:23 [ sin16s_genb::sintab#2 sin16s_genb::sintab#0 print_str::str#3 print_str::str#5 print_str::str#0 ] ] Coalescing zero page register [ zp[2]:89 [ mulu16_sel::return#18 mulu16_sel::return#17 mulu16_sel::return#20 sin16sb::x3_6#0 mulu16_sel::return#11 sin16sb::x5#0 mulu16_sel::return#14 sin16s::x3_6#0 mulu16_sel::return#16 sin16s::x5#0 sin16sb::x5_128#0 sin16s::x5_128#0 ] ] with [ zp[2]:51 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] ] Coalescing zero page register [ zp[2]:132 [ div32u16u::quotient_hi#0 sin16s_gen::i#2 sin16s_gen::i#1 ] ] with [ zp[2]:26 [ sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 sin16sb::x1#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] ] Coalescing zero page register [ zp[2]:162 [ sin16s::x1#0 ] ] with [ zp[2]:28 [ sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 sin16sb::usinx#1 sin16sb::return#0 sin16s_genb::$3 sin16sb::usinx#0 print_char_cursor#35 print_char_cursor#54 print_char_cursor#51 print_char_cursor#52 print_char_cursor#2 print_char_cursor#13 print_char_cursor#1 ] ] -Allocated (was zp[4]:41) zp[4]:2 [ mul16u::mb#2 mul16u::mb#1 ] -Allocated (was zp[2]:47) zp[2]:6 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 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 sin16s::x3#0 sin16sb::x2#0 sin16sb::x4#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#19 mulu16_sel::return#10 mulu16_sel::return#0 mulu16_sel::return#1 mulu16_sel::return#15 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] -Allocated (was zp[2]:49) zp[2]:8 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 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 mul16u::b#0 ] -Allocated (was zp[4]:56) zp[4]:10 [ sin16s_gen::x#2 sin16s_gen::x#1 sin16s_genb::x#2 sin16s_genb::x#1 ] -Allocated (was zp[2]:60) zp[2]:14 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 sin16s_genb::i#2 sin16s_genb::i#1 main::st2#2 main::st2#1 ] -Allocated (was zp[1]:62) zp[1]:16 [ sin16s::isUpper#2 print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -Allocated (was zp[4]:63) zp[4]:17 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] -Allocated (was zp[2]:67) zp[2]:21 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 sin16s_genb::sintab#2 sin16s_genb::sintab#0 print_str::str#3 print_str::str#5 print_str::str#0 ] -Allocated (was zp[4]:75) zp[4]:23 [ div32u16u::return#3 sin16s_genb::step#0 div32u16u::return#0 div32u16u::return#2 sin16s_gen::step#0 ] -Allocated (was zp[2]:89) zp[2]:27 [ mulu16_sel::return#18 mulu16_sel::return#17 mulu16_sel::return#20 sin16sb::x3_6#0 mulu16_sel::return#11 sin16sb::x5#0 mulu16_sel::return#14 sin16s::x3_6#0 mulu16_sel::return#16 sin16s::x5#0 sin16sb::x5_128#0 sin16s::x5_128#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] -Allocated (was zp[2]:132) zp[2]:29 [ div32u16u::quotient_hi#0 sin16s_gen::i#2 sin16s_gen::i#1 sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 sin16sb::x1#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] +Allocated (was zp[1]:14) zp[1]:2 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] +Allocated (was zp[2]:47) zp[2]:3 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 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 sin16s::x3#0 sin16sb::x2#0 sin16sb::x4#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#19 mulu16_sel::return#10 mulu16_sel::return#0 mulu16_sel::return#1 mulu16_sel::return#15 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] +Allocated (was zp[2]:49) zp[2]:5 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 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 mul16u::b#0 ] +Allocated (was zp[4]:56) zp[4]:7 [ sin16s_gen::x#2 sin16s_gen::x#1 sin16s_genb::x#2 sin16s_genb::x#1 ] +Allocated (was zp[2]:60) zp[2]:11 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 sin16s_genb::i#2 sin16s_genb::i#1 main::st2#2 main::st2#1 ] +Allocated (was zp[4]:63) zp[4]:13 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] +Allocated (was zp[2]:67) zp[2]:17 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 sin16s_genb::sintab#2 sin16s_genb::sintab#0 print_str::str#3 print_str::str#5 print_str::str#0 ] +Allocated (was zp[4]:75) zp[4]:19 [ div32u16u::return#3 sin16s_genb::step#0 div32u16u::return#0 div32u16u::return#2 sin16s_gen::step#0 ] +Allocated (was zp[2]:89) zp[2]:23 [ mulu16_sel::return#18 mulu16_sel::return#17 mulu16_sel::return#20 sin16sb::x3_6#0 mulu16_sel::return#11 sin16sb::x5#0 mulu16_sel::return#14 sin16s::x3_6#0 mulu16_sel::return#16 sin16s::x5#0 sin16sb::x5_128#0 sin16s::x5_128#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] +Allocated (was zp[2]:132) zp[2]:25 [ div32u16u::quotient_hi#0 sin16s_gen::i#2 sin16s_gen::i#1 sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 sin16sb::x1#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] +Allocated (was zp[4]:158) zp[4]:27 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] Allocated (was zp[2]:162) zp[2]:31 [ sin16s::x1#0 sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 sin16sb::usinx#1 sin16sb::return#0 sin16s_genb::$3 sin16sb::usinx#0 print_char_cursor#35 print_char_cursor#54 print_char_cursor#51 print_char_cursor#52 print_char_cursor#2 print_char_cursor#13 print_char_cursor#1 ] ASSEMBLER BEFORE OPTIMIZATION @@ -5977,7 +5977,7 @@ ASSEMBLER BEFORE OPTIMIZATION // PI/2 in u[4.12] format .const PI_HALF_u4f12 = $1922 .label print_line_cursor = $400 - .label rem16u = 6 + .label rem16u = 3 .label print_char_cursor = $1f // @begin __bbegin: @@ -5998,9 +5998,9 @@ __bend: // main main: { .label wavelength = $78 - .label sw = $1d - .label st1 = 6 - .label st2 = $e + .label sw = $19 + .label st1 = 3 + .label st2 = $b // [5] call sin16s_gen // [169] phi from main to sin16s_gen [phi:main->sin16s_gen] sin16s_gen_from_main: @@ -6143,9 +6143,9 @@ main: { } // print_str // Print a zero-terminated string -// print_str(byte* zeropage($15) str) +// print_str(byte* zeropage($11) str) print_str: { - .label str = $15 + .label str = $11 // [26] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] __b1_from_print_str: __b1_from___b2: @@ -6185,9 +6185,9 @@ print_str: { } // print_sword // Print a signed word as HEX -// print_sword(signed word zeropage($1d) w) +// print_sword(signed word zeropage($19) w) print_sword: { - .label w = $1d + .label w = $19 // [32] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1 -- vwsz1_lt_0_then_la1 lda.z w+1 bmi __b1_from_print_sword @@ -6263,9 +6263,9 @@ print_char: { } // print_word // Print a word as HEX -// print_word(word zeropage($1d) w) +// print_word(word zeropage($19) w) print_word: { - .label w = $1d + .label w = $19 // [46] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuz1=_hi_vwuz2 lda.z w+1 sta.z print_byte.b @@ -6293,9 +6293,9 @@ print_word: { } // print_byte // Print a byte as HEX -// print_byte(byte zeropage($10) b) +// print_byte(byte zeropage(2) b) print_byte: { - .label b = $10 + .label b = 2 // [52] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuz1_ror_4 lda.z b lsr @@ -6352,7 +6352,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = 6 + .label dst = 3 // [63] phi from memset to memset::@1 [phi:memset->memset::@1] __b1_from_memset: // [63] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 @@ -6395,13 +6395,13 @@ memset: { // Generate signed (large) word sinus table - on the full -$7fff - $7fff range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_genb(signed word* zeropage($15) sintab) +// sin16s_genb(signed word* zeropage($11) sintab) sin16s_genb: { .label __3 = $1f - .label step = $17 - .label sintab = $15 - .label x = $a - .label i = $e + .label step = $13 + .label sintab = $11 + .label x = 7 + .label i = $b // [69] call div32u16u // [141] phi from sin16s_genb to div32u16u [phi:sin16s_genb->div32u16u] div32u16u_from_sin16s_genb: @@ -6507,18 +6507,18 @@ sin16s_genb: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16sb(word zeropage($1d) x) +// sin16sb(word zeropage($19) x) sin16sb: { - .label x = $1d + .label x = $19 .label return = $1f - .label x1 = $1d - .label x2 = 6 - .label x3 = 6 - .label x3_6 = $1b + .label x1 = $19 + .label x2 = 3 + .label x3 = 3 + .label x3_6 = $17 .label usinx = $1f - .label x4 = 6 - .label x5 = $1b - .label x5_128 = $1b + .label x4 = 3 + .label x5 = $17 + .label x5_128 = $17 .label sinx = $1f // [83] if((word) sin16sb::x#0<(const word) PI_u4f12) goto sin16sb::@1 -- vwuz1_lt_vwuc1_then_la1 lda.z x+1 @@ -6757,14 +6757,14 @@ sin16sb: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage(6) v1, word zeropage(8) v2, byte register(X) select) +// mulu16_sel(word zeropage(3) v1, word zeropage(5) v2, byte register(X) select) mulu16_sel: { - .label __0 = $11 - .label __1 = $11 - .label v1 = 6 - .label v2 = 8 - .label return = 6 - .label return_1 = $1b + .label __0 = $d + .label __1 = $d + .label v1 = 3 + .label v2 = 5 + .label return = 3 + .label return_1 = $17 // [123] (word) mul16u::a#1 ← (word) mulu16_sel::v1#10 -- vwuz1=vwuz2 lda.z v1 sta.z mul16u.a @@ -6804,13 +6804,13 @@ mulu16_sel: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1b) a, word zeropage(8) b) +// mul16u(word zeropage($17) a, word zeropage(5) b) mul16u: { - .label a = $1b - .label mb = 2 - .label res = $11 - .label b = 8 - .label return = $11 + .label a = $17 + .label mb = $1b + .label res = $d + .label b = 5 + .label return = $d // [132] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] __b1_from_mul16u: // [132] phi (dword) mul16u::mb#2 = (word) mul16u::b#0 [phi:mul16u->mul16u::@1#0] -- vduz1=vwuz2 @@ -6893,9 +6893,9 @@ mul16u: { // Divide unsigned 32-bit dword dividend with a 16-bit word divisor // The 16-bit word remainder can be found in rem16u after the division div32u16u: { - .label quotient_hi = $1d - .label quotient_lo = $1b - .label return = $17 + .label quotient_hi = $19 + .label quotient_lo = $17 + .label return = $13 // [142] call divr16u // [151] phi from div32u16u to divr16u [phi:div32u16u->divr16u] divr16u_from_div32u16u: @@ -6955,12 +6955,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage(8) dividend, word zeropage(6) rem) +// divr16u(word zeropage(5) dividend, word zeropage(3) rem) divr16u: { - .label rem = 6 - .label dividend = 8 - .label quotient = $1b - .label return = $1b + .label rem = 3 + .label dividend = 5 + .label quotient = $17 + .label return = $17 // [152] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] __b1_from_divr16u: // [152] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 @@ -7064,13 +7064,13 @@ divr16u: { // Generate signed (large) word sinus table - on the full -$7fff - $7fff range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen(signed word* zeropage($e) sintab) +// sin16s_gen(signed word* zeropage($b) sintab) sin16s_gen: { - .label __2 = $15 - .label step = $17 - .label sintab = $e - .label x = $a - .label i = $1d + .label __2 = $11 + .label step = $13 + .label sintab = $b + .label x = 7 + .label i = $19 // [170] call div32u16u // [141] phi from sin16s_gen to div32u16u [phi:sin16s_gen->div32u16u] div32u16u_from_sin16s_gen: @@ -7180,21 +7180,20 @@ sin16s_gen: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($11) x) +// sin16s(dword zeropage($d) x) sin16s: { - .label __4 = $11 - .label x = $11 - .label return = $15 + .label __4 = $1b + .label x = $d + .label return = $11 .label x1 = $1f - .label x2 = 6 - .label x3 = 6 - .label x3_6 = $1b - .label usinx = $15 - .label x4 = 6 - .label x5 = $1b - .label x5_128 = $1b - .label sinx = $15 - .label isUpper = $10 + .label x2 = 3 + .label x3 = 3 + .label x3_6 = $17 + .label usinx = $11 + .label x4 = 3 + .label x5 = $17 + .label x5_128 = $17 + .label sinx = $11 // [184] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 cmp #>PI_u4f28>>$10 @@ -7231,16 +7230,14 @@ sin16s: { sta.z x+3 // [186] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] __b1_from___b4: - // [186] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [186] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [186] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [186] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] __b1_from_sin16s: - // [186] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [186] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [186] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy jmp __b1 // sin16s::@1 @@ -7286,15 +7283,27 @@ sin16s: { jmp __b2 // sin16s::@2 __b2: - // [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // [191] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -7435,9 +7444,8 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - // [219] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [219] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b12 jmp __b6 // sin16s::@6 @@ -7748,13 +7756,13 @@ FINAL SYMBOL TABLE (word) div32u16u::divisor (dword) div32u16u::quotient (word) div32u16u::quotient_hi -(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:29 0.8 +(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:25 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:27 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:23 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:23 1.5 -(dword) div32u16u::return#2 return zp[4]:23 4.0 -(dword) div32u16u::return#3 return zp[4]:23 4.0 +(dword) div32u16u::return#0 return zp[4]:19 1.5 +(dword) div32u16u::return#2 return zp[4]:19 4.0 +(dword) div32u16u::return#3 return zp[4]:19 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -7766,30 +7774,30 @@ FINAL SYMBOL TABLE (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:8 2.75 -(word) divr16u::dividend#3 dividend zp[2]:8 5.0 -(word) divr16u::dividend#5 dividend zp[2]:8 2.0 +(word) divr16u::dividend#0 dividend zp[2]:5 2.75 +(word) divr16u::dividend#3 dividend zp[2]:5 5.0 +(word) divr16u::dividend#5 dividend zp[2]:5 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:27 16.5 -(word) divr16u::quotient#2 quotient zp[2]:27 11.0 -(word) divr16u::quotient#3 quotient zp[2]:27 2.75 +(word) divr16u::quotient#1 quotient zp[2]:23 16.5 +(word) divr16u::quotient#2 quotient zp[2]:23 11.0 +(word) divr16u::quotient#3 quotient zp[2]:23 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:6 8.25 -(word) divr16u::rem#1 rem zp[2]:6 22.0 -(word) divr16u::rem#10 rem zp[2]:6 4.0 -(word) divr16u::rem#11 rem zp[2]:6 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:6 22.0 -(word) divr16u::rem#4 rem zp[2]:6 4.0 -(word) divr16u::rem#5 rem zp[2]:6 24.0 -(word) divr16u::rem#6 rem zp[2]:6 11.0 +(word) divr16u::rem#0 rem zp[2]:3 8.25 +(word) divr16u::rem#1 rem zp[2]:3 22.0 +(word) divr16u::rem#10 rem zp[2]:3 4.0 +(word) divr16u::rem#11 rem zp[2]:3 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:3 22.0 +(word) divr16u::rem#4 rem zp[2]:3 4.0 +(word) divr16u::rem#5 rem zp[2]:3 24.0 +(word) divr16u::rem#6 rem zp[2]:3 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:27 5.285714285714286 -(word) divr16u::return#2 return zp[2]:27 4.0 -(word) divr16u::return#3 return zp[2]:27 4.0 +(word) divr16u::return#0 return zp[2]:23 5.285714285714286 +(word) divr16u::return#2 return zp[2]:23 4.0 +(word) divr16u::return#3 return zp[2]:23 4.0 (void()) main() (label) main::@1 (label) main::@2 @@ -7805,15 +7813,15 @@ FINAL SYMBOL TABLE (const signed word[$78]) main::sintab1 = { fill( $78, 0) } (const signed word[$78]) main::sintab2 = { fill( $78, 0) } (signed word*) main::st1 -(signed word*) main::st1#1 st1 zp[2]:6 5.5 -(signed word*) main::st1#2 st1 zp[2]:6 3.3000000000000003 +(signed word*) main::st1#1 st1 zp[2]:3 5.5 +(signed word*) main::st1#2 st1 zp[2]:3 3.3000000000000003 (signed word*) main::st2 -(signed word*) main::st2#1 st2 zp[2]:14 7.333333333333333 -(signed word*) main::st2#2 st2 zp[2]:14 3.0 +(signed word*) main::st2#1 st2 zp[2]:11 7.333333333333333 +(signed word*) main::st2#2 st2 zp[2]:11 3.0 (const string) main::str = (string) " " (const string) main::str1 = (string) " " (signed word) main::sw -(signed word) main::sw#0 sw zp[2]:29 6.6000000000000005 +(signed word) main::sw#0 sw zp[2]:25 6.6000000000000005 (const word) main::wavelength = (byte) $78 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 @@ -7822,8 +7830,8 @@ FINAL SYMBOL TABLE (byte) memset::c (const byte) memset::c#0 c = (byte) ' ' (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:6 22.0 -(byte*) memset::dst#2 dst zp[2]:6 14.666666666666666 +(byte*) memset::dst#1 dst zp[2]:3 22.0 +(byte*) memset::dst#2 dst zp[2]:3 14.666666666666666 (byte*) memset::end (const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 (word) memset::num @@ -7839,70 +7847,70 @@ FINAL SYMBOL TABLE (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:27 101.0 -(word) mul16u::a#1 a zp[2]:27 1.3333333333333333 -(word) mul16u::a#2 a zp[2]:27 67.66666666666666 +(word) mul16u::a#0 a zp[2]:23 101.0 +(word) mul16u::a#1 a zp[2]:23 1.3333333333333333 +(word) mul16u::a#2 a zp[2]:23 67.66666666666666 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:8 2.0 +(word) mul16u::b#0 b zp[2]:5 2.0 (dword) mul16u::mb -(dword) mul16u::mb#1 mb zp[4]:2 202.0 -(dword) mul16u::mb#2 mb zp[4]:2 43.57142857142858 +(dword) mul16u::mb#1 mb zp[4]:27 202.0 +(dword) mul16u::mb#2 mb zp[4]:27 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:17 202.0 -(dword) mul16u::res#2 res zp[4]:17 50.83333333333333 -(dword) mul16u::res#6 res zp[4]:17 101.0 +(dword) mul16u::res#1 res zp[4]:13 202.0 +(dword) mul16u::res#2 res zp[4]:13 50.83333333333333 +(dword) mul16u::res#6 res zp[4]:13 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:17 4.0 +(dword) mul16u::return#2 return zp[4]:13 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:17 4.0 -(dword~) mulu16_sel::$1 zp[4]:17 4.0 +(dword~) mulu16_sel::$0 zp[4]:13 4.0 +(dword~) mulu16_sel::$1 zp[4]:13 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return -(word) mulu16_sel::return#0 return zp[2]:6 4.0 -(word) mulu16_sel::return#1 return zp[2]:6 4.0 -(word) mulu16_sel::return#10 return zp[2]:6 4.0 -(word) mulu16_sel::return#11 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#14 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#15 return zp[2]:6 4.0 -(word) mulu16_sel::return#16 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#17 return_1 zp[2]:27 1.8333333333333335 -(word) mulu16_sel::return#18 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#19 return zp[2]:6 4.0 -(word) mulu16_sel::return#20 return_1 zp[2]:27 4.0 +(word) mulu16_sel::return#0 return zp[2]:3 4.0 +(word) mulu16_sel::return#1 return zp[2]:3 4.0 +(word) mulu16_sel::return#10 return zp[2]:3 4.0 +(word) mulu16_sel::return#11 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#14 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#15 return zp[2]:3 4.0 +(word) mulu16_sel::return#16 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#17 return_1 zp[2]:23 1.8333333333333335 +(word) mulu16_sel::return#18 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#19 return zp[2]:3 4.0 +(word) mulu16_sel::return#20 return_1 zp[2]:23 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#10 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#10 v1 zp[2]:6 22.0 -(word) mulu16_sel::v1#2 v1 zp[2]:6 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#6 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#7 v1 zp[2]:6 4.0 -(word) mulu16_sel::v1#8 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#9 v1 zp[2]:6 2.0 +(word) mulu16_sel::v1#0 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#10 v1 zp[2]:3 22.0 +(word) mulu16_sel::v1#2 v1 zp[2]:3 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#6 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#7 v1 zp[2]:3 4.0 +(word) mulu16_sel::v1#8 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#9 v1 zp[2]:3 2.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#10 v2 zp[2]:8 9.0 -(word) mulu16_sel::v2#3 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#6 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#8 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#9 v2 zp[2]:8 4.0 +(word) mulu16_sel::v2#0 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#10 v2 zp[2]:5 9.0 +(word) mulu16_sel::v2#3 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#6 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#8 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#9 v2 zp[2]:5 4.0 (void()) print_byte((byte) print_byte::b) (byte~) print_byte::$0 reg byte a 4.0 (byte~) print_byte::$2 reg byte a 4.0 (label) print_byte::@1 (label) print_byte::@return (byte) print_byte::b -(byte) print_byte::b#0 b zp[1]:16 4.0 -(byte) print_byte::b#1 b zp[1]:16 4.0 -(byte) print_byte::b#2 b zp[1]:16 2.0 +(byte) print_byte::b#0 b zp[1]:2 4.0 +(byte) print_byte::b#1 b zp[1]:2 4.0 +(byte) print_byte::b#2 b zp[1]:2 2.0 (void()) print_char((byte) print_char::ch) (label) print_char::@return (byte) print_char::ch @@ -7928,9 +7936,9 @@ FINAL SYMBOL TABLE (label) print_str::@2 (label) print_str::@return (byte*) print_str::str -(byte*) print_str::str#0 str zp[2]:21 202.0 -(byte*) print_str::str#3 str zp[2]:21 101.5 -(byte*) print_str::str#5 str zp[2]:21 2.0 +(byte*) print_str::str#0 str zp[2]:17 202.0 +(byte*) print_str::str#3 str zp[2]:17 101.5 +(byte*) print_str::str#5 str zp[2]:17 2.0 (void()) print_sword((signed word) print_sword::w) (label) print_sword::@1 (label) print_sword::@2 @@ -7938,18 +7946,18 @@ FINAL SYMBOL TABLE (label) print_sword::@4 (label) print_sword::@return (signed word) print_sword::w -(signed word) print_sword::w#0 w zp[2]:29 4.0 -(signed word) print_sword::w#1 w zp[2]:29 2.8333333333333335 -(signed word) print_sword::w#4 w zp[2]:29 4.0 +(signed word) print_sword::w#0 w zp[2]:25 4.0 +(signed word) print_sword::w#1 w zp[2]:25 2.8333333333333335 +(signed word) print_sword::w#4 w zp[2]:25 4.0 (void()) print_word((word) print_word::w) (label) print_word::@1 (label) print_word::@return (word) print_word::w -(word) print_word::w#0 w zp[2]:29 2.0 +(word) print_word::w#0 w zp[2]:25 2.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:6 0.8 +(word) rem16u#1 rem16u zp[2]:3 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:17 4.0 +(dword~) sin16s::$4 zp[4]:27 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -7964,55 +7972,55 @@ FINAL SYMBOL TABLE (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:16 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:21 22.0 -(signed word) sin16s::return#1 return zp[2]:21 5.0 -(signed word~) sin16s::return#5 return zp[2]:21 4.0 +(signed word) sin16s::return#0 return zp[2]:17 22.0 +(signed word) sin16s::return#1 return zp[2]:17 5.0 +(signed word~) sin16s::return#5 return zp[2]:17 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:21 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:17 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:21 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:21 1.0 +(word) sin16s::usinx#0 usinx zp[2]:17 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:17 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:17 8.5 -(dword) sin16s::x#1 x zp[4]:17 4.0 -(dword) sin16s::x#2 x zp[4]:17 4.0 -(dword) sin16s::x#4 x zp[4]:17 5.0 -(dword) sin16s::x#6 x zp[4]:17 6.0 +(dword) sin16s::x#0 x zp[4]:13 8.5 +(dword) sin16s::x#1 x zp[4]:13 4.0 +(dword) sin16s::x#2 x zp[4]:13 4.0 +(dword) sin16s::x#4 x zp[4]:13 5.0 +(dword) sin16s::x#6 x zp[4]:13 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:31 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:6 4.0 +(word) sin16s::x2#0 x2 zp[2]:3 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:6 1.0 +(word) sin16s::x3#0 x3 zp[2]:3 1.0 (word) sin16s::x3_6 -(word) sin16s::x3_6#0 x3_6 zp[2]:27 4.0 +(word) sin16s::x3_6#0 x3_6 zp[2]:23 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:6 4.0 +(word) sin16s::x4#0 x4 zp[2]:3 4.0 (word) sin16s::x5 -(word) sin16s::x5#0 x5 zp[2]:27 4.0 +(word) sin16s::x5#0 x5 zp[2]:23 4.0 (word) sin16s::x5_128 -(word) sin16s::x5_128#0 x5_128 zp[2]:27 4.0 +(word) sin16s::x5_128#0 x5_128 zp[2]:23 4.0 (void()) sin16s_gen((signed word*) sin16s_gen::sintab , (word) sin16s_gen::wavelength) -(signed word~) sin16s_gen::$2 zp[2]:21 22.0 +(signed word~) sin16s_gen::$2 zp[2]:17 22.0 (label) sin16s_gen::@1 (label) sin16s_gen::@2 (label) sin16s_gen::@3 (label) sin16s_gen::@4 (label) sin16s_gen::@return (word) sin16s_gen::i -(word) sin16s_gen::i#1 i zp[2]:29 22.0 -(word) sin16s_gen::i#2 i zp[2]:29 3.666666666666667 +(word) sin16s_gen::i#1 i zp[2]:25 22.0 +(word) sin16s_gen::i#2 i zp[2]:25 3.666666666666667 (signed word*) sin16s_gen::sintab -(signed word*) sin16s_gen::sintab#0 sintab zp[2]:14 7.333333333333333 -(signed word*) sin16s_gen::sintab#2 sintab zp[2]:14 4.714285714285714 +(signed word*) sin16s_gen::sintab#0 sintab zp[2]:11 7.333333333333333 +(signed word*) sin16s_gen::sintab#2 sintab zp[2]:11 4.714285714285714 (dword) sin16s_gen::step -(dword) sin16s_gen::step#0 step zp[4]:23 1.1818181818181819 +(dword) sin16s_gen::step#0 step zp[4]:19 1.1818181818181819 (word) sin16s_gen::wavelength (dword) sin16s_gen::x -(dword) sin16s_gen::x#1 x zp[4]:10 11.0 -(dword) sin16s_gen::x#2 x zp[4]:10 4.125 +(dword) sin16s_gen::x#1 x zp[4]:7 11.0 +(dword) sin16s_gen::x#2 x zp[4]:7 4.125 (void()) sin16s_genb((signed word*) sin16s_genb::sintab , (word) sin16s_genb::wavelength) (signed word~) sin16s_genb::$3 zp[2]:31 22.0 (label) sin16s_genb::@1 @@ -8021,17 +8029,17 @@ FINAL SYMBOL TABLE (label) sin16s_genb::@4 (label) sin16s_genb::@return (word) sin16s_genb::i -(word) sin16s_genb::i#1 i zp[2]:14 22.0 -(word) sin16s_genb::i#2 i zp[2]:14 3.666666666666667 +(word) sin16s_genb::i#1 i zp[2]:11 22.0 +(word) sin16s_genb::i#2 i zp[2]:11 3.666666666666667 (signed word*) sin16s_genb::sintab -(signed word*) sin16s_genb::sintab#0 sintab zp[2]:21 7.333333333333333 -(signed word*) sin16s_genb::sintab#2 sintab zp[2]:21 4.714285714285714 +(signed word*) sin16s_genb::sintab#0 sintab zp[2]:17 7.333333333333333 +(signed word*) sin16s_genb::sintab#2 sintab zp[2]:17 4.714285714285714 (dword) sin16s_genb::step -(dword) sin16s_genb::step#0 step zp[4]:23 1.1818181818181819 +(dword) sin16s_genb::step#0 step zp[4]:19 1.1818181818181819 (word) sin16s_genb::wavelength (dword) sin16s_genb::x -(dword) sin16s_genb::x#1 x zp[4]:10 11.0 -(dword) sin16s_genb::x#2 x zp[4]:10 4.125 +(dword) sin16s_genb::x#1 x zp[4]:7 11.0 +(dword) sin16s_genb::x#2 x zp[4]:7 4.125 (signed word()) sin16sb((word) sin16sb::x) (label) sin16sb::@1 (label) sin16sb::@10 @@ -8058,52 +8066,53 @@ FINAL SYMBOL TABLE (word) sin16sb::usinx#0 usinx zp[2]:31 0.3333333333333333 (word) sin16sb::usinx#1 usinx zp[2]:31 1.0 (word) sin16sb::x -(word) sin16sb::x#0 x zp[2]:29 8.5 -(word) sin16sb::x#1 x zp[2]:29 4.0 -(word) sin16sb::x#2 x zp[2]:29 4.0 -(word) sin16sb::x#4 x zp[2]:29 5.0 -(word) sin16sb::x#6 x zp[2]:29 6.0 +(word) sin16sb::x#0 x zp[2]:25 8.5 +(word) sin16sb::x#1 x zp[2]:25 4.0 +(word) sin16sb::x#2 x zp[2]:25 4.0 +(word) sin16sb::x#4 x zp[2]:25 5.0 +(word) sin16sb::x#6 x zp[2]:25 6.0 (word) sin16sb::x1 -(word) sin16sb::x1#0 x1 zp[2]:29 0.6363636363636365 +(word) sin16sb::x1#0 x1 zp[2]:25 0.6363636363636365 (word) sin16sb::x2 -(word) sin16sb::x2#0 x2 zp[2]:6 4.0 +(word) sin16sb::x2#0 x2 zp[2]:3 4.0 (word) sin16sb::x3 -(word) sin16sb::x3#0 x3 zp[2]:6 1.0 +(word) sin16sb::x3#0 x3 zp[2]:3 1.0 (word) sin16sb::x3_6 -(word) sin16sb::x3_6#0 x3_6 zp[2]:27 4.0 +(word) sin16sb::x3_6#0 x3_6 zp[2]:23 4.0 (word) sin16sb::x4 -(word) sin16sb::x4#0 x4 zp[2]:6 4.0 +(word) sin16sb::x4#0 x4 zp[2]:3 4.0 (word) sin16sb::x5 -(word) sin16sb::x5#0 x5 zp[2]:27 4.0 +(word) sin16sb::x5#0 x5 zp[2]:23 4.0 (word) sin16sb::x5_128 -(word) sin16sb::x5_128#0 x5_128 zp[2]:27 4.0 +(word) sin16sb::x5_128#0 x5_128 zp[2]:23 4.0 reg byte x [ main::i#2 main::i#1 ] reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] +zp[1]:2 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte y [ sin16sb::isUpper#2 ] reg byte x [ mulu16_sel::select#10 ] -zp[4]:2 [ mul16u::mb#2 mul16u::mb#1 ] -zp[2]:6 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 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 sin16s::x3#0 sin16sb::x2#0 sin16sb::x4#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#19 mulu16_sel::return#10 mulu16_sel::return#0 mulu16_sel::return#1 mulu16_sel::return#15 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] -zp[2]:8 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 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 mul16u::b#0 ] +zp[2]:3 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 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 sin16s::x3#0 sin16sb::x2#0 sin16sb::x4#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#19 mulu16_sel::return#10 mulu16_sel::return#0 mulu16_sel::return#1 mulu16_sel::return#15 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] +zp[2]:5 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 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 mul16u::b#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[4]:10 [ sin16s_gen::x#2 sin16s_gen::x#1 sin16s_genb::x#2 sin16s_genb::x#1 ] -zp[2]:14 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 sin16s_genb::i#2 sin16s_genb::i#1 main::st2#2 main::st2#1 ] -zp[1]:16 [ sin16s::isUpper#2 print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -zp[4]:17 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] -zp[2]:21 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 sin16s_genb::sintab#2 sin16s_genb::sintab#0 print_str::str#3 print_str::str#5 print_str::str#0 ] +zp[4]:7 [ sin16s_gen::x#2 sin16s_gen::x#1 sin16s_genb::x#2 sin16s_genb::x#1 ] +zp[2]:11 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 sin16s_genb::i#2 sin16s_genb::i#1 main::st2#2 main::st2#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:13 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] +zp[2]:17 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 sin16s_genb::sintab#2 sin16s_genb::sintab#0 print_str::str#3 print_str::str#5 print_str::str#0 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -zp[4]:23 [ div32u16u::return#3 sin16s_genb::step#0 div32u16u::return#0 div32u16u::return#2 sin16s_gen::step#0 ] -zp[2]:27 [ mulu16_sel::return#18 mulu16_sel::return#17 mulu16_sel::return#20 sin16sb::x3_6#0 mulu16_sel::return#11 sin16sb::x5#0 mulu16_sel::return#14 sin16s::x3_6#0 mulu16_sel::return#16 sin16s::x5#0 sin16sb::x5_128#0 sin16s::x5_128#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] +zp[4]:19 [ div32u16u::return#3 sin16s_genb::step#0 div32u16u::return#0 div32u16u::return#2 sin16s_gen::step#0 ] +zp[2]:23 [ mulu16_sel::return#18 mulu16_sel::return#17 mulu16_sel::return#20 sin16sb::x3_6#0 mulu16_sel::return#11 sin16sb::x5#0 mulu16_sel::return#14 sin16s::x3_6#0 mulu16_sel::return#16 sin16s::x5#0 sin16sb::x5_128#0 sin16s::x5_128#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] reg byte a [ mul16u::$1 ] -zp[2]:29 [ div32u16u::quotient_hi#0 sin16s_gen::i#2 sin16s_gen::i#1 sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 sin16sb::x1#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] +zp[2]:25 [ div32u16u::quotient_hi#0 sin16s_gen::i#2 sin16s_gen::i#1 sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 sin16sb::x1#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] +zp[4]:27 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] zp[2]:31 [ sin16s::x1#0 sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 sin16sb::usinx#1 sin16sb::return#0 sin16s_genb::$3 sin16sb::usinx#0 print_char_cursor#35 print_char_cursor#54 print_char_cursor#51 print_char_cursor#52 print_char_cursor#2 print_char_cursor#13 print_char_cursor#1 ] FINAL ASSEMBLER -Score: 25005 +Score: 25042 // File Comments // Generates a 16-bit signed sinus @@ -8124,7 +8133,7 @@ Score: 25005 // PI/2 in u[4.12] format .const PI_HALF_u4f12 = $1922 .label print_line_cursor = $400 - .label rem16u = 6 + .label rem16u = 3 .label print_char_cursor = $1f // @begin // [1] phi from @begin to @1 [phi:@begin->@1] @@ -8136,9 +8145,9 @@ Score: 25005 // main main: { .label wavelength = $78 - .label sw = $1d - .label st1 = 6 - .label st2 = $e + .label sw = $19 + .label st1 = 3 + .label st2 = $b // sin16s_gen(sintab1, wavelength) // [5] call sin16s_gen // [169] phi from main to sin16s_gen [phi:main->sin16s_gen] @@ -8264,9 +8273,9 @@ main: { } // print_str // Print a zero-terminated string -// print_str(byte* zeropage($15) str) +// print_str(byte* zeropage($11) str) print_str: { - .label str = $15 + .label str = $11 // [26] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1] // [26] phi (byte*) print_char_cursor#2 = (byte*) print_char_cursor#54 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy // [26] phi (byte*) print_str::str#3 = (byte*) print_str::str#5 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy @@ -8304,9 +8313,9 @@ print_str: { } // print_sword // Print a signed word as HEX -// print_sword(signed word zeropage($1d) w) +// print_sword(signed word zeropage($19) w) print_sword: { - .label w = $1d + .label w = $19 // if(w<0) // [32] if((signed word) print_sword::w#1<(signed byte) 0) goto print_sword::@1 -- vwsz1_lt_0_then_la1 lda.z w+1 @@ -8375,9 +8384,9 @@ print_char: { } // print_word // Print a word as HEX -// print_word(word zeropage($1d) w) +// print_word(word zeropage($19) w) print_word: { - .label w = $1d + .label w = $19 // print_byte(>w) // [46] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuz1=_hi_vwuz2 lda.z w+1 @@ -8402,9 +8411,9 @@ print_word: { } // print_byte // Print a byte as HEX -// print_byte(byte zeropage($10) b) +// print_byte(byte zeropage(2) b) print_byte: { - .label b = $10 + .label b = 2 // b>>4 // [52] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4 -- vbuaa=vbuz1_ror_4 lda.z b @@ -8459,7 +8468,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = 6 + .label dst = 3 // [63] phi from memset to memset::@1 [phi:memset->memset::@1] // [63] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 lda #div32u16u] @@ -8610,18 +8619,18 @@ sin16s_genb: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16sb(word zeropage($1d) x) +// sin16sb(word zeropage($19) x) sin16sb: { - .label x = $1d + .label x = $19 .label return = $1f - .label x1 = $1d - .label x2 = 6 - .label x3 = 6 - .label x3_6 = $1b + .label x1 = $19 + .label x2 = 3 + .label x3 = 3 + .label x3_6 = $17 .label usinx = $1f - .label x4 = 6 - .label x5 = $1b - .label x5_128 = $1b + .label x4 = 3 + .label x5 = $17 + .label x5_128 = $17 .label sinx = $1f // if(x >= PI_u4f12 ) // [83] if((word) sin16sb::x#0<(const word) PI_u4f12) goto sin16sb::@1 -- vwuz1_lt_vwuc1_then_la1 @@ -8853,14 +8862,14 @@ sin16sb: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage(6) v1, word zeropage(8) v2, byte register(X) select) +// mulu16_sel(word zeropage(3) v1, word zeropage(5) v2, byte register(X) select) mulu16_sel: { - .label __0 = $11 - .label __1 = $11 - .label v1 = 6 - .label v2 = 8 - .label return = 6 - .label return_1 = $1b + .label __0 = $d + .label __1 = $d + .label v1 = 3 + .label v2 = 5 + .label return = 3 + .label return_1 = $17 // mul16u(v1, v2) // [123] (word) mul16u::a#1 ← (word) mulu16_sel::v1#10 -- vwuz1=vwuz2 lda.z v1 @@ -8900,13 +8909,13 @@ mulu16_sel: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($1b) a, word zeropage(8) b) +// mul16u(word zeropage($17) a, word zeropage(5) b) mul16u: { - .label a = $1b - .label mb = 2 - .label res = $11 - .label b = 8 - .label return = $11 + .label a = $17 + .label mb = $1b + .label res = $d + .label b = 5 + .label return = $d // [132] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] // [132] phi (dword) mul16u::mb#2 = (word) mul16u::b#0 [phi:mul16u->mul16u::@1#0] -- vduz1=vwuz2 lda.z b @@ -8984,9 +8993,9 @@ mul16u: { // Divide unsigned 32-bit dword dividend with a 16-bit word divisor // The 16-bit word remainder can be found in rem16u after the division div32u16u: { - .label quotient_hi = $1d - .label quotient_lo = $1b - .label return = $17 + .label quotient_hi = $19 + .label quotient_lo = $17 + .label return = $13 // divr16u(>dividend, divisor, 0) // [142] call divr16u // [151] phi from div32u16u to divr16u [phi:div32u16u->divr16u] @@ -9045,12 +9054,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage(8) dividend, word zeropage(6) rem) +// divr16u(word zeropage(5) dividend, word zeropage(3) rem) divr16u: { - .label rem = 6 - .label dividend = 8 - .label quotient = $1b - .label return = $1b + .label rem = 3 + .label dividend = 5 + .label quotient = $17 + .label return = $17 // [152] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] // [152] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 ldx #0 @@ -9148,13 +9157,13 @@ divr16u: { // Generate signed (large) word sinus table - on the full -$7fff - $7fff range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen(signed word* zeropage($e) sintab) +// sin16s_gen(signed word* zeropage($b) sintab) sin16s_gen: { - .label __2 = $15 - .label step = $17 - .label sintab = $e - .label x = $a - .label i = $1d + .label __2 = $11 + .label step = $13 + .label sintab = $b + .label x = 7 + .label i = $19 // div32u16u(PI2_u4f28, wavelength) // [170] call div32u16u // [141] phi from sin16s_gen to div32u16u [phi:sin16s_gen->div32u16u] @@ -9261,21 +9270,20 @@ sin16s_gen: { // Calculate signed word sinus sin(x) // x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28 // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff -// sin16s(dword zeropage($11) x) +// sin16s(dword zeropage($d) x) sin16s: { - .label __4 = $11 - .label x = $11 - .label return = $15 + .label __4 = $1b + .label x = $d + .label return = $11 .label x1 = $1f - .label x2 = 6 - .label x3 = 6 - .label x3_6 = $1b - .label usinx = $15 - .label x4 = 6 - .label x5 = $1b - .label x5_128 = $1b - .label sinx = $15 - .label isUpper = $10 + .label x2 = 3 + .label x3 = 3 + .label x3_6 = $17 + .label usinx = $11 + .label x4 = 3 + .label x5 = $17 + .label x5_128 = $17 + .label sinx = $11 // if(x >= PI_u4f28 ) // [184] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 @@ -9311,16 +9319,14 @@ sin16s: { sbc #>PI_u4f28>>$10 sta.z x+3 // [186] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] - // [186] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [186] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [186] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [186] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] b1: - // [186] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [186] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [186] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy // sin16s::@1 __b1: @@ -9363,15 +9369,27 @@ sin16s: { // sin16s::@2 __b2: // x<<3 - // [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [190] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // x1 = >x<<3 // [191] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 @@ -9517,9 +9535,8 @@ sin16s: { adc.z x5_128+1 sta.z usinx+1 // if(isUpper!=0) - // [219] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [219] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b3 // sin16s::@6 // sinx = -(signed word)usinx diff --git a/src/test/ref/sinusgen16b.sym b/src/test/ref/sinusgen16b.sym index cd6a208ba..0937e58d3 100644 --- a/src/test/ref/sinusgen16b.sym +++ b/src/test/ref/sinusgen16b.sym @@ -19,13 +19,13 @@ (word) div32u16u::divisor (dword) div32u16u::quotient (word) div32u16u::quotient_hi -(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:29 0.8 +(word) div32u16u::quotient_hi#0 quotient_hi zp[2]:25 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:27 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:23 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:23 1.5 -(dword) div32u16u::return#2 return zp[4]:23 4.0 -(dword) div32u16u::return#3 return zp[4]:23 4.0 +(dword) div32u16u::return#0 return zp[4]:19 1.5 +(dword) div32u16u::return#2 return zp[4]:19 4.0 +(dword) div32u16u::return#3 return zp[4]:19 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -37,30 +37,30 @@ (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:8 2.75 -(word) divr16u::dividend#3 dividend zp[2]:8 5.0 -(word) divr16u::dividend#5 dividend zp[2]:8 2.0 +(word) divr16u::dividend#0 dividend zp[2]:5 2.75 +(word) divr16u::dividend#3 dividend zp[2]:5 5.0 +(word) divr16u::dividend#5 dividend zp[2]:5 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:27 16.5 -(word) divr16u::quotient#2 quotient zp[2]:27 11.0 -(word) divr16u::quotient#3 quotient zp[2]:27 2.75 +(word) divr16u::quotient#1 quotient zp[2]:23 16.5 +(word) divr16u::quotient#2 quotient zp[2]:23 11.0 +(word) divr16u::quotient#3 quotient zp[2]:23 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:6 8.25 -(word) divr16u::rem#1 rem zp[2]:6 22.0 -(word) divr16u::rem#10 rem zp[2]:6 4.0 -(word) divr16u::rem#11 rem zp[2]:6 11.666666666666666 -(word) divr16u::rem#2 rem zp[2]:6 22.0 -(word) divr16u::rem#4 rem zp[2]:6 4.0 -(word) divr16u::rem#5 rem zp[2]:6 24.0 -(word) divr16u::rem#6 rem zp[2]:6 11.0 +(word) divr16u::rem#0 rem zp[2]:3 8.25 +(word) divr16u::rem#1 rem zp[2]:3 22.0 +(word) divr16u::rem#10 rem zp[2]:3 4.0 +(word) divr16u::rem#11 rem zp[2]:3 11.666666666666666 +(word) divr16u::rem#2 rem zp[2]:3 22.0 +(word) divr16u::rem#4 rem zp[2]:3 4.0 +(word) divr16u::rem#5 rem zp[2]:3 24.0 +(word) divr16u::rem#6 rem zp[2]:3 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:27 5.285714285714286 -(word) divr16u::return#2 return zp[2]:27 4.0 -(word) divr16u::return#3 return zp[2]:27 4.0 +(word) divr16u::return#0 return zp[2]:23 5.285714285714286 +(word) divr16u::return#2 return zp[2]:23 4.0 +(word) divr16u::return#3 return zp[2]:23 4.0 (void()) main() (label) main::@1 (label) main::@2 @@ -76,15 +76,15 @@ (const signed word[$78]) main::sintab1 = { fill( $78, 0) } (const signed word[$78]) main::sintab2 = { fill( $78, 0) } (signed word*) main::st1 -(signed word*) main::st1#1 st1 zp[2]:6 5.5 -(signed word*) main::st1#2 st1 zp[2]:6 3.3000000000000003 +(signed word*) main::st1#1 st1 zp[2]:3 5.5 +(signed word*) main::st1#2 st1 zp[2]:3 3.3000000000000003 (signed word*) main::st2 -(signed word*) main::st2#1 st2 zp[2]:14 7.333333333333333 -(signed word*) main::st2#2 st2 zp[2]:14 3.0 +(signed word*) main::st2#1 st2 zp[2]:11 7.333333333333333 +(signed word*) main::st2#2 st2 zp[2]:11 3.0 (const string) main::str = (string) " " (const string) main::str1 = (string) " " (signed word) main::sw -(signed word) main::sw#0 sw zp[2]:29 6.6000000000000005 +(signed word) main::sw#0 sw zp[2]:25 6.6000000000000005 (const word) main::wavelength = (byte) $78 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 @@ -93,8 +93,8 @@ (byte) memset::c (const byte) memset::c#0 c = (byte) ' ' (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:6 22.0 -(byte*) memset::dst#2 dst zp[2]:6 14.666666666666666 +(byte*) memset::dst#1 dst zp[2]:3 22.0 +(byte*) memset::dst#2 dst zp[2]:3 14.666666666666666 (byte*) memset::end (const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 (word) memset::num @@ -110,70 +110,70 @@ (label) mul16u::@4 (label) mul16u::@return (word) mul16u::a -(word) mul16u::a#0 a zp[2]:27 101.0 -(word) mul16u::a#1 a zp[2]:27 1.3333333333333333 -(word) mul16u::a#2 a zp[2]:27 67.66666666666666 +(word) mul16u::a#0 a zp[2]:23 101.0 +(word) mul16u::a#1 a zp[2]:23 1.3333333333333333 +(word) mul16u::a#2 a zp[2]:23 67.66666666666666 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:8 2.0 +(word) mul16u::b#0 b zp[2]:5 2.0 (dword) mul16u::mb -(dword) mul16u::mb#1 mb zp[4]:2 202.0 -(dword) mul16u::mb#2 mb zp[4]:2 43.57142857142858 +(dword) mul16u::mb#1 mb zp[4]:27 202.0 +(dword) mul16u::mb#2 mb zp[4]:27 43.57142857142858 (dword) mul16u::res -(dword) mul16u::res#1 res zp[4]:17 202.0 -(dword) mul16u::res#2 res zp[4]:17 50.83333333333333 -(dword) mul16u::res#6 res zp[4]:17 101.0 +(dword) mul16u::res#1 res zp[4]:13 202.0 +(dword) mul16u::res#2 res zp[4]:13 50.83333333333333 +(dword) mul16u::res#6 res zp[4]:13 101.0 (dword) mul16u::return -(dword) mul16u::return#2 return zp[4]:17 4.0 +(dword) mul16u::return#2 return zp[4]:13 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) -(dword~) mulu16_sel::$0 zp[4]:17 4.0 -(dword~) mulu16_sel::$1 zp[4]:17 4.0 +(dword~) mulu16_sel::$0 zp[4]:13 4.0 +(dword~) mulu16_sel::$1 zp[4]:13 4.0 (label) mulu16_sel::@1 (label) mulu16_sel::@return (word) mulu16_sel::return -(word) mulu16_sel::return#0 return zp[2]:6 4.0 -(word) mulu16_sel::return#1 return zp[2]:6 4.0 -(word) mulu16_sel::return#10 return zp[2]:6 4.0 -(word) mulu16_sel::return#11 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#14 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#15 return zp[2]:6 4.0 -(word) mulu16_sel::return#16 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#17 return_1 zp[2]:27 1.8333333333333335 -(word) mulu16_sel::return#18 return_1 zp[2]:27 4.0 -(word) mulu16_sel::return#19 return zp[2]:6 4.0 -(word) mulu16_sel::return#20 return_1 zp[2]:27 4.0 +(word) mulu16_sel::return#0 return zp[2]:3 4.0 +(word) mulu16_sel::return#1 return zp[2]:3 4.0 +(word) mulu16_sel::return#10 return zp[2]:3 4.0 +(word) mulu16_sel::return#11 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#14 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#15 return zp[2]:3 4.0 +(word) mulu16_sel::return#16 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#17 return_1 zp[2]:23 1.8333333333333335 +(word) mulu16_sel::return#18 return_1 zp[2]:23 4.0 +(word) mulu16_sel::return#19 return zp[2]:3 4.0 +(word) mulu16_sel::return#20 return_1 zp[2]:23 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#10 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#10 v1 zp[2]:6 22.0 -(word) mulu16_sel::v1#2 v1 zp[2]:6 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#6 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#7 v1 zp[2]:6 4.0 -(word) mulu16_sel::v1#8 v1 zp[2]:6 2.0 -(word) mulu16_sel::v1#9 v1 zp[2]:6 2.0 +(word) mulu16_sel::v1#0 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#10 v1 zp[2]:3 22.0 +(word) mulu16_sel::v1#2 v1 zp[2]:3 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#6 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#7 v1 zp[2]:3 4.0 +(word) mulu16_sel::v1#8 v1 zp[2]:3 2.0 +(word) mulu16_sel::v1#9 v1 zp[2]:3 2.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#10 v2 zp[2]:8 9.0 -(word) mulu16_sel::v2#3 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#6 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#8 v2 zp[2]:8 4.0 -(word) mulu16_sel::v2#9 v2 zp[2]:8 4.0 +(word) mulu16_sel::v2#0 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#10 v2 zp[2]:5 9.0 +(word) mulu16_sel::v2#3 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#6 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#8 v2 zp[2]:5 4.0 +(word) mulu16_sel::v2#9 v2 zp[2]:5 4.0 (void()) print_byte((byte) print_byte::b) (byte~) print_byte::$0 reg byte a 4.0 (byte~) print_byte::$2 reg byte a 4.0 (label) print_byte::@1 (label) print_byte::@return (byte) print_byte::b -(byte) print_byte::b#0 b zp[1]:16 4.0 -(byte) print_byte::b#1 b zp[1]:16 4.0 -(byte) print_byte::b#2 b zp[1]:16 2.0 +(byte) print_byte::b#0 b zp[1]:2 4.0 +(byte) print_byte::b#1 b zp[1]:2 4.0 +(byte) print_byte::b#2 b zp[1]:2 2.0 (void()) print_char((byte) print_char::ch) (label) print_char::@return (byte) print_char::ch @@ -199,9 +199,9 @@ (label) print_str::@2 (label) print_str::@return (byte*) print_str::str -(byte*) print_str::str#0 str zp[2]:21 202.0 -(byte*) print_str::str#3 str zp[2]:21 101.5 -(byte*) print_str::str#5 str zp[2]:21 2.0 +(byte*) print_str::str#0 str zp[2]:17 202.0 +(byte*) print_str::str#3 str zp[2]:17 101.5 +(byte*) print_str::str#5 str zp[2]:17 2.0 (void()) print_sword((signed word) print_sword::w) (label) print_sword::@1 (label) print_sword::@2 @@ -209,18 +209,18 @@ (label) print_sword::@4 (label) print_sword::@return (signed word) print_sword::w -(signed word) print_sword::w#0 w zp[2]:29 4.0 -(signed word) print_sword::w#1 w zp[2]:29 2.8333333333333335 -(signed word) print_sword::w#4 w zp[2]:29 4.0 +(signed word) print_sword::w#0 w zp[2]:25 4.0 +(signed word) print_sword::w#1 w zp[2]:25 2.8333333333333335 +(signed word) print_sword::w#4 w zp[2]:25 4.0 (void()) print_word((word) print_word::w) (label) print_word::@1 (label) print_word::@return (word) print_word::w -(word) print_word::w#0 w zp[2]:29 2.0 +(word) print_word::w#0 w zp[2]:25 2.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:6 0.8 +(word) rem16u#1 rem16u zp[2]:3 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:17 4.0 +(dword~) sin16s::$4 zp[4]:27 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -235,55 +235,55 @@ (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:16 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:21 22.0 -(signed word) sin16s::return#1 return zp[2]:21 5.0 -(signed word~) sin16s::return#5 return zp[2]:21 4.0 +(signed word) sin16s::return#0 return zp[2]:17 22.0 +(signed word) sin16s::return#1 return zp[2]:17 5.0 +(signed word~) sin16s::return#5 return zp[2]:17 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:21 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:17 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:21 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:21 1.0 +(word) sin16s::usinx#0 usinx zp[2]:17 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:17 1.0 (dword) sin16s::x -(dword) sin16s::x#0 x zp[4]:17 8.5 -(dword) sin16s::x#1 x zp[4]:17 4.0 -(dword) sin16s::x#2 x zp[4]:17 4.0 -(dword) sin16s::x#4 x zp[4]:17 5.0 -(dword) sin16s::x#6 x zp[4]:17 6.0 +(dword) sin16s::x#0 x zp[4]:13 8.5 +(dword) sin16s::x#1 x zp[4]:13 4.0 +(dword) sin16s::x#2 x zp[4]:13 4.0 +(dword) sin16s::x#4 x zp[4]:13 5.0 +(dword) sin16s::x#6 x zp[4]:13 6.0 (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:31 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:6 4.0 +(word) sin16s::x2#0 x2 zp[2]:3 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:6 1.0 +(word) sin16s::x3#0 x3 zp[2]:3 1.0 (word) sin16s::x3_6 -(word) sin16s::x3_6#0 x3_6 zp[2]:27 4.0 +(word) sin16s::x3_6#0 x3_6 zp[2]:23 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:6 4.0 +(word) sin16s::x4#0 x4 zp[2]:3 4.0 (word) sin16s::x5 -(word) sin16s::x5#0 x5 zp[2]:27 4.0 +(word) sin16s::x5#0 x5 zp[2]:23 4.0 (word) sin16s::x5_128 -(word) sin16s::x5_128#0 x5_128 zp[2]:27 4.0 +(word) sin16s::x5_128#0 x5_128 zp[2]:23 4.0 (void()) sin16s_gen((signed word*) sin16s_gen::sintab , (word) sin16s_gen::wavelength) -(signed word~) sin16s_gen::$2 zp[2]:21 22.0 +(signed word~) sin16s_gen::$2 zp[2]:17 22.0 (label) sin16s_gen::@1 (label) sin16s_gen::@2 (label) sin16s_gen::@3 (label) sin16s_gen::@4 (label) sin16s_gen::@return (word) sin16s_gen::i -(word) sin16s_gen::i#1 i zp[2]:29 22.0 -(word) sin16s_gen::i#2 i zp[2]:29 3.666666666666667 +(word) sin16s_gen::i#1 i zp[2]:25 22.0 +(word) sin16s_gen::i#2 i zp[2]:25 3.666666666666667 (signed word*) sin16s_gen::sintab -(signed word*) sin16s_gen::sintab#0 sintab zp[2]:14 7.333333333333333 -(signed word*) sin16s_gen::sintab#2 sintab zp[2]:14 4.714285714285714 +(signed word*) sin16s_gen::sintab#0 sintab zp[2]:11 7.333333333333333 +(signed word*) sin16s_gen::sintab#2 sintab zp[2]:11 4.714285714285714 (dword) sin16s_gen::step -(dword) sin16s_gen::step#0 step zp[4]:23 1.1818181818181819 +(dword) sin16s_gen::step#0 step zp[4]:19 1.1818181818181819 (word) sin16s_gen::wavelength (dword) sin16s_gen::x -(dword) sin16s_gen::x#1 x zp[4]:10 11.0 -(dword) sin16s_gen::x#2 x zp[4]:10 4.125 +(dword) sin16s_gen::x#1 x zp[4]:7 11.0 +(dword) sin16s_gen::x#2 x zp[4]:7 4.125 (void()) sin16s_genb((signed word*) sin16s_genb::sintab , (word) sin16s_genb::wavelength) (signed word~) sin16s_genb::$3 zp[2]:31 22.0 (label) sin16s_genb::@1 @@ -292,17 +292,17 @@ (label) sin16s_genb::@4 (label) sin16s_genb::@return (word) sin16s_genb::i -(word) sin16s_genb::i#1 i zp[2]:14 22.0 -(word) sin16s_genb::i#2 i zp[2]:14 3.666666666666667 +(word) sin16s_genb::i#1 i zp[2]:11 22.0 +(word) sin16s_genb::i#2 i zp[2]:11 3.666666666666667 (signed word*) sin16s_genb::sintab -(signed word*) sin16s_genb::sintab#0 sintab zp[2]:21 7.333333333333333 -(signed word*) sin16s_genb::sintab#2 sintab zp[2]:21 4.714285714285714 +(signed word*) sin16s_genb::sintab#0 sintab zp[2]:17 7.333333333333333 +(signed word*) sin16s_genb::sintab#2 sintab zp[2]:17 4.714285714285714 (dword) sin16s_genb::step -(dword) sin16s_genb::step#0 step zp[4]:23 1.1818181818181819 +(dword) sin16s_genb::step#0 step zp[4]:19 1.1818181818181819 (word) sin16s_genb::wavelength (dword) sin16s_genb::x -(dword) sin16s_genb::x#1 x zp[4]:10 11.0 -(dword) sin16s_genb::x#2 x zp[4]:10 4.125 +(dword) sin16s_genb::x#1 x zp[4]:7 11.0 +(dword) sin16s_genb::x#2 x zp[4]:7 4.125 (signed word()) sin16sb((word) sin16sb::x) (label) sin16sb::@1 (label) sin16sb::@10 @@ -329,45 +329,46 @@ (word) sin16sb::usinx#0 usinx zp[2]:31 0.3333333333333333 (word) sin16sb::usinx#1 usinx zp[2]:31 1.0 (word) sin16sb::x -(word) sin16sb::x#0 x zp[2]:29 8.5 -(word) sin16sb::x#1 x zp[2]:29 4.0 -(word) sin16sb::x#2 x zp[2]:29 4.0 -(word) sin16sb::x#4 x zp[2]:29 5.0 -(word) sin16sb::x#6 x zp[2]:29 6.0 +(word) sin16sb::x#0 x zp[2]:25 8.5 +(word) sin16sb::x#1 x zp[2]:25 4.0 +(word) sin16sb::x#2 x zp[2]:25 4.0 +(word) sin16sb::x#4 x zp[2]:25 5.0 +(word) sin16sb::x#6 x zp[2]:25 6.0 (word) sin16sb::x1 -(word) sin16sb::x1#0 x1 zp[2]:29 0.6363636363636365 +(word) sin16sb::x1#0 x1 zp[2]:25 0.6363636363636365 (word) sin16sb::x2 -(word) sin16sb::x2#0 x2 zp[2]:6 4.0 +(word) sin16sb::x2#0 x2 zp[2]:3 4.0 (word) sin16sb::x3 -(word) sin16sb::x3#0 x3 zp[2]:6 1.0 +(word) sin16sb::x3#0 x3 zp[2]:3 1.0 (word) sin16sb::x3_6 -(word) sin16sb::x3_6#0 x3_6 zp[2]:27 4.0 +(word) sin16sb::x3_6#0 x3_6 zp[2]:23 4.0 (word) sin16sb::x4 -(word) sin16sb::x4#0 x4 zp[2]:6 4.0 +(word) sin16sb::x4#0 x4 zp[2]:3 4.0 (word) sin16sb::x5 -(word) sin16sb::x5#0 x5 zp[2]:27 4.0 +(word) sin16sb::x5#0 x5 zp[2]:23 4.0 (word) sin16sb::x5_128 -(word) sin16sb::x5_128#0 x5_128 zp[2]:27 4.0 +(word) sin16sb::x5_128#0 x5_128 zp[2]:23 4.0 reg byte x [ main::i#2 main::i#1 ] reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] +zp[1]:2 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ] reg byte y [ sin16sb::isUpper#2 ] reg byte x [ mulu16_sel::select#10 ] -zp[4]:2 [ mul16u::mb#2 mul16u::mb#1 ] -zp[2]:6 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 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 sin16s::x3#0 sin16sb::x2#0 sin16sb::x4#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#19 mulu16_sel::return#10 mulu16_sel::return#0 mulu16_sel::return#1 mulu16_sel::return#15 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] -zp[2]:8 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 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 mul16u::b#0 ] +zp[2]:3 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 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 sin16s::x3#0 sin16sb::x2#0 sin16sb::x4#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#19 mulu16_sel::return#10 mulu16_sel::return#0 mulu16_sel::return#1 mulu16_sel::return#15 memset::dst#2 memset::dst#1 main::st1#2 main::st1#1 ] +zp[2]:5 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 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 mul16u::b#0 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[4]:10 [ sin16s_gen::x#2 sin16s_gen::x#1 sin16s_genb::x#2 sin16s_genb::x#1 ] -zp[2]:14 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 sin16s_genb::i#2 sin16s_genb::i#1 main::st2#2 main::st2#1 ] -zp[1]:16 [ sin16s::isUpper#2 print_byte::b#2 print_byte::b#0 print_byte::b#1 ] -zp[4]:17 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] -zp[2]:21 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 sin16s_genb::sintab#2 sin16s_genb::sintab#0 print_str::str#3 print_str::str#5 print_str::str#0 ] +zp[4]:7 [ sin16s_gen::x#2 sin16s_gen::x#1 sin16s_genb::x#2 sin16s_genb::x#1 ] +zp[2]:11 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 sin16s_genb::i#2 sin16s_genb::i#1 main::st2#2 main::st2#1 ] +reg byte y [ sin16s::isUpper#2 ] +zp[4]:13 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] +zp[2]:17 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 sin16s_genb::sintab#2 sin16s_genb::sintab#0 print_str::str#3 print_str::str#5 print_str::str#0 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -zp[4]:23 [ div32u16u::return#3 sin16s_genb::step#0 div32u16u::return#0 div32u16u::return#2 sin16s_gen::step#0 ] -zp[2]:27 [ mulu16_sel::return#18 mulu16_sel::return#17 mulu16_sel::return#20 sin16sb::x3_6#0 mulu16_sel::return#11 sin16sb::x5#0 mulu16_sel::return#14 sin16s::x3_6#0 mulu16_sel::return#16 sin16s::x5#0 sin16sb::x5_128#0 sin16s::x5_128#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] +zp[4]:19 [ div32u16u::return#3 sin16s_genb::step#0 div32u16u::return#0 div32u16u::return#2 sin16s_gen::step#0 ] +zp[2]:23 [ mulu16_sel::return#18 mulu16_sel::return#17 mulu16_sel::return#20 sin16sb::x3_6#0 mulu16_sel::return#11 sin16sb::x5#0 mulu16_sel::return#14 sin16s::x3_6#0 mulu16_sel::return#16 sin16s::x5#0 sin16sb::x5_128#0 sin16s::x5_128#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 div32u16u::quotient_lo#0 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] reg byte a [ mul16u::$1 ] -zp[2]:29 [ div32u16u::quotient_hi#0 sin16s_gen::i#2 sin16s_gen::i#1 sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 sin16sb::x1#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] +zp[2]:25 [ div32u16u::quotient_hi#0 sin16s_gen::i#2 sin16s_gen::i#1 sin16sb::x#6 sin16sb::x#4 sin16sb::x#0 sin16sb::x#1 sin16sb::x#2 sin16sb::x1#0 print_sword::w#4 print_sword::w#0 print_sword::w#1 main::sw#0 print_word::w#0 ] reg byte a [ divr16u::$1 ] reg byte a [ divr16u::$2 ] +zp[4]:27 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] zp[2]:31 [ sin16s::x1#0 sin16sb::return#1 sin16sb::return#5 sin16sb::sinx#1 sin16sb::usinx#1 sin16sb::return#0 sin16s_genb::$3 sin16sb::usinx#0 print_char_cursor#35 print_char_cursor#54 print_char_cursor#51 print_char_cursor#52 print_char_cursor#2 print_char_cursor#13 print_char_cursor#1 ] diff --git a/src/test/ref/sinusgen8b.asm b/src/test/ref/sinusgen8b.asm index 8100b2c92..bdee66528 100644 --- a/src/test/ref/sinusgen8b.asm +++ b/src/test/ref/sinusgen8b.asm @@ -15,15 +15,15 @@ // PI/2 in u[4.12] format .const PI_HALF_u4f12 = $1922 .label print_line_cursor = $400 - .label rem16u = $e - .label print_char_cursor = $15 + .label rem16u = $a + .label print_char_cursor = $11 main: { .label wavelength = $c0 - .label __3 = $18 - .label __4 = $18 - .label __11 = $18 - .label sb = $17 - .label sw = $18 + .label __3 = $14 + .label __4 = $14 + .label __11 = $14 + .label sb = $13 + .label sw = $14 jsr sin8s_gen jsr sin16s_gen jsr print_cls @@ -73,9 +73,9 @@ main: { sintabw: .fill 2*$c0, 0 } // Print a zero-terminated string -// print_str(byte* zeropage($e) str) +// print_str(byte* zeropage($a) str) print_str: { - .label str = $e + .label str = $a lda #main.str @@ -101,9 +101,9 @@ print_str: { jmp __b1 } // Print a signed byte as HEX -// print_sbyte(signed byte zeropage($14) b) +// print_sbyte(signed byte zeropage($10) b) print_sbyte: { - .label b = $14 + .label b = $10 lda.z b bmi __b1 lda #' ' @@ -133,9 +133,9 @@ print_char: { rts } // Print a byte as HEX -// print_byte(byte zeropage($14) b) +// print_byte(byte zeropage($10) b) print_byte: { - .label b = $14 + .label b = $10 lda.z b lsr lsr @@ -162,7 +162,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = $e + .label dst = $a lda #str @@ -188,13 +188,13 @@ memset: { // Generate signed (large) word sinus table - on the full -$7fff - $7fff range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen(signed word* zeropage($e) sintab) +// sin16s_gen(signed word* zeropage($a) sintab) sin16s_gen: { - .label __2 = $18 - .label step = $1a - .label sintab = $e + .label __2 = $14 + .label step = $16 + .label sintab = $a .label x = 2 - .label i = $15 + .label i = $11 jsr div32u16u lda #PI_u4f28>>$10 bcc b1 @@ -307,12 +306,10 @@ sin16s: { lda.z x+3 sbc #>PI_u4f28>>$10 sta.z x+3 - lda #1 - sta.z isUpper + ldy #1 jmp __b1 b1: - lda #0 - sta.z isUpper + ldy #0 __b1: lda.z x+3 cmp #>PI_HALF_u4f28>>$10 @@ -344,14 +341,26 @@ sin16s: { sbc.z x+3 sta.z x+3 __b2: - ldy #3 - !: + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- lda.z __4+2 sta.z x1 lda.z __4+3 @@ -424,8 +433,7 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - lda.z isUpper - cmp #0 + cpy #0 beq __b3 sec lda #0 @@ -439,14 +447,14 @@ sin16s: { } // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($10) v1, word zeropage($12) v2, byte register(X) select) +// mulu16_sel(word zeropage($c) v1, word zeropage($e) v2, byte register(X) select) mulu16_sel: { .label __0 = 6 .label __1 = 6 - .label v1 = $10 - .label v2 = $12 + .label v1 = $c + .label v2 = $e .label return = $20 - .label return_1 = $10 + .label return_1 = $c lda.z v1 sta.z mul16u.a lda.z v1+1 @@ -469,12 +477,12 @@ mulu16_sel: { rts } // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($20) a, word zeropage($12) b) +// mul16u(word zeropage($20) a, word zeropage($e) b) mul16u: { .label a = $20 - .label mb = $a + .label mb = $1a .label res = 6 - .label b = $12 + .label b = $e .label return = 6 lda.z b sta.z mb @@ -524,8 +532,8 @@ mul16u: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $20 - .label quotient_lo = $10 - .label return = $1a + .label quotient_lo = $c + .label return = $16 lda #>$10 sta.z divr16u.dividend lda #>PI2_u4f28>>$10 @@ -557,12 +565,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($18) dividend, word zeropage($e) rem) +// divr16u(word zeropage($14) dividend, word zeropage($a) rem) divr16u: { - .label rem = $e - .label dividend = $18 - .label quotient = $10 - .label return = $10 + .label rem = $a + .label dividend = $14 + .label quotient = $c + .label return = $c ldx #0 txa sta.z quotient @@ -610,12 +618,12 @@ divr16u: { // Generate signed byte sinus table - on the full -$7f - $7f range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin8s_gen(signed byte* zeropage($18) sintab) +// sin8s_gen(signed byte* zeropage($14) sintab) sin8s_gen: { - .label step = $10 - .label sintab = $18 + .label step = $c + .label sintab = $14 .label x = $20 - .label i = $12 + .label i = $e jsr div16u lda #PI_u4f12 bcc b1 @@ -776,11 +784,11 @@ sin8s: { } // Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result. // The select parameter indicates how many of the highest bits of the 16-bit result to skip -// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($14) select) +// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($13) select) mulu8_sel: { - .label __0 = $15 - .label __1 = $15 - .label select = $14 + .label __0 = $11 + .label __1 = $11 + .label select = $13 tya jsr mul8u ldy.z select @@ -798,8 +806,8 @@ mulu8_sel: { // mul8u(byte register(X) a, byte register(A) b) mul8u: { .label mb = $1e - .label res = $15 - .label return = $15 + .label res = $11 + .label return = $11 sta.z mb lda #0 sta.z mb+1 @@ -834,7 +842,7 @@ mul8u: { // The remainder will be set into the global variable rem16u // Implemented using simple binary division div16u: { - .label return = $10 + .label return = $c lda #PI2_u4f12 diff --git a/src/test/ref/sinusgen8b.log b/src/test/ref/sinusgen8b.log index e3b225e24..0adc29e3b 100644 --- a/src/test/ref/sinusgen8b.log +++ b/src/test/ref/sinusgen8b.log @@ -4648,21 +4648,25 @@ sin16s: { __b2: // [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 lda.z x + asl sta.z __4 lda.z x+1 + rol sta.z __4+1 lda.z x+2 + rol sta.z __4+2 lda.z x+3 + rol sta.z __4+3 - ldy #3 - !: asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 // [84] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -5877,8 +5881,7 @@ Statement [78] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4 Statement [80] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:19 [ sin16s::isUpper#2 ] Statement [81] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte y as potential for zp[1]:19 [ sin16s::isUpper#2 ] +Statement [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [84] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [85] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [86] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -5982,7 +5985,7 @@ Statement [77] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 [ Statement [78] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28 [ sin16s::x#1 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#1 ] ) always clobbers reg byte a Statement [80] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28) goto sin16s::@2 [ sin16s::x#4 sin16s::isUpper#2 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::x#4 sin16s::isUpper#2 ] ) always clobbers reg byte a Statement [81] (dword) sin16s::x#2 ← (const dword) PI_u4f28 - (dword) sin16s::x#4 [ sin16s::isUpper#2 sin16s::x#2 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x#2 ] ) always clobbers reg byte a -Statement [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a reg byte y +Statement [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 [ sin16s::isUpper#2 sin16s::$4 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::$4 ] ) always clobbers reg byte a Statement [84] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 [ sin16s::isUpper#2 sin16s::x1#0 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 ] ) always clobbers reg byte a Statement [85] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 ] ) always clobbers reg byte a Statement [86] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0 [ sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ( main:2::sin16s_gen:7::sin16s:70 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::v1#0 mulu16_sel::v2#0 ] ) always clobbers reg byte a @@ -6061,7 +6064,7 @@ Potential registers zp[2]:9 [ memset::dst#2 memset::dst#1 ] : zp[2]:9 , Potential registers zp[2]:11 [ sin16s_gen::i#2 sin16s_gen::i#1 ] : zp[2]:11 , Potential registers zp[4]:13 [ sin16s_gen::x#2 sin16s_gen::x#1 ] : zp[4]:13 , Potential registers zp[2]:17 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] : zp[2]:17 , -Potential registers zp[1]:19 [ sin16s::isUpper#2 ] : zp[1]:19 , reg byte x , +Potential registers zp[1]:19 [ sin16s::isUpper#2 ] : zp[1]:19 , reg byte x , reg byte y , Potential registers zp[4]:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] : zp[4]:20 , Potential registers zp[2]:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] : zp[2]:24 , Potential registers zp[2]: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[2]:26 , @@ -6179,69 +6182,66 @@ Uplift Scope [div16u] 4: zp[2]:159 [ div16u::return#2 ] 1.33: zp[2]:190 [ div16u Uplift Scope [RADIX] Uplift Scope [print_cls] -Uplifting [mul8u] best 39011 combination zp[2]:65 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp[2]: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[2]:180 [ mul8u::return#2 ] reg byte a [ mul8u::b#0 ] -Uplifting [mul16u] best 38411 combination zp[4]:33 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:37 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:31 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp[4]:128 [ mul16u::return#2 ] zp[2]:41 [ mul16u::b#0 ] -Uplifting [print_str] best 38411 combination zp[2]:3 [ print_str::str#2 print_str::str#0 ] -Uplifting [divr16u] best 38201 combination zp[2]: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[2]: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[2]:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 ] zp[2]:143 [ divr16u::return#3 ] zp[2]:147 [ divr16u::return#4 ] zp[2]:188 [ divr16u::return#2 ] -Uplifting [] best 38201 combination zp[2]:7 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] zp[2]:157 [ rem16u#1 ] -Uplifting [main] best 37971 combination zp[2]:71 [ main::$3 ] zp[2]:73 [ main::$11 ] zp[2]:75 [ main::$4 ] zp[2]:77 [ main::sw#0 ] reg byte a [ main::sd#0 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$6 ] zp[1]:70 [ main::sb#0 ] -Uplifting [sin8s] best 37866 combination zp[2]: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[2]:165 [ sin8s::$4 ] zp[1]:169 [ sin8s::x2#0 ] zp[1]:173 [ sin8s::x3_6#0 ] zp[1]:176 [ sin8s::x4#0 ] zp[1]:178 [ sin8s::x5#0 ] zp[1]:179 [ sin8s::x5_128#0 ] zp[1]:171 [ sin8s::x3#0 ] zp[1]:167 [ sin8s::x1#0 ] zp[1]:174 [ sin8s::usinx#0 ] zp[1]:56 [ sin8s::isUpper#10 ] +Uplifting [mul8u] best 39033 combination zp[2]:65 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 ] zp[2]: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[2]:180 [ mul8u::return#2 ] reg byte a [ mul8u::b#0 ] +Uplifting [mul16u] best 38433 combination zp[4]:33 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 ] zp[4]:37 [ mul16u::mb#2 mul16u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:31 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] zp[4]:128 [ mul16u::return#2 ] zp[2]:41 [ mul16u::b#0 ] +Uplifting [print_str] best 38433 combination zp[2]:3 [ print_str::str#2 print_str::str#0 ] +Uplifting [divr16u] best 38223 combination zp[2]: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[2]: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[2]:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 ] zp[2]:143 [ divr16u::return#3 ] zp[2]:147 [ divr16u::return#4 ] zp[2]:188 [ divr16u::return#2 ] +Uplifting [] best 38223 combination zp[2]:7 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] zp[2]:157 [ rem16u#1 ] +Uplifting [main] best 37993 combination zp[2]:71 [ main::$3 ] zp[2]:73 [ main::$11 ] zp[2]:75 [ main::$4 ] zp[2]:77 [ main::sw#0 ] reg byte a [ main::sd#0 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$6 ] zp[1]:70 [ main::sb#0 ] +Uplifting [sin8s] best 37888 combination zp[2]: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[2]:165 [ sin8s::$4 ] zp[1]:169 [ sin8s::x2#0 ] zp[1]:173 [ sin8s::x3_6#0 ] zp[1]:176 [ sin8s::x4#0 ] zp[1]:178 [ sin8s::x5#0 ] zp[1]:179 [ sin8s::x5_128#0 ] zp[1]:171 [ sin8s::x3#0 ] zp[1]:167 [ sin8s::x1#0 ] zp[1]:174 [ sin8s::usinx#0 ] zp[1]:56 [ sin8s::isUpper#10 ] Limited combination testing to 100 combinations of 5308416 possible. -Uplifting [sin16s] best 37866 combination zp[4]:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:92 [ sin16s::return#0 ] zp[2]:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:96 [ sin16s::$4 ] zp[2]:104 [ sin16s::x2#0 ] zp[2]:112 [ sin16s::x3_6#0 ] zp[2]:118 [ sin16s::x4#0 ] zp[2]:122 [ sin16s::x5#0 ] zp[2]:124 [ sin16s::x5_128#0 ] zp[2]:108 [ sin16s::x3#0 ] zp[2]:126 [ sin16s::usinx#1 ] zp[2]:100 [ sin16s::x1#0 ] zp[2]:114 [ sin16s::usinx#0 ] zp[1]:19 [ sin16s::isUpper#2 ] -Uplifting [sin16s_gen] best 37866 combination zp[2]:11 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp[2]:94 [ sin16s_gen::$2 ] zp[4]:13 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:17 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp[4]:88 [ sin16s_gen::step#0 ] -Uplifting [sin8s_gen] best 37806 combination zp[2]:50 [ sin8s_gen::i#2 sin8s_gen::i#1 ] reg byte a [ sin8s_gen::$2 ] zp[2]:52 [ sin8s_gen::x#2 sin8s_gen::x#1 ] zp[2]:54 [ sin8s_gen::sintab#2 sin8s_gen::sintab#0 ] zp[2]:161 [ sin8s_gen::step#0 ] -Uplifting [mulu16_sel] best 37790 combination zp[2]: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[2]:28 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:102 [ mulu16_sel::return#0 ] zp[2]:106 [ mulu16_sel::return#1 ] zp[2]:110 [ mulu16_sel::return#2 ] zp[2]:116 [ mulu16_sel::return#10 ] zp[2]:120 [ mulu16_sel::return#11 ] zp[4]:132 [ mulu16_sel::$0 ] zp[4]:136 [ mulu16_sel::$1 ] zp[2]:140 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] -Uplifting [mulu8_sel] best 37744 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[1]:172 [ mulu8_sel::return#2 ] zp[1]:175 [ mulu8_sel::return#10 ] zp[1]:177 [ mulu8_sel::return#11 ] zp[2]:182 [ mulu8_sel::$0 ] zp[2]:184 [ mulu8_sel::$1 ] zp[1]:186 [ mulu8_sel::return#12 ] zp[1]:63 [ mulu8_sel::select#5 ] +Uplifting [sin16s] best 37879 combination zp[4]:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] zp[2]:92 [ sin16s::return#0 ] zp[2]:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] zp[4]:96 [ sin16s::$4 ] zp[2]:104 [ sin16s::x2#0 ] zp[2]:112 [ sin16s::x3_6#0 ] zp[2]:118 [ sin16s::x4#0 ] zp[2]:122 [ sin16s::x5#0 ] zp[2]:124 [ sin16s::x5_128#0 ] zp[2]:108 [ sin16s::x3#0 ] zp[2]:126 [ sin16s::usinx#1 ] zp[2]:100 [ sin16s::x1#0 ] zp[2]:114 [ sin16s::usinx#0 ] reg byte y [ sin16s::isUpper#2 ] +Uplifting [sin16s_gen] best 37879 combination zp[2]:11 [ sin16s_gen::i#2 sin16s_gen::i#1 ] zp[2]:94 [ sin16s_gen::$2 ] zp[4]:13 [ sin16s_gen::x#2 sin16s_gen::x#1 ] zp[2]:17 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] zp[4]:88 [ sin16s_gen::step#0 ] +Uplifting [sin8s_gen] best 37819 combination zp[2]:50 [ sin8s_gen::i#2 sin8s_gen::i#1 ] reg byte a [ sin8s_gen::$2 ] zp[2]:52 [ sin8s_gen::x#2 sin8s_gen::x#1 ] zp[2]:54 [ sin8s_gen::sintab#2 sin8s_gen::sintab#0 ] zp[2]:161 [ sin8s_gen::step#0 ] +Uplifting [mulu16_sel] best 37803 combination zp[2]: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[2]:28 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 ] zp[2]:102 [ mulu16_sel::return#0 ] zp[2]:106 [ mulu16_sel::return#1 ] zp[2]:110 [ mulu16_sel::return#2 ] zp[2]:116 [ mulu16_sel::return#10 ] zp[2]:120 [ mulu16_sel::return#11 ] zp[4]:132 [ mulu16_sel::$0 ] zp[4]:136 [ mulu16_sel::$1 ] zp[2]:140 [ mulu16_sel::return#12 ] reg byte x [ mulu16_sel::select#5 ] +Uplifting [mulu8_sel] best 37757 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[1]:172 [ mulu8_sel::return#2 ] zp[1]:175 [ mulu8_sel::return#10 ] zp[1]:177 [ mulu8_sel::return#11 ] zp[2]:182 [ mulu8_sel::$0 ] zp[2]:184 [ mulu8_sel::$1 ] zp[1]:186 [ mulu8_sel::return#12 ] zp[1]:63 [ mulu8_sel::select#5 ] Limited combination testing to 100 combinations of 196608 possible. -Uplifting [memset] best 37744 combination zp[2]:9 [ memset::dst#2 memset::dst#1 ] -Uplifting [print_char] best 37729 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] -Uplifting [print_sbyte] best 37729 combination zp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] -Uplifting [div32u16u] best 37729 combination zp[4]:84 [ div32u16u::return#2 ] zp[2]:149 [ div32u16u::quotient_lo#0 ] zp[4]:151 [ div32u16u::return#0 ] zp[2]:145 [ div32u16u::quotient_hi#0 ] -Uplifting [print_byte] best 37721 combination reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] zp[1]:81 [ print_byte::b#0 ] -Uplifting [div16u] best 37721 combination zp[2]:159 [ div16u::return#2 ] zp[2]:190 [ div16u::return#0 ] -Uplifting [RADIX] best 37721 combination -Uplifting [print_cls] best 37721 combination +Uplifting [memset] best 37757 combination zp[2]:9 [ memset::dst#2 memset::dst#1 ] +Uplifting [print_char] best 37742 combination reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] +Uplifting [print_sbyte] best 37742 combination zp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] +Uplifting [div32u16u] best 37742 combination zp[4]:84 [ div32u16u::return#2 ] zp[2]:149 [ div32u16u::quotient_lo#0 ] zp[4]:151 [ div32u16u::return#0 ] zp[2]:145 [ div32u16u::quotient_hi#0 ] +Uplifting [print_byte] best 37734 combination reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] zp[1]:81 [ print_byte::b#0 ] +Uplifting [div16u] best 37734 combination zp[2]:159 [ div16u::return#2 ] zp[2]:190 [ div16u::return#0 ] +Uplifting [RADIX] best 37734 combination +Uplifting [print_cls] best 37734 combination Attempting to uplift remaining variables inzp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] -Uplifting [print_sbyte] best 37721 combination zp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] +Uplifting [print_sbyte] best 37734 combination zp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] Attempting to uplift remaining variables inzp[1]:169 [ sin8s::x2#0 ] -Uplifting [sin8s] best 37717 combination reg byte a [ sin8s::x2#0 ] +Uplifting [sin8s] best 37730 combination reg byte a [ sin8s::x2#0 ] Attempting to uplift remaining variables inzp[1]:172 [ mulu8_sel::return#2 ] -Uplifting [mulu8_sel] best 37711 combination reg byte a [ mulu8_sel::return#2 ] +Uplifting [mulu8_sel] best 37724 combination reg byte a [ mulu8_sel::return#2 ] Attempting to uplift remaining variables inzp[1]:173 [ sin8s::x3_6#0 ] -Uplifting [sin8s] best 37707 combination reg byte a [ sin8s::x3_6#0 ] +Uplifting [sin8s] best 37720 combination reg byte a [ sin8s::x3_6#0 ] Attempting to uplift remaining variables inzp[1]:175 [ mulu8_sel::return#10 ] -Uplifting [mulu8_sel] best 37701 combination reg byte a [ mulu8_sel::return#10 ] +Uplifting [mulu8_sel] best 37714 combination reg byte a [ mulu8_sel::return#10 ] Attempting to uplift remaining variables inzp[1]:176 [ sin8s::x4#0 ] -Uplifting [sin8s] best 37697 combination reg byte a [ sin8s::x4#0 ] +Uplifting [sin8s] best 37710 combination reg byte a [ sin8s::x4#0 ] Attempting to uplift remaining variables inzp[1]:177 [ mulu8_sel::return#11 ] -Uplifting [mulu8_sel] best 37691 combination reg byte a [ mulu8_sel::return#11 ] +Uplifting [mulu8_sel] best 37704 combination reg byte a [ mulu8_sel::return#11 ] Attempting to uplift remaining variables inzp[1]:178 [ sin8s::x5#0 ] -Uplifting [sin8s] best 37685 combination reg byte a [ sin8s::x5#0 ] +Uplifting [sin8s] best 37698 combination reg byte a [ sin8s::x5#0 ] Attempting to uplift remaining variables inzp[1]:179 [ sin8s::x5_128#0 ] -Uplifting [sin8s] best 37679 combination reg byte a [ sin8s::x5_128#0 ] +Uplifting [sin8s] best 37692 combination reg byte a [ sin8s::x5_128#0 ] Attempting to uplift remaining variables inzp[1]:70 [ main::sb#0 ] -Uplifting [main] best 37679 combination zp[1]:70 [ main::sb#0 ] +Uplifting [main] best 37692 combination zp[1]:70 [ main::sb#0 ] Attempting to uplift remaining variables inzp[1]:186 [ mulu8_sel::return#12 ] -Uplifting [mulu8_sel] best 37661 combination reg byte a [ mulu8_sel::return#12 ] +Uplifting [mulu8_sel] best 37674 combination reg byte a [ mulu8_sel::return#12 ] Attempting to uplift remaining variables inzp[1]:81 [ print_byte::b#0 ] -Uplifting [print_byte] best 37661 combination zp[1]:81 [ print_byte::b#0 ] +Uplifting [print_byte] best 37674 combination zp[1]:81 [ print_byte::b#0 ] Attempting to uplift remaining variables inzp[1]:171 [ sin8s::x3#0 ] -Uplifting [sin8s] best 37661 combination zp[1]:171 [ sin8s::x3#0 ] +Uplifting [sin8s] best 37674 combination zp[1]:171 [ sin8s::x3#0 ] Attempting to uplift remaining variables inzp[1]:167 [ sin8s::x1#0 ] -Uplifting [sin8s] best 37661 combination zp[1]:167 [ sin8s::x1#0 ] +Uplifting [sin8s] best 37674 combination zp[1]:167 [ sin8s::x1#0 ] Attempting to uplift remaining variables inzp[1]:63 [ mulu8_sel::select#5 ] -Uplifting [mulu8_sel] best 37661 combination zp[1]:63 [ mulu8_sel::select#5 ] +Uplifting [mulu8_sel] best 37674 combination zp[1]:63 [ mulu8_sel::select#5 ] Attempting to uplift remaining variables inzp[1]:174 [ sin8s::usinx#0 ] -Uplifting [sin8s] best 37661 combination zp[1]:174 [ sin8s::usinx#0 ] -Attempting to uplift remaining variables inzp[1]:19 [ sin16s::isUpper#2 ] -Uplifting [sin16s] best 37661 combination zp[1]:19 [ sin16s::isUpper#2 ] +Uplifting [sin8s] best 37674 combination zp[1]:174 [ sin8s::usinx#0 ] Attempting to uplift remaining variables inzp[1]:56 [ sin8s::isUpper#10 ] -Uplifting [sin8s] best 37661 combination zp[1]:56 [ sin8s::isUpper#10 ] +Uplifting [sin8s] best 37674 combination zp[1]:56 [ sin8s::isUpper#10 ] Coalescing zero page register [ zp[2]:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 ] ] with [ zp[2]:126 [ sin16s::usinx#1 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:108 [ sin16s::x3#0 ] ] - score: 2 Coalescing zero page register [ zp[2]: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[2]:157 [ rem16u#1 ] ] - score: 2 Coalescing zero page register [ zp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 ] ] with [ zp[1]:81 [ print_byte::b#0 ] ] - score: 1 -Coalescing zero page register [ zp[4]:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] with [ zp[4]:96 [ sin16s::$4 ] ] - score: 1 Coalescing zero page register [ zp[2]:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 ] ] with [ zp[2]:92 [ sin16s::return#0 ] ] - score: 1 Coalescing zero page register [ zp[2]: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 sin16s::x3#0 ] ] with [ zp[2]:104 [ sin16s::x2#0 ] ] - score: 1 Coalescing zero page register [ zp[2]: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 sin16s::x3#0 sin16s::x2#0 ] ] with [ zp[2]:118 [ sin16s::x4#0 ] ] - score: 1 @@ -6277,34 +6277,34 @@ Coalescing zero page register [ zp[2]:102 [ mulu16_sel::return#0 mulu16_sel::ret Coalescing zero page register [ zp[2]:102 [ mulu16_sel::return#0 mulu16_sel::return#12 mulu16_sel::return#2 sin16s::x3_6#0 mulu16_sel::return#11 sin16s::x5#0 ] ] with [ zp[2]:124 [ sin16s::x5_128#0 ] ] - score: 1 Coalescing zero page register [ zp[2]:9 [ memset::dst#2 memset::dst#1 ] ] with [ zp[2]:3 [ print_str::str#2 print_str::str#0 ] ] Coalescing zero page register [ zp[2]:11 [ sin16s_gen::i#2 sin16s_gen::i#1 ] ] with [ zp[2]:7 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] ] -Coalescing zero page register [ zp[1]:19 [ sin16s::isUpper#2 ] ] with [ zp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] ] -Coalescing zero page register [ zp[4]:33 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] ] with [ zp[4]:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] ] +Coalescing zero page register [ zp[4]:33 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ] ] with [ zp[4]:20 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] ] Coalescing zero page register [ zp[2]: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 rem16u#1 ] ] with [ zp[2]:17 [ sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] ] Coalescing zero page register [ zp[2]:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 ] ] with [ zp[2]:24 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] ] Coalescing zero page register [ zp[2]:47 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 ] ] with [ zp[2]: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 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] ] Coalescing zero page register [ zp[2]:50 [ sin8s_gen::i#2 sin8s_gen::i#1 ] ] with [ zp[2]:28 [ mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] ] Coalescing zero page register [ zp[2]:52 [ sin8s_gen::x#2 sin8s_gen::x#1 ] ] with [ zp[2]:31 [ mul16u::a#2 mul16u::a#1 mul16u::a#0 ] ] +Coalescing zero page register [ zp[1]:56 [ sin8s::isUpper#10 ] ] with [ zp[1]:5 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] ] Coalescing zero page register [ zp[2]:65 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 ] ] with [ zp[2]:57 [ sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 ] ] -Coalescing zero page register [ zp[1]:70 [ main::sb#0 ] ] with [ zp[1]:56 [ sin8s::isUpper#10 ] ] +Coalescing zero page register [ zp[1]:70 [ main::sb#0 ] ] with [ zp[1]:63 [ mulu8_sel::select#5 ] ] Coalescing zero page register [ zp[2]:71 [ main::$3 main::$11 main::$4 main::sw#0 ] ] with [ zp[2]:54 [ sin8s_gen::sintab#2 sin8s_gen::sintab#0 ] ] +Coalescing zero page register [ zp[4]:96 [ sin16s::$4 ] ] with [ zp[4]:37 [ mul16u::mb#2 mul16u::mb#1 ] ] Coalescing zero page register [ zp[2]:100 [ sin16s::x1#0 ] ] with [ zp[2]:67 [ mul8u::mb#2 mul8u::mb#1 ] ] Coalescing zero page register [ zp[2]:145 [ div32u16u::quotient_hi#0 ] ] with [ zp[2]:102 [ 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 ] ] Coalescing zero page register [ zp[2]: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 rem16u#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 ] ] with [ zp[2]:9 [ memset::dst#2 memset::dst#1 print_str::str#2 print_str::str#0 ] ] -Coalescing zero page register [ zp[1]:63 [ mulu8_sel::select#5 ] ] with [ zp[1]:19 [ sin16s::isUpper#2 print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] ] Coalescing zero page register [ zp[2]:65 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 ] ] with [ zp[2]:11 [ sin16s_gen::i#2 sin16s_gen::i#1 print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] ] Coalescing zero page register [ zp[2]:71 [ main::$3 main::$11 main::$4 main::sw#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 ] ] with [ zp[2]:45 [ divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] ] Coalescing zero page register [ zp[2]:145 [ div32u16u::quotient_hi#0 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 ] ] with [ zp[2]:52 [ sin8s_gen::x#2 sin8s_gen::x#1 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] ] Allocated (was zp[4]:13) zp[4]:2 [ sin16s_gen::x#2 sin16s_gen::x#1 ] -Allocated (was zp[4]:33) zp[4]:6 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] -Allocated (was zp[4]:37) zp[4]:10 [ mul16u::mb#2 mul16u::mb#1 ] -Allocated (was zp[2]:43) zp[2]:14 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 memset::dst#2 memset::dst#1 print_str::str#2 print_str::str#0 ] -Allocated (was zp[2]:47) zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] -Allocated (was zp[2]:50) zp[2]:18 [ sin8s_gen::i#2 sin8s_gen::i#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] -Allocated (was zp[1]:63) zp[1]:20 [ mulu8_sel::select#5 sin16s::isUpper#2 print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] -Allocated (was zp[2]:65) zp[2]:21 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 sin16s_gen::i#2 sin16s_gen::i#1 print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] -Allocated (was zp[1]:70) zp[1]:23 [ main::sb#0 sin8s::isUpper#10 ] -Allocated (was zp[2]:71) zp[2]:24 [ main::$3 main::$11 main::$4 main::sw#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] -Allocated (was zp[4]:84) zp[4]:26 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +Allocated (was zp[4]:33) zp[4]:6 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] +Allocated (was zp[2]:43) zp[2]:10 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 memset::dst#2 memset::dst#1 print_str::str#2 print_str::str#0 ] +Allocated (was zp[2]:47) zp[2]:12 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +Allocated (was zp[2]:50) zp[2]:14 [ sin8s_gen::i#2 sin8s_gen::i#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +Allocated (was zp[1]:56) zp[1]:16 [ sin8s::isUpper#10 print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] +Allocated (was zp[2]:65) zp[2]:17 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 sin16s_gen::i#2 sin16s_gen::i#1 print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] +Allocated (was zp[1]:70) zp[1]:19 [ main::sb#0 mulu8_sel::select#5 ] +Allocated (was zp[2]:71) zp[2]:20 [ main::$3 main::$11 main::$4 main::sw#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] +Allocated (was zp[4]:84) zp[4]:22 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +Allocated (was zp[4]:96) zp[4]:26 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] Allocated (was zp[2]:100) zp[2]:30 [ sin16s::x1#0 mul8u::mb#2 mul8u::mb#1 ] Allocated (was zp[2]:145) zp[2]:32 [ div32u16u::quotient_hi#0 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 sin8s_gen::x#2 sin8s_gen::x#1 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] Allocated (was zp[1]:167) zp[1]:34 [ sin8s::x1#0 ] @@ -6332,8 +6332,8 @@ ASSEMBLER BEFORE OPTIMIZATION // PI/2 in u[4.12] format .const PI_HALF_u4f12 = $1922 .label print_line_cursor = $400 - .label rem16u = $e - .label print_char_cursor = $15 + .label rem16u = $a + .label print_char_cursor = $11 // @begin __bbegin: // [1] phi from @begin to @1 [phi:@begin->@1] @@ -6353,11 +6353,11 @@ __bend: // main main: { .label wavelength = $c0 - .label __3 = $18 - .label __4 = $18 - .label __11 = $18 - .label sb = $17 - .label sw = $18 + .label __3 = $14 + .label __4 = $14 + .label __11 = $14 + .label sb = $13 + .label sw = $14 // [5] call sin8s_gen // [164] phi from main to sin8s_gen [phi:main->sin8s_gen] sin8s_gen_from_main: @@ -6464,9 +6464,9 @@ main: { } // print_str // Print a zero-terminated string -// print_str(byte* zeropage($e) str) +// print_str(byte* zeropage($a) str) print_str: { - .label str = $e + .label str = $a // [26] phi from print_str to print_str::@1 [phi:print_str->print_str::@1] __b1_from_print_str: // [26] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#10 [phi:print_str->print_str::@1#0] -- register_copy @@ -6513,9 +6513,9 @@ print_str: { } // print_sbyte // Print a signed byte as HEX -// print_sbyte(signed byte zeropage($14) b) +// print_sbyte(signed byte zeropage($10) b) print_sbyte: { - .label b = $14 + .label b = $10 // [32] if((signed byte) print_sbyte::b#1<(signed byte) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1 lda.z b bmi __b1_from_print_sbyte @@ -6589,9 +6589,9 @@ print_char: { } // print_byte // Print a byte as HEX -// print_byte(byte zeropage($14) b) +// print_byte(byte zeropage($10) b) print_byte: { - .label b = $14 + .label b = $10 // [46] (byte~) print_byte::$0 ← (byte) print_byte::b#0 >> (byte) 4 -- vbuaa=vbuz1_ror_4 lda.z b lsr @@ -6648,7 +6648,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = $e + .label dst = $a // [57] phi from memset to memset::@1 [phi:memset->memset::@1] __b1_from_memset: // [57] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 @@ -6691,13 +6691,13 @@ memset: { // Generate signed (large) word sinus table - on the full -$7fff - $7fff range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin16s_gen(signed word* zeropage($e) sintab) +// sin16s_gen(signed word* zeropage($a) sintab) sin16s_gen: { - .label __2 = $18 - .label step = $1a - .label sintab = $e + .label __2 = $14 + .label step = $16 + .label sintab = $a .label x = 2 - .label i = $15 + .label i = $11 // [63] call div32u16u // [136] phi from sin16s_gen to div32u16u [phi:sin16s_gen->div32u16u] div32u16u_from_sin16s_gen: @@ -6809,19 +6809,18 @@ sin16s_gen: { // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff // sin16s(dword zeropage(6) x) sin16s: { - .label __4 = 6 + .label __4 = $1a .label x = 6 - .label return = $18 + .label return = $14 .label x1 = $1e - .label x2 = $10 - .label x3 = $10 + .label x2 = $c + .label x3 = $c .label x3_6 = $20 - .label usinx = $18 - .label x4 = $10 + .label usinx = $14 + .label x4 = $c .label x5 = $20 .label x5_128 = $20 - .label sinx = $18 - .label isUpper = $14 + .label sinx = $14 // [77] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 cmp #>PI_u4f28>>$10 @@ -6858,16 +6857,14 @@ sin16s: { sta.z x+3 // [79] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] __b1_from___b4: - // [79] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [79] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [79] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [79] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] __b1_from_sin16s: - // [79] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [79] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [79] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy jmp __b1 // sin16s::@1 @@ -6913,15 +6910,27 @@ sin16s: { jmp __b2 // sin16s::@2 __b2: - // [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // [84] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 sta.z x1 @@ -7062,9 +7071,8 @@ sin16s: { lda.z usinx+1 adc.z x5_128+1 sta.z usinx+1 - // [112] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [112] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b12 jmp __b6 // sin16s::@6 @@ -7097,14 +7105,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($10) v1, word zeropage($12) v2, byte register(X) select) +// mulu16_sel(word zeropage($c) v1, word zeropage($e) v2, byte register(X) select) mulu16_sel: { .label __0 = 6 .label __1 = 6 - .label v1 = $10 - .label v2 = $12 + .label v1 = $c + .label v2 = $e .label return = $20 - .label return_1 = $10 + .label return_1 = $c // [118] (word) mul16u::a#1 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 sta.z mul16u.a @@ -7144,12 +7152,12 @@ mulu16_sel: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($20) a, word zeropage($12) b) +// mul16u(word zeropage($20) a, word zeropage($e) b) mul16u: { .label a = $20 - .label mb = $a + .label mb = $1a .label res = 6 - .label b = $12 + .label b = $e .label return = 6 // [127] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] __b1_from_mul16u: @@ -7234,8 +7242,8 @@ mul16u: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $20 - .label quotient_lo = $10 - .label return = $1a + .label quotient_lo = $c + .label return = $16 // [137] call divr16u // [146] phi from div32u16u to divr16u [phi:div32u16u->divr16u] divr16u_from_div32u16u: @@ -7295,12 +7303,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($18) dividend, word zeropage($e) rem) +// divr16u(word zeropage($14) dividend, word zeropage($a) rem) divr16u: { - .label rem = $e - .label dividend = $18 - .label quotient = $10 - .label return = $10 + .label rem = $a + .label dividend = $14 + .label quotient = $c + .label return = $c // [147] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] __b1_from_divr16u: // [147] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 @@ -7404,12 +7412,12 @@ divr16u: { // Generate signed byte sinus table - on the full -$7f - $7f range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin8s_gen(signed byte* zeropage($18) sintab) +// sin8s_gen(signed byte* zeropage($14) sintab) sin8s_gen: { - .label step = $10 - .label sintab = $18 + .label step = $c + .label sintab = $14 .label x = $20 - .label i = $12 + .label i = $e // [165] call div16u // [241] phi from sin8s_gen to div16u [phi:sin8s_gen->div16u] div16u_from_sin8s_gen: @@ -7500,16 +7508,16 @@ sin8s_gen: { // Calculate signed byte sinus sin(x) // x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12 // result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f -// sin8s(word zeropage($15) x) +// sin8s(word zeropage($11) x) sin8s: { // u[2.6] x^3 .const DIV_6 = $2b - .label __4 = $15 - .label x = $15 + .label __4 = $11 + .label x = $11 .label x1 = $22 .label x3 = $23 .label usinx = $24 - .label isUpper = $17 + .label isUpper = $10 // [179] if((word) sin8s::x#0<(const word) PI_u4f12) goto sin8s::@1 -- vwuz1_lt_vwuc1_then_la1 lda.z x+1 cmp #>PI_u4f12 @@ -7735,11 +7743,11 @@ sin8s: { // mulu8_sel // Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result. // The select parameter indicates how many of the highest bits of the 16-bit result to skip -// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($14) select) +// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($13) select) mulu8_sel: { - .label __0 = $15 - .label __1 = $15 - .label select = $14 + .label __0 = $11 + .label __1 = $11 + .label select = $13 // [223] (byte) mul8u::a#1 ← (byte) mulu8_sel::v1#5 // [224] (byte) mul8u::b#0 ← (byte) mulu8_sel::v2#5 -- vbuaa=vbuyy tya @@ -7774,8 +7782,8 @@ mulu8_sel: { // mul8u(byte register(X) a, byte register(A) b) mul8u: { .label mb = $1e - .label res = $15 - .label return = $15 + .label res = $11 + .label return = $11 // [232] phi from mul8u to mul8u::@1 [phi:mul8u->mul8u::@1] __b1_from_mul8u: // [232] phi (word) mul8u::mb#2 = (byte) mul8u::b#0 [phi:mul8u->mul8u::@1#0] -- vwuz1=vbuaa @@ -7845,7 +7853,7 @@ mul8u: { // The remainder will be set into the global variable rem16u // Implemented using simple binary division div16u: { - .label return = $10 + .label return = $c // [242] call divr16u // [146] phi from div16u to divr16u [phi:div16u->divr16u] divr16u_from_div16u: @@ -8166,8 +8174,8 @@ FINAL SYMBOL TABLE (word) div16u::dividend (word) div16u::divisor (word) div16u::return -(word) div16u::return#0 return zp[2]:16 1.3333333333333333 -(word) div16u::return#2 return zp[2]:16 4.0 +(word) div16u::return#0 return zp[2]:12 1.3333333333333333 +(word) div16u::return#2 return zp[2]:12 4.0 (dword()) div32u16u((dword) div32u16u::dividend , (word) div32u16u::divisor) (label) div32u16u::@1 (label) div32u16u::@2 @@ -8178,10 +8186,10 @@ FINAL SYMBOL TABLE (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:32 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:16 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:12 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:26 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:26 4.0 +(dword) div32u16u::return#0 return zp[4]:22 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:22 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -8193,35 +8201,35 @@ FINAL SYMBOL TABLE (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:24 2.75 -(word) divr16u::dividend#4 dividend zp[2]:24 5.0 -(word) divr16u::dividend#6 dividend zp[2]:24 2.0 +(word) divr16u::dividend#0 dividend zp[2]:20 2.75 +(word) divr16u::dividend#4 dividend zp[2]:20 5.0 +(word) divr16u::dividend#6 dividend zp[2]:20 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:16 16.5 -(word) divr16u::quotient#2 quotient zp[2]:16 11.0 -(word) divr16u::quotient#3 quotient zp[2]:16 2.75 +(word) divr16u::quotient#1 quotient zp[2]:12 16.5 +(word) divr16u::quotient#2 quotient zp[2]:12 11.0 +(word) divr16u::quotient#3 quotient zp[2]:12 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:14 8.25 -(word) divr16u::rem#1 rem zp[2]:14 22.0 -(word) divr16u::rem#10 rem zp[2]:14 11.666666666666666 -(word) divr16u::rem#11 rem zp[2]:14 4.0 -(word) divr16u::rem#2 rem zp[2]:14 22.0 -(word) divr16u::rem#5 rem zp[2]:14 4.0 -(word) divr16u::rem#6 rem zp[2]:14 24.0 -(word) divr16u::rem#7 rem zp[2]:14 11.0 +(word) divr16u::rem#0 rem zp[2]:10 8.25 +(word) divr16u::rem#1 rem zp[2]:10 22.0 +(word) divr16u::rem#10 rem zp[2]:10 11.666666666666666 +(word) divr16u::rem#11 rem zp[2]:10 4.0 +(word) divr16u::rem#2 rem zp[2]:10 22.0 +(word) divr16u::rem#5 rem zp[2]:10 4.0 +(word) divr16u::rem#6 rem zp[2]:10 24.0 +(word) divr16u::rem#7 rem zp[2]:10 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:16 4.875 -(word) divr16u::return#2 return zp[2]:16 4.0 -(word) divr16u::return#3 return zp[2]:16 4.0 -(word) divr16u::return#4 return zp[2]:16 4.0 +(word) divr16u::return#0 return zp[2]:12 4.875 +(word) divr16u::return#2 return zp[2]:12 4.0 +(word) divr16u::return#3 return zp[2]:12 4.0 +(word) divr16u::return#4 return zp[2]:12 4.0 (void()) main() -(word~) main::$11 zp[2]:24 22.0 -(word~) main::$3 zp[2]:24 22.0 -(signed word*~) main::$4 zp[2]:24 22.0 +(word~) main::$11 zp[2]:20 22.0 +(word~) main::$3 zp[2]:20 22.0 +(signed word*~) main::$4 zp[2]:20 22.0 (byte~) main::$6 reg byte a 11.0 (label) main::@1 (label) main::@2 @@ -8233,14 +8241,14 @@ FINAL SYMBOL TABLE (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 2.75 (signed byte) main::sb -(signed byte) main::sb#0 sb zp[1]:23 3.6666666666666665 +(signed byte) main::sb#0 sb zp[1]:19 3.6666666666666665 (signed byte) main::sd (signed byte) main::sd#0 reg byte a 22.0 (const signed byte[$c0]) main::sintabb = { fill( $c0, 0) } (const signed word[$c0]) main::sintabw = { fill( $c0, 0) } (const string) main::str = (string) " " (signed word) main::sw -(signed word) main::sw#0 sw zp[2]:24 22.0 +(signed word) main::sw#0 sw zp[2]:20 22.0 (const word) main::wavelength = (byte) $c0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 @@ -8249,8 +8257,8 @@ FINAL SYMBOL TABLE (byte) memset::c (const byte) memset::c#0 c = (byte) ' ' (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:14 22.0 -(byte*) memset::dst#2 dst zp[2]:14 14.666666666666666 +(byte*) memset::dst#1 dst zp[2]:10 22.0 +(byte*) memset::dst#2 dst zp[2]:10 14.666666666666666 (byte*) memset::end (const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 (word) memset::num @@ -8270,10 +8278,10 @@ FINAL SYMBOL TABLE (word) mul16u::a#1 a zp[2]:32 1.3333333333333333 (word) mul16u::a#2 a zp[2]:32 67.66666666666666 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:18 2.0 +(word) mul16u::b#0 b zp[2]:14 2.0 (dword) mul16u::mb -(dword) mul16u::mb#1 mb zp[4]:10 202.0 -(dword) mul16u::mb#2 mb zp[4]:10 43.57142857142858 +(dword) mul16u::mb#1 mb zp[4]:26 202.0 +(dword) mul16u::mb#2 mb zp[4]:26 43.57142857142858 (dword) mul16u::res (dword) mul16u::res#1 res zp[4]:6 202.0 (dword) mul16u::res#2 res zp[4]:6 50.83333333333333 @@ -8297,11 +8305,11 @@ FINAL SYMBOL TABLE (word) mul8u::mb#1 mb zp[2]:30 202.0 (word) mul8u::mb#2 mb zp[2]:30 43.57142857142858 (word) mul8u::res -(word) mul8u::res#1 res zp[2]:21 202.0 -(word) mul8u::res#2 res zp[2]:21 50.83333333333333 -(word) mul8u::res#6 res zp[2]:21 101.0 +(word) mul8u::res#1 res zp[2]:17 202.0 +(word) mul8u::res#2 res zp[2]:17 50.83333333333333 +(word) mul8u::res#6 res zp[2]:17 101.0 (word) mul8u::return -(word) mul8u::return#2 return zp[2]:21 4.0 +(word) mul8u::return#2 return zp[2]:17 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) (dword~) mulu16_sel::$0 zp[4]:6 4.0 (dword~) mulu16_sel::$1 zp[4]:6 4.0 @@ -8309,29 +8317,29 @@ FINAL SYMBOL TABLE (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:32 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:16 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:16 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:12 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:12 4.0 (word) mulu16_sel::return#11 return zp[2]:32 4.0 (word) mulu16_sel::return#12 return zp[2]:32 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:32 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:16 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:16 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:12 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:12 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:18 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:14 5.0 (byte()) mulu8_sel((byte) mulu8_sel::v1 , (byte) mulu8_sel::v2 , (byte) mulu8_sel::select) -(word~) mulu8_sel::$0 zp[2]:21 4.0 -(word~) mulu8_sel::$1 zp[2]:21 4.0 +(word~) mulu8_sel::$0 zp[2]:17 4.0 +(word~) mulu8_sel::$1 zp[2]:17 4.0 (label) mulu8_sel::@1 (label) mulu8_sel::@return (byte) mulu8_sel::return @@ -8342,7 +8350,7 @@ FINAL SYMBOL TABLE (byte) mulu8_sel::return#12 reg byte a 1.714285714285714 (byte) mulu8_sel::return#2 reg byte a 4.0 (byte) mulu8_sel::select -(byte) mulu8_sel::select#5 select zp[1]:20 0.3333333333333333 +(byte) mulu8_sel::select#5 select zp[1]:19 0.3333333333333333 (byte) mulu8_sel::v1 (byte) mulu8_sel::v1#0 reg byte x 2.0 (byte) mulu8_sel::v1#1 reg byte x 2.0 @@ -8362,7 +8370,7 @@ FINAL SYMBOL TABLE (label) print_byte::@1 (label) print_byte::@return (byte) print_byte::b -(byte) print_byte::b#0 b zp[1]:20 1.5 +(byte) print_byte::b#0 b zp[1]:16 1.5 (void()) print_char((byte) print_char::ch) (label) print_char::@return (byte) print_char::ch @@ -8370,11 +8378,11 @@ FINAL SYMBOL TABLE (byte) print_char::ch#3 reg byte a 4.0 (byte) print_char::ch#4 reg byte a 6.0 (byte*) print_char_cursor -(byte*) print_char_cursor#1 print_char_cursor zp[2]:21 101.0 -(byte*) print_char_cursor#10 print_char_cursor zp[2]:21 0.42105263157894735 -(byte*) print_char_cursor#19 print_char_cursor zp[2]:21 45.142857142857146 -(byte*) print_char_cursor#28 print_char_cursor zp[2]:21 6.0 -(byte*) print_char_cursor#42 print_char_cursor zp[2]:21 1.25 +(byte*) print_char_cursor#1 print_char_cursor zp[2]:17 101.0 +(byte*) print_char_cursor#10 print_char_cursor zp[2]:17 0.42105263157894735 +(byte*) print_char_cursor#19 print_char_cursor zp[2]:17 45.142857142857146 +(byte*) print_char_cursor#28 print_char_cursor zp[2]:17 6.0 +(byte*) print_char_cursor#42 print_char_cursor zp[2]:17 1.25 (void()) print_cls() (label) print_cls::@return (const byte[]) print_hextab = (string) "0123456789abcdef"z @@ -8387,21 +8395,21 @@ FINAL SYMBOL TABLE (label) print_sbyte::@4 (label) print_sbyte::@return (signed byte) print_sbyte::b -(signed byte) print_sbyte::b#0 b zp[1]:20 4.0 -(signed byte) print_sbyte::b#1 b zp[1]:20 2.8333333333333335 -(signed byte) print_sbyte::b#4 b zp[1]:20 4.0 +(signed byte) print_sbyte::b#0 b zp[1]:16 4.0 +(signed byte) print_sbyte::b#1 b zp[1]:16 2.8333333333333335 +(signed byte) print_sbyte::b#4 b zp[1]:16 4.0 (byte*) print_screen (void()) print_str((byte*) print_str::str) (label) print_str::@1 (label) print_str::@2 (label) print_str::@return (byte*) print_str::str -(byte*) print_str::str#0 str zp[2]:14 202.0 -(byte*) print_str::str#2 str zp[2]:14 101.0 +(byte*) print_str::str#0 str zp[2]:10 202.0 +(byte*) print_str::str#2 str zp[2]:10 101.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:14 0.8 +(word) rem16u#1 rem16u zp[2]:10 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:6 4.0 +(dword~) sin16s::$4 zp[4]:26 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -8416,16 +8424,16 @@ FINAL SYMBOL TABLE (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:20 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:24 22.0 -(signed word) sin16s::return#1 return zp[2]:24 5.0 -(signed word~) sin16s::return#5 return zp[2]:24 4.0 +(signed word) sin16s::return#0 return zp[2]:20 22.0 +(signed word) sin16s::return#1 return zp[2]:20 5.0 +(signed word~) sin16s::return#5 return zp[2]:20 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:24 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:20 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:24 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:24 1.0 +(word) sin16s::usinx#0 usinx zp[2]:20 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:20 1.0 (dword) sin16s::x (dword) sin16s::x#0 x zp[4]:6 8.5 (dword) sin16s::x#1 x zp[4]:6 4.0 @@ -8435,38 +8443,38 @@ FINAL SYMBOL TABLE (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:30 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:16 4.0 +(word) sin16s::x2#0 x2 zp[2]:12 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:16 1.0 +(word) sin16s::x3#0 x3 zp[2]:12 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:32 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:16 4.0 +(word) sin16s::x4#0 x4 zp[2]:12 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:32 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:32 4.0 (void()) sin16s_gen((signed word*) sin16s_gen::sintab , (word) sin16s_gen::wavelength) -(signed word~) sin16s_gen::$2 zp[2]:24 22.0 +(signed word~) sin16s_gen::$2 zp[2]:20 22.0 (label) sin16s_gen::@1 (label) sin16s_gen::@2 (label) sin16s_gen::@3 (label) sin16s_gen::@4 (label) sin16s_gen::@return (word) sin16s_gen::i -(word) sin16s_gen::i#1 i zp[2]:21 22.0 -(word) sin16s_gen::i#2 i zp[2]:21 3.666666666666667 +(word) sin16s_gen::i#1 i zp[2]:17 22.0 +(word) sin16s_gen::i#2 i zp[2]:17 3.666666666666667 (signed word*) sin16s_gen::sintab -(signed word*) sin16s_gen::sintab#0 sintab zp[2]:14 7.333333333333333 -(signed word*) sin16s_gen::sintab#2 sintab zp[2]:14 4.714285714285714 +(signed word*) sin16s_gen::sintab#0 sintab zp[2]:10 7.333333333333333 +(signed word*) sin16s_gen::sintab#2 sintab zp[2]:10 4.714285714285714 (dword) sin16s_gen::step -(dword) sin16s_gen::step#0 step zp[4]:26 1.1818181818181819 +(dword) sin16s_gen::step#0 step zp[4]:22 1.1818181818181819 (word) sin16s_gen::wavelength (dword) sin16s_gen::x (dword) sin16s_gen::x#1 x zp[4]:2 11.0 (dword) sin16s_gen::x#2 x zp[4]:2 4.125 (signed byte()) sin8s((word) sin8s::x) -(word~) sin8s::$4 zp[2]:21 4.0 +(word~) sin8s::$4 zp[2]:17 4.0 (label) sin8s::@1 (label) sin8s::@10 (label) sin8s::@11 @@ -8484,7 +8492,7 @@ FINAL SYMBOL TABLE (label) sin8s::@return (const byte) sin8s::DIV_6 = (byte) $2b (byte) sin8s::isUpper -(byte) sin8s::isUpper#10 isUpper zp[1]:23 0.05555555555555555 +(byte) sin8s::isUpper#10 isUpper zp[1]:16 0.05555555555555555 (signed byte) sin8s::return (signed byte) sin8s::return#0 reg byte a 22.0 (signed byte) sin8s::return#1 reg byte a 5.0 @@ -8497,11 +8505,11 @@ FINAL SYMBOL TABLE (byte) sin8s::usinx#2 reg byte x 4.0 (byte) sin8s::usinx#4 reg byte x 2.0 (word) sin8s::x -(word) sin8s::x#0 x zp[2]:21 8.5 -(word) sin8s::x#1 x zp[2]:21 4.0 -(word) sin8s::x#2 x zp[2]:21 4.0 -(word) sin8s::x#4 x zp[2]:21 5.0 -(word) sin8s::x#6 x zp[2]:21 6.0 +(word) sin8s::x#0 x zp[2]:17 8.5 +(word) sin8s::x#1 x zp[2]:17 4.0 +(word) sin8s::x#2 x zp[2]:17 4.0 +(word) sin8s::x#4 x zp[2]:17 5.0 +(word) sin8s::x#6 x zp[2]:17 6.0 (byte) sin8s::x1 (byte) sin8s::x1#0 x1 zp[1]:34 0.6363636363636365 (byte) sin8s::x2 @@ -8524,13 +8532,13 @@ FINAL SYMBOL TABLE (label) sin8s_gen::@4 (label) sin8s_gen::@return (word) sin8s_gen::i -(word) sin8s_gen::i#1 i zp[2]:18 22.0 -(word) sin8s_gen::i#2 i zp[2]:18 3.666666666666667 +(word) sin8s_gen::i#1 i zp[2]:14 22.0 +(word) sin8s_gen::i#2 i zp[2]:14 3.666666666666667 (signed byte*) sin8s_gen::sintab -(signed byte*) sin8s_gen::sintab#0 sintab zp[2]:24 7.333333333333333 -(signed byte*) sin8s_gen::sintab#2 sintab zp[2]:24 4.714285714285714 +(signed byte*) sin8s_gen::sintab#0 sintab zp[2]:20 7.333333333333333 +(signed byte*) sin8s_gen::sintab#2 sintab zp[2]:20 4.714285714285714 (word) sin8s_gen::step -(word) sin8s_gen::step#0 step zp[2]:16 1.1818181818181819 +(word) sin8s_gen::step#0 step zp[2]:12 1.1818181818181819 (word) sin8s_gen::wavelength (word) sin8s_gen::x (word) sin8s_gen::x#1 x zp[2]:32 11.0 @@ -8539,28 +8547,29 @@ FINAL SYMBOL TABLE reg byte x [ main::i#2 main::i#1 ] reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] zp[4]:2 [ sin16s_gen::x#2 sin16s_gen::x#1 ] +reg byte y [ sin16s::isUpper#2 ] reg byte x [ mulu16_sel::select#5 ] -zp[4]:6 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] -zp[4]:10 [ mul16u::mb#2 mul16u::mb#1 ] -zp[2]:14 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 memset::dst#2 memset::dst#1 print_str::str#2 print_str::str#0 ] -zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +zp[4]:6 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] +zp[2]:10 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 memset::dst#2 memset::dst#1 print_str::str#2 print_str::str#0 ] +zp[2]:12 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[2]:18 [ sin8s_gen::i#2 sin8s_gen::i#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +zp[2]:14 [ sin8s_gen::i#2 sin8s_gen::i#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +zp[1]:16 [ sin8s::isUpper#10 print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] reg byte x [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] reg byte a [ sin8s::return#1 sin8s::return#5 sin8s::sinx#1 ] 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 ] -zp[1]:20 [ mulu8_sel::select#5 sin16s::isUpper#2 print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] -zp[2]:21 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 sin16s_gen::i#2 sin16s_gen::i#1 print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] +zp[2]:17 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 sin16s_gen::i#2 sin16s_gen::i#1 print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] reg byte a [ mul8u::b#0 ] -zp[1]:23 [ main::sb#0 sin8s::isUpper#10 ] -zp[2]:24 [ main::$3 main::$11 main::$4 main::sw#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] +zp[1]:19 [ main::sb#0 mulu8_sel::select#5 ] +zp[2]:20 [ main::$3 main::$11 main::$4 main::sw#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] reg byte a [ main::$6 ] reg byte a [ main::sd#0 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -zp[4]:26 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +zp[4]:22 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +zp[4]:26 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] zp[2]:30 [ sin16s::x1#0 mul8u::mb#2 mul8u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:32 [ div32u16u::quotient_hi#0 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 sin8s_gen::x#2 sin8s_gen::x#1 mul16u::a#2 mul16u::a#1 mul16u::a#0 ] @@ -8586,7 +8595,7 @@ reg byte a [ mul8u::$1 ] FINAL ASSEMBLER -Score: 32036 +Score: 32073 // File Comments // Upstart @@ -8608,8 +8617,8 @@ Score: 32036 // PI/2 in u[4.12] format .const PI_HALF_u4f12 = $1922 .label print_line_cursor = $400 - .label rem16u = $e - .label print_char_cursor = $15 + .label rem16u = $a + .label print_char_cursor = $11 // @begin // [1] phi from @begin to @1 [phi:@begin->@1] // @1 @@ -8620,11 +8629,11 @@ Score: 32036 // main main: { .label wavelength = $c0 - .label __3 = $18 - .label __4 = $18 - .label __11 = $18 - .label sb = $17 - .label sw = $18 + .label __3 = $14 + .label __4 = $14 + .label __11 = $14 + .label sb = $13 + .label sw = $14 // sin8s_gen(sintabb, wavelength) // [5] call sin8s_gen // [164] phi from main to sin8s_gen [phi:main->sin8s_gen] @@ -8723,9 +8732,9 @@ main: { } // print_str // Print a zero-terminated string -// print_str(byte* zeropage($e) str) +// print_str(byte* zeropage($a) str) print_str: { - .label str = $e + .label str = $a // [26] phi from print_str to print_str::@1 [phi:print_str->print_str::@1] // [26] phi (byte*) print_char_cursor#19 = (byte*) print_char_cursor#10 [phi:print_str->print_str::@1#0] -- register_copy // [26] phi (byte*) print_str::str#2 = (const string) main::str [phi:print_str->print_str::@1#1] -- pbuz1=pbuc1 @@ -8770,9 +8779,9 @@ print_str: { } // print_sbyte // Print a signed byte as HEX -// print_sbyte(signed byte zeropage($14) b) +// print_sbyte(signed byte zeropage($10) b) print_sbyte: { - .label b = $14 + .label b = $10 // if(b<0) // [32] if((signed byte) print_sbyte::b#1<(signed byte) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1 lda.z b @@ -8839,9 +8848,9 @@ print_char: { } // print_byte // Print a byte as HEX -// print_byte(byte zeropage($14) b) +// print_byte(byte zeropage($10) b) print_byte: { - .label b = $14 + .label b = $10 // b>>4 // [46] (byte~) print_byte::$0 ← (byte) print_byte::b#0 >> (byte) 4 -- vbuaa=vbuz1_ror_4 lda.z b @@ -8896,7 +8905,7 @@ memset: { .const num = $3e8 .label str = print_line_cursor .label end = str+num - .label dst = $e + .label dst = $a // [57] phi from memset to memset::@1 [phi:memset->memset::@1] // [57] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1 lda #div32u16u] @@ -9053,19 +9062,18 @@ sin16s_gen: { // result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff // sin16s(dword zeropage(6) x) sin16s: { - .label __4 = 6 + .label __4 = $1a .label x = 6 - .label return = $18 + .label return = $14 .label x1 = $1e - .label x2 = $10 - .label x3 = $10 + .label x2 = $c + .label x3 = $c .label x3_6 = $20 - .label usinx = $18 - .label x4 = $10 + .label usinx = $14 + .label x4 = $c .label x5 = $20 .label x5_128 = $20 - .label sinx = $18 - .label isUpper = $14 + .label sinx = $14 // if(x >= PI_u4f28 ) // [77] if((dword) sin16s::x#0<(const dword) PI_u4f28) goto sin16s::@1 -- vduz1_lt_vduc1_then_la1 lda.z x+3 @@ -9101,16 +9109,14 @@ sin16s: { sbc #>PI_u4f28>>$10 sta.z x+3 // [79] phi from sin16s::@4 to sin16s::@1 [phi:sin16s::@4->sin16s::@1] - // [79] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z isUpper + // [79] phi (byte) sin16s::isUpper#2 = (byte) 1 [phi:sin16s::@4->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #1 // [79] phi (dword) sin16s::x#4 = (dword) sin16s::x#1 [phi:sin16s::@4->sin16s::@1#1] -- register_copy jmp __b1 // [79] phi from sin16s to sin16s::@1 [phi:sin16s->sin16s::@1] b1: - // [79] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z isUpper + // [79] phi (byte) sin16s::isUpper#2 = (byte) 0 [phi:sin16s->sin16s::@1#0] -- vbuyy=vbuc1 + ldy #0 // [79] phi (dword) sin16s::x#4 = (dword) sin16s::x#0 [phi:sin16s->sin16s::@1#1] -- register_copy // sin16s::@1 __b1: @@ -9153,15 +9159,27 @@ sin16s: { // sin16s::@2 __b2: // x<<3 - // [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz1_rol_3 - ldy #3 - !: + // [83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte) 3 -- vduz1=vduz2_rol_3 + lda.z x + asl + sta.z __4 + lda.z x+1 + rol + sta.z __4+1 + lda.z x+2 + rol + sta.z __4+2 + lda.z x+3 + rol + sta.z __4+3 + asl.z __4 + rol.z __4+1 + rol.z __4+2 + rol.z __4+3 asl.z __4 rol.z __4+1 rol.z __4+2 rol.z __4+3 - dey - bne !- // x1 = >x<<3 // [84] (word) sin16s::x1#0 ← > (dword~) sin16s::$4 -- vwuz1=_hi_vduz2 lda.z __4+2 @@ -9307,9 +9325,8 @@ sin16s: { adc.z x5_128+1 sta.z usinx+1 // if(isUpper!=0) - // [112] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuz1_eq_0_then_la1 - lda.z isUpper - cmp #0 + // [112] if((byte) sin16s::isUpper#2==(byte) 0) goto sin16s::@12 -- vbuyy_eq_0_then_la1 + cpy #0 beq __b3 // sin16s::@6 // sinx = -(signed word)usinx @@ -9335,14 +9352,14 @@ sin16s: { // mulu16_sel // Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result. // The select parameter indicates how many of the highest bits of the 32-bit result to skip -// mulu16_sel(word zeropage($10) v1, word zeropage($12) v2, byte register(X) select) +// mulu16_sel(word zeropage($c) v1, word zeropage($e) v2, byte register(X) select) mulu16_sel: { .label __0 = 6 .label __1 = 6 - .label v1 = $10 - .label v2 = $12 + .label v1 = $c + .label v2 = $e .label return = $20 - .label return_1 = $10 + .label return_1 = $c // mul16u(v1, v2) // [118] (word) mul16u::a#1 ← (word) mulu16_sel::v1#5 -- vwuz1=vwuz2 lda.z v1 @@ -9382,12 +9399,12 @@ mulu16_sel: { } // mul16u // Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word -// mul16u(word zeropage($20) a, word zeropage($12) b) +// mul16u(word zeropage($20) a, word zeropage($e) b) mul16u: { .label a = $20 - .label mb = $a + .label mb = $1a .label res = 6 - .label b = $12 + .label b = $e .label return = 6 // [127] phi from mul16u to mul16u::@1 [phi:mul16u->mul16u::@1] // [127] phi (dword) mul16u::mb#2 = (word) mul16u::b#0 [phi:mul16u->mul16u::@1#0] -- vduz1=vwuz2 @@ -9467,8 +9484,8 @@ mul16u: { // The 16-bit word remainder can be found in rem16u after the division div32u16u: { .label quotient_hi = $20 - .label quotient_lo = $10 - .label return = $1a + .label quotient_lo = $c + .label return = $16 // divr16u(>dividend, divisor, 0) // [137] call divr16u // [146] phi from div32u16u to divr16u [phi:div32u16u->divr16u] @@ -9527,12 +9544,12 @@ div32u16u: { // Returns the quotient dividend/divisor. // The final remainder will be set into the global variable rem16u // Implemented using simple binary division -// divr16u(word zeropage($18) dividend, word zeropage($e) rem) +// divr16u(word zeropage($14) dividend, word zeropage($a) rem) divr16u: { - .label rem = $e - .label dividend = $18 - .label quotient = $10 - .label return = $10 + .label rem = $a + .label dividend = $14 + .label quotient = $c + .label return = $c // [147] phi from divr16u to divr16u::@1 [phi:divr16u->divr16u::@1] // [147] phi (byte) divr16u::i#2 = (byte) 0 [phi:divr16u->divr16u::@1#0] -- vbuxx=vbuc1 ldx #0 @@ -9630,12 +9647,12 @@ divr16u: { // Generate signed byte sinus table - on the full -$7f - $7f range // sintab - the table to generate into // wavelength - the number of sinus points in a total sinus wavelength (the size of the table) -// sin8s_gen(signed byte* zeropage($18) sintab) +// sin8s_gen(signed byte* zeropage($14) sintab) sin8s_gen: { - .label step = $10 - .label sintab = $18 + .label step = $c + .label sintab = $14 .label x = $20 - .label i = $12 + .label i = $e // div16u(PI2_u4f12, wavelength) // [165] call div16u // [241] phi from sin8s_gen to div16u [phi:sin8s_gen->div16u] @@ -9723,16 +9740,16 @@ sin8s_gen: { // Calculate signed byte sinus sin(x) // x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12 // result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f -// sin8s(word zeropage($15) x) +// sin8s(word zeropage($11) x) sin8s: { // u[2.6] x^3 .const DIV_6 = $2b - .label __4 = $15 - .label x = $15 + .label __4 = $11 + .label x = $11 .label x1 = $22 .label x3 = $23 .label usinx = $24 - .label isUpper = $17 + .label isUpper = $10 // if(x >= PI_u4f12 ) // [179] if((word) sin8s::x#0<(const word) PI_u4f12) goto sin8s::@1 -- vwuz1_lt_vwuc1_then_la1 lda.z x+1 @@ -9950,11 +9967,11 @@ sin8s: { // mulu8_sel // Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result. // The select parameter indicates how many of the highest bits of the 16-bit result to skip -// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($14) select) +// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($13) select) mulu8_sel: { - .label __0 = $15 - .label __1 = $15 - .label select = $14 + .label __0 = $11 + .label __1 = $11 + .label select = $13 // mul8u(v1, v2) // [223] (byte) mul8u::a#1 ← (byte) mulu8_sel::v1#5 // [224] (byte) mul8u::b#0 ← (byte) mulu8_sel::v2#5 -- vbuaa=vbuyy @@ -9989,8 +10006,8 @@ mulu8_sel: { // mul8u(byte register(X) a, byte register(A) b) mul8u: { .label mb = $1e - .label res = $15 - .label return = $15 + .label res = $11 + .label return = $11 // [232] phi from mul8u to mul8u::@1 [phi:mul8u->mul8u::@1] // [232] phi (word) mul8u::mb#2 = (byte) mul8u::b#0 [phi:mul8u->mul8u::@1#0] -- vwuz1=vbuaa sta.z mb @@ -10055,7 +10072,7 @@ mul8u: { // The remainder will be set into the global variable rem16u // Implemented using simple binary division div16u: { - .label return = $10 + .label return = $c // divr16u(dividend, divisor, 0) // [242] call divr16u // [146] phi from div16u to divr16u [phi:div16u->divr16u] diff --git a/src/test/ref/sinusgen8b.sym b/src/test/ref/sinusgen8b.sym index 1c538e468..35e9aff7f 100644 --- a/src/test/ref/sinusgen8b.sym +++ b/src/test/ref/sinusgen8b.sym @@ -18,8 +18,8 @@ (word) div16u::dividend (word) div16u::divisor (word) div16u::return -(word) div16u::return#0 return zp[2]:16 1.3333333333333333 -(word) div16u::return#2 return zp[2]:16 4.0 +(word) div16u::return#0 return zp[2]:12 1.3333333333333333 +(word) div16u::return#2 return zp[2]:12 4.0 (dword()) div32u16u((dword) div32u16u::dividend , (word) div32u16u::divisor) (label) div32u16u::@1 (label) div32u16u::@2 @@ -30,10 +30,10 @@ (word) div32u16u::quotient_hi (word) div32u16u::quotient_hi#0 quotient_hi zp[2]:32 0.8 (word) div32u16u::quotient_lo -(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:16 4.0 +(word) div32u16u::quotient_lo#0 quotient_lo zp[2]:12 4.0 (dword) div32u16u::return -(dword) div32u16u::return#0 return zp[4]:26 1.3333333333333333 -(dword) div32u16u::return#2 return zp[4]:26 4.0 +(dword) div32u16u::return#0 return zp[4]:22 1.3333333333333333 +(dword) div32u16u::return#2 return zp[4]:22 4.0 (word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem) (byte~) divr16u::$1 reg byte a 22.0 (byte~) divr16u::$2 reg byte a 22.0 @@ -45,35 +45,35 @@ (label) divr16u::@6 (label) divr16u::@return (word) divr16u::dividend -(word) divr16u::dividend#0 dividend zp[2]:24 2.75 -(word) divr16u::dividend#4 dividend zp[2]:24 5.0 -(word) divr16u::dividend#6 dividend zp[2]:24 2.0 +(word) divr16u::dividend#0 dividend zp[2]:20 2.75 +(word) divr16u::dividend#4 dividend zp[2]:20 5.0 +(word) divr16u::dividend#6 dividend zp[2]:20 2.0 (word) divr16u::divisor (byte) divr16u::i (byte) divr16u::i#1 reg byte x 16.5 (byte) divr16u::i#2 reg byte x 1.6923076923076923 (word) divr16u::quotient -(word) divr16u::quotient#1 quotient zp[2]:16 16.5 -(word) divr16u::quotient#2 quotient zp[2]:16 11.0 -(word) divr16u::quotient#3 quotient zp[2]:16 2.75 +(word) divr16u::quotient#1 quotient zp[2]:12 16.5 +(word) divr16u::quotient#2 quotient zp[2]:12 11.0 +(word) divr16u::quotient#3 quotient zp[2]:12 2.75 (word) divr16u::rem -(word) divr16u::rem#0 rem zp[2]:14 8.25 -(word) divr16u::rem#1 rem zp[2]:14 22.0 -(word) divr16u::rem#10 rem zp[2]:14 11.666666666666666 -(word) divr16u::rem#11 rem zp[2]:14 4.0 -(word) divr16u::rem#2 rem zp[2]:14 22.0 -(word) divr16u::rem#5 rem zp[2]:14 4.0 -(word) divr16u::rem#6 rem zp[2]:14 24.0 -(word) divr16u::rem#7 rem zp[2]:14 11.0 +(word) divr16u::rem#0 rem zp[2]:10 8.25 +(word) divr16u::rem#1 rem zp[2]:10 22.0 +(word) divr16u::rem#10 rem zp[2]:10 11.666666666666666 +(word) divr16u::rem#11 rem zp[2]:10 4.0 +(word) divr16u::rem#2 rem zp[2]:10 22.0 +(word) divr16u::rem#5 rem zp[2]:10 4.0 +(word) divr16u::rem#6 rem zp[2]:10 24.0 +(word) divr16u::rem#7 rem zp[2]:10 11.0 (word) divr16u::return -(word) divr16u::return#0 return zp[2]:16 4.875 -(word) divr16u::return#2 return zp[2]:16 4.0 -(word) divr16u::return#3 return zp[2]:16 4.0 -(word) divr16u::return#4 return zp[2]:16 4.0 +(word) divr16u::return#0 return zp[2]:12 4.875 +(word) divr16u::return#2 return zp[2]:12 4.0 +(word) divr16u::return#3 return zp[2]:12 4.0 +(word) divr16u::return#4 return zp[2]:12 4.0 (void()) main() -(word~) main::$11 zp[2]:24 22.0 -(word~) main::$3 zp[2]:24 22.0 -(signed word*~) main::$4 zp[2]:24 22.0 +(word~) main::$11 zp[2]:20 22.0 +(word~) main::$3 zp[2]:20 22.0 +(signed word*~) main::$4 zp[2]:20 22.0 (byte~) main::$6 reg byte a 11.0 (label) main::@1 (label) main::@2 @@ -85,14 +85,14 @@ (byte) main::i#1 reg byte x 16.5 (byte) main::i#2 reg byte x 2.75 (signed byte) main::sb -(signed byte) main::sb#0 sb zp[1]:23 3.6666666666666665 +(signed byte) main::sb#0 sb zp[1]:19 3.6666666666666665 (signed byte) main::sd (signed byte) main::sd#0 reg byte a 22.0 (const signed byte[$c0]) main::sintabb = { fill( $c0, 0) } (const signed word[$c0]) main::sintabw = { fill( $c0, 0) } (const string) main::str = (string) " " (signed word) main::sw -(signed word) main::sw#0 sw zp[2]:24 22.0 +(signed word) main::sw#0 sw zp[2]:20 22.0 (const word) main::wavelength = (byte) $c0 (void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num) (label) memset::@1 @@ -101,8 +101,8 @@ (byte) memset::c (const byte) memset::c#0 c = (byte) ' ' (byte*) memset::dst -(byte*) memset::dst#1 dst zp[2]:14 22.0 -(byte*) memset::dst#2 dst zp[2]:14 14.666666666666666 +(byte*) memset::dst#1 dst zp[2]:10 22.0 +(byte*) memset::dst#2 dst zp[2]:10 14.666666666666666 (byte*) memset::end (const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0 (word) memset::num @@ -122,10 +122,10 @@ (word) mul16u::a#1 a zp[2]:32 1.3333333333333333 (word) mul16u::a#2 a zp[2]:32 67.66666666666666 (word) mul16u::b -(word) mul16u::b#0 b zp[2]:18 2.0 +(word) mul16u::b#0 b zp[2]:14 2.0 (dword) mul16u::mb -(dword) mul16u::mb#1 mb zp[4]:10 202.0 -(dword) mul16u::mb#2 mb zp[4]:10 43.57142857142858 +(dword) mul16u::mb#1 mb zp[4]:26 202.0 +(dword) mul16u::mb#2 mb zp[4]:26 43.57142857142858 (dword) mul16u::res (dword) mul16u::res#1 res zp[4]:6 202.0 (dword) mul16u::res#2 res zp[4]:6 50.83333333333333 @@ -149,11 +149,11 @@ (word) mul8u::mb#1 mb zp[2]:30 202.0 (word) mul8u::mb#2 mb zp[2]:30 43.57142857142858 (word) mul8u::res -(word) mul8u::res#1 res zp[2]:21 202.0 -(word) mul8u::res#2 res zp[2]:21 50.83333333333333 -(word) mul8u::res#6 res zp[2]:21 101.0 +(word) mul8u::res#1 res zp[2]:17 202.0 +(word) mul8u::res#2 res zp[2]:17 50.83333333333333 +(word) mul8u::res#6 res zp[2]:17 101.0 (word) mul8u::return -(word) mul8u::return#2 return zp[2]:21 4.0 +(word) mul8u::return#2 return zp[2]:17 4.0 (word()) mulu16_sel((word) mulu16_sel::v1 , (word) mulu16_sel::v2 , (byte) mulu16_sel::select) (dword~) mulu16_sel::$0 zp[4]:6 4.0 (dword~) mulu16_sel::$1 zp[4]:6 4.0 @@ -161,29 +161,29 @@ (label) mulu16_sel::@return (word) mulu16_sel::return (word) mulu16_sel::return#0 return zp[2]:32 4.0 -(word) mulu16_sel::return#1 return_1 zp[2]:16 4.0 -(word) mulu16_sel::return#10 return_1 zp[2]:16 4.0 +(word) mulu16_sel::return#1 return_1 zp[2]:12 4.0 +(word) mulu16_sel::return#10 return_1 zp[2]:12 4.0 (word) mulu16_sel::return#11 return zp[2]:32 4.0 (word) mulu16_sel::return#12 return zp[2]:32 1.714285714285714 (word) mulu16_sel::return#2 return zp[2]:32 4.0 (byte) mulu16_sel::select (byte) mulu16_sel::select#5 reg byte x 0.3333333333333333 (word) mulu16_sel::v1 -(word) mulu16_sel::v1#0 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#1 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#2 v1 zp[2]:16 4.0 -(word) mulu16_sel::v1#3 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#4 v1 zp[2]:16 2.0 -(word) mulu16_sel::v1#5 v1 zp[2]:16 12.0 +(word) mulu16_sel::v1#0 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#1 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#2 v1 zp[2]:12 4.0 +(word) mulu16_sel::v1#3 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#4 v1 zp[2]:12 2.0 +(word) mulu16_sel::v1#5 v1 zp[2]:12 12.0 (word) mulu16_sel::v2 -(word) mulu16_sel::v2#0 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#1 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#3 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#4 v2 zp[2]:18 4.0 -(word) mulu16_sel::v2#5 v2 zp[2]:18 5.0 +(word) mulu16_sel::v2#0 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#1 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#3 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#4 v2 zp[2]:14 4.0 +(word) mulu16_sel::v2#5 v2 zp[2]:14 5.0 (byte()) mulu8_sel((byte) mulu8_sel::v1 , (byte) mulu8_sel::v2 , (byte) mulu8_sel::select) -(word~) mulu8_sel::$0 zp[2]:21 4.0 -(word~) mulu8_sel::$1 zp[2]:21 4.0 +(word~) mulu8_sel::$0 zp[2]:17 4.0 +(word~) mulu8_sel::$1 zp[2]:17 4.0 (label) mulu8_sel::@1 (label) mulu8_sel::@return (byte) mulu8_sel::return @@ -194,7 +194,7 @@ (byte) mulu8_sel::return#12 reg byte a 1.714285714285714 (byte) mulu8_sel::return#2 reg byte a 4.0 (byte) mulu8_sel::select -(byte) mulu8_sel::select#5 select zp[1]:20 0.3333333333333333 +(byte) mulu8_sel::select#5 select zp[1]:19 0.3333333333333333 (byte) mulu8_sel::v1 (byte) mulu8_sel::v1#0 reg byte x 2.0 (byte) mulu8_sel::v1#1 reg byte x 2.0 @@ -214,7 +214,7 @@ (label) print_byte::@1 (label) print_byte::@return (byte) print_byte::b -(byte) print_byte::b#0 b zp[1]:20 1.5 +(byte) print_byte::b#0 b zp[1]:16 1.5 (void()) print_char((byte) print_char::ch) (label) print_char::@return (byte) print_char::ch @@ -222,11 +222,11 @@ (byte) print_char::ch#3 reg byte a 4.0 (byte) print_char::ch#4 reg byte a 6.0 (byte*) print_char_cursor -(byte*) print_char_cursor#1 print_char_cursor zp[2]:21 101.0 -(byte*) print_char_cursor#10 print_char_cursor zp[2]:21 0.42105263157894735 -(byte*) print_char_cursor#19 print_char_cursor zp[2]:21 45.142857142857146 -(byte*) print_char_cursor#28 print_char_cursor zp[2]:21 6.0 -(byte*) print_char_cursor#42 print_char_cursor zp[2]:21 1.25 +(byte*) print_char_cursor#1 print_char_cursor zp[2]:17 101.0 +(byte*) print_char_cursor#10 print_char_cursor zp[2]:17 0.42105263157894735 +(byte*) print_char_cursor#19 print_char_cursor zp[2]:17 45.142857142857146 +(byte*) print_char_cursor#28 print_char_cursor zp[2]:17 6.0 +(byte*) print_char_cursor#42 print_char_cursor zp[2]:17 1.25 (void()) print_cls() (label) print_cls::@return (const byte[]) print_hextab = (string) "0123456789abcdef"z @@ -239,21 +239,21 @@ (label) print_sbyte::@4 (label) print_sbyte::@return (signed byte) print_sbyte::b -(signed byte) print_sbyte::b#0 b zp[1]:20 4.0 -(signed byte) print_sbyte::b#1 b zp[1]:20 2.8333333333333335 -(signed byte) print_sbyte::b#4 b zp[1]:20 4.0 +(signed byte) print_sbyte::b#0 b zp[1]:16 4.0 +(signed byte) print_sbyte::b#1 b zp[1]:16 2.8333333333333335 +(signed byte) print_sbyte::b#4 b zp[1]:16 4.0 (byte*) print_screen (void()) print_str((byte*) print_str::str) (label) print_str::@1 (label) print_str::@2 (label) print_str::@return (byte*) print_str::str -(byte*) print_str::str#0 str zp[2]:14 202.0 -(byte*) print_str::str#2 str zp[2]:14 101.0 +(byte*) print_str::str#0 str zp[2]:10 202.0 +(byte*) print_str::str#2 str zp[2]:10 101.0 (word) rem16u -(word) rem16u#1 rem16u zp[2]:14 0.8 +(word) rem16u#1 rem16u zp[2]:10 0.8 (signed word()) sin16s((dword) sin16s::x) -(dword~) sin16s::$4 zp[4]:6 4.0 +(dword~) sin16s::$4 zp[4]:26 4.0 (label) sin16s::@1 (label) sin16s::@10 (label) sin16s::@11 @@ -268,16 +268,16 @@ (label) sin16s::@9 (label) sin16s::@return (byte) sin16s::isUpper -(byte) sin16s::isUpper#2 isUpper zp[1]:20 0.06060606060606061 +(byte) sin16s::isUpper#2 reg byte y 0.06060606060606061 (signed word) sin16s::return -(signed word) sin16s::return#0 return zp[2]:24 22.0 -(signed word) sin16s::return#1 return zp[2]:24 5.0 -(signed word~) sin16s::return#5 return zp[2]:24 4.0 +(signed word) sin16s::return#0 return zp[2]:20 22.0 +(signed word) sin16s::return#1 return zp[2]:20 5.0 +(signed word~) sin16s::return#5 return zp[2]:20 4.0 (signed word) sin16s::sinx -(signed word) sin16s::sinx#1 sinx zp[2]:24 4.0 +(signed word) sin16s::sinx#1 sinx zp[2]:20 4.0 (word) sin16s::usinx -(word) sin16s::usinx#0 usinx zp[2]:24 0.3333333333333333 -(word) sin16s::usinx#1 usinx zp[2]:24 1.0 +(word) sin16s::usinx#0 usinx zp[2]:20 0.3333333333333333 +(word) sin16s::usinx#1 usinx zp[2]:20 1.0 (dword) sin16s::x (dword) sin16s::x#0 x zp[4]:6 8.5 (dword) sin16s::x#1 x zp[4]:6 4.0 @@ -287,38 +287,38 @@ (word) sin16s::x1 (word) sin16s::x1#0 x1 zp[2]:30 0.6363636363636365 (word) sin16s::x2 -(word) sin16s::x2#0 x2 zp[2]:16 4.0 +(word) sin16s::x2#0 x2 zp[2]:12 4.0 (word) sin16s::x3 -(word) sin16s::x3#0 x3 zp[2]:16 1.0 +(word) sin16s::x3#0 x3 zp[2]:12 1.0 (word) sin16s::x3_6 (word) sin16s::x3_6#0 x3_6 zp[2]:32 4.0 (word) sin16s::x4 -(word) sin16s::x4#0 x4 zp[2]:16 4.0 +(word) sin16s::x4#0 x4 zp[2]:12 4.0 (word) sin16s::x5 (word) sin16s::x5#0 x5 zp[2]:32 4.0 (word) sin16s::x5_128 (word) sin16s::x5_128#0 x5_128 zp[2]:32 4.0 (void()) sin16s_gen((signed word*) sin16s_gen::sintab , (word) sin16s_gen::wavelength) -(signed word~) sin16s_gen::$2 zp[2]:24 22.0 +(signed word~) sin16s_gen::$2 zp[2]:20 22.0 (label) sin16s_gen::@1 (label) sin16s_gen::@2 (label) sin16s_gen::@3 (label) sin16s_gen::@4 (label) sin16s_gen::@return (word) sin16s_gen::i -(word) sin16s_gen::i#1 i zp[2]:21 22.0 -(word) sin16s_gen::i#2 i zp[2]:21 3.666666666666667 +(word) sin16s_gen::i#1 i zp[2]:17 22.0 +(word) sin16s_gen::i#2 i zp[2]:17 3.666666666666667 (signed word*) sin16s_gen::sintab -(signed word*) sin16s_gen::sintab#0 sintab zp[2]:14 7.333333333333333 -(signed word*) sin16s_gen::sintab#2 sintab zp[2]:14 4.714285714285714 +(signed word*) sin16s_gen::sintab#0 sintab zp[2]:10 7.333333333333333 +(signed word*) sin16s_gen::sintab#2 sintab zp[2]:10 4.714285714285714 (dword) sin16s_gen::step -(dword) sin16s_gen::step#0 step zp[4]:26 1.1818181818181819 +(dword) sin16s_gen::step#0 step zp[4]:22 1.1818181818181819 (word) sin16s_gen::wavelength (dword) sin16s_gen::x (dword) sin16s_gen::x#1 x zp[4]:2 11.0 (dword) sin16s_gen::x#2 x zp[4]:2 4.125 (signed byte()) sin8s((word) sin8s::x) -(word~) sin8s::$4 zp[2]:21 4.0 +(word~) sin8s::$4 zp[2]:17 4.0 (label) sin8s::@1 (label) sin8s::@10 (label) sin8s::@11 @@ -336,7 +336,7 @@ (label) sin8s::@return (const byte) sin8s::DIV_6 = (byte) $2b (byte) sin8s::isUpper -(byte) sin8s::isUpper#10 isUpper zp[1]:23 0.05555555555555555 +(byte) sin8s::isUpper#10 isUpper zp[1]:16 0.05555555555555555 (signed byte) sin8s::return (signed byte) sin8s::return#0 reg byte a 22.0 (signed byte) sin8s::return#1 reg byte a 5.0 @@ -349,11 +349,11 @@ (byte) sin8s::usinx#2 reg byte x 4.0 (byte) sin8s::usinx#4 reg byte x 2.0 (word) sin8s::x -(word) sin8s::x#0 x zp[2]:21 8.5 -(word) sin8s::x#1 x zp[2]:21 4.0 -(word) sin8s::x#2 x zp[2]:21 4.0 -(word) sin8s::x#4 x zp[2]:21 5.0 -(word) sin8s::x#6 x zp[2]:21 6.0 +(word) sin8s::x#0 x zp[2]:17 8.5 +(word) sin8s::x#1 x zp[2]:17 4.0 +(word) sin8s::x#2 x zp[2]:17 4.0 +(word) sin8s::x#4 x zp[2]:17 5.0 +(word) sin8s::x#6 x zp[2]:17 6.0 (byte) sin8s::x1 (byte) sin8s::x1#0 x1 zp[1]:34 0.6363636363636365 (byte) sin8s::x2 @@ -376,13 +376,13 @@ (label) sin8s_gen::@4 (label) sin8s_gen::@return (word) sin8s_gen::i -(word) sin8s_gen::i#1 i zp[2]:18 22.0 -(word) sin8s_gen::i#2 i zp[2]:18 3.666666666666667 +(word) sin8s_gen::i#1 i zp[2]:14 22.0 +(word) sin8s_gen::i#2 i zp[2]:14 3.666666666666667 (signed byte*) sin8s_gen::sintab -(signed byte*) sin8s_gen::sintab#0 sintab zp[2]:24 7.333333333333333 -(signed byte*) sin8s_gen::sintab#2 sintab zp[2]:24 4.714285714285714 +(signed byte*) sin8s_gen::sintab#0 sintab zp[2]:20 7.333333333333333 +(signed byte*) sin8s_gen::sintab#2 sintab zp[2]:20 4.714285714285714 (word) sin8s_gen::step -(word) sin8s_gen::step#0 step zp[2]:16 1.1818181818181819 +(word) sin8s_gen::step#0 step zp[2]:12 1.1818181818181819 (word) sin8s_gen::wavelength (word) sin8s_gen::x (word) sin8s_gen::x#1 x zp[2]:32 11.0 @@ -391,28 +391,29 @@ reg byte x [ main::i#2 main::i#1 ] reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ] zp[4]:2 [ sin16s_gen::x#2 sin16s_gen::x#1 ] +reg byte y [ sin16s::isUpper#2 ] reg byte x [ mulu16_sel::select#5 ] -zp[4]:6 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 ] -zp[4]:10 [ mul16u::mb#2 mul16u::mb#1 ] -zp[2]:14 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 memset::dst#2 memset::dst#1 print_str::str#2 print_str::str#0 ] -zp[2]:16 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] +zp[4]:6 [ mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 ] +zp[2]:10 [ divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 memset::dst#2 memset::dst#1 print_str::str#2 print_str::str#0 ] +zp[2]:12 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 mulu16_sel::v1#5 mulu16_sel::v1#3 mulu16_sel::v1#4 mulu16_sel::v1#0 mulu16_sel::v1#1 mulu16_sel::v1#2 sin16s::x3#0 sin16s::x2#0 sin16s::x4#0 mulu16_sel::return#1 mulu16_sel::return#10 ] reg byte x [ divr16u::i#2 divr16u::i#1 ] -zp[2]:18 [ sin8s_gen::i#2 sin8s_gen::i#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +zp[2]:14 [ sin8s_gen::i#2 sin8s_gen::i#1 mulu16_sel::v2#5 mulu16_sel::v2#3 mulu16_sel::v2#4 mulu16_sel::v2#0 mulu16_sel::v2#1 mul16u::b#0 ] +zp[1]:16 [ sin8s::isUpper#10 print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] reg byte x [ sin8s::usinx#4 sin8s::usinx#1 sin8s::usinx#2 ] reg byte a [ sin8s::return#1 sin8s::return#5 sin8s::sinx#1 ] 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 ] -zp[1]:20 [ mulu8_sel::select#5 sin16s::isUpper#2 print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 print_byte::b#0 ] reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ] -zp[2]:21 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 sin16s_gen::i#2 sin16s_gen::i#1 print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] +zp[2]:17 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mulu8_sel::$0 mulu8_sel::$1 sin8s::x#6 sin8s::x#4 sin8s::x#0 sin8s::x#1 sin8s::x#2 sin8s::$4 sin16s_gen::i#2 sin16s_gen::i#1 print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 ] reg byte a [ mul8u::b#0 ] -zp[1]:23 [ main::sb#0 sin8s::isUpper#10 ] -zp[2]:24 [ main::$3 main::$11 main::$4 main::sw#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] +zp[1]:19 [ main::sb#0 mulu8_sel::select#5 ] +zp[2]:20 [ main::$3 main::$11 main::$4 main::sw#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$2 sin16s::usinx#0 ] reg byte a [ main::$6 ] reg byte a [ main::sd#0 ] reg byte a [ print_byte::$0 ] reg byte a [ print_byte::$2 ] -zp[4]:26 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +zp[4]:22 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ] +zp[4]:26 [ sin16s::$4 mul16u::mb#2 mul16u::mb#1 ] zp[2]:30 [ sin16s::x1#0 mul8u::mb#2 mul8u::mb#1 ] reg byte a [ mul16u::$1 ] zp[2]:32 [ div32u16u::quotient_hi#0 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 sin8s_gen::x#2 sin8s_gen::x#1 mul16u::a#2 mul16u::a#1 mul16u::a#0 ]