mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-11 20:37:40 +00:00
Added constant loop head optimization, that detects when the condition is constant in the first loop iteration. Closes #246
This commit is contained in:
parent
b2804ef335
commit
ce5e3cf19a
src
main/java/dk/camelot64/kickc
test/ref
bitmap-plot-1.asmbitmap-plot-1.cfgbitmap-plot-1.logbitmap-plot-1.symbitmap-plot-2.asmbitmap-plot-2.cfgbitmap-plot-2.logbitmap-plot-2.symbitmap-plot-3.asmbitmap-plot-3.cfgbitmap-plot-3.logbitmap-plot-3.symbitmap-plotter.asmbitmap-plotter.cfgbitmap-plotter.logbitmap-plotter.symbool-ifs-min.asmbool-ifs-min.cfgbool-ifs-min.logbool-ifs-min.symbool-vars.asmbool-vars.cfgbool-vars.logbool-vars.symc-types.asmc-types.cfgc-types.logc-types.symc64dtv-gfxexplorer.asmc64dtv-gfxexplorer.cfgc64dtv-gfxexplorer.logc64dtv-gfxexplorer.symc64dtv-gfxmodes.asmc64dtv-gfxmodes.cfgc64dtv-gfxmodes.logc64dtv-gfxmodes.symcomma-decl-for.asmcomma-decl-for.cfgcomma-decl-for.logcomma-decl-for.symcomma-expr-for.asmcomma-expr-for.cfgcomma-expr-for.logcomma-expr-for.symcomparison-rewriting-pointer.asmcomparison-rewriting-pointer.cfgcomparison-rewriting-pointer.logcomparison-rewriting-pointer.symcomparison-rewriting.asmcomparison-rewriting.cfgcomparison-rewriting.logcomparison-rewriting.symcondition-integer-0.asmcondition-integer-0.cfgcondition-integer-0.logcondition-integer-0.symcondition-integer-1.asmcondition-integer-1.cfgcondition-integer-1.logcondition-integer-1.symcondition-integer-2.asmcondition-integer-2.cfgcondition-integer-2.logcondition-integer-2.symcondition-integer-3.asmcondition-integer-3.cfgcondition-integer-3.logcondition-integer-3.symconst-identification.asmconst-identification.cfgconst-identification.logconst-identification.symconstants.asmconstants.cfgconstants.logconstants.symcordic-atan2-clear.asmcordic-atan2-clear.cfgcordic-atan2-clear.logcordic-atan2-clear.symdefault-font.asmdefault-font.cfgdefault-font.logdefault-font.symderefidx-word-0.asmderefidx-word-0.cfgderefidx-word-0.logderefidx-word-0.symeuclid-3.asmeuclid-3.cfg
complex
clearscreen
tetris
@ -31,8 +31,8 @@ public class Compiler {
|
||||
/** Enable the zero-page coalesce pass. It takes a lot of time, but limits the zero page usage significantly. */
|
||||
private boolean enableZeroPageCoalasce = false;
|
||||
|
||||
/** Enable loop head constant optimization. It identified whenever a while()/for() has a constant condition on the first iteration and rewrites it. */
|
||||
private boolean enableLoopHeadConstant = false;
|
||||
/** Disable loop head constant optimization. It identified whenever a while()/for() has a constant condition on the first iteration and rewrites it. */
|
||||
private boolean disableLoopHeadConstant = true;
|
||||
|
||||
public Compiler() {
|
||||
this.program = new Program();
|
||||
@ -46,8 +46,8 @@ public class Compiler {
|
||||
this.enableZeroPageCoalasce = true;
|
||||
}
|
||||
|
||||
void enableLoopHeadConstant() {
|
||||
this.enableLoopHeadConstant = true;
|
||||
void disableLoopHeadConstant() {
|
||||
this.disableLoopHeadConstant = false;
|
||||
}
|
||||
|
||||
void setTargetPlatform(TargetPlatform targetPlatform) {
|
||||
@ -312,7 +312,7 @@ public class Compiler {
|
||||
optimizations.add(new PassNSimplifyExpressionWithZero(program));
|
||||
optimizations.add(new PassNEliminateUnusedVars(program, true));
|
||||
optimizations.add(new Pass2EliminateUnusedBlocks(program));
|
||||
if(enableLoopHeadConstant) {
|
||||
if(!disableLoopHeadConstant) {
|
||||
optimizations.add(new PassNStatementIndices(program));
|
||||
optimizations.add(() -> { program.clearDominators(); return false; });
|
||||
optimizations.add(() -> { program.clearLoopSet(); return false; });
|
||||
|
@ -66,8 +66,8 @@ public class KickC implements Callable<Void> {
|
||||
@CommandLine.Option(names = {"-Ocoalesce"}, description = "Optimization Option. Enables zero-page coalesce pass which limits zero-page usage significantly, but takes a lot of compile time.")
|
||||
private boolean optimizeZeroPageCoalesce = false;
|
||||
|
||||
@CommandLine.Option(names = {"-Oloophead"}, description = "Optimization Option. Enables loop-head constant pass which identifies loops where the condition is constant on the first iteration.")
|
||||
private boolean optimizeLoopHeadConstant = false;
|
||||
@CommandLine.Option(names = {"-Onoloophead"}, description = "Optimization Option. Disables loop-head constant pass which identifies loops where the condition is constant on the first iteration.")
|
||||
private boolean optimizeNoLoopHeadConstant = false;
|
||||
|
||||
@CommandLine.Option(names = {"-Ocache"}, description = "Optimization Option. Enables a fragment cache file.")
|
||||
private boolean optimizeFragmentCache = false;
|
||||
@ -215,8 +215,8 @@ public class KickC implements Callable<Void> {
|
||||
compiler.enableZeroPageCoalasce();
|
||||
}
|
||||
|
||||
if(optimizeLoopHeadConstant) {
|
||||
compiler.enableLoopHeadConstant();
|
||||
if(optimizeNoLoopHeadConstant) {
|
||||
compiler.disableLoopHeadConstant();
|
||||
}
|
||||
|
||||
System.out.println("Compiling " + kcFile);
|
||||
|
@ -523,17 +523,6 @@ sin16s_gen2: {
|
||||
sta x+3
|
||||
sta i
|
||||
sta i+1
|
||||
// u[4.28]
|
||||
b1:
|
||||
lda i+1
|
||||
cmp #>wavelength
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<wavelength
|
||||
bcc b2
|
||||
!:
|
||||
rts
|
||||
b2:
|
||||
lda x
|
||||
sta sin16s.x
|
||||
@ -583,7 +572,16 @@ sin16s_gen2: {
|
||||
bne !+
|
||||
inc i+1
|
||||
!:
|
||||
jmp b1
|
||||
// u[4.28]
|
||||
lda i+1
|
||||
cmp #>wavelength
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<wavelength
|
||||
bcc b2
|
||||
!:
|
||||
rts
|
||||
}
|
||||
// Calculate signed word sinus sin(x)
|
||||
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
|
||||
|
@ -245,34 +245,34 @@ sin16s_gen2: scope:[sin16s_gen2] from main
|
||||
to:sin16s_gen2::@3
|
||||
sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2
|
||||
[131] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2
|
||||
to:sin16s_gen2::@1
|
||||
sin16s_gen2::@1: scope:[sin16s_gen2] from sin16s_gen2::@3 sin16s_gen2::@5
|
||||
[132] (signed word*) sin16s_gen2::sintab#2 ← phi( sin16s_gen2::@3/(const signed word[$200]) SINUS#0 sin16s_gen2::@5/(signed word*) sin16s_gen2::sintab#0 )
|
||||
[132] (dword) sin16s_gen2::x#2 ← phi( sin16s_gen2::@3/(byte) 0 sin16s_gen2::@5/(dword) sin16s_gen2::x#1 )
|
||||
[132] (word) sin16s_gen2::i#2 ← phi( sin16s_gen2::@3/(byte) 0 sin16s_gen2::@5/(word) sin16s_gen2::i#1 )
|
||||
[133] if((word) sin16s_gen2::i#2<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@2
|
||||
to:sin16s_gen2::@return
|
||||
sin16s_gen2::@return: scope:[sin16s_gen2] from sin16s_gen2::@1
|
||||
[134] return
|
||||
to:@return
|
||||
sin16s_gen2::@2: scope:[sin16s_gen2] from sin16s_gen2::@1
|
||||
[135] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#2
|
||||
[136] call sin16s
|
||||
[137] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
|
||||
to:sin16s_gen2::@2
|
||||
sin16s_gen2::@2: scope:[sin16s_gen2] from sin16s_gen2::@1 sin16s_gen2::@3
|
||||
[132] (signed word*) sin16s_gen2::sintab#10 ← phi( sin16s_gen2::@1/(signed word*) sin16s_gen2::sintab#0 sin16s_gen2::@3/(const signed word[$200]) SINUS#0 )
|
||||
[132] (dword) sin16s_gen2::x#6 ← phi( sin16s_gen2::@1/(dword) sin16s_gen2::x#1 sin16s_gen2::@3/(byte) 0 )
|
||||
[132] (word) sin16s_gen2::i#6 ← phi( sin16s_gen2::@1/(word) sin16s_gen2::i#1 sin16s_gen2::@3/(byte) 0 )
|
||||
[133] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#6
|
||||
[134] call sin16s
|
||||
[135] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
|
||||
to:sin16s_gen2::@4
|
||||
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@2
|
||||
[138] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
|
||||
[139] call mul16s
|
||||
[140] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
|
||||
[136] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
|
||||
[137] call mul16s
|
||||
[138] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
|
||||
to:sin16s_gen2::@5
|
||||
sin16s_gen2::@5: scope:[sin16s_gen2] from sin16s_gen2::@4
|
||||
[141] (signed dword~) sin16s_gen2::$6 ← (signed dword) mul16s::return#2
|
||||
[142] (word~) sin16s_gen2::$9 ← > (signed dword~) sin16s_gen2::$6
|
||||
[143] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$9
|
||||
[144] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
|
||||
[145] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
|
||||
[146] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
|
||||
[139] (signed dword~) sin16s_gen2::$6 ← (signed dword) mul16s::return#2
|
||||
[140] (word~) sin16s_gen2::$9 ← > (signed dword~) sin16s_gen2::$6
|
||||
[141] *((signed word*) sin16s_gen2::sintab#10) ← (signed word)(word~) sin16s_gen2::$9
|
||||
[142] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#10 + (const byte) SIZEOF_SIGNED_WORD
|
||||
[143] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#6 + (dword) sin16s_gen2::step#0
|
||||
[144] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#6
|
||||
to:sin16s_gen2::@1
|
||||
sin16s_gen2::@1: scope:[sin16s_gen2] from sin16s_gen2::@5
|
||||
[145] if((word) sin16s_gen2::i#1<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@2
|
||||
to:sin16s_gen2::@return
|
||||
sin16s_gen2::@return: scope:[sin16s_gen2] from sin16s_gen2::@1
|
||||
[146] return
|
||||
to:@return
|
||||
sin16s: scope:[sin16s] from sin16s_gen2::@2
|
||||
[147] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
|
||||
to:sin16s::@4
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -387,23 +387,23 @@ 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 ZP_WORD:18 22.0
|
||||
(word) sin16s_gen2::i#2 i zp ZP_WORD:18 2.5384615384615383
|
||||
(word) sin16s_gen2::i#1 i zp ZP_WORD:18 16.5
|
||||
(word) sin16s_gen2::i#6 i zp ZP_WORD:18 1.8333333333333333
|
||||
(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 ZP_WORD:20 7.333333333333333
|
||||
(signed word*) sin16s_gen2::sintab#2 sintab zp ZP_WORD:20 3.0
|
||||
(signed word*) sin16s_gen2::sintab#0 sintab zp ZP_WORD:20 5.5
|
||||
(signed word*) sin16s_gen2::sintab#10 sintab zp ZP_WORD:20 3.3000000000000003
|
||||
(dword) sin16s_gen2::step
|
||||
(dword) sin16s_gen2::step#0 step zp ZP_DWORD:28 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 ZP_DWORD:8 11.0
|
||||
(dword) sin16s_gen2::x#2 x zp ZP_DWORD:8 2.75
|
||||
(dword) sin16s_gen2::x#1 x zp ZP_DWORD:8 7.333333333333333
|
||||
(dword) sin16s_gen2::x#6 x zp ZP_DWORD:8 3.0
|
||||
|
||||
zp ZP_WORD: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 ZP_DWORD:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ]
|
||||
@ -411,12 +411,12 @@ 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 ZP_DWORD:8 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ]
|
||||
zp ZP_DWORD:8 [ sin16s_gen2::x#6 sin16s_gen2::x#1 ]
|
||||
zp ZP_DWORD: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 ]
|
||||
reg byte x [ mulu16_sel::select#5 ]
|
||||
zp ZP_WORD: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 ZP_WORD: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 ZP_WORD: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 ZP_WORD:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#6 sin16s_gen2::i#1 memset::num#2 memset::end#0 main::idx_y#3 main::idx_y#10 main::idx_y#1 ]
|
||||
zp ZP_WORD: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#10 sin16s_gen2::sintab#0 ]
|
||||
reg byte x [ divr16u::i#2 divr16u::i#1 ]
|
||||
zp ZP_BYTE:22 [ frame_cnt#10 frame_cnt#0 frame_cnt#1 ]
|
||||
reg byte alu [ main::$10 ]
|
||||
|
@ -553,17 +553,6 @@ sin16s_gen2: {
|
||||
sta x+3
|
||||
sta i
|
||||
sta i+1
|
||||
// u[4.28]
|
||||
b1:
|
||||
lda i+1
|
||||
cmp #>wavelength
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<wavelength
|
||||
bcc b2
|
||||
!:
|
||||
rts
|
||||
b2:
|
||||
lda x
|
||||
sta sin16s.x
|
||||
@ -613,7 +602,16 @@ sin16s_gen2: {
|
||||
bne !+
|
||||
inc i+1
|
||||
!:
|
||||
jmp b1
|
||||
// u[4.28]
|
||||
lda i+1
|
||||
cmp #>wavelength
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<wavelength
|
||||
bcc b2
|
||||
!:
|
||||
rts
|
||||
}
|
||||
// Calculate signed word sinus sin(x)
|
||||
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
|
||||
|
@ -264,34 +264,34 @@ sin16s_gen2: scope:[sin16s_gen2] from main
|
||||
to:sin16s_gen2::@3
|
||||
sin16s_gen2::@3: scope:[sin16s_gen2] from sin16s_gen2
|
||||
[140] (dword) sin16s_gen2::step#0 ← (dword) div32u16u::return#2
|
||||
to:sin16s_gen2::@1
|
||||
sin16s_gen2::@1: scope:[sin16s_gen2] from sin16s_gen2::@3 sin16s_gen2::@5
|
||||
[141] (signed word*) sin16s_gen2::sintab#2 ← phi( sin16s_gen2::@3/(const signed word[$200]) SINUS#0 sin16s_gen2::@5/(signed word*) sin16s_gen2::sintab#0 )
|
||||
[141] (dword) sin16s_gen2::x#2 ← phi( sin16s_gen2::@3/(byte) 0 sin16s_gen2::@5/(dword) sin16s_gen2::x#1 )
|
||||
[141] (word) sin16s_gen2::i#2 ← phi( sin16s_gen2::@3/(byte) 0 sin16s_gen2::@5/(word) sin16s_gen2::i#1 )
|
||||
[142] if((word) sin16s_gen2::i#2<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@2
|
||||
to:sin16s_gen2::@return
|
||||
sin16s_gen2::@return: scope:[sin16s_gen2] from sin16s_gen2::@1
|
||||
[143] return
|
||||
to:@return
|
||||
sin16s_gen2::@2: scope:[sin16s_gen2] from sin16s_gen2::@1
|
||||
[144] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#2
|
||||
[145] call sin16s
|
||||
[146] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
|
||||
to:sin16s_gen2::@2
|
||||
sin16s_gen2::@2: scope:[sin16s_gen2] from sin16s_gen2::@1 sin16s_gen2::@3
|
||||
[141] (signed word*) sin16s_gen2::sintab#10 ← phi( sin16s_gen2::@1/(signed word*) sin16s_gen2::sintab#0 sin16s_gen2::@3/(const signed word[$200]) SINUS#0 )
|
||||
[141] (dword) sin16s_gen2::x#6 ← phi( sin16s_gen2::@1/(dword) sin16s_gen2::x#1 sin16s_gen2::@3/(byte) 0 )
|
||||
[141] (word) sin16s_gen2::i#6 ← phi( sin16s_gen2::@1/(word) sin16s_gen2::i#1 sin16s_gen2::@3/(byte) 0 )
|
||||
[142] (dword) sin16s::x#0 ← (dword) sin16s_gen2::x#6
|
||||
[143] call sin16s
|
||||
[144] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
|
||||
to:sin16s_gen2::@4
|
||||
sin16s_gen2::@4: scope:[sin16s_gen2] from sin16s_gen2::@2
|
||||
[147] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
|
||||
[148] call mul16s
|
||||
[149] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
|
||||
[145] (signed word) mul16s::a#0 ← (signed word) sin16s::return#0
|
||||
[146] call mul16s
|
||||
[147] (signed dword) mul16s::return#2 ← (signed dword) mul16s::return#0
|
||||
to:sin16s_gen2::@5
|
||||
sin16s_gen2::@5: scope:[sin16s_gen2] from sin16s_gen2::@4
|
||||
[150] (signed dword~) sin16s_gen2::$6 ← (signed dword) mul16s::return#2
|
||||
[151] (word~) sin16s_gen2::$9 ← > (signed dword~) sin16s_gen2::$6
|
||||
[152] *((signed word*) sin16s_gen2::sintab#2) ← (signed word)(word~) sin16s_gen2::$9
|
||||
[153] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
|
||||
[154] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#2 + (dword) sin16s_gen2::step#0
|
||||
[155] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#2
|
||||
[148] (signed dword~) sin16s_gen2::$6 ← (signed dword) mul16s::return#2
|
||||
[149] (word~) sin16s_gen2::$9 ← > (signed dword~) sin16s_gen2::$6
|
||||
[150] *((signed word*) sin16s_gen2::sintab#10) ← (signed word)(word~) sin16s_gen2::$9
|
||||
[151] (signed word*) sin16s_gen2::sintab#0 ← (signed word*) sin16s_gen2::sintab#10 + (const byte) SIZEOF_SIGNED_WORD
|
||||
[152] (dword) sin16s_gen2::x#1 ← (dword) sin16s_gen2::x#6 + (dword) sin16s_gen2::step#0
|
||||
[153] (word) sin16s_gen2::i#1 ← ++ (word) sin16s_gen2::i#6
|
||||
to:sin16s_gen2::@1
|
||||
sin16s_gen2::@1: scope:[sin16s_gen2] from sin16s_gen2::@5
|
||||
[154] if((word) sin16s_gen2::i#1<(const word) sin16s_gen2::wavelength#0) goto sin16s_gen2::@2
|
||||
to:sin16s_gen2::@return
|
||||
sin16s_gen2::@return: scope:[sin16s_gen2] from sin16s_gen2::@1
|
||||
[155] return
|
||||
to:@return
|
||||
sin16s: scope:[sin16s] from sin16s_gen2::@2
|
||||
[156] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
|
||||
to:sin16s::@4
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -402,23 +402,23 @@ 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 ZP_WORD:18 22.0
|
||||
(word) sin16s_gen2::i#2 i zp ZP_WORD:18 2.5384615384615383
|
||||
(word) sin16s_gen2::i#1 i zp ZP_WORD:18 16.5
|
||||
(word) sin16s_gen2::i#6 i zp ZP_WORD:18 1.8333333333333333
|
||||
(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 ZP_WORD:20 7.333333333333333
|
||||
(signed word*) sin16s_gen2::sintab#2 sintab zp ZP_WORD:20 3.0
|
||||
(signed word*) sin16s_gen2::sintab#0 sintab zp ZP_WORD:20 5.5
|
||||
(signed word*) sin16s_gen2::sintab#10 sintab zp ZP_WORD:20 3.3000000000000003
|
||||
(dword) sin16s_gen2::step
|
||||
(dword) sin16s_gen2::step#0 step zp ZP_DWORD:28 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 ZP_DWORD:10 11.0
|
||||
(dword) sin16s_gen2::x#2 x zp ZP_DWORD:10 2.75
|
||||
(dword) sin16s_gen2::x#1 x zp ZP_DWORD:10 7.333333333333333
|
||||
(dword) sin16s_gen2::x#6 x zp ZP_DWORD:10 3.0
|
||||
|
||||
zp ZP_WORD: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 ZP_DWORD:4 [ mul16u::mb#2 mul16u::mb#0 mul16u::mb#1 ]
|
||||
@ -427,11 +427,11 @@ 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 ZP_DWORD:10 [ sin16s_gen2::x#2 sin16s_gen2::x#1 ]
|
||||
zp ZP_DWORD:10 [ sin16s_gen2::x#6 sin16s_gen2::x#1 ]
|
||||
zp ZP_DWORD: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 ]
|
||||
reg byte x [ mulu16_sel::select#5 ]
|
||||
zp ZP_WORD: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 ZP_WORD: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 ZP_WORD:18 [ divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#0 sin16s_gen2::i#6 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 ZP_WORD: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#10 sin16s_gen2::sintab#0 ]
|
||||
reg byte x [ divr16u::i#2 divr16u::i#1 ]
|
||||
zp ZP_BYTE:22 [ frame_cnt#2 frame_cnt#0 frame_cnt#1 ]
|
||||
reg byte x [ bitmap_plot::y#0 ]
|
||||
|
@ -27,13 +27,6 @@ main: {
|
||||
lda #0
|
||||
sta a
|
||||
sta i
|
||||
b1:
|
||||
lda #8
|
||||
cmp i
|
||||
bne b2
|
||||
b3:
|
||||
inc SCREEN+$3e7
|
||||
jmp b3
|
||||
b2:
|
||||
ldy a
|
||||
lda COSTAB,y
|
||||
@ -73,7 +66,12 @@ main: {
|
||||
axs #-[$20]
|
||||
stx a
|
||||
inc i
|
||||
jmp b1
|
||||
lda #8
|
||||
cmp i
|
||||
bne b2
|
||||
b3:
|
||||
inc SCREEN+$3e7
|
||||
jmp b3
|
||||
}
|
||||
// Draw a line on the bitmap using bresenhams algorithm
|
||||
// bitmap_line(word zeropage($b) x1, word zeropage(9) y1, word zeropage($f) x2, word zeropage($11) y2)
|
||||
|
@ -23,28 +23,28 @@ main::toD0181: scope:[main] from main::@6
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::toD0181
|
||||
[10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@4 main::@7
|
||||
[11] (byte) main::a#2 ← phi( main::@4/(byte) 0 main::@7/(byte) main::a#1 )
|
||||
[11] (byte) main::i#2 ← phi( main::@4/(byte) 0 main::@7/(byte) main::i#1 )
|
||||
[12] if((byte) main::i#2!=(byte) 8) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@3
|
||||
[13] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7)
|
||||
to:main::@3
|
||||
main::@2: scope:[main] from main::@1
|
||||
[14] (word~) main::$7 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#2)
|
||||
[15] (word) bitmap_line::x1#0 ← (word~) main::$7 + (byte) $78
|
||||
[16] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#2)
|
||||
[17] (word~) main::$11 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#2)
|
||||
[18] (word) bitmap_line::x2#0 ← (word~) main::$11 + (byte) $78
|
||||
[19] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#2)
|
||||
[20] call bitmap_line
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1 main::@4
|
||||
[11] (byte) main::a#5 ← phi( main::@1/(byte) main::a#1 main::@4/(byte) 0 )
|
||||
[11] (byte) main::i#5 ← phi( main::@1/(byte) main::i#1 main::@4/(byte) 0 )
|
||||
[12] (word~) main::$7 ← (word)*((const byte*) COSTAB#0 + (byte) main::a#5)
|
||||
[13] (word) bitmap_line::x1#0 ← (word~) main::$7 + (byte) $78
|
||||
[14] (word) bitmap_line::y1#0 ← (word)*((const byte[$180]) SINTAB#0 + (byte) main::a#5)
|
||||
[15] (word~) main::$11 ← (word)*((const byte*) COSTAB#0+(byte) $20 + (byte) main::a#5)
|
||||
[16] (word) bitmap_line::x2#0 ← (word~) main::$11 + (byte) $78
|
||||
[17] (word) bitmap_line::y2#0 ← (word)*((const byte[$180]) SINTAB#0+(byte) $20 + (byte) main::a#5)
|
||||
[18] call bitmap_line
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@2
|
||||
[21] (byte) main::a#1 ← (byte) main::a#2 + (byte) $20
|
||||
[22] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[19] (byte) main::a#1 ← (byte) main::a#5 + (byte) $20
|
||||
[20] (byte) main::i#1 ← ++ (byte) main::i#5
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@7
|
||||
[21] if((byte) main::i#1!=(byte) 8) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@3
|
||||
[22] *((const byte*) SCREEN#0+(word) $3e7) ← ++ *((const byte*) SCREEN#0+(word) $3e7)
|
||||
to:main::@3
|
||||
bitmap_line: scope:[bitmap_line] from main::@2
|
||||
[23] (word) abs_u16::w#0 ← (word) bitmap_line::x2#0 - (word) bitmap_line::x1#0
|
||||
[24] call abs_u16
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -175,11 +175,11 @@
|
||||
(label) main::@6
|
||||
(label) main::@7
|
||||
(byte) main::a
|
||||
(byte) main::a#1 a zp ZP_BYTE:2 11.0
|
||||
(byte) main::a#2 a zp ZP_BYTE:2 2.4444444444444446
|
||||
(byte) main::a#1 a zp ZP_BYTE:2 7.333333333333333
|
||||
(byte) main::a#5 a zp ZP_BYTE:2 2.75
|
||||
(byte) main::i
|
||||
(byte) main::i#1 i zp ZP_BYTE:27 22.0
|
||||
(byte) main::i#2 i zp ZP_BYTE:27 3.3000000000000003
|
||||
(byte) main::i#1 i zp ZP_BYTE:27 16.5
|
||||
(byte) main::i#5 i zp ZP_BYTE:27 2.4444444444444446
|
||||
(label) main::toD0181
|
||||
(word~) main::toD0181_$0
|
||||
(number~) main::toD0181_$1
|
||||
@ -226,7 +226,7 @@
|
||||
(word) sgn_u16::w#1 w zp ZP_WORD:3 4.0
|
||||
(word) sgn_u16::w#2 w zp ZP_WORD:3 6.0
|
||||
|
||||
zp ZP_BYTE:2 [ main::a#2 main::a#1 ]
|
||||
zp ZP_BYTE:2 [ main::a#5 main::a#1 ]
|
||||
reg byte x [ bitmap_plot::y#4 bitmap_plot::y#3 bitmap_plot::y#2 bitmap_plot::y#0 bitmap_plot::y#1 ]
|
||||
zp ZP_WORD:3 [ sgn_u16::w#2 sgn_u16::w#0 sgn_u16::w#1 bitmap_line::e#3 bitmap_line::e#0 bitmap_line::e#6 bitmap_line::e#1 bitmap_line::e#2 ]
|
||||
zp ZP_WORD:5 [ sgn_u16::return#4 sgn_u16::return#0 sgn_u16::return#1 bitmap_line::sy#0 ]
|
||||
@ -249,7 +249,7 @@ reg byte a [ sgn_u16::$0 ]
|
||||
reg byte a [ sgn_u16::$1 ]
|
||||
reg byte a [ abs_u16::$0 ]
|
||||
reg byte a [ abs_u16::$1 ]
|
||||
zp ZP_BYTE:27 [ bitmap_init::$7 main::i#2 main::i#1 ]
|
||||
zp ZP_BYTE:27 [ bitmap_init::$7 main::i#5 main::i#1 ]
|
||||
reg byte a [ bitmap_init::$4 ]
|
||||
reg byte a [ bitmap_init::$5 ]
|
||||
reg byte a [ bitmap_init::$6 ]
|
||||
|
@ -33,10 +33,6 @@ main: {
|
||||
}
|
||||
plots: {
|
||||
ldx #0
|
||||
b1:
|
||||
cpx #plots_cnt
|
||||
bcc b2
|
||||
rts
|
||||
b2:
|
||||
lda plots_x,x
|
||||
sta plot.x
|
||||
@ -44,7 +40,9 @@ plots: {
|
||||
sta plot.y
|
||||
jsr plot
|
||||
inx
|
||||
jmp b1
|
||||
cpx #plots_cnt
|
||||
bcc b2
|
||||
rts
|
||||
}
|
||||
// plot(byte zeropage(7) x, byte zeropage(2) y)
|
||||
plot: {
|
||||
@ -140,7 +138,14 @@ init_screen: {
|
||||
sta b
|
||||
lda #>BITMAP
|
||||
sta b+1
|
||||
b1:
|
||||
b2:
|
||||
lda #0
|
||||
tay
|
||||
sta (b),y
|
||||
inc b
|
||||
bne !+
|
||||
inc b+1
|
||||
!:
|
||||
lda b+1
|
||||
cmp #>BITMAP+$2000
|
||||
bne b2
|
||||
@ -151,14 +156,6 @@ init_screen: {
|
||||
sta c
|
||||
lda #>SCREEN
|
||||
sta c+1
|
||||
b3:
|
||||
lda c+1
|
||||
cmp #>SCREEN+$400
|
||||
bne b4
|
||||
lda c
|
||||
cmp #<SCREEN+$400
|
||||
bne b4
|
||||
rts
|
||||
b4:
|
||||
lda #$14
|
||||
ldy #0
|
||||
@ -167,16 +164,13 @@ init_screen: {
|
||||
bne !+
|
||||
inc c+1
|
||||
!:
|
||||
jmp b3
|
||||
b2:
|
||||
lda #0
|
||||
tay
|
||||
sta (b),y
|
||||
inc b
|
||||
bne !+
|
||||
inc b+1
|
||||
!:
|
||||
jmp b1
|
||||
lda c+1
|
||||
cmp #>SCREEN+$400
|
||||
bne b4
|
||||
lda c
|
||||
cmp #<SCREEN+$400
|
||||
bne b4
|
||||
rts
|
||||
}
|
||||
plots_x: .byte $3c, $50, $6e, $50, $3c, $28, $a, $28
|
||||
plots_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28
|
||||
|
@ -30,22 +30,22 @@ main::@4: scope:[main] from main::@2
|
||||
to:main::@1
|
||||
plots: scope:[plots] from main::@2
|
||||
[15] phi()
|
||||
to:plots::@1
|
||||
plots::@1: scope:[plots] from plots plots::@3
|
||||
[16] (byte) plots::i#2 ← phi( plots/(byte) 0 plots::@3/(byte) plots::i#1 )
|
||||
[17] if((byte) plots::i#2<(const byte) plots_cnt#0) goto plots::@2
|
||||
to:plots::@return
|
||||
plots::@return: scope:[plots] from plots::@1
|
||||
[18] return
|
||||
to:@return
|
||||
plots::@2: scope:[plots] from plots::@1
|
||||
[19] (byte) plot::x#0 ← *((const byte[]) plots_x#0 + (byte) plots::i#2)
|
||||
[20] (byte) plot::y#0 ← *((const byte[]) plots_y#0 + (byte) plots::i#2)
|
||||
[21] call plot
|
||||
to:plots::@2
|
||||
plots::@2: scope:[plots] from plots plots::@1
|
||||
[16] (byte) plots::i#5 ← phi( plots::@1/(byte) plots::i#1 plots/(byte) 0 )
|
||||
[17] (byte) plot::x#0 ← *((const byte[]) plots_x#0 + (byte) plots::i#5)
|
||||
[18] (byte) plot::y#0 ← *((const byte[]) plots_y#0 + (byte) plots::i#5)
|
||||
[19] call plot
|
||||
to:plots::@3
|
||||
plots::@3: scope:[plots] from plots::@2
|
||||
[22] (byte) plots::i#1 ← ++ (byte) plots::i#2
|
||||
[20] (byte) plots::i#1 ← ++ (byte) plots::i#5
|
||||
to:plots::@1
|
||||
plots::@1: scope:[plots] from plots::@3
|
||||
[21] if((byte) plots::i#1<(const byte) plots_cnt#0) goto plots::@2
|
||||
to:plots::@return
|
||||
plots::@return: scope:[plots] from plots::@1
|
||||
[22] return
|
||||
to:@return
|
||||
plot: scope:[plot] from plots::@2
|
||||
[23] (byte~) plot::$6 ← *((const byte[$100]) plot_xhi#0 + (byte) plot::x#0)
|
||||
[24] (byte*) plot::plotter_x#1 ← (byte*) 0 hi= (byte~) plot::$6
|
||||
@ -107,23 +107,23 @@ init_plot_tables::@return: scope:[init_plot_tables] from init_plot_tables::@4
|
||||
to:@return
|
||||
init_screen: scope:[init_screen] from main
|
||||
[60] phi()
|
||||
to:init_screen::@2
|
||||
init_screen::@2: scope:[init_screen] from init_screen init_screen::@1
|
||||
[61] (byte*) init_screen::b#4 ← phi( init_screen::@1/(byte*) init_screen::b#1 init_screen/(const byte*) BITMAP#0 )
|
||||
[62] *((byte*) init_screen::b#4) ← (byte) 0
|
||||
[63] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#4
|
||||
to:init_screen::@1
|
||||
init_screen::@1: scope:[init_screen] from init_screen init_screen::@2
|
||||
[61] (byte*) init_screen::b#2 ← phi( init_screen/(const byte*) BITMAP#0 init_screen::@2/(byte*) init_screen::b#1 )
|
||||
[62] if((byte*) init_screen::b#2!=(const byte*) BITMAP#0+(word) $2000) goto init_screen::@2
|
||||
init_screen::@1: scope:[init_screen] from init_screen::@2
|
||||
[64] if((byte*) init_screen::b#1!=(const byte*) BITMAP#0+(word) $2000) goto init_screen::@2
|
||||
to:init_screen::@4
|
||||
init_screen::@4: scope:[init_screen] from init_screen::@1 init_screen::@3
|
||||
[65] (byte*) init_screen::c#4 ← phi( init_screen::@3/(byte*) init_screen::c#1 init_screen::@1/(const byte*) SCREEN#0 )
|
||||
[66] *((byte*) init_screen::c#4) ← (byte) $14
|
||||
[67] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#4
|
||||
to:init_screen::@3
|
||||
init_screen::@3: scope:[init_screen] from init_screen::@1 init_screen::@4
|
||||
[63] (byte*) init_screen::c#2 ← phi( init_screen::@1/(const byte*) SCREEN#0 init_screen::@4/(byte*) init_screen::c#1 )
|
||||
[64] if((byte*) init_screen::c#2!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4
|
||||
init_screen::@3: scope:[init_screen] from init_screen::@4
|
||||
[68] if((byte*) init_screen::c#1!=(const byte*) SCREEN#0+(word) $400) goto init_screen::@4
|
||||
to:init_screen::@return
|
||||
init_screen::@return: scope:[init_screen] from init_screen::@3
|
||||
[65] return
|
||||
[69] return
|
||||
to:@return
|
||||
init_screen::@4: scope:[init_screen] from init_screen::@3
|
||||
[66] *((byte*) init_screen::c#2) ← (byte) $14
|
||||
[67] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2
|
||||
to:init_screen::@3
|
||||
init_screen::@2: scope:[init_screen] from init_screen::@1
|
||||
[68] *((byte*) init_screen::b#2) ← (byte) 0
|
||||
[69] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2
|
||||
to:init_screen::@1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -55,11 +55,11 @@
|
||||
(label) init_screen::@4
|
||||
(label) init_screen::@return
|
||||
(byte*) init_screen::b
|
||||
(byte*) init_screen::b#1 b zp ZP_WORD:5 22.0
|
||||
(byte*) init_screen::b#2 b zp ZP_WORD:5 14.666666666666666
|
||||
(byte*) init_screen::b#1 b zp ZP_WORD:5 16.5
|
||||
(byte*) init_screen::b#4 b zp ZP_WORD:5 16.5
|
||||
(byte*) init_screen::c
|
||||
(byte*) init_screen::c#1 c zp ZP_WORD:3 22.0
|
||||
(byte*) init_screen::c#2 c zp ZP_WORD:3 14.666666666666666
|
||||
(byte*) init_screen::c#1 c zp ZP_WORD:3 16.5
|
||||
(byte*) init_screen::c#4 c zp ZP_WORD:3 16.5
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
@ -100,8 +100,8 @@
|
||||
(label) plots::@3
|
||||
(label) plots::@return
|
||||
(byte) plots::i
|
||||
(byte) plots::i#1 reg byte x 202.0
|
||||
(byte) plots::i#2 reg byte x 101.0
|
||||
(byte) plots::i#1 reg byte x 151.5
|
||||
(byte) plots::i#5 reg byte x 101.0
|
||||
(byte) plots_cnt
|
||||
(const byte) plots_cnt#0 plots_cnt = (byte) 8
|
||||
(byte[]) plots_x
|
||||
@ -109,16 +109,16 @@
|
||||
(byte[]) plots_y
|
||||
(const byte[]) plots_y#0 plots_y = { (byte) $a, (byte) $28, (byte) $3c, (byte) $50, (byte) $6e, (byte) $50, (byte) $3c, (byte) $28 }
|
||||
|
||||
reg byte x [ plots::i#2 plots::i#1 ]
|
||||
reg byte x [ plots::i#5 plots::i#1 ]
|
||||
reg byte x [ init_plot_tables::x#2 init_plot_tables::x#1 ]
|
||||
reg byte y [ init_plot_tables::bits#3 init_plot_tables::bits#4 init_plot_tables::bits#1 ]
|
||||
reg byte x [ init_plot_tables::y#2 init_plot_tables::y#1 ]
|
||||
zp ZP_BYTE:2 [ plot::y#0 ]
|
||||
reg byte a [ plot::$6 ]
|
||||
zp ZP_WORD:3 [ plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 init_screen::c#2 init_screen::c#1 ]
|
||||
zp ZP_WORD:3 [ plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 init_screen::c#4 init_screen::c#1 ]
|
||||
reg byte a [ plot::$7 ]
|
||||
reg byte a [ plot::$8 ]
|
||||
zp ZP_WORD:5 [ plot::plotter_y#1 plot::plotter_y#2 init_screen::b#2 init_screen::b#1 init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
|
||||
zp ZP_WORD:5 [ plot::plotter_y#1 plot::plotter_y#2 init_screen::b#4 init_screen::b#1 init_plot_tables::yoffs#2 init_plot_tables::yoffs#4 init_plot_tables::yoffs#1 ]
|
||||
reg byte a [ plot::$9 ]
|
||||
reg byte a [ plot::$5 ]
|
||||
reg byte a [ init_plot_tables::$0 ]
|
||||
|
@ -5,13 +5,7 @@
|
||||
main: {
|
||||
.label screen = $400
|
||||
ldx #0
|
||||
b1:
|
||||
txa
|
||||
and #1
|
||||
cpx #$a
|
||||
bcs b2
|
||||
cmp #0
|
||||
bne b2
|
||||
b3:
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
b2:
|
||||
@ -19,4 +13,12 @@ main: {
|
||||
cpx #$15
|
||||
bne b1
|
||||
rts
|
||||
b1:
|
||||
txa
|
||||
and #1
|
||||
cpx #$a
|
||||
bcs b2
|
||||
cmp #0
|
||||
bne b2
|
||||
jmp b3
|
||||
}
|
||||
|
@ -9,22 +9,23 @@
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
|
||||
[6] (byte~) main::$1 ← (byte) main::i#2 & (byte) 1
|
||||
[7] if((byte) main::i#2>=(byte) $a) goto main::@2
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@1
|
||||
[8] if((byte~) main::$1!=(byte) 0) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@4
|
||||
[9] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*'
|
||||
main::@3: scope:[main] from main main::@4
|
||||
[5] (byte) main::i#9 ← phi( main::@4/(byte) main::i#1 main/(byte) 0 )
|
||||
[6] *((const byte*) main::screen#0 + (byte) main::i#9) ← (byte) '*'
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1 main::@3 main::@4
|
||||
[10] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[11] if((byte) main::i#1!=(byte) $15) goto main::@1
|
||||
[7] (byte) main::i#5 ← phi( main::@1/(byte) main::i#1 main::@3/(byte) main::i#9 main::@4/(byte) main::i#1 )
|
||||
[8] (byte) main::i#1 ← ++ (byte) main::i#5
|
||||
[9] if((byte) main::i#1!=(byte) $15) goto main::@1
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[12] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@1: scope:[main] from main::@2
|
||||
[11] (byte~) main::$6 ← (byte) main::i#1 & (byte) 1
|
||||
[12] if((byte) main::i#1>=(byte) $a) goto main::@2
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@1
|
||||
[13] if((byte~) main::$6!=(byte) 0) goto main::@2
|
||||
to:main::@3
|
||||
|
@ -105,22 +105,60 @@ Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Negating conditional jump and destination [4] if((byte) main::i#2>=(byte) $a) goto main::@2
|
||||
Negating conditional jump and destination [10] if((byte~) main::$1!=(byte) 0) goto main::@2
|
||||
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte) main::i#1 = (byte) main::i#2
|
||||
Alias (byte) main::i#6 = (byte) main::i#7
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) main::i#8 (const byte) main::i#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Constant right-side identified [13] (byte~) main::$7 ← (const byte) main::i#0 & (byte) 1
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte) main::$7 = main::i#0&1
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Removing PHI-reference to removed block (main::@1_1) in block main::@2
|
||||
if() condition always false - eliminating [14] if((const byte) main::i#0>=(byte) $a) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Simplifying constant evaluating to zero (const byte) main::i#0&(byte) 1 in
|
||||
Successful SSA optimization PassNSimplifyConstantZero
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte) main::i#1 = (byte) main::i#6
|
||||
Alias (byte~) main::$6 = (byte~) main::$1
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) main::i#10 (const byte) main::i#0
|
||||
Identical Phi Values (byte~) main::$8 (const byte) main::$7
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Removing PHI-reference to removed block (main::@5_1) in block main::@2
|
||||
if() condition always false - eliminating [12] if((const byte) main::$7!=(byte) 0) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Eliminating unused constant (const byte) main::$7
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Inlining constant with var siblings (const byte) main::i#0
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@6(between main::@2 and main::@1)
|
||||
Added new block during phi lifting main::@6(between main::@1 and main::@2)
|
||||
Added new block during phi lifting main::@7(between main::@5 and main::@2)
|
||||
Added new block during phi lifting main::@8(between main::@5 and main::@3)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1_1
|
||||
Adding NOP phi() at start of main::@5_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 1 initial phi equivalence classes
|
||||
Coalesced [14] main::i#5 ← main::i#1
|
||||
Created 2 initial phi equivalence classes
|
||||
Coalesced [10] main::i#12 ← main::i#9
|
||||
Coalesced [18] main::i#14 ← main::i#1
|
||||
Coalesced (already) [19] main::i#13 ← main::i#1
|
||||
Coalesced (already) [20] main::i#11 ← main::i#1
|
||||
Coalesced down to 1 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1_1
|
||||
Culled Empty Block (label) main::@5_1
|
||||
Culled Empty Block (label) main::@8
|
||||
Culled Empty Block (label) main::@7
|
||||
Culled Empty Block (label) main::@6
|
||||
Renumbering block main::@5 to main::@4
|
||||
Adding NOP phi() at start of @begin
|
||||
@ -140,43 +178,45 @@ FINAL CONTROL FLOW GRAPH
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
|
||||
[6] (byte~) main::$1 ← (byte) main::i#2 & (byte) 1
|
||||
[7] if((byte) main::i#2>=(byte) $a) goto main::@2
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@1
|
||||
[8] if((byte~) main::$1!=(byte) 0) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@4
|
||||
[9] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*'
|
||||
main::@3: scope:[main] from main main::@4
|
||||
[5] (byte) main::i#9 ← phi( main::@4/(byte) main::i#1 main/(byte) 0 )
|
||||
[6] *((const byte*) main::screen#0 + (byte) main::i#9) ← (byte) '*'
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1 main::@3 main::@4
|
||||
[10] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[11] if((byte) main::i#1!=(byte) $15) goto main::@1
|
||||
[7] (byte) main::i#5 ← phi( main::@1/(byte) main::i#1 main::@3/(byte) main::i#9 main::@4/(byte) main::i#1 )
|
||||
[8] (byte) main::i#1 ← ++ (byte) main::i#5
|
||||
[9] if((byte) main::i#1!=(byte) $15) goto main::@1
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[12] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@1: scope:[main] from main::@2
|
||||
[11] (byte~) main::$6 ← (byte) main::i#1 & (byte) 1
|
||||
[12] if((byte) main::i#1>=(byte) $a) goto main::@2
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@1
|
||||
[13] if((byte~) main::$6!=(byte) 0) goto main::@2
|
||||
to:main::@3
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(void()) main()
|
||||
(byte~) main::$1 11.0
|
||||
(byte~) main::$6 551.0
|
||||
(byte) main::i
|
||||
(byte) main::i#1 16.5
|
||||
(byte) main::i#2 11.0
|
||||
(byte) main::i#1 1041.4
|
||||
(byte) main::i#5 2114.0
|
||||
(byte) main::i#9 61.5
|
||||
(byte*) main::screen
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
Added variable main::$1 to zero page equivalence class [ main::$1 ]
|
||||
[ main::i#5 main::i#9 main::i#1 ]
|
||||
Added variable main::$6 to zero page equivalence class [ main::$6 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::$1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::$1 ]
|
||||
[ main::i#5 main::i#9 main::i#1 ]
|
||||
[ main::$6 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#5 main::i#9 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::$6 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -206,73 +246,78 @@ bend:
|
||||
// main
|
||||
main: {
|
||||
.label screen = $400
|
||||
.label _1 = 3
|
||||
.label i = 2
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
.label _6 = 3
|
||||
// [5] phi from main to main::@3 [phi:main->main::@3]
|
||||
b3_from_main:
|
||||
// [5] phi (byte) main::i#9 = (byte) 0 [phi:main->main::@3#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta i
|
||||
jmp b1
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] (byte~) main::$1 ← (byte) main::i#2 & (byte) 1 -- vbuz1=vbuz2_band_vbuc1
|
||||
lda #1
|
||||
and i
|
||||
sta _1
|
||||
// [7] if((byte) main::i#2>=(byte) $a) goto main::@2 -- vbuz1_ge_vbuc1_then_la1
|
||||
lda i
|
||||
cmp #$a
|
||||
bcs b2
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [8] if((byte~) main::$1!=(byte) 0) goto main::@2 -- vbuz1_neq_0_then_la1
|
||||
lda _1
|
||||
cmp #0
|
||||
bne b2
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [9] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [6] *((const byte*) main::screen#0 + (byte) main::i#9) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #'*'
|
||||
ldy i
|
||||
sta screen,y
|
||||
// [7] phi from main::@1 main::@3 main::@4 to main::@2 [phi:main::@1/main::@3/main::@4->main::@2]
|
||||
b2_from_b1:
|
||||
b2_from_b3:
|
||||
b2_from_b4:
|
||||
// [7] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@1/main::@3/main::@4->main::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
|
||||
// [8] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuz1=_inc_vbuz1
|
||||
inc i
|
||||
// [11] if((byte) main::i#1!=(byte) $15) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
|
||||
// [9] if((byte) main::i#1!=(byte) $15) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
|
||||
lda #$15
|
||||
cmp i
|
||||
bne b1_from_b2
|
||||
bne b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [12] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@1
|
||||
b1:
|
||||
// [11] (byte~) main::$6 ← (byte) main::i#1 & (byte) 1 -- vbuz1=vbuz2_band_vbuc1
|
||||
lda #1
|
||||
and i
|
||||
sta _6
|
||||
// [12] if((byte) main::i#1>=(byte) $a) goto main::@2 -- vbuz1_ge_vbuc1_then_la1
|
||||
lda i
|
||||
cmp #$a
|
||||
bcs b2_from_b1
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [13] if((byte~) main::$6!=(byte) 0) goto main::@2 -- vbuz1_neq_0_then_la1
|
||||
lda _6
|
||||
cmp #0
|
||||
bne b2_from_b4
|
||||
// [5] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [5] phi (byte) main::i#9 = (byte) main::i#1 [phi:main::@4->main::@3#0] -- register_copy
|
||||
jmp b3
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [9] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Statement [6] (byte~) main::$1 ← (byte) main::i#2 & (byte) 1 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::$1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Statement [6] *((const byte*) main::screen#0 + (byte) main::i#9) ← (byte) '*' [ main::i#9 ] ( main:2 [ main::i#9 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#5 main::i#9 main::i#1 ]
|
||||
Statement [11] (byte~) main::$6 ← (byte) main::i#1 & (byte) 1 [ main::i#1 main::$6 ] ( main:2 [ main::i#1 main::$6 ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) main::screen#0 + (byte) main::i#9) ← (byte) '*' [ main::i#9 ] ( main:2 [ main::i#9 ] ) always clobbers reg byte a
|
||||
Statement [11] (byte~) main::$6 ← (byte) main::i#1 & (byte) 1 [ main::i#1 main::$6 ] ( main:2 [ main::i#1 main::$6 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#5 main::i#9 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::$6 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 11: zp ZP_BYTE:3 [ main::$1 ]
|
||||
Uplift Scope [main] 3,216.9: zp ZP_BYTE:2 [ main::i#5 main::i#9 main::i#1 ] 551: zp ZP_BYTE:3 [ main::$6 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 483 combination reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$1 ]
|
||||
Uplifting [] best 483 combination
|
||||
Uplifting [main] best 24618 combination reg byte x [ main::i#5 main::i#9 main::i#1 ] reg byte a [ main::$6 ]
|
||||
Uplifting [] best 24618 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -301,78 +346,82 @@ bend:
|
||||
// main
|
||||
main: {
|
||||
.label screen = $400
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
||||
// [5] phi from main to main::@3 [phi:main->main::@3]
|
||||
b3_from_main:
|
||||
// [5] phi (byte) main::i#9 = (byte) 0 [phi:main->main::@3#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
jmp b1
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] (byte~) main::$1 ← (byte) main::i#2 & (byte) 1 -- vbuaa=vbuxx_band_vbuc1
|
||||
txa
|
||||
and #1
|
||||
// [7] if((byte) main::i#2>=(byte) $a) goto main::@2 -- vbuxx_ge_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcs b2
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [8] if((byte~) main::$1!=(byte) 0) goto main::@2 -- vbuaa_neq_0_then_la1
|
||||
cmp #0
|
||||
bne b2
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [9] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [6] *((const byte*) main::screen#0 + (byte) main::i#9) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
// [7] phi from main::@1 main::@3 main::@4 to main::@2 [phi:main::@1/main::@3/main::@4->main::@2]
|
||||
b2_from_b1:
|
||||
b2_from_b3:
|
||||
b2_from_b4:
|
||||
// [7] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@1/main::@3/main::@4->main::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
// [8] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [11] if((byte) main::i#1!=(byte) $15) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
|
||||
// [9] if((byte) main::i#1!=(byte) $15) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
|
||||
cpx #$15
|
||||
bne b1_from_b2
|
||||
bne b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [12] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@1
|
||||
b1:
|
||||
// [11] (byte~) main::$6 ← (byte) main::i#1 & (byte) 1 -- vbuaa=vbuxx_band_vbuc1
|
||||
txa
|
||||
and #1
|
||||
// [12] if((byte) main::i#1>=(byte) $a) goto main::@2 -- vbuxx_ge_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcs b2_from_b1
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [13] if((byte~) main::$6!=(byte) 0) goto main::@2 -- vbuaa_neq_0_then_la1
|
||||
cmp #0
|
||||
bne b2_from_b4
|
||||
// [5] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [5] phi (byte) main::i#9 = (byte) main::i#1 [phi:main::@4->main::@3#0] -- register_copy
|
||||
jmp b3
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b4
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp b4
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b1_from_b2 with b1
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b2_from_b4 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b1_from_b2:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction b2_from_b3:
|
||||
Removing instruction b2_from_b4:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b4:
|
||||
Removing instruction b3:
|
||||
Removing instruction b3_from_main:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b4:
|
||||
Removing instruction b3_from_b4:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -381,24 +430,25 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) main()
|
||||
(byte~) main::$1 reg byte a 11.0
|
||||
(byte~) main::$6 reg byte a 551.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@3
|
||||
(label) main::@4
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 11.0
|
||||
(byte) main::i#1 reg byte x 1041.4
|
||||
(byte) main::i#5 reg byte x 2114.0
|
||||
(byte) main::i#9 reg byte x 61.5
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = (byte*) 1024
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte a [ main::$1 ]
|
||||
reg byte x [ main::i#5 main::i#9 main::i#1 ]
|
||||
reg byte a [ main::$6 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 291
|
||||
Score: 15576
|
||||
|
||||
// File Comments
|
||||
// A test of boolean conditions using && || and !
|
||||
@ -417,42 +467,46 @@ Score: 291
|
||||
// main
|
||||
main: {
|
||||
.label screen = $400
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
||||
// [5] phi from main to main::@3 [phi:main->main::@3]
|
||||
// [5] phi (byte) main::i#9 = (byte) 0 [phi:main->main::@3#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// main::@1
|
||||
b1:
|
||||
// i&1
|
||||
// [6] (byte~) main::$1 ← (byte) main::i#2 & (byte) 1 -- vbuaa=vbuxx_band_vbuc1
|
||||
txa
|
||||
and #1
|
||||
// if( (i<10) && ((i&1)==0) )
|
||||
// [7] if((byte) main::i#2>=(byte) $a) goto main::@2 -- vbuxx_ge_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcs b2
|
||||
// main::@4
|
||||
// [8] if((byte~) main::$1!=(byte) 0) goto main::@2 -- vbuaa_neq_0_then_la1
|
||||
cmp #0
|
||||
bne b2
|
||||
// main::@3
|
||||
b3:
|
||||
// screen[i] = '*'
|
||||
// [9] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [6] *((const byte*) main::screen#0 + (byte) main::i#9) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
// [7] phi from main::@1 main::@3 main::@4 to main::@2 [phi:main::@1/main::@3/main::@4->main::@2]
|
||||
// [7] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@1/main::@3/main::@4->main::@2#0] -- register_copy
|
||||
// main::@2
|
||||
b2:
|
||||
// for( char i : 0..20)
|
||||
// [10] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
// [8] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [11] if((byte) main::i#1!=(byte) $15) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
|
||||
// [9] if((byte) main::i#1!=(byte) $15) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
|
||||
cpx #$15
|
||||
bne b1
|
||||
// main::@return
|
||||
// }
|
||||
// [12] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@1
|
||||
b1:
|
||||
// i&1
|
||||
// [11] (byte~) main::$6 ← (byte) main::i#1 & (byte) 1 -- vbuaa=vbuxx_band_vbuc1
|
||||
txa
|
||||
and #1
|
||||
// if( (i<10) && ((i&1)==0) )
|
||||
// [12] if((byte) main::i#1>=(byte) $a) goto main::@2 -- vbuxx_ge_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcs b2
|
||||
// main::@4
|
||||
// [13] if((byte~) main::$6!=(byte) 0) goto main::@2 -- vbuaa_neq_0_then_la1
|
||||
cmp #0
|
||||
bne b2
|
||||
// [5] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
// [5] phi (byte) main::i#9 = (byte) main::i#1 [phi:main::@4->main::@3#0] -- register_copy
|
||||
jmp b3
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -2,17 +2,18 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) main()
|
||||
(byte~) main::$1 reg byte a 11.0
|
||||
(byte~) main::$6 reg byte a 551.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@3
|
||||
(label) main::@4
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 11.0
|
||||
(byte) main::i#1 reg byte x 1041.4
|
||||
(byte) main::i#5 reg byte x 2114.0
|
||||
(byte) main::i#9 reg byte x 61.5
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = (byte*) 1024
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte a [ main::$1 ]
|
||||
reg byte x [ main::i#5 main::i#9 main::i#1 ]
|
||||
reg byte a [ main::$6 ]
|
||||
|
@ -59,6 +59,14 @@ bool_complex: {
|
||||
bool_not: {
|
||||
.label screen = $450
|
||||
ldx #0
|
||||
b4:
|
||||
lda #' '
|
||||
sta screen,x
|
||||
b3:
|
||||
inx
|
||||
cpx #$15
|
||||
bne b1
|
||||
rts
|
||||
b1:
|
||||
txa
|
||||
and #1
|
||||
@ -68,19 +76,19 @@ bool_not: {
|
||||
beq b4
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
b3:
|
||||
inx
|
||||
cpx #$15
|
||||
bne b1
|
||||
rts
|
||||
b4:
|
||||
lda #' '
|
||||
sta screen,x
|
||||
jmp b3
|
||||
}
|
||||
bool_or: {
|
||||
.label screen = $428
|
||||
ldx #0
|
||||
b2:
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
b3:
|
||||
inx
|
||||
cpx #$15
|
||||
bne b1
|
||||
rts
|
||||
b1:
|
||||
txa
|
||||
and #1
|
||||
@ -90,19 +98,19 @@ bool_or: {
|
||||
beq b2
|
||||
lda #' '
|
||||
sta screen,x
|
||||
b3:
|
||||
inx
|
||||
cpx #$15
|
||||
bne b1
|
||||
rts
|
||||
b2:
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
jmp b3
|
||||
}
|
||||
bool_and: {
|
||||
.label screen = $400
|
||||
ldx #0
|
||||
b2:
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
b3:
|
||||
inx
|
||||
cpx #$15
|
||||
bne b1
|
||||
rts
|
||||
b1:
|
||||
txa
|
||||
and #1
|
||||
@ -113,13 +121,5 @@ bool_and: {
|
||||
b4:
|
||||
lda #' '
|
||||
sta screen,x
|
||||
b3:
|
||||
inx
|
||||
cpx #$15
|
||||
bne b1
|
||||
rts
|
||||
b2:
|
||||
lda #'*'
|
||||
sta screen,x
|
||||
jmp b3
|
||||
}
|
||||
|
@ -60,73 +60,76 @@ bool_complex::@4: scope:[bool_complex] from bool_complex::@5 bool_complex::@7
|
||||
to:bool_complex::@3
|
||||
bool_not: scope:[bool_not] from main::@2
|
||||
[27] phi()
|
||||
to:bool_not::@1
|
||||
bool_not::@1: scope:[bool_not] from bool_not bool_not::@3
|
||||
[28] (byte) bool_not::i#2 ← phi( bool_not/(byte) 0 bool_not::@3/(byte) bool_not::i#1 )
|
||||
[29] (byte~) bool_not::$1 ← (byte) bool_not::i#2 & (byte) 1
|
||||
[30] if((byte) bool_not::i#2<(byte) $a) goto bool_not::@4
|
||||
to:bool_not::@5
|
||||
bool_not::@5: scope:[bool_not] from bool_not::@1
|
||||
[31] if((byte~) bool_not::$1==(byte) 0) goto bool_not::@4
|
||||
to:bool_not::@2
|
||||
bool_not::@2: scope:[bool_not] from bool_not::@5
|
||||
[32] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) '*'
|
||||
to:bool_not::@4
|
||||
bool_not::@4: scope:[bool_not] from bool_not bool_not::@1 bool_not::@5
|
||||
[28] (byte) bool_not::i#7 ← phi( bool_not::@1/(byte) bool_not::i#1 bool_not/(byte) 0 bool_not::@5/(byte) bool_not::i#1 )
|
||||
[29] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#7) ← (byte) ' '
|
||||
to:bool_not::@3
|
||||
bool_not::@3: scope:[bool_not] from bool_not::@2 bool_not::@4
|
||||
[33] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#2
|
||||
[34] if((byte) bool_not::i#1!=(byte) $15) goto bool_not::@1
|
||||
[30] (byte) bool_not::i#8 ← phi( bool_not::@2/(byte) bool_not::i#1 bool_not::@4/(byte) bool_not::i#7 )
|
||||
[31] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#8
|
||||
[32] if((byte) bool_not::i#1!=(byte) $15) goto bool_not::@1
|
||||
to:bool_not::@return
|
||||
bool_not::@return: scope:[bool_not] from bool_not::@3
|
||||
[35] return
|
||||
[33] return
|
||||
to:@return
|
||||
bool_not::@4: scope:[bool_not] from bool_not::@1 bool_not::@5
|
||||
[36] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) ' '
|
||||
bool_not::@1: scope:[bool_not] from bool_not::@3
|
||||
[34] (byte~) bool_not::$6 ← (byte) bool_not::i#1 & (byte) 1
|
||||
[35] if((byte) bool_not::i#1<(byte) $a) goto bool_not::@4
|
||||
to:bool_not::@5
|
||||
bool_not::@5: scope:[bool_not] from bool_not::@1
|
||||
[36] if((byte~) bool_not::$6==(byte) 0) goto bool_not::@4
|
||||
to:bool_not::@2
|
||||
bool_not::@2: scope:[bool_not] from bool_not::@5
|
||||
[37] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#1) ← (byte) '*'
|
||||
to:bool_not::@3
|
||||
bool_or: scope:[bool_or] from main::@1
|
||||
[37] phi()
|
||||
to:bool_or::@1
|
||||
bool_or::@1: scope:[bool_or] from bool_or bool_or::@3
|
||||
[38] (byte) bool_or::i#2 ← phi( bool_or/(byte) 0 bool_or::@3/(byte) bool_or::i#1 )
|
||||
[39] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte) 1
|
||||
[40] if((byte) bool_or::i#2<(byte) $a) goto bool_or::@2
|
||||
to:bool_or::@5
|
||||
bool_or::@5: scope:[bool_or] from bool_or::@1
|
||||
[41] if((byte~) bool_or::$1==(byte) 0) goto bool_or::@2
|
||||
to:bool_or::@4
|
||||
bool_or::@4: scope:[bool_or] from bool_or::@5
|
||||
[42] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) ' '
|
||||
[38] phi()
|
||||
to:bool_or::@2
|
||||
bool_or::@2: scope:[bool_or] from bool_or bool_or::@1 bool_or::@5
|
||||
[39] (byte) bool_or::i#6 ← phi( bool_or::@1/(byte) bool_or::i#1 bool_or/(byte) 0 bool_or::@5/(byte) bool_or::i#1 )
|
||||
[40] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#6) ← (byte) '*'
|
||||
to:bool_or::@3
|
||||
bool_or::@3: scope:[bool_or] from bool_or::@2 bool_or::@4
|
||||
[43] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#2
|
||||
[44] if((byte) bool_or::i#1!=(byte) $15) goto bool_or::@1
|
||||
[41] (byte) bool_or::i#8 ← phi( bool_or::@2/(byte) bool_or::i#6 bool_or::@4/(byte) bool_or::i#1 )
|
||||
[42] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#8
|
||||
[43] if((byte) bool_or::i#1!=(byte) $15) goto bool_or::@1
|
||||
to:bool_or::@return
|
||||
bool_or::@return: scope:[bool_or] from bool_or::@3
|
||||
[45] return
|
||||
[44] return
|
||||
to:@return
|
||||
bool_or::@2: scope:[bool_or] from bool_or::@1 bool_or::@5
|
||||
[46] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) '*'
|
||||
bool_or::@1: scope:[bool_or] from bool_or::@3
|
||||
[45] (byte~) bool_or::$5 ← (byte) bool_or::i#1 & (byte) 1
|
||||
[46] if((byte) bool_or::i#1<(byte) $a) goto bool_or::@2
|
||||
to:bool_or::@5
|
||||
bool_or::@5: scope:[bool_or] from bool_or::@1
|
||||
[47] if((byte~) bool_or::$5==(byte) 0) goto bool_or::@2
|
||||
to:bool_or::@4
|
||||
bool_or::@4: scope:[bool_or] from bool_or::@5
|
||||
[48] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#1) ← (byte) ' '
|
||||
to:bool_or::@3
|
||||
bool_and: scope:[bool_and] from main
|
||||
[47] phi()
|
||||
to:bool_and::@1
|
||||
bool_and::@1: scope:[bool_and] from bool_and bool_and::@3
|
||||
[48] (byte) bool_and::i#2 ← phi( bool_and/(byte) 0 bool_and::@3/(byte) bool_and::i#1 )
|
||||
[49] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte) 1
|
||||
[50] if((byte) bool_and::i#2>=(byte) $a) goto bool_and::@4
|
||||
to:bool_and::@5
|
||||
bool_and::@5: scope:[bool_and] from bool_and::@1
|
||||
[51] if((byte~) bool_and::$1==(byte) 0) goto bool_and::@2
|
||||
to:bool_and::@4
|
||||
bool_and::@4: scope:[bool_and] from bool_and::@1 bool_and::@5
|
||||
[52] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) ' '
|
||||
[49] phi()
|
||||
to:bool_and::@2
|
||||
bool_and::@2: scope:[bool_and] from bool_and bool_and::@5
|
||||
[50] (byte) bool_and::i#11 ← phi( bool_and::@5/(byte) bool_and::i#1 bool_and/(byte) 0 )
|
||||
[51] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#11) ← (byte) '*'
|
||||
to:bool_and::@3
|
||||
bool_and::@3: scope:[bool_and] from bool_and::@2 bool_and::@4
|
||||
[53] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#2
|
||||
[52] (byte) bool_and::i#8 ← phi( bool_and::@2/(byte) bool_and::i#11 bool_and::@4/(byte) bool_and::i#1 )
|
||||
[53] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#8
|
||||
[54] if((byte) bool_and::i#1!=(byte) $15) goto bool_and::@1
|
||||
to:bool_and::@return
|
||||
bool_and::@return: scope:[bool_and] from bool_and::@3
|
||||
[55] return
|
||||
to:@return
|
||||
bool_and::@2: scope:[bool_and] from bool_and::@5
|
||||
[56] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) '*'
|
||||
bool_and::@1: scope:[bool_and] from bool_and::@3
|
||||
[56] (byte~) bool_and::$5 ← (byte) bool_and::i#1 & (byte) 1
|
||||
[57] if((byte) bool_and::i#1>=(byte) $a) goto bool_and::@4
|
||||
to:bool_and::@5
|
||||
bool_and::@5: scope:[bool_and] from bool_and::@1
|
||||
[58] if((byte~) bool_and::$5==(byte) 0) goto bool_and::@2
|
||||
to:bool_and::@4
|
||||
bool_and::@4: scope:[bool_and] from bool_and::@1 bool_and::@5
|
||||
[59] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#1) ← (byte) ' '
|
||||
to:bool_and::@3
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) bool_and()
|
||||
(byte~) bool_and::$1 reg byte a 11.0
|
||||
(byte~) bool_and::$5 reg byte a 101.0
|
||||
(label) bool_and::@1
|
||||
(label) bool_and::@2
|
||||
(label) bool_and::@3
|
||||
@ -10,8 +10,9 @@
|
||||
(label) bool_and::@5
|
||||
(label) bool_and::@return
|
||||
(byte) bool_and::i
|
||||
(byte) bool_and::i#1 reg byte x 16.5
|
||||
(byte) bool_and::i#2 reg byte x 11.0
|
||||
(byte) bool_and::i#1 reg byte x 117.83333333333331
|
||||
(byte) bool_and::i#11 reg byte x 61.5
|
||||
(byte) bool_and::i#8 reg byte x 213.0
|
||||
(bool) bool_and::o1
|
||||
(bool) bool_and::o2
|
||||
(bool) bool_and::o3
|
||||
@ -40,7 +41,7 @@
|
||||
(byte*) bool_complex::screen
|
||||
(const byte*) bool_complex::screen#0 screen = (byte*) 1144
|
||||
(void()) bool_not()
|
||||
(byte~) bool_not::$1 reg byte a 11.0
|
||||
(byte~) bool_not::$6 reg byte a 101.0
|
||||
(label) bool_not::@1
|
||||
(label) bool_not::@2
|
||||
(label) bool_not::@3
|
||||
@ -48,15 +49,16 @@
|
||||
(label) bool_not::@5
|
||||
(label) bool_not::@return
|
||||
(byte) bool_not::i
|
||||
(byte) bool_not::i#1 reg byte x 16.5
|
||||
(byte) bool_not::i#2 reg byte x 11.0
|
||||
(byte) bool_not::i#1 reg byte x 134.66666666666666
|
||||
(byte) bool_not::i#7 reg byte x 112.0
|
||||
(byte) bool_not::i#8 reg byte x 213.0
|
||||
(bool) bool_not::o1
|
||||
(bool) bool_not::o2
|
||||
(bool) bool_not::o3
|
||||
(byte*) bool_not::screen
|
||||
(const byte*) bool_not::screen#0 screen = (byte*) 1104
|
||||
(void()) bool_or()
|
||||
(byte~) bool_or::$1 reg byte a 11.0
|
||||
(byte~) bool_or::$5 reg byte a 101.0
|
||||
(label) bool_or::@1
|
||||
(label) bool_or::@2
|
||||
(label) bool_or::@3
|
||||
@ -64,8 +66,9 @@
|
||||
(label) bool_or::@5
|
||||
(label) bool_or::@return
|
||||
(byte) bool_or::i
|
||||
(byte) bool_or::i#1 reg byte x 16.5
|
||||
(byte) bool_or::i#2 reg byte x 11.0
|
||||
(byte) bool_or::i#1 reg byte x 134.66666666666666
|
||||
(byte) bool_or::i#6 reg byte x 112.0
|
||||
(byte) bool_or::i#8 reg byte x 213.0
|
||||
(bool) bool_or::o1
|
||||
(bool) bool_or::o2
|
||||
(bool) bool_or::o3
|
||||
@ -78,12 +81,12 @@
|
||||
(label) main::@return
|
||||
|
||||
reg byte x [ bool_complex::i#2 bool_complex::i#1 ]
|
||||
reg byte x [ bool_not::i#2 bool_not::i#1 ]
|
||||
reg byte x [ bool_or::i#2 bool_or::i#1 ]
|
||||
reg byte x [ bool_and::i#2 bool_and::i#1 ]
|
||||
reg byte x [ bool_not::i#8 bool_not::i#7 bool_not::i#1 ]
|
||||
reg byte x [ bool_or::i#8 bool_or::i#6 bool_or::i#1 ]
|
||||
reg byte x [ bool_and::i#8 bool_and::i#11 bool_and::i#1 ]
|
||||
zp ZP_BOOL:2 [ bool_complex::o1#0 ]
|
||||
reg byte a [ bool_complex::$1 ]
|
||||
zp ZP_BOOL:3 [ bool_complex::o2#0 ]
|
||||
reg byte a [ bool_not::$1 ]
|
||||
reg byte a [ bool_or::$1 ]
|
||||
reg byte a [ bool_and::$1 ]
|
||||
reg byte a [ bool_not::$6 ]
|
||||
reg byte a [ bool_or::$5 ]
|
||||
reg byte a [ bool_and::$5 ]
|
||||
|
@ -343,14 +343,6 @@ memset: {
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
b1:
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
b2:
|
||||
lda #c
|
||||
ldy #0
|
||||
@ -359,6 +351,12 @@ memset: {
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
jmp b1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
}
|
||||
print_hextab: .text "0123456789abcdef"
|
||||
|
@ -301,15 +301,15 @@ print_cls::@return: scope:[print_cls] from print_cls
|
||||
to:@return
|
||||
memset: scope:[memset] from print_cls
|
||||
[142] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[143] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[144] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[145] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[143] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[144] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[146] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[145] return
|
||||
[147] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[146] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[147] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
|
@ -1603,6 +1603,13 @@ Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memse
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) memset::end#0 = memset::$2+memset::num#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte*) memset::dst#1 = (byte*) memset::dst#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte*) memset::dst#5 (const byte*) memset::dst#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
if() condition always true - replacing block destination [106] if((const byte*) memset::dst#0!=(const byte*) memset::end#0) goto memset::@5
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Inlining constant with var siblings (const byte*) memset::dst#0
|
||||
Inlining constant with var siblings (const byte*) print_str::str#1
|
||||
Inlining constant with var siblings (const byte*) print_str::str#2
|
||||
@ -1670,6 +1677,7 @@ Constant inlined print_str::str#2 = (const string) testShort::str
|
||||
Constant inlined memset::dst#0 = (byte*)(const void*) memset::str#0
|
||||
Constant inlined print_str::str#1 = (const string) testChar::str
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting memset::@10(between memset::@4 and memset::@5)
|
||||
Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @12
|
||||
@ -1709,6 +1717,7 @@ Adding NOP phi() at start of print_cls
|
||||
Adding NOP phi() at start of print_cls::@1
|
||||
Adding NOP phi() at start of memset
|
||||
Adding NOP phi() at start of memset::@2
|
||||
Adding NOP phi() at start of memset::@4_1
|
||||
Adding NOP phi() at start of memset::@1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:4
|
||||
@ -1777,7 +1786,7 @@ Coalesced (already) [163] print_char_cursor#177 ← print_char_cursor#26
|
||||
Coalesced (already) [165] print_char_cursor#186 ← print_char_cursor#26
|
||||
Coalesced (already) [174] print_char_cursor#180 ← print_char_cursor#26
|
||||
Coalesced (already) [177] print_char_cursor#173 ← print_char_cursor#26
|
||||
Coalesced [193] memset::dst#4 ← memset::dst#1
|
||||
Coalesced [194] memset::dst#6 ← memset::dst#1
|
||||
Coalesced down to 10 phi equivalence classes
|
||||
Culled Empty Block (label) @12
|
||||
Culled Empty Block (label) @29
|
||||
@ -1800,7 +1809,9 @@ Culled Empty Block (label) print_sbyte::@5
|
||||
Culled Empty Block (label) print_sbyte::@7
|
||||
Culled Empty Block (label) print_cls::@1
|
||||
Culled Empty Block (label) memset::@2
|
||||
Culled Empty Block (label) memset::@4_1
|
||||
Culled Empty Block (label) memset::@1
|
||||
Culled Empty Block (label) memset::@10
|
||||
Renumbering block @41 to @1
|
||||
Renumbering block memset::@4 to memset::@1
|
||||
Renumbering block memset::@5 to memset::@2
|
||||
@ -2153,18 +2164,18 @@ print_cls::@return: scope:[print_cls] from print_cls
|
||||
to:@return
|
||||
memset: scope:[memset] from print_cls
|
||||
[142] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[143] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[144] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[145] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[143] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[144] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[146] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[145] return
|
||||
[147] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[146] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[147] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
@ -2172,8 +2183,8 @@ VARIABLE REGISTER WEIGHTS
|
||||
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
|
||||
(byte) memset::c
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 22.0
|
||||
(byte*) memset::dst#2 14.666666666666666
|
||||
(byte*) memset::dst#1 16.5
|
||||
(byte*) memset::dst#4 16.5
|
||||
(byte*) memset::end
|
||||
(word) memset::num
|
||||
(void*) memset::return
|
||||
@ -2264,7 +2275,7 @@ Initial phi equivalence classes
|
||||
[ print_byte::b#5 print_byte::b#1 print_byte::b#2 ]
|
||||
[ print_str::str#5 print_str::str#7 print_str::str#0 ]
|
||||
[ print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
[ memset::dst#2 memset::dst#1 ]
|
||||
[ memset::dst#4 memset::dst#1 ]
|
||||
Added variable print_byte::$0 to zero page equivalence class [ print_byte::$0 ]
|
||||
Added variable print_byte::$2 to zero page equivalence class [ print_byte::$2 ]
|
||||
Complete equivalence classes
|
||||
@ -2277,7 +2288,7 @@ Complete equivalence classes
|
||||
[ print_byte::b#5 print_byte::b#1 print_byte::b#2 ]
|
||||
[ print_str::str#5 print_str::str#7 print_str::str#0 ]
|
||||
[ print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
[ memset::dst#2 memset::dst#1 ]
|
||||
[ memset::dst#4 memset::dst#1 ]
|
||||
[ print_byte::$0 ]
|
||||
[ print_byte::$2 ]
|
||||
Allocated zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
@ -2289,7 +2300,7 @@ Allocated zp ZP_WORD:15 [ print_char_cursor#144 print_char_cursor#145 print_char
|
||||
Allocated zp ZP_BYTE:17 [ print_byte::b#5 print_byte::b#1 print_byte::b#2 ]
|
||||
Allocated zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ]
|
||||
Allocated zp ZP_WORD:20 [ print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
Allocated zp ZP_WORD:22 [ memset::dst#2 memset::dst#1 ]
|
||||
Allocated zp ZP_WORD:22 [ memset::dst#4 memset::dst#1 ]
|
||||
Allocated zp ZP_BYTE:24 [ print_byte::$0 ]
|
||||
Allocated zp ZP_BYTE:25 [ print_byte::$2 ]
|
||||
|
||||
@ -3214,43 +3225,44 @@ memset: {
|
||||
.label str = $400
|
||||
.label end = str+num
|
||||
.label dst = $16
|
||||
// [143] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
b1_from_memset:
|
||||
// [143] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [143] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
b2_from_memset:
|
||||
// [143] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [144] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [145] return
|
||||
rts
|
||||
jmp b2
|
||||
// [143] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
b2_from_b1:
|
||||
// [143] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// memset::@2
|
||||
b2:
|
||||
// [146] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
// [144] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// [147] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
// [145] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [143] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
b1_from_b2:
|
||||
// [143] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [146] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2_from_b1
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2_from_b1
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [147] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
print_hextab: .text "0123456789abcdef"
|
||||
@ -3278,8 +3290,8 @@ Statement [93] if((signed word) print_sword::w#10<(signed byte) 0) goto print_sw
|
||||
Statement [97] (word) print_word::w#0 ← (word)(signed word) print_sword::w#7 [ print_char_cursor#26 print_word::w#0 ] ( main:2::testInt:11::print_sword:84 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] main:2::testInt:11::print_sword:88 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] main:2::testShort:9::print_sword:110 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] main:2::testShort:9::print_sword:114 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] ) always clobbers reg byte a
|
||||
Statement [102] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#10 [ print_char_cursor#26 print_sword::w#0 ] ( main:2::testInt:11::print_sword:84 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] main:2::testInt:11::print_sword:88 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] main:2::testShort:9::print_sword:110 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] main:2::testShort:9::print_sword:114 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] ) always clobbers reg byte a
|
||||
Statement [103] (byte*~) print_char_cursor#163 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#163 ] ( main:2::testShort:9 [ print_line_cursor#1 print_char_cursor#163 ] ) always clobbers reg byte a
|
||||
Statement [144] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:5::memset:140 [ memset::dst#2 ] ) always clobbers reg byte a
|
||||
Statement [146] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:140 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [144] *((byte*) memset::dst#4) ← (const byte) memset::c#0 [ memset::dst#4 ] ( main:2::print_cls:5::memset:140 [ memset::dst#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [146] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#1 ] ( main:2::print_cls:5::memset:140 [ memset::dst#1 ] ) always clobbers reg byte a
|
||||
Statement [15] (byte*~) print_char_cursor#162 ← (byte*) print_line_cursor#1 [ print_char_cursor#162 print_line_cursor#1 ] ( main:2::testLong:13 [ print_char_cursor#162 print_line_cursor#1 ] ) always clobbers reg byte a
|
||||
Statement [32] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#20 + (byte) $28 [ print_line_cursor#1 print_char_cursor#26 ] ( main:2::testLong:13::print_ln:28 [ print_line_cursor#1 print_char_cursor#26 ] main:2::testInt:11::print_ln:90 [ print_line_cursor#1 print_char_cursor#26 ] main:2::testShort:9::print_ln:116 [ print_line_cursor#1 print_char_cursor#26 ] main:2::testChar:7::print_ln:131 [ print_line_cursor#1 print_char_cursor#26 ] ) always clobbers reg byte a
|
||||
Statement [33] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#26) goto print_ln::@1 [ print_line_cursor#1 print_char_cursor#26 ] ( main:2::testLong:13::print_ln:28 [ print_line_cursor#1 print_char_cursor#26 ] main:2::testInt:11::print_ln:90 [ print_line_cursor#1 print_char_cursor#26 ] main:2::testShort:9::print_ln:116 [ print_line_cursor#1 print_char_cursor#26 ] main:2::testChar:7::print_ln:131 [ print_line_cursor#1 print_char_cursor#26 ] ) always clobbers reg byte a
|
||||
@ -3300,8 +3312,8 @@ Statement [93] if((signed word) print_sword::w#10<(signed byte) 0) goto print_sw
|
||||
Statement [97] (word) print_word::w#0 ← (word)(signed word) print_sword::w#7 [ print_char_cursor#26 print_word::w#0 ] ( main:2::testInt:11::print_sword:84 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] main:2::testInt:11::print_sword:88 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] main:2::testShort:9::print_sword:110 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] main:2::testShort:9::print_sword:114 [ print_line_cursor#1 print_char_cursor#26 print_word::w#0 ] ) always clobbers reg byte a
|
||||
Statement [102] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#10 [ print_char_cursor#26 print_sword::w#0 ] ( main:2::testInt:11::print_sword:84 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] main:2::testInt:11::print_sword:88 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] main:2::testShort:9::print_sword:110 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] main:2::testShort:9::print_sword:114 [ print_line_cursor#1 print_char_cursor#26 print_sword::w#0 ] ) always clobbers reg byte a
|
||||
Statement [103] (byte*~) print_char_cursor#163 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#163 ] ( main:2::testShort:9 [ print_line_cursor#1 print_char_cursor#163 ] ) always clobbers reg byte a
|
||||
Statement [144] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:5::memset:140 [ memset::dst#2 ] ) always clobbers reg byte a
|
||||
Statement [146] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:140 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [144] *((byte*) memset::dst#4) ← (const byte) memset::c#0 [ memset::dst#4 ] ( main:2::print_cls:5::memset:140 [ memset::dst#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [146] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#1 ] ( main:2::print_cls:5::memset:140 [ memset::dst#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_DWORD:4 [ print_sdword::dw#5 print_sdword::dw#0 print_sdword::dw#3 ] : zp ZP_DWORD:4 ,
|
||||
Potential registers zp ZP_BYTE:8 [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y ,
|
||||
@ -3311,14 +3323,14 @@ Potential registers zp ZP_WORD:15 [ print_char_cursor#144 print_char_cursor#145
|
||||
Potential registers zp ZP_BYTE:17 [ print_byte::b#5 print_byte::b#1 print_byte::b#2 ] : zp ZP_BYTE:17 , reg byte x ,
|
||||
Potential registers zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ] : zp ZP_WORD:18 ,
|
||||
Potential registers zp ZP_WORD:20 [ print_sword::w#7 print_sword::w#0 print_sword::w#10 ] : zp ZP_WORD:20 ,
|
||||
Potential registers zp ZP_WORD:22 [ memset::dst#2 memset::dst#1 ] : zp ZP_WORD:22 ,
|
||||
Potential registers zp ZP_WORD:22 [ memset::dst#4 memset::dst#1 ] : zp ZP_WORD:22 ,
|
||||
Potential registers zp ZP_BYTE:24 [ print_byte::$0 ] : zp ZP_BYTE:24 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:25 [ print_byte::$2 ] : zp ZP_BYTE:25 , reg byte a , reg byte x , reg byte y ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [] 65.19: zp ZP_WORD:15 [ print_char_cursor#144 print_char_cursor#145 print_char_cursor#94 print_char_cursor#149 print_char_cursor#26 print_char_cursor#136 print_char_cursor#156 print_char_cursor#161 print_char_cursor#162 print_char_cursor#163 print_char_cursor#1 ] 32.83: zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
Uplift Scope [memset] 36.67: zp ZP_WORD:22 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplift Scope [print_str] 35.5: zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ]
|
||||
Uplift Scope [memset] 33: zp ZP_WORD:22 [ memset::dst#4 memset::dst#1 ]
|
||||
Uplift Scope [print_byte] 10: zp ZP_BYTE:17 [ print_byte::b#5 print_byte::b#1 print_byte::b#2 ] 4: zp ZP_BYTE:24 [ print_byte::$0 ] 4: zp ZP_BYTE:25 [ print_byte::$2 ]
|
||||
Uplift Scope [print_word] 15.33: zp ZP_WORD:13 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 ]
|
||||
Uplift Scope [print_char] 14: zp ZP_BYTE:8 [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ]
|
||||
@ -3335,32 +3347,32 @@ Uplift Scope [testShort]
|
||||
Uplift Scope [testInt]
|
||||
Uplift Scope [testLong]
|
||||
|
||||
Uplifting [] best 2677 combination zp ZP_WORD:15 [ print_char_cursor#144 print_char_cursor#145 print_char_cursor#94 print_char_cursor#149 print_char_cursor#26 print_char_cursor#136 print_char_cursor#156 print_char_cursor#161 print_char_cursor#162 print_char_cursor#163 print_char_cursor#1 ] zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
Uplifting [memset] best 2677 combination zp ZP_WORD:22 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplifting [print_str] best 2677 combination zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ]
|
||||
Uplifting [print_byte] best 2654 combination reg byte x [ print_byte::b#5 print_byte::b#1 print_byte::b#2 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ]
|
||||
Uplifting [print_word] best 2654 combination zp ZP_WORD:13 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 ]
|
||||
Uplifting [print_char] best 2606 combination reg byte a [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ]
|
||||
Uplifting [print_sword] best 2606 combination zp ZP_WORD:20 [ print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
Uplifting [print_sdword] best 2606 combination zp ZP_DWORD:4 [ print_sdword::dw#5 print_sdword::dw#0 print_sdword::dw#3 ]
|
||||
Uplifting [print_dword] best 2606 combination zp ZP_DWORD:9 [ print_dword::dw#2 print_dword::dw#0 ]
|
||||
Uplifting [RADIX] best 2606 combination
|
||||
Uplifting [print_ln] best 2606 combination
|
||||
Uplifting [print_sbyte] best 2606 combination
|
||||
Uplifting [print_cls] best 2606 combination
|
||||
Uplifting [main] best 2606 combination
|
||||
Uplifting [testChar] best 2606 combination
|
||||
Uplifting [testShort] best 2606 combination
|
||||
Uplifting [testInt] best 2606 combination
|
||||
Uplifting [testLong] best 2606 combination
|
||||
Uplifting [] best 2707 combination zp ZP_WORD:15 [ print_char_cursor#144 print_char_cursor#145 print_char_cursor#94 print_char_cursor#149 print_char_cursor#26 print_char_cursor#136 print_char_cursor#156 print_char_cursor#161 print_char_cursor#162 print_char_cursor#163 print_char_cursor#1 ] zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
Uplifting [print_str] best 2707 combination zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ]
|
||||
Uplifting [memset] best 2707 combination zp ZP_WORD:22 [ memset::dst#4 memset::dst#1 ]
|
||||
Uplifting [print_byte] best 2684 combination reg byte x [ print_byte::b#5 print_byte::b#1 print_byte::b#2 ] reg byte a [ print_byte::$0 ] reg byte x [ print_byte::$2 ]
|
||||
Uplifting [print_word] best 2684 combination zp ZP_WORD:13 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 ]
|
||||
Uplifting [print_char] best 2636 combination reg byte a [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ]
|
||||
Uplifting [print_sword] best 2636 combination zp ZP_WORD:20 [ print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
Uplifting [print_sdword] best 2636 combination zp ZP_DWORD:4 [ print_sdword::dw#5 print_sdword::dw#0 print_sdword::dw#3 ]
|
||||
Uplifting [print_dword] best 2636 combination zp ZP_DWORD:9 [ print_dword::dw#2 print_dword::dw#0 ]
|
||||
Uplifting [RADIX] best 2636 combination
|
||||
Uplifting [print_ln] best 2636 combination
|
||||
Uplifting [print_sbyte] best 2636 combination
|
||||
Uplifting [print_cls] best 2636 combination
|
||||
Uplifting [main] best 2636 combination
|
||||
Uplifting [testChar] best 2636 combination
|
||||
Uplifting [testShort] best 2636 combination
|
||||
Uplifting [testInt] best 2636 combination
|
||||
Uplifting [testLong] best 2636 combination
|
||||
Coalescing zero page register [ zp ZP_DWORD:4 [ print_sdword::dw#5 print_sdword::dw#0 print_sdword::dw#3 ] ] with [ zp ZP_DWORD:9 [ print_dword::dw#2 print_dword::dw#0 ] ] - score: 1
|
||||
Coalescing zero page register [ zp ZP_WORD:13 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 ] ] with [ zp ZP_WORD:20 [ print_sword::w#7 print_sword::w#0 print_sword::w#10 ] ] - score: 1
|
||||
Coalescing zero page register [ zp ZP_WORD:18 [ print_str::str#5 print_str::str#7 print_str::str#0 ] ] with [ zp ZP_WORD:13 [ print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 print_sword::w#7 print_sword::w#0 print_sword::w#10 ] ]
|
||||
Coalescing zero page register [ zp ZP_WORD:22 [ memset::dst#2 memset::dst#1 ] ] with [ zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ] ]
|
||||
Coalescing zero page register [ zp ZP_WORD:22 [ memset::dst#4 memset::dst#1 ] ] with [ zp ZP_WORD:2 [ print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ] ]
|
||||
Allocated (was zp ZP_DWORD:4) zp ZP_DWORD:2 [ print_sdword::dw#5 print_sdword::dw#0 print_sdword::dw#3 print_dword::dw#2 print_dword::dw#0 ]
|
||||
Allocated (was zp ZP_WORD:15) zp ZP_WORD:6 [ print_char_cursor#144 print_char_cursor#145 print_char_cursor#94 print_char_cursor#149 print_char_cursor#26 print_char_cursor#136 print_char_cursor#156 print_char_cursor#161 print_char_cursor#162 print_char_cursor#163 print_char_cursor#1 ]
|
||||
Allocated (was zp ZP_WORD:18) zp ZP_WORD:8 [ print_str::str#5 print_str::str#7 print_str::str#0 print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
Allocated (was zp ZP_WORD:22) zp ZP_WORD:10 [ memset::dst#2 memset::dst#1 print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
Allocated (was zp ZP_WORD:22) zp ZP_WORD:10 [ memset::dst#4 memset::dst#1 print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -4244,43 +4256,44 @@ memset: {
|
||||
.label str = $400
|
||||
.label end = str+num
|
||||
.label dst = $a
|
||||
// [143] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
b1_from_memset:
|
||||
// [143] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [143] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
b2_from_memset:
|
||||
// [143] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [144] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [145] return
|
||||
rts
|
||||
jmp b2
|
||||
// [143] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
b2_from_b1:
|
||||
// [143] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// memset::@2
|
||||
b2:
|
||||
// [146] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
// [144] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// [147] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
// [145] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [143] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
b1_from_b2:
|
||||
// [143] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [146] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2_from_b1
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2_from_b1
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [147] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
print_hextab: .text "0123456789abcdef"
|
||||
@ -4346,6 +4359,7 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
@ -4358,6 +4372,8 @@ Replacing label b2_from_b4 with b2
|
||||
Replacing label b1_from_b2 with b1
|
||||
Replacing label b1_from_print_sword with b1
|
||||
Replacing label b2_from_b4 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
@ -4437,6 +4453,7 @@ Removing instruction b1_from_print_sbyte:
|
||||
Removing instruction print_char_from_b1:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction print_byte_from_b2:
|
||||
Removing instruction b2_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction print_cls_from_main:
|
||||
@ -4503,13 +4520,15 @@ Removing instruction b2:
|
||||
Removing instruction breturn:
|
||||
Removing instruction memset_from_print_cls:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_memset:
|
||||
Removing instruction b2_from_memset:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -4534,8 +4553,8 @@ FINAL SYMBOL TABLE
|
||||
(byte) memset::c
|
||||
(const byte) memset::c#0 c = (byte) ' '
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:10 22.0
|
||||
(byte*) memset::dst#2 dst zp ZP_WORD:10 14.666666666666666
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:10 16.5
|
||||
(byte*) memset::dst#4 dst zp ZP_WORD:10 16.5
|
||||
(byte*) memset::end
|
||||
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||
(word) memset::num
|
||||
@ -4696,13 +4715,13 @@ reg byte a [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ]
|
||||
zp ZP_WORD:6 [ print_char_cursor#144 print_char_cursor#145 print_char_cursor#94 print_char_cursor#149 print_char_cursor#26 print_char_cursor#136 print_char_cursor#156 print_char_cursor#161 print_char_cursor#162 print_char_cursor#163 print_char_cursor#1 ]
|
||||
reg byte x [ print_byte::b#5 print_byte::b#1 print_byte::b#2 ]
|
||||
zp ZP_WORD:8 [ print_str::str#5 print_str::str#7 print_str::str#0 print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
zp ZP_WORD:10 [ memset::dst#2 memset::dst#1 print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
zp ZP_WORD:10 [ memset::dst#4 memset::dst#1 print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
reg byte a [ print_byte::$0 ]
|
||||
reg byte x [ print_byte::$2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 2196
|
||||
Score: 2166
|
||||
|
||||
// File Comments
|
||||
// Tests the different standard C types
|
||||
@ -5454,16 +5473,29 @@ memset: {
|
||||
.label str = $400
|
||||
.label end = str+num
|
||||
.label dst = $a
|
||||
// [143] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
// [143] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [143] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
// [143] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [143] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
// [143] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
// memset::@2
|
||||
b2:
|
||||
// *dst = c
|
||||
// [144] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// for(char* dst = str; dst!=end; dst++)
|
||||
// [144] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
// [145] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// memset::@1
|
||||
// [146] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
@ -5472,24 +5504,8 @@ memset: {
|
||||
bne b2
|
||||
// memset::@return
|
||||
// }
|
||||
// [145] return
|
||||
// [147] return
|
||||
rts
|
||||
// memset::@2
|
||||
b2:
|
||||
// *dst = c
|
||||
// [146] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// for(char* dst = str; dst!=end; dst++)
|
||||
// [147] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [143] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
// [143] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
print_hextab: .text "0123456789abcdef"
|
||||
|
@ -18,8 +18,8 @@
|
||||
(byte) memset::c
|
||||
(const byte) memset::c#0 c = (byte) ' '
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:10 22.0
|
||||
(byte*) memset::dst#2 dst zp ZP_WORD:10 14.666666666666666
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:10 16.5
|
||||
(byte*) memset::dst#4 dst zp ZP_WORD:10 16.5
|
||||
(byte*) memset::end
|
||||
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||
(word) memset::num
|
||||
@ -180,6 +180,6 @@ reg byte a [ print_char::ch#16 print_char::ch#6 print_char::ch#7 ]
|
||||
zp ZP_WORD:6 [ print_char_cursor#144 print_char_cursor#145 print_char_cursor#94 print_char_cursor#149 print_char_cursor#26 print_char_cursor#136 print_char_cursor#156 print_char_cursor#161 print_char_cursor#162 print_char_cursor#163 print_char_cursor#1 ]
|
||||
reg byte x [ print_byte::b#5 print_byte::b#1 print_byte::b#2 ]
|
||||
zp ZP_WORD:8 [ print_str::str#5 print_str::str#7 print_str::str#0 print_word::w#5 print_word::w#1 print_word::w#2 print_word::w#0 print_sword::w#7 print_sword::w#0 print_sword::w#10 ]
|
||||
zp ZP_WORD:10 [ memset::dst#2 memset::dst#1 print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
zp ZP_WORD:10 [ memset::dst#4 memset::dst#1 print_line_cursor#20 print_line_cursor#39 print_line_cursor#1 ]
|
||||
reg byte a [ print_byte::$0 ]
|
||||
reg byte x [ print_byte::$2 ]
|
||||
|
@ -1132,10 +1132,6 @@ print_str_at: {
|
||||
// Render all form values from the form_fields_val array
|
||||
form_render_values: {
|
||||
ldx #0
|
||||
b1:
|
||||
cpx #form_fields_cnt
|
||||
bcc b2
|
||||
rts
|
||||
b2:
|
||||
jsr form_field_ptr
|
||||
ldy form_fields_val,x
|
||||
@ -1143,7 +1139,9 @@ form_render_values: {
|
||||
ldy form_field_ptr.x
|
||||
sta (form_field_ptr.line),y
|
||||
inx
|
||||
jmp b1
|
||||
cpx #form_fields_cnt
|
||||
bcc b2
|
||||
rts
|
||||
}
|
||||
// Get the screen address of a form field
|
||||
// field_idx is the index of the field to get the screen address for
|
||||
@ -1255,16 +1253,14 @@ apply_preset: {
|
||||
sta preset+1
|
||||
b2:
|
||||
ldy #0
|
||||
// Copy preset values into the fields
|
||||
b13:
|
||||
cpy #form_fields_cnt
|
||||
bne b14
|
||||
rts
|
||||
b14:
|
||||
lda (preset),y
|
||||
sta form_fields_val,y
|
||||
iny
|
||||
jmp b13
|
||||
// Copy preset values into the fields
|
||||
cpy #form_fields_cnt
|
||||
bne b14
|
||||
rts
|
||||
}
|
||||
// Reads keyboard and allows the user to navigate and change the fields of the form
|
||||
// Returns 0 if space is not pressed, non-0 if space is pressed
|
||||
@ -1922,11 +1918,6 @@ gfx_init_vic_bitmap: {
|
||||
jsr bitmap_clear
|
||||
lda #0
|
||||
sta l
|
||||
b1:
|
||||
lda l
|
||||
cmp #lines_cnt
|
||||
bcc b2
|
||||
rts
|
||||
b2:
|
||||
ldy l
|
||||
lda lines_x,y
|
||||
@ -1938,7 +1929,10 @@ gfx_init_vic_bitmap: {
|
||||
sta bitmap_line.y1
|
||||
jsr bitmap_line
|
||||
inc l
|
||||
jmp b1
|
||||
lda l
|
||||
cmp #lines_cnt
|
||||
bcc b2
|
||||
rts
|
||||
lines_x: .byte 0, $ff, $ff, 0, 0, $80, $ff, $80, 0, $80
|
||||
lines_y: .byte 0, 0, $c7, $c7, 0, 0, $64, $c7, $64, 0
|
||||
}
|
||||
|
@ -625,22 +625,22 @@ print_str_at::@2: scope:[print_str_at] from print_str_at::@1
|
||||
to:print_str_at::@1
|
||||
form_render_values: scope:[form_render_values] from form_mode::@14 form_mode::@18
|
||||
[328] phi()
|
||||
to:form_render_values::@1
|
||||
form_render_values::@1: scope:[form_render_values] from form_render_values form_render_values::@3
|
||||
[329] (byte) form_render_values::idx#2 ← phi( form_render_values/(byte) 0 form_render_values::@3/(byte) form_render_values::idx#1 )
|
||||
[330] if((byte) form_render_values::idx#2<(const byte) form_fields_cnt#0) goto form_render_values::@2
|
||||
to:form_render_values::@return
|
||||
form_render_values::@return: scope:[form_render_values] from form_render_values::@1
|
||||
[331] return
|
||||
to:@return
|
||||
form_render_values::@2: scope:[form_render_values] from form_render_values::@1
|
||||
[332] (byte) form_field_ptr::field_idx#0 ← (byte) form_render_values::idx#2
|
||||
[333] call form_field_ptr
|
||||
to:form_render_values::@2
|
||||
form_render_values::@2: scope:[form_render_values] from form_render_values form_render_values::@1
|
||||
[329] (byte) form_render_values::idx#5 ← phi( form_render_values::@1/(byte) form_render_values::idx#1 form_render_values/(byte) 0 )
|
||||
[330] (byte) form_field_ptr::field_idx#0 ← (byte) form_render_values::idx#5
|
||||
[331] call form_field_ptr
|
||||
to:form_render_values::@3
|
||||
form_render_values::@3: scope:[form_render_values] from form_render_values::@2
|
||||
[334] *((byte*)(word) form_field_ptr::line#0 + (byte) form_field_ptr::x#0) ← *((const byte[]) print_hextab#0 + *((const byte[]) form_fields_val#0 + (byte) form_render_values::idx#2))
|
||||
[335] (byte) form_render_values::idx#1 ← ++ (byte) form_render_values::idx#2
|
||||
[332] *((byte*)(word) form_field_ptr::line#0 + (byte) form_field_ptr::x#0) ← *((const byte[]) print_hextab#0 + *((const byte[]) form_fields_val#0 + (byte) form_render_values::idx#5))
|
||||
[333] (byte) form_render_values::idx#1 ← ++ (byte) form_render_values::idx#5
|
||||
to:form_render_values::@1
|
||||
form_render_values::@1: scope:[form_render_values] from form_render_values::@3
|
||||
[334] if((byte) form_render_values::idx#1<(const byte) form_fields_cnt#0) goto form_render_values::@2
|
||||
to:form_render_values::@return
|
||||
form_render_values::@return: scope:[form_render_values] from form_render_values::@1
|
||||
[335] return
|
||||
to:@return
|
||||
form_field_ptr: scope:[form_field_ptr] from form_control form_render_values::@2
|
||||
[336] (byte) form_field_ptr::field_idx#2 ← phi( form_control/(byte) form_field_ptr::field_idx#1 form_render_values::@2/(byte) form_field_ptr::field_idx#0 )
|
||||
[337] (byte) form_field_ptr::y#0 ← *((const byte[]) form_fields_y#0 + (byte) form_field_ptr::field_idx#2)
|
||||
@ -688,18 +688,18 @@ apply_preset::@1: scope:[apply_preset] from apply_preset::@12
|
||||
to:apply_preset::@2
|
||||
apply_preset::@2: scope:[apply_preset] from apply_preset apply_preset::@1 apply_preset::@10 apply_preset::@11 apply_preset::@12 apply_preset::@3 apply_preset::@4 apply_preset::@5 apply_preset::@6 apply_preset::@7 apply_preset::@8 apply_preset::@9
|
||||
[353] (byte*) apply_preset::preset#15 ← phi( apply_preset/(const byte[]) preset_stdchar#0 apply_preset::@11/(const byte[]) preset_sixsfred2#0 apply_preset::@1/(const byte[]) preset_8bpppixelcell#0 apply_preset::@3/(const byte[]) preset_ecmchar#0 apply_preset::@4/(const byte[]) preset_stdbm#0 apply_preset::@12/(const byte[]) preset_stdchar#0 apply_preset::@5/(const byte[]) preset_mcbm#0 apply_preset::@6/(const byte[]) preset_hi_stdchar#0 apply_preset::@7/(const byte[]) preset_hi_ecmchar#0 apply_preset::@8/(const byte[]) preset_twoplane#0 apply_preset::@9/(const byte[]) preset_chunky#0 apply_preset::@10/(const byte[]) preset_sixsfred#0 )
|
||||
to:apply_preset::@14
|
||||
apply_preset::@14: scope:[apply_preset] from apply_preset::@13 apply_preset::@2
|
||||
[354] (byte) apply_preset::i#4 ← phi( apply_preset::@13/(byte) apply_preset::i#1 apply_preset::@2/(byte) 0 )
|
||||
[355] *((const byte[]) form_fields_val#0 + (byte) apply_preset::i#4) ← *((byte*) apply_preset::preset#15 + (byte) apply_preset::i#4)
|
||||
[356] (byte) apply_preset::i#1 ← ++ (byte) apply_preset::i#4
|
||||
to:apply_preset::@13
|
||||
apply_preset::@13: scope:[apply_preset] from apply_preset::@14 apply_preset::@2
|
||||
[354] (byte) apply_preset::i#2 ← phi( apply_preset::@2/(byte) 0 apply_preset::@14/(byte) apply_preset::i#1 )
|
||||
[355] if((byte) apply_preset::i#2!=(const byte) form_fields_cnt#0) goto apply_preset::@14
|
||||
apply_preset::@13: scope:[apply_preset] from apply_preset::@14
|
||||
[357] if((byte) apply_preset::i#1!=(const byte) form_fields_cnt#0) goto apply_preset::@14
|
||||
to:apply_preset::@return
|
||||
apply_preset::@return: scope:[apply_preset] from apply_preset::@13
|
||||
[356] return
|
||||
[358] return
|
||||
to:@return
|
||||
apply_preset::@14: scope:[apply_preset] from apply_preset::@13
|
||||
[357] *((const byte[]) form_fields_val#0 + (byte) apply_preset::i#2) ← *((byte*) apply_preset::preset#15 + (byte) apply_preset::i#2)
|
||||
[358] (byte) apply_preset::i#1 ← ++ (byte) apply_preset::i#2
|
||||
to:apply_preset::@13
|
||||
form_control: scope:[form_control] from form_mode::@5
|
||||
[359] (byte) form_field_ptr::field_idx#1 ← (byte) form_field_idx#28
|
||||
[360] call form_field_ptr
|
||||
@ -1219,24 +1219,24 @@ gfx_init_vic_bitmap: scope:[gfx_init_vic_bitmap] from gfx_init::@6
|
||||
gfx_init_vic_bitmap::@3: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap
|
||||
[604] phi()
|
||||
[605] call bitmap_clear
|
||||
to:gfx_init_vic_bitmap::@1
|
||||
gfx_init_vic_bitmap::@1: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@3 gfx_init_vic_bitmap::@4
|
||||
[606] (byte) gfx_init_vic_bitmap::l#2 ← phi( gfx_init_vic_bitmap::@3/(byte) 0 gfx_init_vic_bitmap::@4/(byte) gfx_init_vic_bitmap::l#1 )
|
||||
[607] if((byte) gfx_init_vic_bitmap::l#2<(const byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@2
|
||||
to:gfx_init_vic_bitmap::@return
|
||||
gfx_init_vic_bitmap::@return: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1
|
||||
[608] return
|
||||
to:@return
|
||||
gfx_init_vic_bitmap::@2: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1
|
||||
[609] (byte) bitmap_line::x0#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_x#0 + (byte) gfx_init_vic_bitmap::l#2)
|
||||
[610] (byte) bitmap_line::x1#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_x#0+(byte) 1 + (byte) gfx_init_vic_bitmap::l#2)
|
||||
[611] (byte) bitmap_line::y0#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_y#0 + (byte) gfx_init_vic_bitmap::l#2)
|
||||
[612] (byte) bitmap_line::y1#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_y#0+(byte) 1 + (byte) gfx_init_vic_bitmap::l#2)
|
||||
[613] call bitmap_line
|
||||
to:gfx_init_vic_bitmap::@2
|
||||
gfx_init_vic_bitmap::@2: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1 gfx_init_vic_bitmap::@3
|
||||
[606] (byte) gfx_init_vic_bitmap::l#5 ← phi( gfx_init_vic_bitmap::@1/(byte) gfx_init_vic_bitmap::l#1 gfx_init_vic_bitmap::@3/(byte) 0 )
|
||||
[607] (byte) bitmap_line::x0#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_x#0 + (byte) gfx_init_vic_bitmap::l#5)
|
||||
[608] (byte) bitmap_line::x1#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_x#0+(byte) 1 + (byte) gfx_init_vic_bitmap::l#5)
|
||||
[609] (byte) bitmap_line::y0#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_y#0 + (byte) gfx_init_vic_bitmap::l#5)
|
||||
[610] (byte) bitmap_line::y1#0 ← *((const byte[]) gfx_init_vic_bitmap::lines_y#0+(byte) 1 + (byte) gfx_init_vic_bitmap::l#5)
|
||||
[611] call bitmap_line
|
||||
to:gfx_init_vic_bitmap::@4
|
||||
gfx_init_vic_bitmap::@4: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@2
|
||||
[614] (byte) gfx_init_vic_bitmap::l#1 ← ++ (byte) gfx_init_vic_bitmap::l#2
|
||||
[612] (byte) gfx_init_vic_bitmap::l#1 ← ++ (byte) gfx_init_vic_bitmap::l#5
|
||||
to:gfx_init_vic_bitmap::@1
|
||||
gfx_init_vic_bitmap::@1: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@4
|
||||
[613] if((byte) gfx_init_vic_bitmap::l#1<(const byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@2
|
||||
to:gfx_init_vic_bitmap::@return
|
||||
gfx_init_vic_bitmap::@return: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1
|
||||
[614] return
|
||||
to:@return
|
||||
bitmap_line: scope:[bitmap_line] from gfx_init_vic_bitmap::@2
|
||||
[615] if((byte) bitmap_line::x0#0<(byte) bitmap_line::x1#0) goto bitmap_line::@1
|
||||
to:bitmap_line::@2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -198,8 +198,8 @@
|
||||
(label) apply_preset::@9
|
||||
(label) apply_preset::@return
|
||||
(byte) apply_preset::i
|
||||
(byte) apply_preset::i#1 reg byte y 2002.0
|
||||
(byte) apply_preset::i#2 reg byte y 1668.3333333333335
|
||||
(byte) apply_preset::i#1 reg byte y 1501.5
|
||||
(byte) apply_preset::i#4 reg byte y 2002.0
|
||||
(byte) apply_preset::idx
|
||||
(byte) apply_preset::idx#0 reg byte a 11.18181818181818
|
||||
(byte*) apply_preset::preset
|
||||
@ -610,8 +610,8 @@
|
||||
(label) form_render_values::@return
|
||||
(byte*) form_render_values::field
|
||||
(byte) form_render_values::idx
|
||||
(byte) form_render_values::idx#1 reg byte x 2002.0
|
||||
(byte) form_render_values::idx#2 reg byte x 1001.0
|
||||
(byte) form_render_values::idx#1 reg byte x 1501.5
|
||||
(byte) form_render_values::idx#5 reg byte x 1001.0
|
||||
(void()) form_set_screen((byte*) form_set_screen::screen)
|
||||
(byte~) form_set_screen::$0 reg byte a 202.0
|
||||
(byte~) form_set_screen::$1 reg byte a 202.0
|
||||
@ -990,8 +990,8 @@
|
||||
(label) gfx_init_vic_bitmap::@4
|
||||
(label) gfx_init_vic_bitmap::@return
|
||||
(byte) gfx_init_vic_bitmap::l
|
||||
(byte) gfx_init_vic_bitmap::l#1 l zp ZP_BYTE:8 22.0
|
||||
(byte) gfx_init_vic_bitmap::l#2 l zp ZP_BYTE:8 11.0
|
||||
(byte) gfx_init_vic_bitmap::l#1 l zp ZP_BYTE:8 16.5
|
||||
(byte) gfx_init_vic_bitmap::l#5 l zp ZP_BYTE:8 11.0
|
||||
(byte) gfx_init_vic_bitmap::lines_cnt
|
||||
(const byte) gfx_init_vic_bitmap::lines_cnt#0 lines_cnt = (byte) 9
|
||||
(byte[]) gfx_init_vic_bitmap::lines_x
|
||||
@ -1368,9 +1368,9 @@ reg byte a [ get_vic_screen::idx#2 get_vic_screen::idx#0 get_vic_screen::idx#1 ]
|
||||
reg byte a [ get_plane::idx#10 get_plane::idx#1 get_plane::idx#0 ]
|
||||
reg byte x [ form_mode::i#2 form_mode::i#1 ]
|
||||
reg byte a [ render_preset_name::idx#10 render_preset_name::idx#0 render_preset_name::idx#1 ]
|
||||
reg byte x [ form_render_values::idx#2 form_render_values::idx#1 ]
|
||||
reg byte x [ form_render_values::idx#5 form_render_values::idx#1 ]
|
||||
reg byte x [ form_field_ptr::field_idx#2 form_field_ptr::field_idx#1 form_field_ptr::field_idx#0 ]
|
||||
reg byte y [ apply_preset::i#2 apply_preset::i#1 ]
|
||||
reg byte y [ apply_preset::i#4 apply_preset::i#1 ]
|
||||
reg byte x [ form_control::return#2 ]
|
||||
reg byte x [ form_set_screen::y#2 form_set_screen::y#1 ]
|
||||
zp ZP_DWORD:2 [ gfx_init_plane_fill::plane_addr#3 get_plane::return#14 get_plane::return#16 get_plane::return#17 gfx_mode::$22 gfx_mode::plane_a#0 gfx_mode::$36 gfx_mode::plane_b#0 ]
|
||||
@ -1383,7 +1383,7 @@ zp ZP_WORD:6 [ gfx_init_plane_charset8::chargen#2 gfx_init_plane_charset8::charg
|
||||
reg byte x [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ]
|
||||
reg byte a [ gfx_init_plane_charset8::c#2 gfx_init_plane_charset8::c#3 ]
|
||||
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 ZP_BYTE:8 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 gfx_init_plane_fill::fill#6 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 ZP_BYTE:8 [ gfx_init_vic_bitmap::l#5 gfx_init_vic_bitmap::l#1 gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 gfx_init_plane_fill::fill#6 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 ]
|
||||
reg byte x [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ]
|
||||
reg byte y [ bitmap_plot::y#4 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#3 bitmap_plot::y#2 ]
|
||||
zp ZP_BYTE:9 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#0 bitmap_line_xdyi::x1#1 bitmap_line::x0#0 bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#0 bitmap_line_xdyd::x1#1 gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ]
|
||||
|
@ -156,18 +156,21 @@ menu: {
|
||||
sta c
|
||||
lda #>COLS
|
||||
sta c+1
|
||||
b3:
|
||||
lda #LIGHT_GREEN
|
||||
ldy #0
|
||||
sta (c),y
|
||||
inc c
|
||||
bne !+
|
||||
inc c+1
|
||||
!:
|
||||
// Char Colors
|
||||
b2:
|
||||
lda c+1
|
||||
cmp #>COLS+$3e8
|
||||
beq !b3+
|
||||
jmp b3
|
||||
!b3:
|
||||
bne b3
|
||||
lda c
|
||||
cmp #<COLS+$3e8
|
||||
beq !b3+
|
||||
jmp b3
|
||||
!b3:
|
||||
bne b3
|
||||
// Screen colors
|
||||
lda #0
|
||||
sta BGCOL
|
||||
@ -261,15 +264,6 @@ menu: {
|
||||
!b5:
|
||||
jsr mode_8bppchunkybmm
|
||||
rts
|
||||
b3:
|
||||
lda #LIGHT_GREEN
|
||||
ldy #0
|
||||
sta (c),y
|
||||
inc c
|
||||
bne !+
|
||||
inc c+1
|
||||
!:
|
||||
jmp b2
|
||||
}
|
||||
//Chunky 8bpp Bitmap Mode (BMM = 0, ECM/MCM/HICOL/LINEAR/CHUNK/COLDIS = 1)
|
||||
// Resolution: 320x200
|
||||
@ -1526,14 +1520,6 @@ mode_stdbitmap: {
|
||||
jsr bitmap_clear
|
||||
lda #0
|
||||
sta l
|
||||
b7:
|
||||
lda l
|
||||
cmp #lines_cnt
|
||||
bcc b8
|
||||
lda #0
|
||||
sta dtv_control
|
||||
jsr mode_ctrl
|
||||
rts
|
||||
b8:
|
||||
ldy l
|
||||
lda lines_x,y
|
||||
@ -1545,7 +1531,13 @@ mode_stdbitmap: {
|
||||
sta bitmap_line.y1
|
||||
jsr bitmap_line
|
||||
inc l
|
||||
jmp b7
|
||||
lda l
|
||||
cmp #lines_cnt
|
||||
bcc b8
|
||||
lda #0
|
||||
sta dtv_control
|
||||
jsr mode_ctrl
|
||||
rts
|
||||
lines_x: .byte 0, $ff, $ff, 0, 0, $80, $ff, $80, 0, $80
|
||||
lines_y: .byte 0, 0, $c7, $c7, 0, 0, $64, $c7, $64, 0
|
||||
}
|
||||
@ -2314,14 +2306,6 @@ memset: {
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
b1:
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
b2:
|
||||
lda #c
|
||||
ldy #0
|
||||
@ -2330,7 +2314,13 @@ memset: {
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
jmp b1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
}
|
||||
// Set the screen to print on. Also resets current line/char cursor.
|
||||
print_set_screen: {
|
||||
|
@ -33,187 +33,187 @@ menu::@1: scope:[menu] from menu menu::@1
|
||||
[20] *((const byte*) DTV_PALETTE#0 + (byte) menu::i#2) ← *((const byte[$10]) DTV_PALETTE_DEFAULT#0 + (byte) menu::i#2)
|
||||
[21] (byte) menu::i#1 ← ++ (byte) menu::i#2
|
||||
[22] if((byte) menu::i#1!=(byte) $10) goto menu::@1
|
||||
to:menu::@3
|
||||
menu::@3: scope:[menu] from menu::@1 menu::@2
|
||||
[23] (byte*) menu::c#4 ← phi( menu::@2/(byte*) menu::c#1 menu::@1/(const byte*) COLS#0 )
|
||||
[24] *((byte*) menu::c#4) ← (const byte) LIGHT_GREEN#0
|
||||
[25] (byte*) menu::c#1 ← ++ (byte*) menu::c#4
|
||||
to:menu::@2
|
||||
menu::@2: scope:[menu] from menu::@1 menu::@3
|
||||
[23] (byte*) menu::c#2 ← phi( menu::@1/(const byte*) COLS#0 menu::@3/(byte*) menu::c#1 )
|
||||
[24] if((byte*) menu::c#2!=(const byte*) COLS#0+(word) $3e8) goto menu::@3
|
||||
menu::@2: scope:[menu] from menu::@3
|
||||
[26] if((byte*) menu::c#1!=(const byte*) COLS#0+(word) $3e8) goto menu::@3
|
||||
to:menu::@4
|
||||
menu::@4: scope:[menu] from menu::@2
|
||||
[25] *((const byte*) BGCOL#0) ← (byte) 0
|
||||
[26] *((const byte*) BORDERCOL#0) ← (byte) 0
|
||||
[27] call print_set_screen
|
||||
[27] *((const byte*) BGCOL#0) ← (byte) 0
|
||||
[28] *((const byte*) BORDERCOL#0) ← (byte) 0
|
||||
[29] call print_set_screen
|
||||
to:menu::@29
|
||||
menu::@29: scope:[menu] from menu::@4
|
||||
[28] phi()
|
||||
[29] call print_cls
|
||||
[30] phi()
|
||||
[31] call print_cls
|
||||
to:menu::@30
|
||||
menu::@30: scope:[menu] from menu::@29
|
||||
[30] phi()
|
||||
[31] call print_str_lines
|
||||
[32] phi()
|
||||
[33] call print_str_lines
|
||||
to:menu::@5
|
||||
menu::@5: scope:[menu] from menu::@30 menu::@42
|
||||
[32] phi()
|
||||
[33] call keyboard_key_pressed
|
||||
[34] (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#0
|
||||
[34] phi()
|
||||
[35] call keyboard_key_pressed
|
||||
[36] (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@31
|
||||
menu::@31: scope:[menu] from menu::@5
|
||||
[35] (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#2
|
||||
[36] if((byte~) menu::$29==(byte) 0) goto menu::@6
|
||||
[37] (byte~) menu::$29 ← (byte) keyboard_key_pressed::return#2
|
||||
[38] if((byte~) menu::$29==(byte) 0) goto menu::@6
|
||||
to:menu::@17
|
||||
menu::@17: scope:[menu] from menu::@31
|
||||
[37] phi()
|
||||
[38] call mode_stdchar
|
||||
[39] phi()
|
||||
[40] call mode_stdchar
|
||||
to:menu::@return
|
||||
menu::@return: scope:[menu] from menu::@17 menu::@18 menu::@19 menu::@20 menu::@21 menu::@22 menu::@23 menu::@24 menu::@25 menu::@26 menu::@27 menu::@28
|
||||
[39] return
|
||||
[41] return
|
||||
to:@return
|
||||
menu::@6: scope:[menu] from menu::@31
|
||||
[40] phi()
|
||||
[41] call keyboard_key_pressed
|
||||
[42] (byte) keyboard_key_pressed::return#24 ← (byte) keyboard_key_pressed::return#0
|
||||
[42] phi()
|
||||
[43] call keyboard_key_pressed
|
||||
[44] (byte) keyboard_key_pressed::return#24 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@32
|
||||
menu::@32: scope:[menu] from menu::@6
|
||||
[43] (byte~) menu::$33 ← (byte) keyboard_key_pressed::return#24
|
||||
[44] if((byte~) menu::$33==(byte) 0) goto menu::@7
|
||||
[45] (byte~) menu::$33 ← (byte) keyboard_key_pressed::return#24
|
||||
[46] if((byte~) menu::$33==(byte) 0) goto menu::@7
|
||||
to:menu::@18
|
||||
menu::@18: scope:[menu] from menu::@32
|
||||
[45] phi()
|
||||
[46] call mode_ecmchar
|
||||
[47] phi()
|
||||
[48] call mode_ecmchar
|
||||
to:menu::@return
|
||||
menu::@7: scope:[menu] from menu::@32
|
||||
[47] phi()
|
||||
[48] call keyboard_key_pressed
|
||||
[49] (byte) keyboard_key_pressed::return#25 ← (byte) keyboard_key_pressed::return#0
|
||||
[49] phi()
|
||||
[50] call keyboard_key_pressed
|
||||
[51] (byte) keyboard_key_pressed::return#25 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@33
|
||||
menu::@33: scope:[menu] from menu::@7
|
||||
[50] (byte~) menu::$37 ← (byte) keyboard_key_pressed::return#25
|
||||
[51] if((byte~) menu::$37==(byte) 0) goto menu::@8
|
||||
[52] (byte~) menu::$37 ← (byte) keyboard_key_pressed::return#25
|
||||
[53] if((byte~) menu::$37==(byte) 0) goto menu::@8
|
||||
to:menu::@19
|
||||
menu::@19: scope:[menu] from menu::@33
|
||||
[52] phi()
|
||||
[53] call mode_mcchar
|
||||
[54] phi()
|
||||
[55] call mode_mcchar
|
||||
to:menu::@return
|
||||
menu::@8: scope:[menu] from menu::@33
|
||||
[54] phi()
|
||||
[55] call keyboard_key_pressed
|
||||
[56] (byte) keyboard_key_pressed::return#26 ← (byte) keyboard_key_pressed::return#0
|
||||
[56] phi()
|
||||
[57] call keyboard_key_pressed
|
||||
[58] (byte) keyboard_key_pressed::return#26 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@34
|
||||
menu::@34: scope:[menu] from menu::@8
|
||||
[57] (byte~) menu::$41 ← (byte) keyboard_key_pressed::return#26
|
||||
[58] if((byte~) menu::$41==(byte) 0) goto menu::@9
|
||||
[59] (byte~) menu::$41 ← (byte) keyboard_key_pressed::return#26
|
||||
[60] if((byte~) menu::$41==(byte) 0) goto menu::@9
|
||||
to:menu::@20
|
||||
menu::@20: scope:[menu] from menu::@34
|
||||
[59] phi()
|
||||
[60] call mode_stdbitmap
|
||||
[61] phi()
|
||||
[62] call mode_stdbitmap
|
||||
to:menu::@return
|
||||
menu::@9: scope:[menu] from menu::@34
|
||||
[61] phi()
|
||||
[62] call keyboard_key_pressed
|
||||
[63] (byte) keyboard_key_pressed::return#27 ← (byte) keyboard_key_pressed::return#0
|
||||
[63] phi()
|
||||
[64] call keyboard_key_pressed
|
||||
[65] (byte) keyboard_key_pressed::return#27 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@35
|
||||
menu::@35: scope:[menu] from menu::@9
|
||||
[64] (byte~) menu::$45 ← (byte) keyboard_key_pressed::return#27
|
||||
[65] if((byte~) menu::$45==(byte) 0) goto menu::@10
|
||||
[66] (byte~) menu::$45 ← (byte) keyboard_key_pressed::return#27
|
||||
[67] if((byte~) menu::$45==(byte) 0) goto menu::@10
|
||||
to:menu::@21
|
||||
menu::@21: scope:[menu] from menu::@35
|
||||
[66] phi()
|
||||
[67] call mode_hicolstdchar
|
||||
[68] phi()
|
||||
[69] call mode_hicolstdchar
|
||||
to:menu::@return
|
||||
menu::@10: scope:[menu] from menu::@35
|
||||
[68] phi()
|
||||
[69] call keyboard_key_pressed
|
||||
[70] (byte) keyboard_key_pressed::return#28 ← (byte) keyboard_key_pressed::return#0
|
||||
[70] phi()
|
||||
[71] call keyboard_key_pressed
|
||||
[72] (byte) keyboard_key_pressed::return#28 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@36
|
||||
menu::@36: scope:[menu] from menu::@10
|
||||
[71] (byte~) menu::$49 ← (byte) keyboard_key_pressed::return#28
|
||||
[72] if((byte~) menu::$49==(byte) 0) goto menu::@11
|
||||
[73] (byte~) menu::$49 ← (byte) keyboard_key_pressed::return#28
|
||||
[74] if((byte~) menu::$49==(byte) 0) goto menu::@11
|
||||
to:menu::@22
|
||||
menu::@22: scope:[menu] from menu::@36
|
||||
[73] phi()
|
||||
[74] call mode_hicolecmchar
|
||||
[75] phi()
|
||||
[76] call mode_hicolecmchar
|
||||
to:menu::@return
|
||||
menu::@11: scope:[menu] from menu::@36
|
||||
[75] phi()
|
||||
[76] call keyboard_key_pressed
|
||||
[77] (byte) keyboard_key_pressed::return#29 ← (byte) keyboard_key_pressed::return#0
|
||||
[77] phi()
|
||||
[78] call keyboard_key_pressed
|
||||
[79] (byte) keyboard_key_pressed::return#29 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@37
|
||||
menu::@37: scope:[menu] from menu::@11
|
||||
[78] (byte~) menu::$53 ← (byte) keyboard_key_pressed::return#29
|
||||
[79] if((byte~) menu::$53==(byte) 0) goto menu::@12
|
||||
[80] (byte~) menu::$53 ← (byte) keyboard_key_pressed::return#29
|
||||
[81] if((byte~) menu::$53==(byte) 0) goto menu::@12
|
||||
to:menu::@23
|
||||
menu::@23: scope:[menu] from menu::@37
|
||||
[80] phi()
|
||||
[81] call mode_hicolmcchar
|
||||
[82] phi()
|
||||
[83] call mode_hicolmcchar
|
||||
to:menu::@return
|
||||
menu::@12: scope:[menu] from menu::@37
|
||||
[82] phi()
|
||||
[83] call keyboard_key_pressed
|
||||
[84] (byte) keyboard_key_pressed::return#30 ← (byte) keyboard_key_pressed::return#0
|
||||
[84] phi()
|
||||
[85] call keyboard_key_pressed
|
||||
[86] (byte) keyboard_key_pressed::return#30 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@38
|
||||
menu::@38: scope:[menu] from menu::@12
|
||||
[85] (byte~) menu::$57 ← (byte) keyboard_key_pressed::return#30
|
||||
[86] if((byte~) menu::$57==(byte) 0) goto menu::@13
|
||||
[87] (byte~) menu::$57 ← (byte) keyboard_key_pressed::return#30
|
||||
[88] if((byte~) menu::$57==(byte) 0) goto menu::@13
|
||||
to:menu::@24
|
||||
menu::@24: scope:[menu] from menu::@38
|
||||
[87] phi()
|
||||
[88] call mode_sixsfred2
|
||||
[89] phi()
|
||||
[90] call mode_sixsfred2
|
||||
to:menu::@return
|
||||
menu::@13: scope:[menu] from menu::@38
|
||||
[89] phi()
|
||||
[90] call keyboard_key_pressed
|
||||
[91] (byte) keyboard_key_pressed::return#10 ← (byte) keyboard_key_pressed::return#0
|
||||
[91] phi()
|
||||
[92] call keyboard_key_pressed
|
||||
[93] (byte) keyboard_key_pressed::return#10 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@39
|
||||
menu::@39: scope:[menu] from menu::@13
|
||||
[92] (byte~) menu::$61 ← (byte) keyboard_key_pressed::return#10
|
||||
[93] if((byte~) menu::$61==(byte) 0) goto menu::@14
|
||||
[94] (byte~) menu::$61 ← (byte) keyboard_key_pressed::return#10
|
||||
[95] if((byte~) menu::$61==(byte) 0) goto menu::@14
|
||||
to:menu::@25
|
||||
menu::@25: scope:[menu] from menu::@39
|
||||
[94] phi()
|
||||
[95] call mode_twoplanebitmap
|
||||
[96] phi()
|
||||
[97] call mode_twoplanebitmap
|
||||
to:menu::@return
|
||||
menu::@14: scope:[menu] from menu::@39
|
||||
[96] phi()
|
||||
[97] call keyboard_key_pressed
|
||||
[98] (byte) keyboard_key_pressed::return#11 ← (byte) keyboard_key_pressed::return#0
|
||||
[98] phi()
|
||||
[99] call keyboard_key_pressed
|
||||
[100] (byte) keyboard_key_pressed::return#11 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@40
|
||||
menu::@40: scope:[menu] from menu::@14
|
||||
[99] (byte~) menu::$65 ← (byte) keyboard_key_pressed::return#11
|
||||
[100] if((byte~) menu::$65==(byte) 0) goto menu::@15
|
||||
[101] (byte~) menu::$65 ← (byte) keyboard_key_pressed::return#11
|
||||
[102] if((byte~) menu::$65==(byte) 0) goto menu::@15
|
||||
to:menu::@26
|
||||
menu::@26: scope:[menu] from menu::@40
|
||||
[101] phi()
|
||||
[102] call mode_sixsfred
|
||||
[103] phi()
|
||||
[104] call mode_sixsfred
|
||||
to:menu::@return
|
||||
menu::@15: scope:[menu] from menu::@40
|
||||
[103] phi()
|
||||
[104] call keyboard_key_pressed
|
||||
[105] (byte) keyboard_key_pressed::return#12 ← (byte) keyboard_key_pressed::return#0
|
||||
[105] phi()
|
||||
[106] call keyboard_key_pressed
|
||||
[107] (byte) keyboard_key_pressed::return#12 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@41
|
||||
menu::@41: scope:[menu] from menu::@15
|
||||
[106] (byte~) menu::$69 ← (byte) keyboard_key_pressed::return#12
|
||||
[107] if((byte~) menu::$69==(byte) 0) goto menu::@16
|
||||
[108] (byte~) menu::$69 ← (byte) keyboard_key_pressed::return#12
|
||||
[109] if((byte~) menu::$69==(byte) 0) goto menu::@16
|
||||
to:menu::@27
|
||||
menu::@27: scope:[menu] from menu::@41
|
||||
[108] phi()
|
||||
[109] call mode_8bpppixelcell
|
||||
[110] phi()
|
||||
[111] call mode_8bpppixelcell
|
||||
to:menu::@return
|
||||
menu::@16: scope:[menu] from menu::@41
|
||||
[110] phi()
|
||||
[111] call keyboard_key_pressed
|
||||
[112] (byte) keyboard_key_pressed::return#13 ← (byte) keyboard_key_pressed::return#0
|
||||
[112] phi()
|
||||
[113] call keyboard_key_pressed
|
||||
[114] (byte) keyboard_key_pressed::return#13 ← (byte) keyboard_key_pressed::return#0
|
||||
to:menu::@42
|
||||
menu::@42: scope:[menu] from menu::@16
|
||||
[113] (byte~) menu::$73 ← (byte) keyboard_key_pressed::return#13
|
||||
[114] if((byte~) menu::$73==(byte) 0) goto menu::@5
|
||||
[115] (byte~) menu::$73 ← (byte) keyboard_key_pressed::return#13
|
||||
[116] if((byte~) menu::$73==(byte) 0) goto menu::@5
|
||||
to:menu::@28
|
||||
menu::@28: scope:[menu] from menu::@42
|
||||
[115] phi()
|
||||
[116] call mode_8bppchunkybmm
|
||||
[117] phi()
|
||||
[118] call mode_8bppchunkybmm
|
||||
to:menu::@return
|
||||
menu::@3: scope:[menu] from menu::@2
|
||||
[117] *((byte*) menu::c#2) ← (const byte) LIGHT_GREEN#0
|
||||
[118] (byte*) menu::c#1 ← ++ (byte*) menu::c#2
|
||||
to:menu::@2
|
||||
mode_8bppchunkybmm: scope:[mode_8bppchunkybmm] from menu::@28
|
||||
[119] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_LINEAR#0|(const byte) DTV_CHUNKY#0|(const byte) DTV_COLORRAM_OFF#0
|
||||
[120] *((const byte*) VIC_CONTROL#0) ← (const byte) VIC_ECM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3
|
||||
@ -1003,28 +1003,28 @@ mode_stdbitmap::@6: scope:[mode_stdbitmap] from mode_stdbitmap::@5
|
||||
mode_stdbitmap::@10: scope:[mode_stdbitmap] from mode_stdbitmap::@6
|
||||
[579] phi()
|
||||
[580] call bitmap_clear
|
||||
to:mode_stdbitmap::@7
|
||||
mode_stdbitmap::@7: scope:[mode_stdbitmap] from mode_stdbitmap::@10 mode_stdbitmap::@11
|
||||
[581] (byte) mode_stdbitmap::l#2 ← phi( mode_stdbitmap::@10/(byte) 0 mode_stdbitmap::@11/(byte) mode_stdbitmap::l#1 )
|
||||
[582] if((byte) mode_stdbitmap::l#2<(const byte) mode_stdbitmap::lines_cnt#0) goto mode_stdbitmap::@8
|
||||
to:mode_stdbitmap::@9
|
||||
mode_stdbitmap::@9: scope:[mode_stdbitmap] from mode_stdbitmap::@7
|
||||
[583] phi()
|
||||
[584] call mode_ctrl
|
||||
to:mode_stdbitmap::@return
|
||||
mode_stdbitmap::@return: scope:[mode_stdbitmap] from mode_stdbitmap::@9
|
||||
[585] return
|
||||
to:@return
|
||||
mode_stdbitmap::@8: scope:[mode_stdbitmap] from mode_stdbitmap::@7
|
||||
[586] (byte) bitmap_line::x0#0 ← *((const byte[]) mode_stdbitmap::lines_x#0 + (byte) mode_stdbitmap::l#2)
|
||||
[587] (byte) bitmap_line::x1#0 ← *((const byte[]) mode_stdbitmap::lines_x#0+(byte) 1 + (byte) mode_stdbitmap::l#2)
|
||||
[588] (byte) bitmap_line::y0#0 ← *((const byte[]) mode_stdbitmap::lines_y#0 + (byte) mode_stdbitmap::l#2)
|
||||
[589] (byte) bitmap_line::y1#0 ← *((const byte[]) mode_stdbitmap::lines_y#0+(byte) 1 + (byte) mode_stdbitmap::l#2)
|
||||
[590] call bitmap_line
|
||||
to:mode_stdbitmap::@8
|
||||
mode_stdbitmap::@8: scope:[mode_stdbitmap] from mode_stdbitmap::@10 mode_stdbitmap::@7
|
||||
[581] (byte) mode_stdbitmap::l#5 ← phi( mode_stdbitmap::@7/(byte) mode_stdbitmap::l#1 mode_stdbitmap::@10/(byte) 0 )
|
||||
[582] (byte) bitmap_line::x0#0 ← *((const byte[]) mode_stdbitmap::lines_x#0 + (byte) mode_stdbitmap::l#5)
|
||||
[583] (byte) bitmap_line::x1#0 ← *((const byte[]) mode_stdbitmap::lines_x#0+(byte) 1 + (byte) mode_stdbitmap::l#5)
|
||||
[584] (byte) bitmap_line::y0#0 ← *((const byte[]) mode_stdbitmap::lines_y#0 + (byte) mode_stdbitmap::l#5)
|
||||
[585] (byte) bitmap_line::y1#0 ← *((const byte[]) mode_stdbitmap::lines_y#0+(byte) 1 + (byte) mode_stdbitmap::l#5)
|
||||
[586] call bitmap_line
|
||||
to:mode_stdbitmap::@11
|
||||
mode_stdbitmap::@11: scope:[mode_stdbitmap] from mode_stdbitmap::@8
|
||||
[591] (byte) mode_stdbitmap::l#1 ← ++ (byte) mode_stdbitmap::l#2
|
||||
[587] (byte) mode_stdbitmap::l#1 ← ++ (byte) mode_stdbitmap::l#5
|
||||
to:mode_stdbitmap::@7
|
||||
mode_stdbitmap::@7: scope:[mode_stdbitmap] from mode_stdbitmap::@11
|
||||
[588] if((byte) mode_stdbitmap::l#1<(const byte) mode_stdbitmap::lines_cnt#0) goto mode_stdbitmap::@8
|
||||
to:mode_stdbitmap::@9
|
||||
mode_stdbitmap::@9: scope:[mode_stdbitmap] from mode_stdbitmap::@7
|
||||
[589] phi()
|
||||
[590] call mode_ctrl
|
||||
to:mode_stdbitmap::@return
|
||||
mode_stdbitmap::@return: scope:[mode_stdbitmap] from mode_stdbitmap::@9
|
||||
[591] return
|
||||
to:@return
|
||||
bitmap_line: scope:[bitmap_line] from mode_stdbitmap::@8
|
||||
[592] if((byte) bitmap_line::x0#0<(byte) bitmap_line::x1#0) goto bitmap_line::@1
|
||||
to:bitmap_line::@2
|
||||
@ -1554,18 +1554,18 @@ print_cls::@return: scope:[print_cls] from print_cls
|
||||
to:@return
|
||||
memset: scope:[memset] from print_cls
|
||||
[887] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[888] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[889] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[890] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[888] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[889] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[891] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[890] return
|
||||
[892] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[891] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[892] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
print_set_screen: scope:[print_set_screen] from menu::@4
|
||||
[893] phi()
|
||||
to:print_set_screen::@return
|
||||
|
File diff suppressed because one or more lines are too long
@ -481,8 +481,8 @@
|
||||
(byte) memset::c
|
||||
(const byte) memset::c#0 c = (byte) ' '
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:9 202.0
|
||||
(byte*) memset::dst#2 dst zp ZP_WORD:9 134.66666666666666
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:9 151.5
|
||||
(byte*) memset::dst#4 dst zp ZP_WORD:9 151.5
|
||||
(byte*) memset::end
|
||||
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||
(word) memset::num
|
||||
@ -551,8 +551,8 @@
|
||||
(byte*) menu::SCREEN
|
||||
(const byte*) menu::SCREEN#0 SCREEN = (byte*) 32768
|
||||
(byte*) menu::c
|
||||
(byte*) menu::c#1 c zp ZP_WORD:4 202.0
|
||||
(byte*) menu::c#2 c zp ZP_WORD:4 134.66666666666666
|
||||
(byte*) menu::c#1 c zp ZP_WORD:4 151.5
|
||||
(byte*) menu::c#4 c zp ZP_WORD:4 151.5
|
||||
(byte) menu::i
|
||||
(byte) menu::i#1 reg byte x 151.5
|
||||
(byte) menu::i#2 reg byte x 202.0
|
||||
@ -1055,8 +1055,8 @@
|
||||
(byte) mode_stdbitmap::i#1 reg byte x 151.5
|
||||
(byte) mode_stdbitmap::i#2 reg byte x 202.0
|
||||
(byte) mode_stdbitmap::l
|
||||
(byte) mode_stdbitmap::l#1 l zp ZP_BYTE:14 202.0
|
||||
(byte) mode_stdbitmap::l#2 l zp ZP_BYTE:14 101.0
|
||||
(byte) mode_stdbitmap::l#1 l zp ZP_BYTE:14 151.5
|
||||
(byte) mode_stdbitmap::l#5 l zp ZP_BYTE:14 100.99999999999999
|
||||
(byte) mode_stdbitmap::lines_cnt
|
||||
(const byte) mode_stdbitmap::lines_cnt#0 lines_cnt = (byte) 9
|
||||
(byte[]) mode_stdbitmap::lines_x
|
||||
@ -1243,7 +1243,7 @@ reg byte x [ mode_ecmchar::i#2 mode_ecmchar::i#1 ]
|
||||
reg byte x [ mode_ecmchar::cx#2 mode_ecmchar::cx#1 ]
|
||||
reg byte x [ mode_stdchar::i#2 mode_stdchar::i#1 ]
|
||||
reg byte x [ mode_stdchar::cx#2 mode_stdchar::cx#1 ]
|
||||
zp ZP_WORD:4 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#100 print_char_cursor#32 print_char_cursor#1 mode_stdchar::ch#2 mode_stdchar::ch#3 mode_stdchar::ch#1 mode_ecmchar::ch#2 mode_ecmchar::ch#3 mode_ecmchar::ch#1 mode_mcchar::ch#2 mode_mcchar::ch#3 mode_mcchar::ch#1 mode_hicolecmchar::col#2 mode_hicolecmchar::col#3 mode_hicolecmchar::col#1 mode_hicolmcchar::ch#2 mode_hicolmcchar::ch#3 mode_hicolmcchar::ch#1 mode_sixsfred2::gfxa#2 mode_sixsfred2::gfxa#3 mode_sixsfred2::gfxa#1 mode_twoplanebitmap::gfxb#2 mode_twoplanebitmap::gfxb#3 mode_twoplanebitmap::gfxb#1 mode_sixsfred::col#2 mode_sixsfred::col#3 mode_sixsfred::col#1 mode_8bpppixelcell::chargen#2 mode_8bpppixelcell::chargen#4 mode_8bpppixelcell::chargen#1 mode_8bppchunkybmm::x#2 mode_8bppchunkybmm::x#1 menu::c#2 menu::c#1 ]
|
||||
zp ZP_WORD:4 [ print_char_cursor#17 print_char_cursor#19 print_char_cursor#100 print_char_cursor#32 print_char_cursor#1 mode_stdchar::ch#2 mode_stdchar::ch#3 mode_stdchar::ch#1 mode_ecmchar::ch#2 mode_ecmchar::ch#3 mode_ecmchar::ch#1 mode_mcchar::ch#2 mode_mcchar::ch#3 mode_mcchar::ch#1 mode_hicolecmchar::col#2 mode_hicolecmchar::col#3 mode_hicolecmchar::col#1 mode_hicolmcchar::ch#2 mode_hicolmcchar::ch#3 mode_hicolmcchar::ch#1 mode_sixsfred2::gfxa#2 mode_sixsfred2::gfxa#3 mode_sixsfred2::gfxa#1 mode_twoplanebitmap::gfxb#2 mode_twoplanebitmap::gfxb#3 mode_twoplanebitmap::gfxb#1 mode_sixsfred::col#2 mode_sixsfred::col#3 mode_sixsfred::col#1 mode_8bpppixelcell::chargen#2 mode_8bpppixelcell::chargen#4 mode_8bpppixelcell::chargen#1 mode_8bppchunkybmm::x#2 mode_8bppchunkybmm::x#1 menu::c#4 menu::c#1 ]
|
||||
reg byte a [ keyboard_key_pressed::return#2 ]
|
||||
reg byte a [ menu::$29 ]
|
||||
reg byte a [ keyboard_key_pressed::return#24 ]
|
||||
@ -1330,7 +1330,7 @@ reg byte y [ bitmap_line::yd#1 ]
|
||||
reg byte y [ bitmap_line::yd#10 ]
|
||||
reg byte y [ bitmap_line::yd#11 ]
|
||||
reg byte x [ bitmap_line_xdyi::$6 ]
|
||||
zp ZP_WORD:9 [ bitmap_plot::plotter_x#0 bitmap_plot::plotter#0 mode_8bppchunkybmm::$26 memset::dst#2 memset::dst#1 print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 bitmap_clear::bitmap#2 bitmap_clear::bitmap#3 bitmap_clear::bitmap#5 bitmap_clear::bitmap#1 bitmap_clear::bitmap#0 mode_stdbitmap::ch#2 mode_stdbitmap::ch#3 mode_stdbitmap::ch#1 mode_hicolstdchar::ch#2 mode_hicolstdchar::ch#3 mode_hicolstdchar::ch#1 mode_sixsfred2::col#2 mode_sixsfred2::col#3 mode_sixsfred2::col#1 mode_twoplanebitmap::gfxa#3 mode_twoplanebitmap::gfxa#7 mode_twoplanebitmap::gfxa#6 mode_twoplanebitmap::gfxa#2 mode_twoplanebitmap::gfxa#1 mode_sixsfred::gfxa#2 mode_sixsfred::gfxa#3 mode_sixsfred::gfxa#1 mode_8bpppixelcell::gfxb#2 mode_8bpppixelcell::gfxb#5 mode_8bpppixelcell::gfxb#7 mode_8bpppixelcell::gfxb#1 ]
|
||||
zp ZP_WORD:9 [ bitmap_plot::plotter_x#0 bitmap_plot::plotter#0 mode_8bppchunkybmm::$26 memset::dst#4 memset::dst#1 print_line_cursor#18 print_line_cursor#17 print_line_cursor#19 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 bitmap_clear::bitmap#2 bitmap_clear::bitmap#3 bitmap_clear::bitmap#5 bitmap_clear::bitmap#1 bitmap_clear::bitmap#0 mode_stdbitmap::ch#2 mode_stdbitmap::ch#3 mode_stdbitmap::ch#1 mode_hicolstdchar::ch#2 mode_hicolstdchar::ch#3 mode_hicolstdchar::ch#1 mode_sixsfred2::col#2 mode_sixsfred2::col#3 mode_sixsfred2::col#1 mode_twoplanebitmap::gfxa#3 mode_twoplanebitmap::gfxa#7 mode_twoplanebitmap::gfxa#6 mode_twoplanebitmap::gfxa#2 mode_twoplanebitmap::gfxa#1 mode_sixsfred::gfxa#2 mode_sixsfred::gfxa#3 mode_sixsfred::gfxa#1 mode_8bpppixelcell::gfxb#2 mode_8bpppixelcell::gfxb#5 mode_8bpppixelcell::gfxb#7 mode_8bpppixelcell::gfxb#1 ]
|
||||
zp ZP_WORD:11 [ bitmap_plot::plotter_y#0 print_str_lines::str#3 print_str_lines::str#2 print_str_lines::str#0 mode_stdchar::col#2 mode_stdchar::col#3 mode_stdchar::col#1 mode_ecmchar::col#2 mode_ecmchar::col#3 mode_ecmchar::col#1 mode_mcchar::col#2 mode_mcchar::col#3 mode_mcchar::col#1 mode_hicolstdchar::col#2 mode_hicolstdchar::col#3 mode_hicolstdchar::col#1 mode_hicolecmchar::ch#2 mode_hicolecmchar::ch#3 mode_hicolecmchar::ch#1 mode_hicolmcchar::col#2 mode_hicolmcchar::col#3 mode_hicolmcchar::col#1 mode_sixsfred2::gfxb#2 mode_sixsfred2::gfxb#3 mode_sixsfred2::gfxb#1 mode_twoplanebitmap::col#2 mode_twoplanebitmap::col#3 mode_twoplanebitmap::col#1 mode_sixsfred::gfxb#2 mode_sixsfred::gfxb#3 mode_sixsfred::gfxb#1 mode_8bpppixelcell::gfxa#2 mode_8bpppixelcell::gfxa#3 mode_8bpppixelcell::gfxa#1 mode_8bppchunkybmm::gfxb#4 mode_8bppchunkybmm::gfxb#3 mode_8bppchunkybmm::gfxb#5 mode_8bppchunkybmm::gfxb#1 ]
|
||||
reg byte a [ bitmap_plot::$1 ]
|
||||
reg byte a [ bitmap_line_ydxi::$6 ]
|
||||
@ -1354,7 +1354,7 @@ reg byte a [ mode_ecmchar::$31 ]
|
||||
reg byte a [ mode_stdchar::$25 ]
|
||||
reg byte a [ mode_stdchar::$26 ]
|
||||
reg byte a [ mode_stdchar::$27 ]
|
||||
zp ZP_BYTE:14 [ mode_stdchar::$28 mode_twoplanebitmap::$17 mode_8bpppixelcell::$15 bitmap_clear::y#4 bitmap_clear::y#1 mode_stdbitmap::l#2 mode_stdbitmap::l#1 ]
|
||||
zp ZP_BYTE:14 [ mode_stdchar::$28 mode_twoplanebitmap::$17 mode_8bpppixelcell::$15 bitmap_clear::y#4 bitmap_clear::y#1 mode_stdbitmap::l#5 mode_stdbitmap::l#1 ]
|
||||
reg byte a [ mode_stdchar::$29 ]
|
||||
reg byte a [ mode_stdchar::$30 ]
|
||||
reg byte a [ print_str_lines::ch#0 ]
|
||||
|
@ -6,14 +6,12 @@ main: {
|
||||
.label SCREEN = $400
|
||||
lda #'g'
|
||||
ldx #0
|
||||
b1:
|
||||
cpx #$a
|
||||
bcc b2
|
||||
rts
|
||||
b2:
|
||||
sta SCREEN,x
|
||||
inx
|
||||
clc
|
||||
adc #1
|
||||
jmp b1
|
||||
cpx #$a
|
||||
bcc b2
|
||||
rts
|
||||
}
|
||||
|
@ -9,17 +9,17 @@
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) main::j#4 ← phi( main::@1/(byte) main::j#1 main/(byte) 'g' )
|
||||
[5] (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main/(byte) 0 )
|
||||
[6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4
|
||||
[7] (byte) main::i#1 ← ++ (byte) main::i#4
|
||||
[8] (byte) main::j#1 ← ++ (byte) main::j#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::j#2 ← phi( main/(byte) 'g' main::@2/(byte) main::j#1 )
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
|
||||
[6] if((byte) main::i#2<(byte) $a) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((byte) main::i#1<(byte) $a) goto main::@2
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@1
|
||||
[7] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@2: scope:[main] from main::@1
|
||||
[8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2
|
||||
[9] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[10] (byte) main::j#1 ← ++ (byte) main::j#2
|
||||
to:main::@1
|
||||
|
@ -75,24 +75,37 @@ Constant (const byte*) main::SCREEN#0 = (byte*) 1024
|
||||
Constant (const byte) main::i#0 = 0
|
||||
Constant (const byte) main::j#0 = 'g'
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte) main::i#1 = (byte) main::i#2
|
||||
Alias (byte) main::j#1 = (byte) main::j#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) main::i#5 (const byte) main::i#0
|
||||
Identical Phi Values (byte) main::j#5 (const byte) main::j#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
if() condition always true - replacing block destination [10] if((const byte) main::i#0<(byte) $a) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Inlining constant with var siblings (const byte) main::i#0
|
||||
Inlining constant with var siblings (const byte) main::j#0
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Constant inlined main::j#0 = (byte) 'g'
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@7(between main::@1 and main::@2)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 2 initial phi equivalence classes
|
||||
Coalesced [12] main::i#4 ← main::i#1
|
||||
Coalesced [13] main::j#4 ← main::j#1
|
||||
Coalesced [13] main::i#6 ← main::i#1
|
||||
Coalesced [14] main::j#6 ← main::j#1
|
||||
Coalesced down to 2 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1_1
|
||||
Culled Empty Block (label) main::@7
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
@ -110,20 +123,20 @@ FINAL CONTROL FLOW GRAPH
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) main::j#4 ← phi( main::@1/(byte) main::j#1 main/(byte) 'g' )
|
||||
[5] (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main/(byte) 0 )
|
||||
[6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4
|
||||
[7] (byte) main::i#1 ← ++ (byte) main::i#4
|
||||
[8] (byte) main::j#1 ← ++ (byte) main::j#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::j#2 ← phi( main/(byte) 'g' main::@2/(byte) main::j#1 )
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
|
||||
[6] if((byte) main::i#2<(byte) $a) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((byte) main::i#1<(byte) $a) goto main::@2
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@1
|
||||
[7] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@2: scope:[main] from main::@1
|
||||
[8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2
|
||||
[9] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[10] (byte) main::j#1 ← ++ (byte) main::j#2
|
||||
to:main::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
@ -131,19 +144,19 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte*) main::SCREEN
|
||||
(byte) main::i
|
||||
(byte) main::i#1 11.0
|
||||
(byte) main::i#2 14.666666666666666
|
||||
(byte) main::i#4 16.5
|
||||
(byte) main::j
|
||||
(byte) main::j#1 22.0
|
||||
(byte) main::j#2 8.25
|
||||
(byte) main::j#1 11.0
|
||||
(byte) main::j#4 11.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::j#2 main::j#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
[ main::j#4 main::j#1 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::j#2 main::j#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
[ main::j#4 main::j#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#4 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::j#4 main::j#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -175,54 +188,55 @@ main: {
|
||||
.label SCREEN = $400
|
||||
.label i = 2
|
||||
.label j = 3
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::j#2 = (byte) 'g' [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) main::j#4 = (byte) 'g' [phi:main->main::@2#0] -- vbuz1=vbuc1
|
||||
lda #'g'
|
||||
sta j
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 0 [phi:main->main::@2#1] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta i
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte) main::i#2<(byte) $a) goto main::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda i
|
||||
cmp #$a
|
||||
bcc b2
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [7] return
|
||||
rts
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) main::j#4 = (byte) main::j#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
// [6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda j
|
||||
ldy i
|
||||
sta SCREEN,y
|
||||
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
|
||||
// [7] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuz1=_inc_vbuz1
|
||||
inc i
|
||||
// [10] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuz1=_inc_vbuz1
|
||||
// [8] (byte) main::j#1 ← ++ (byte) main::j#4 -- vbuz1=_inc_vbuz1
|
||||
inc j
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [9] if((byte) main::i#1<(byte) $a) goto main::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda i
|
||||
cmp #$a
|
||||
bcc b2_from_b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [10] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#4 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::j#4 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 30.25: zp ZP_BYTE:3 [ main::j#2 main::j#1 ] 25.67: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#4 main::i#1 ] 22: zp ZP_BYTE:3 [ main::j#4 main::j#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 303 combination reg byte a [ main::j#2 main::j#1 ] reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 303 combination
|
||||
Uplifting [main] best 333 combination reg byte x [ main::i#4 main::i#1 ] reg byte a [ main::j#4 main::j#1 ]
|
||||
Uplifting [] best 333 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -251,59 +265,65 @@ bend:
|
||||
// main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::j#2 = (byte) 'g' [phi:main->main::@1#0] -- vbuaa=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) main::j#4 = (byte) 'g' [phi:main->main::@2#0] -- vbuaa=vbuc1
|
||||
lda #'g'
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 0 [phi:main->main::@2#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) main::j#4 = (byte) main::j#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// [7] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [8] (byte) main::j#1 ← ++ (byte) main::j#4 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte) main::i#2<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
// [9] if((byte) main::i#1<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcc b2
|
||||
bcc b2_from_b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [7] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [10] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b2_from_b1 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b2_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b2_from_main:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -319,17 +339,17 @@ FINAL SYMBOL TABLE
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 11.0
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
(byte) main::i#4 reg byte x 16.5
|
||||
(byte) main::j
|
||||
(byte) main::j#1 reg byte a 22.0
|
||||
(byte) main::j#2 reg byte a 8.25
|
||||
(byte) main::j#1 reg byte a 11.0
|
||||
(byte) main::j#4 reg byte a 11.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte a [ main::j#4 main::j#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 231
|
||||
Score: 201
|
||||
|
||||
// File Comments
|
||||
// Tests comma-separated declarations inside for()
|
||||
@ -348,36 +368,33 @@ Score: 231
|
||||
// main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
// [5] phi (byte) main::j#2 = (byte) 'g' [phi:main->main::@1#0] -- vbuaa=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
// [5] phi (byte) main::j#4 = (byte) 'g' [phi:main->main::@2#0] -- vbuaa=vbuc1
|
||||
lda #'g'
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 0 [phi:main->main::@2#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// main::@1
|
||||
b1:
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
// [5] phi (byte) main::j#4 = (byte) main::j#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
// main::@2
|
||||
b2:
|
||||
// SCREEN[i] = j
|
||||
// [6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// for(byte i, j='g'; i<10; i++, j++)
|
||||
// [6] if((byte) main::i#2<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
// [7] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [8] (byte) main::j#1 ← ++ (byte) main::j#4 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
// main::@1
|
||||
// [9] if((byte) main::i#1<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcc b2
|
||||
// main::@return
|
||||
// }
|
||||
// [7] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@2
|
||||
b2:
|
||||
// SCREEN[i] = j
|
||||
// [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// for(byte i, j='g'; i<10; i++, j++)
|
||||
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [10] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
// [5] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -9,10 +9,10 @@
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 11.0
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
(byte) main::i#4 reg byte x 16.5
|
||||
(byte) main::j
|
||||
(byte) main::j#1 reg byte a 22.0
|
||||
(byte) main::j#2 reg byte a 8.25
|
||||
(byte) main::j#1 reg byte a 11.0
|
||||
(byte) main::j#4 reg byte a 11.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte a [ main::j#4 main::j#1 ]
|
||||
|
@ -6,14 +6,12 @@ main: {
|
||||
.label SCREEN = $400
|
||||
lda #'g'
|
||||
ldx #0
|
||||
b1:
|
||||
cpx #$a
|
||||
bcc b2
|
||||
rts
|
||||
b2:
|
||||
sta SCREEN,x
|
||||
inx
|
||||
clc
|
||||
adc #1
|
||||
jmp b1
|
||||
cpx #$a
|
||||
bcc b2
|
||||
rts
|
||||
}
|
||||
|
@ -9,17 +9,17 @@
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) main::j#4 ← phi( main::@1/(byte) main::j#1 main/(byte) 'g' )
|
||||
[5] (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main/(byte) 0 )
|
||||
[6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4
|
||||
[7] (byte) main::i#1 ← ++ (byte) main::i#4
|
||||
[8] (byte) main::j#1 ← ++ (byte) main::j#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::j#2 ← phi( main/(byte) 'g' main::@2/(byte) main::j#1 )
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
|
||||
[6] if((byte) main::i#2<(byte) $a) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((byte) main::i#1<(byte) $a) goto main::@2
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@1
|
||||
[7] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@2: scope:[main] from main::@1
|
||||
[8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2
|
||||
[9] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[10] (byte) main::j#1 ← ++ (byte) main::j#2
|
||||
to:main::@1
|
||||
|
@ -79,24 +79,37 @@ Constant (const byte*) main::SCREEN#0 = (byte*) 1024
|
||||
Constant (const byte) main::j#0 = 'g'
|
||||
Constant (const byte) main::i#0 = 0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte) main::i#1 = (byte) main::i#2
|
||||
Alias (byte) main::j#1 = (byte) main::j#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) main::i#5 (const byte) main::i#0
|
||||
Identical Phi Values (byte) main::j#5 (const byte) main::j#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
if() condition always true - replacing block destination [10] if((const byte) main::i#0<(byte) $a) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Inlining constant with var siblings (const byte) main::j#0
|
||||
Inlining constant with var siblings (const byte) main::i#0
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Constant inlined main::j#0 = (byte) 'g'
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@7(between main::@1 and main::@2)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 2 initial phi equivalence classes
|
||||
Coalesced [12] main::i#4 ← main::i#1
|
||||
Coalesced [13] main::j#4 ← main::j#1
|
||||
Coalesced [13] main::i#6 ← main::i#1
|
||||
Coalesced [14] main::j#6 ← main::j#1
|
||||
Coalesced down to 2 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1_1
|
||||
Culled Empty Block (label) main::@7
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
@ -114,20 +127,20 @@ FINAL CONTROL FLOW GRAPH
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) main::j#4 ← phi( main::@1/(byte) main::j#1 main/(byte) 'g' )
|
||||
[5] (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main/(byte) 0 )
|
||||
[6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4
|
||||
[7] (byte) main::i#1 ← ++ (byte) main::i#4
|
||||
[8] (byte) main::j#1 ← ++ (byte) main::j#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::j#2 ← phi( main/(byte) 'g' main::@2/(byte) main::j#1 )
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
|
||||
[6] if((byte) main::i#2<(byte) $a) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((byte) main::i#1<(byte) $a) goto main::@2
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@1
|
||||
[7] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@2: scope:[main] from main::@1
|
||||
[8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2
|
||||
[9] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[10] (byte) main::j#1 ← ++ (byte) main::j#2
|
||||
to:main::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
@ -135,19 +148,19 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte*) main::SCREEN
|
||||
(byte) main::i
|
||||
(byte) main::i#1 11.0
|
||||
(byte) main::i#2 14.666666666666666
|
||||
(byte) main::i#4 16.5
|
||||
(byte) main::j
|
||||
(byte) main::j#1 22.0
|
||||
(byte) main::j#2 8.25
|
||||
(byte) main::j#1 11.0
|
||||
(byte) main::j#4 11.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::j#2 main::j#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
[ main::j#4 main::j#1 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::j#2 main::j#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
[ main::j#4 main::j#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#4 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::j#4 main::j#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -179,54 +192,55 @@ main: {
|
||||
.label SCREEN = $400
|
||||
.label i = 2
|
||||
.label j = 3
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::j#2 = (byte) 'g' [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) main::j#4 = (byte) 'g' [phi:main->main::@2#0] -- vbuz1=vbuc1
|
||||
lda #'g'
|
||||
sta j
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuz1=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 0 [phi:main->main::@2#1] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta i
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte) main::i#2<(byte) $a) goto main::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda i
|
||||
cmp #$a
|
||||
bcc b2
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [7] return
|
||||
rts
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) main::j#4 = (byte) main::j#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
// [6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda j
|
||||
ldy i
|
||||
sta SCREEN,y
|
||||
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
|
||||
// [7] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuz1=_inc_vbuz1
|
||||
inc i
|
||||
// [10] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuz1=_inc_vbuz1
|
||||
// [8] (byte) main::j#1 ← ++ (byte) main::j#4 -- vbuz1=_inc_vbuz1
|
||||
inc j
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [9] if((byte) main::i#1<(byte) $a) goto main::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda i
|
||||
cmp #$a
|
||||
bcc b2_from_b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [10] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#4 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::j#4 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 30.25: zp ZP_BYTE:3 [ main::j#2 main::j#1 ] 25.67: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#4 main::i#1 ] 22: zp ZP_BYTE:3 [ main::j#4 main::j#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 303 combination reg byte a [ main::j#2 main::j#1 ] reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 303 combination
|
||||
Uplifting [main] best 333 combination reg byte x [ main::i#4 main::i#1 ] reg byte a [ main::j#4 main::j#1 ]
|
||||
Uplifting [] best 333 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -255,59 +269,65 @@ bend:
|
||||
// main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::j#2 = (byte) 'g' [phi:main->main::@1#0] -- vbuaa=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) main::j#4 = (byte) 'g' [phi:main->main::@2#0] -- vbuaa=vbuc1
|
||||
lda #'g'
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 0 [phi:main->main::@2#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) main::j#4 = (byte) main::j#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// [7] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [8] (byte) main::j#1 ← ++ (byte) main::j#4 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte) main::i#2<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
// [9] if((byte) main::i#1<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcc b2
|
||||
bcc b2_from_b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [7] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [10] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b2_from_b1 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b2_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b2_from_main:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -323,17 +343,17 @@ FINAL SYMBOL TABLE
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 11.0
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
(byte) main::i#4 reg byte x 16.5
|
||||
(byte) main::j
|
||||
(byte) main::j#1 reg byte a 22.0
|
||||
(byte) main::j#2 reg byte a 8.25
|
||||
(byte) main::j#1 reg byte a 11.0
|
||||
(byte) main::j#4 reg byte a 11.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte a [ main::j#4 main::j#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 231
|
||||
Score: 201
|
||||
|
||||
// File Comments
|
||||
// Tests comma-expressions in for()-statement
|
||||
@ -352,36 +372,33 @@ Score: 231
|
||||
// main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
// [5] phi (byte) main::j#2 = (byte) 'g' [phi:main->main::@1#0] -- vbuaa=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
// [5] phi (byte) main::j#4 = (byte) 'g' [phi:main->main::@2#0] -- vbuaa=vbuc1
|
||||
lda #'g'
|
||||
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 0 [phi:main->main::@2#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// main::@1
|
||||
b1:
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
// [5] phi (byte) main::j#4 = (byte) main::j#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
// main::@2
|
||||
b2:
|
||||
// SCREEN[i] = j
|
||||
// [6] *((const byte*) main::SCREEN#0 + (byte) main::i#4) ← (byte) main::j#4 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// for( byte i=0; j<10, i<10; i++, j++)
|
||||
// [6] if((byte) main::i#2<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
// [7] (byte) main::i#1 ← ++ (byte) main::i#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [8] (byte) main::j#1 ← ++ (byte) main::j#4 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
// main::@1
|
||||
// [9] if((byte) main::i#1<(byte) $a) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$a
|
||||
bcc b2
|
||||
// main::@return
|
||||
// }
|
||||
// [7] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@2
|
||||
b2:
|
||||
// SCREEN[i] = j
|
||||
// [8] *((const byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// for( byte i=0; j<10, i<10; i++, j++)
|
||||
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [10] (byte) main::j#1 ← ++ (byte) main::j#2 -- vbuaa=_inc_vbuaa
|
||||
clc
|
||||
adc #1
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
// [5] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -9,10 +9,10 @@
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 11.0
|
||||
(byte) main::i#2 reg byte x 14.666666666666666
|
||||
(byte) main::i#4 reg byte x 16.5
|
||||
(byte) main::j
|
||||
(byte) main::j#1 reg byte a 22.0
|
||||
(byte) main::j#2 reg byte a 8.25
|
||||
(byte) main::j#1 reg byte a 11.0
|
||||
(byte) main::j#4 reg byte a 11.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte a [ main::j#4 main::j#1 ]
|
||||
|
@ -11,7 +11,14 @@ main: {
|
||||
sta sc
|
||||
lda #>screen
|
||||
sta sc+1
|
||||
b1:
|
||||
b2:
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inc sc
|
||||
bne !+
|
||||
inc sc+1
|
||||
!:
|
||||
lda sc+1
|
||||
cmp #>screen+$3e7
|
||||
bne !+
|
||||
@ -24,16 +31,6 @@ main: {
|
||||
sta cc
|
||||
lda #>cols+$3e7
|
||||
sta cc+1
|
||||
b3:
|
||||
lda #>cols-1
|
||||
cmp cc+1
|
||||
bcc b4
|
||||
bne !+
|
||||
lda #<cols-1
|
||||
cmp cc
|
||||
bcc b4
|
||||
!:
|
||||
rts
|
||||
b4:
|
||||
lda #2
|
||||
ldy #0
|
||||
@ -43,14 +40,13 @@ main: {
|
||||
dec cc+1
|
||||
!:
|
||||
dec cc
|
||||
jmp b3
|
||||
b2:
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inc sc
|
||||
lda #>cols-1
|
||||
cmp cc+1
|
||||
bcc b4
|
||||
bne !+
|
||||
inc sc+1
|
||||
lda #<cols-1
|
||||
cmp cc
|
||||
bcc b4
|
||||
!:
|
||||
jmp b1
|
||||
rts
|
||||
}
|
||||
|
@ -9,23 +9,23 @@
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte*) main::sc#4 ← phi( main::@1/(byte*) main::sc#1 main/(const byte*) main::screen#0 )
|
||||
[6] *((byte*) main::sc#4) ← (byte) 'a'
|
||||
[7] (byte*) main::sc#1 ← ++ (byte*) main::sc#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte*) main::sc#2 ← phi( main/(const byte*) main::screen#0 main::@2/(byte*) main::sc#1 )
|
||||
[6] if((byte*) main::sc#2<=(const byte*) main::screen#0+(word) $3e7) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[8] if((byte*) main::sc#1<=(const byte*) main::screen#0+(word) $3e7) goto main::@2
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@1 main::@3
|
||||
[9] (byte*) main::cc#4 ← phi( main::@3/(byte*) main::cc#1 main::@1/(const byte*) main::cols#0+(word) $3e7 )
|
||||
[10] *((byte*) main::cc#4) ← (byte) 2
|
||||
[11] (byte*) main::cc#1 ← -- (byte*) main::cc#4
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@4
|
||||
[7] (byte*) main::cc#2 ← phi( main::@1/(const byte*) main::cols#0+(word) $3e7 main::@4/(byte*) main::cc#1 )
|
||||
[8] if((byte*) main::cc#2>(const byte*) main::cols#0-(byte) 1) goto main::@4
|
||||
main::@3: scope:[main] from main::@4
|
||||
[12] if((byte*) main::cc#1>(const byte*) main::cols#0-(byte) 1) goto main::@4
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@3
|
||||
[9] return
|
||||
[13] return
|
||||
to:@return
|
||||
main::@4: scope:[main] from main::@3
|
||||
[10] *((byte*) main::cc#2) ← (byte) 2
|
||||
[11] (byte*) main::cc#1 ← -- (byte*) main::cc#2
|
||||
to:main::@3
|
||||
main::@2: scope:[main] from main::@1
|
||||
[12] *((byte*) main::sc#2) ← (byte) 'a'
|
||||
[13] (byte*) main::sc#1 ← ++ (byte*) main::sc#2
|
||||
to:main::@1
|
||||
|
@ -122,26 +122,45 @@ Constant (const byte*) main::$0 = main::screen#0+$3e7
|
||||
Constant (const byte*) main::cc#0 = main::cols#0+$3e7
|
||||
Constant (const byte*) main::$3 = main::cols#0-1
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte*) main::sc#1 = (byte*) main::sc#2
|
||||
Alias (byte*) main::cc#1 = (byte*) main::cc#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte*) main::sc#5 (const byte*) main::screen#0
|
||||
Identical Phi Values (byte*) main::cc#5 (const byte*) main::cc#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
if() condition always true - replacing block destination [15] if((const byte*) main::screen#0<=(const byte*) main::$0) goto main::@2
|
||||
if() condition always true - replacing block destination [17] if((const byte*) main::cc#0>(const byte*) main::$3) goto main::@8
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Inlining constant with var siblings (const byte*) main::cc#0
|
||||
Constant inlined main::$3 = (const byte*) main::cols#0-(byte) 1
|
||||
Constant inlined main::cc#0 = (const byte*) main::cols#0+(word) $3e7
|
||||
Constant inlined main::$0 = (const byte*) main::screen#0+(word) $3e7
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@13(between main::@1 and main::@2)
|
||||
Added new block during phi lifting main::@14(between main::@7 and main::@8)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1_1
|
||||
Adding NOP phi() at start of main::@3
|
||||
Adding NOP phi() at start of main::@7_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 2 initial phi equivalence classes
|
||||
Coalesced [14] main::cc#4 ← main::cc#1
|
||||
Coalesced [17] main::sc#4 ← main::sc#1
|
||||
Coalesced [18] main::cc#6 ← main::cc#1
|
||||
Coalesced [19] main::sc#6 ← main::sc#1
|
||||
Coalesced down to 2 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1_1
|
||||
Culled Empty Block (label) main::@3
|
||||
Culled Empty Block (label) main::@7_1
|
||||
Culled Empty Block (label) main::@14
|
||||
Culled Empty Block (label) main::@13
|
||||
Renumbering block main::@7 to main::@3
|
||||
Renumbering block main::@8 to main::@4
|
||||
Adding NOP phi() at start of @begin
|
||||
@ -161,47 +180,47 @@ FINAL CONTROL FLOW GRAPH
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte*) main::sc#4 ← phi( main::@1/(byte*) main::sc#1 main/(const byte*) main::screen#0 )
|
||||
[6] *((byte*) main::sc#4) ← (byte) 'a'
|
||||
[7] (byte*) main::sc#1 ← ++ (byte*) main::sc#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte*) main::sc#2 ← phi( main/(const byte*) main::screen#0 main::@2/(byte*) main::sc#1 )
|
||||
[6] if((byte*) main::sc#2<=(const byte*) main::screen#0+(word) $3e7) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[8] if((byte*) main::sc#1<=(const byte*) main::screen#0+(word) $3e7) goto main::@2
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@1 main::@3
|
||||
[9] (byte*) main::cc#4 ← phi( main::@3/(byte*) main::cc#1 main::@1/(const byte*) main::cols#0+(word) $3e7 )
|
||||
[10] *((byte*) main::cc#4) ← (byte) 2
|
||||
[11] (byte*) main::cc#1 ← -- (byte*) main::cc#4
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@4
|
||||
[7] (byte*) main::cc#2 ← phi( main::@1/(const byte*) main::cols#0+(word) $3e7 main::@4/(byte*) main::cc#1 )
|
||||
[8] if((byte*) main::cc#2>(const byte*) main::cols#0-(byte) 1) goto main::@4
|
||||
main::@3: scope:[main] from main::@4
|
||||
[12] if((byte*) main::cc#1>(const byte*) main::cols#0-(byte) 1) goto main::@4
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@3
|
||||
[9] return
|
||||
[13] return
|
||||
to:@return
|
||||
main::@4: scope:[main] from main::@3
|
||||
[10] *((byte*) main::cc#2) ← (byte) 2
|
||||
[11] (byte*) main::cc#1 ← -- (byte*) main::cc#2
|
||||
to:main::@3
|
||||
main::@2: scope:[main] from main::@1
|
||||
[12] *((byte*) main::sc#2) ← (byte) 'a'
|
||||
[13] (byte*) main::sc#1 ← ++ (byte*) main::sc#2
|
||||
to:main::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(void()) main()
|
||||
(byte*) main::cc
|
||||
(byte*) main::cc#1 22.0
|
||||
(byte*) main::cc#2 14.666666666666666
|
||||
(byte*) main::cc#1 16.5
|
||||
(byte*) main::cc#4 16.5
|
||||
(byte*) main::cols
|
||||
(byte*) main::sc
|
||||
(byte*) main::sc#1 22.0
|
||||
(byte*) main::sc#2 14.666666666666666
|
||||
(byte*) main::sc#1 16.5
|
||||
(byte*) main::sc#4 16.5
|
||||
(byte*) main::screen
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::sc#2 main::sc#1 ]
|
||||
[ main::cc#2 main::cc#1 ]
|
||||
[ main::sc#4 main::sc#1 ]
|
||||
[ main::cc#4 main::cc#1 ]
|
||||
Complete equivalence classes
|
||||
[ main::sc#2 main::sc#1 ]
|
||||
[ main::cc#2 main::cc#1 ]
|
||||
Allocated zp ZP_WORD:2 [ main::sc#2 main::sc#1 ]
|
||||
Allocated zp ZP_WORD:4 [ main::cc#2 main::cc#1 ]
|
||||
[ main::sc#4 main::sc#1 ]
|
||||
[ main::cc#4 main::cc#1 ]
|
||||
Allocated zp ZP_WORD:2 [ main::sc#4 main::sc#1 ]
|
||||
Allocated zp ZP_WORD:4 [ main::cc#4 main::cc#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -234,98 +253,100 @@ main: {
|
||||
.label cols = $d800
|
||||
.label sc = 2
|
||||
.label cc = 4
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte*) main::sc#2 = (const byte*) main::screen#0 [phi:main->main::@1#0] -- pbuz1=pbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte*) main::sc#4 = (const byte*) main::screen#0 [phi:main->main::@2#0] -- pbuz1=pbuc1
|
||||
lda #<screen
|
||||
sta sc
|
||||
lda #>screen
|
||||
sta sc+1
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte*) main::sc#4 = (byte*) main::sc#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [6] *((byte*) main::sc#4) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
// [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#4 -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
bne !+
|
||||
inc sc+1
|
||||
!:
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte*) main::sc#2<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 -- pbuz1_le_pbuc1_then_la1
|
||||
// [8] if((byte*) main::sc#1<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 -- pbuz1_le_pbuc1_then_la1
|
||||
lda sc+1
|
||||
cmp #>screen+$3e7
|
||||
bne !+
|
||||
lda sc
|
||||
cmp #<screen+$3e7
|
||||
!:
|
||||
bcc b2
|
||||
beq b2
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [7] phi (byte*) main::cc#2 = (const byte*) main::cols#0+(word) $3e7 [phi:main::@1->main::@3#0] -- pbuz1=pbuc1
|
||||
bcc b2_from_b1
|
||||
beq b2_from_b1
|
||||
// [9] phi from main::@1 to main::@4 [phi:main::@1->main::@4]
|
||||
b4_from_b1:
|
||||
// [9] phi (byte*) main::cc#4 = (const byte*) main::cols#0+(word) $3e7 [phi:main::@1->main::@4#0] -- pbuz1=pbuc1
|
||||
lda #<cols+$3e7
|
||||
sta cc
|
||||
lda #>cols+$3e7
|
||||
sta cc+1
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [8] if((byte*) main::cc#2>(const byte*) main::cols#0-(byte) 1) goto main::@4 -- pbuz1_gt_pbuc1_then_la1
|
||||
lda #>cols-1
|
||||
cmp cc+1
|
||||
bcc b4
|
||||
bne !+
|
||||
lda #<cols-1
|
||||
cmp cc
|
||||
bcc b4
|
||||
!:
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [9] return
|
||||
rts
|
||||
jmp b4
|
||||
// [9] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
b4_from_b3:
|
||||
// [9] phi (byte*) main::cc#4 = (byte*) main::cc#1 [phi:main::@3->main::@4#0] -- register_copy
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [10] *((byte*) main::cc#2) ← (byte) 2 -- _deref_pbuz1=vbuc1
|
||||
// [10] *((byte*) main::cc#4) ← (byte) 2 -- _deref_pbuz1=vbuc1
|
||||
lda #2
|
||||
ldy #0
|
||||
sta (cc),y
|
||||
// [11] (byte*) main::cc#1 ← -- (byte*) main::cc#2 -- pbuz1=_dec_pbuz1
|
||||
// [11] (byte*) main::cc#1 ← -- (byte*) main::cc#4 -- pbuz1=_dec_pbuz1
|
||||
lda cc
|
||||
bne !+
|
||||
dec cc+1
|
||||
!:
|
||||
dec cc
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [7] phi (byte*) main::cc#2 = (byte*) main::cc#1 [phi:main::@4->main::@3#0] -- register_copy
|
||||
jmp b3
|
||||
// main::@2
|
||||
b2:
|
||||
// [12] *((byte*) main::sc#2) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
// [13] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
// main::@3
|
||||
b3:
|
||||
// [12] if((byte*) main::cc#1>(const byte*) main::cols#0-(byte) 1) goto main::@4 -- pbuz1_gt_pbuc1_then_la1
|
||||
lda #>cols-1
|
||||
cmp cc+1
|
||||
bcc b4_from_b3
|
||||
bne !+
|
||||
inc sc+1
|
||||
lda #<cols-1
|
||||
cmp cc
|
||||
bcc b4_from_b3
|
||||
!:
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [13] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [6] if((byte*) main::sc#2<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 [ main::sc#2 ] ( main:2 [ main::sc#2 ] ) always clobbers reg byte a
|
||||
Statement [8] if((byte*) main::cc#2>(const byte*) main::cols#0-(byte) 1) goto main::@4 [ main::cc#2 ] ( main:2 [ main::cc#2 ] ) always clobbers reg byte a
|
||||
Statement [10] *((byte*) main::cc#2) ← (byte) 2 [ main::cc#2 ] ( main:2 [ main::cc#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [11] (byte*) main::cc#1 ← -- (byte*) main::cc#2 [ main::cc#1 ] ( main:2 [ main::cc#1 ] ) always clobbers reg byte a
|
||||
Statement [12] *((byte*) main::sc#2) ← (byte) 'a' [ main::sc#2 ] ( main:2 [ main::sc#2 ] ) always clobbers reg byte a reg byte y
|
||||
Potential registers zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_WORD:4 [ main::cc#2 main::cc#1 ] : zp ZP_WORD:4 ,
|
||||
Statement [6] *((byte*) main::sc#4) ← (byte) 'a' [ main::sc#4 ] ( main:2 [ main::sc#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [8] if((byte*) main::sc#1<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 [ main::sc#1 ] ( main:2 [ main::sc#1 ] ) always clobbers reg byte a
|
||||
Statement [10] *((byte*) main::cc#4) ← (byte) 2 [ main::cc#4 ] ( main:2 [ main::cc#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [11] (byte*) main::cc#1 ← -- (byte*) main::cc#4 [ main::cc#1 ] ( main:2 [ main::cc#1 ] ) always clobbers reg byte a
|
||||
Statement [12] if((byte*) main::cc#1>(const byte*) main::cols#0-(byte) 1) goto main::@4 [ main::cc#1 ] ( main:2 [ main::cc#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ main::sc#4 main::sc#1 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_WORD:4 [ main::cc#4 main::cc#1 ] : zp ZP_WORD:4 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 36.67: zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] 36.67: zp ZP_WORD:4 [ main::cc#2 main::cc#1 ]
|
||||
Uplift Scope [main] 33: zp ZP_WORD:2 [ main::sc#4 main::sc#1 ] 33: zp ZP_WORD:4 [ main::cc#4 main::cc#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 1198 combination zp ZP_WORD:2 [ main::sc#2 main::sc#1 ] zp ZP_WORD:4 [ main::cc#2 main::cc#1 ]
|
||||
Uplifting [] best 1198 combination
|
||||
Uplifting [main] best 1258 combination zp ZP_WORD:2 [ main::sc#4 main::sc#1 ] zp ZP_WORD:4 [ main::cc#4 main::cc#1 ]
|
||||
Uplifting [] best 1258 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -357,105 +378,118 @@ main: {
|
||||
.label cols = $d800
|
||||
.label sc = 2
|
||||
.label cc = 4
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte*) main::sc#2 = (const byte*) main::screen#0 [phi:main->main::@1#0] -- pbuz1=pbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte*) main::sc#4 = (const byte*) main::screen#0 [phi:main->main::@2#0] -- pbuz1=pbuc1
|
||||
lda #<screen
|
||||
sta sc
|
||||
lda #>screen
|
||||
sta sc+1
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte*) main::sc#4 = (byte*) main::sc#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [6] *((byte*) main::sc#4) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
// [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#4 -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
bne !+
|
||||
inc sc+1
|
||||
!:
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte*) main::sc#2<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 -- pbuz1_le_pbuc1_then_la1
|
||||
// [8] if((byte*) main::sc#1<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 -- pbuz1_le_pbuc1_then_la1
|
||||
lda sc+1
|
||||
cmp #>screen+$3e7
|
||||
bne !+
|
||||
lda sc
|
||||
cmp #<screen+$3e7
|
||||
!:
|
||||
bcc b2
|
||||
beq b2
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [7] phi (byte*) main::cc#2 = (const byte*) main::cols#0+(word) $3e7 [phi:main::@1->main::@3#0] -- pbuz1=pbuc1
|
||||
bcc b2_from_b1
|
||||
beq b2_from_b1
|
||||
// [9] phi from main::@1 to main::@4 [phi:main::@1->main::@4]
|
||||
b4_from_b1:
|
||||
// [9] phi (byte*) main::cc#4 = (const byte*) main::cols#0+(word) $3e7 [phi:main::@1->main::@4#0] -- pbuz1=pbuc1
|
||||
lda #<cols+$3e7
|
||||
sta cc
|
||||
lda #>cols+$3e7
|
||||
sta cc+1
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [8] if((byte*) main::cc#2>(const byte*) main::cols#0-(byte) 1) goto main::@4 -- pbuz1_gt_pbuc1_then_la1
|
||||
lda #>cols-1
|
||||
cmp cc+1
|
||||
bcc b4
|
||||
bne !+
|
||||
lda #<cols-1
|
||||
cmp cc
|
||||
bcc b4
|
||||
!:
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [9] return
|
||||
rts
|
||||
jmp b4
|
||||
// [9] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
b4_from_b3:
|
||||
// [9] phi (byte*) main::cc#4 = (byte*) main::cc#1 [phi:main::@3->main::@4#0] -- register_copy
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [10] *((byte*) main::cc#2) ← (byte) 2 -- _deref_pbuz1=vbuc1
|
||||
// [10] *((byte*) main::cc#4) ← (byte) 2 -- _deref_pbuz1=vbuc1
|
||||
lda #2
|
||||
ldy #0
|
||||
sta (cc),y
|
||||
// [11] (byte*) main::cc#1 ← -- (byte*) main::cc#2 -- pbuz1=_dec_pbuz1
|
||||
// [11] (byte*) main::cc#1 ← -- (byte*) main::cc#4 -- pbuz1=_dec_pbuz1
|
||||
lda cc
|
||||
bne !+
|
||||
dec cc+1
|
||||
!:
|
||||
dec cc
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [7] phi (byte*) main::cc#2 = (byte*) main::cc#1 [phi:main::@4->main::@3#0] -- register_copy
|
||||
jmp b3
|
||||
// main::@2
|
||||
b2:
|
||||
// [12] *((byte*) main::sc#2) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
// [13] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
// main::@3
|
||||
b3:
|
||||
// [12] if((byte*) main::cc#1>(const byte*) main::cols#0-(byte) 1) goto main::@4 -- pbuz1_gt_pbuc1_then_la1
|
||||
lda #>cols-1
|
||||
cmp cc+1
|
||||
bcc b4_from_b3
|
||||
bne !+
|
||||
inc sc+1
|
||||
lda #<cols-1
|
||||
cmp cc
|
||||
bcc b4_from_b3
|
||||
!:
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [13] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b4
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b4_from_b3 with b4
|
||||
Replacing label b4_from_b3 with b4
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction b4_from_b3:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b3_from_b1:
|
||||
Removing instruction b2_from_main:
|
||||
Removing instruction b1:
|
||||
Removing instruction b4_from_b1:
|
||||
Removing instruction b3:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b3_from_b4:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b4
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -470,22 +504,22 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@4
|
||||
(label) main::@return
|
||||
(byte*) main::cc
|
||||
(byte*) main::cc#1 cc zp ZP_WORD:4 22.0
|
||||
(byte*) main::cc#2 cc zp ZP_WORD:4 14.666666666666666
|
||||
(byte*) main::cc#1 cc zp ZP_WORD:4 16.5
|
||||
(byte*) main::cc#4 cc zp ZP_WORD:4 16.5
|
||||
(byte*) main::cols
|
||||
(const byte*) main::cols#0 cols = (byte*) 55296
|
||||
(byte*) main::sc
|
||||
(byte*) main::sc#1 sc zp ZP_WORD:2 22.0
|
||||
(byte*) main::sc#2 sc zp ZP_WORD:2 14.666666666666666
|
||||
(byte*) main::sc#1 sc zp ZP_WORD:2 16.5
|
||||
(byte*) main::sc#4 sc zp ZP_WORD:2 16.5
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = (byte*) 1024
|
||||
|
||||
zp ZP_WORD:2 [ main::sc#2 main::sc#1 ]
|
||||
zp ZP_WORD:4 [ main::cc#2 main::cc#1 ]
|
||||
zp ZP_WORD:2 [ main::sc#4 main::sc#1 ]
|
||||
zp ZP_WORD:4 [ main::cc#4 main::cc#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 1096
|
||||
Score: 1036
|
||||
|
||||
// File Comments
|
||||
// Test rewriting of constant comparisons for pointers
|
||||
@ -507,16 +541,29 @@ main: {
|
||||
.label cols = $d800
|
||||
.label sc = 2
|
||||
.label cc = 4
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
// [5] phi (byte*) main::sc#2 = (const byte*) main::screen#0 [phi:main->main::@1#0] -- pbuz1=pbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
// [5] phi (byte*) main::sc#4 = (const byte*) main::screen#0 [phi:main->main::@2#0] -- pbuz1=pbuc1
|
||||
lda #<screen
|
||||
sta sc
|
||||
lda #>screen
|
||||
sta sc+1
|
||||
// main::@1
|
||||
b1:
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
// [5] phi (byte*) main::sc#4 = (byte*) main::sc#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// main::@2
|
||||
b2:
|
||||
// *sc='a'
|
||||
// [6] *((byte*) main::sc#4) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
// for(byte* sc =screen;sc<=screen+999;sc++)
|
||||
// [6] if((byte*) main::sc#2<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 -- pbuz1_le_pbuc1_then_la1
|
||||
// [7] (byte*) main::sc#1 ← ++ (byte*) main::sc#4 -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
bne !+
|
||||
inc sc+1
|
||||
!:
|
||||
// main::@1
|
||||
// [8] if((byte*) main::sc#1<=(const byte*) main::screen#0+(word) $3e7) goto main::@2 -- pbuz1_le_pbuc1_then_la1
|
||||
lda sc+1
|
||||
cmp #>screen+$3e7
|
||||
bne !+
|
||||
@ -525,16 +572,30 @@ main: {
|
||||
!:
|
||||
bcc b2
|
||||
beq b2
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
// [7] phi (byte*) main::cc#2 = (const byte*) main::cols#0+(word) $3e7 [phi:main::@1->main::@3#0] -- pbuz1=pbuc1
|
||||
// [9] phi from main::@1 to main::@4 [phi:main::@1->main::@4]
|
||||
// [9] phi (byte*) main::cc#4 = (const byte*) main::cols#0+(word) $3e7 [phi:main::@1->main::@4#0] -- pbuz1=pbuc1
|
||||
lda #<cols+$3e7
|
||||
sta cc
|
||||
lda #>cols+$3e7
|
||||
sta cc+1
|
||||
// main::@3
|
||||
b3:
|
||||
// [9] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
// [9] phi (byte*) main::cc#4 = (byte*) main::cc#1 [phi:main::@3->main::@4#0] -- register_copy
|
||||
// main::@4
|
||||
b4:
|
||||
// *cc=2
|
||||
// [10] *((byte*) main::cc#4) ← (byte) 2 -- _deref_pbuz1=vbuc1
|
||||
lda #2
|
||||
ldy #0
|
||||
sta (cc),y
|
||||
// for(byte* cc =cols+999;cc>cols-1;cc--)
|
||||
// [8] if((byte*) main::cc#2>(const byte*) main::cols#0-(byte) 1) goto main::@4 -- pbuz1_gt_pbuc1_then_la1
|
||||
// [11] (byte*) main::cc#1 ← -- (byte*) main::cc#4 -- pbuz1=_dec_pbuz1
|
||||
lda cc
|
||||
bne !+
|
||||
dec cc+1
|
||||
!:
|
||||
dec cc
|
||||
// main::@3
|
||||
// [12] if((byte*) main::cc#1>(const byte*) main::cols#0-(byte) 1) goto main::@4 -- pbuz1_gt_pbuc1_then_la1
|
||||
lda #>cols-1
|
||||
cmp cc+1
|
||||
bcc b4
|
||||
@ -545,41 +606,8 @@ main: {
|
||||
!:
|
||||
// main::@return
|
||||
// }
|
||||
// [9] return
|
||||
// [13] return
|
||||
rts
|
||||
// main::@4
|
||||
b4:
|
||||
// *cc=2
|
||||
// [10] *((byte*) main::cc#2) ← (byte) 2 -- _deref_pbuz1=vbuc1
|
||||
lda #2
|
||||
ldy #0
|
||||
sta (cc),y
|
||||
// for(byte* cc =cols+999;cc>cols-1;cc--)
|
||||
// [11] (byte*) main::cc#1 ← -- (byte*) main::cc#2 -- pbuz1=_dec_pbuz1
|
||||
lda cc
|
||||
bne !+
|
||||
dec cc+1
|
||||
!:
|
||||
dec cc
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
// [7] phi (byte*) main::cc#2 = (byte*) main::cc#1 [phi:main::@4->main::@3#0] -- register_copy
|
||||
jmp b3
|
||||
// main::@2
|
||||
b2:
|
||||
// *sc='a'
|
||||
// [12] *((byte*) main::sc#2) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
// for(byte* sc =screen;sc<=screen+999;sc++)
|
||||
// [13] (byte*) main::sc#1 ← ++ (byte*) main::sc#2 -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
bne !+
|
||||
inc sc+1
|
||||
!:
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
// [5] phi (byte*) main::sc#2 = (byte*) main::sc#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -8,15 +8,15 @@
|
||||
(label) main::@4
|
||||
(label) main::@return
|
||||
(byte*) main::cc
|
||||
(byte*) main::cc#1 cc zp ZP_WORD:4 22.0
|
||||
(byte*) main::cc#2 cc zp ZP_WORD:4 14.666666666666666
|
||||
(byte*) main::cc#1 cc zp ZP_WORD:4 16.5
|
||||
(byte*) main::cc#4 cc zp ZP_WORD:4 16.5
|
||||
(byte*) main::cols
|
||||
(const byte*) main::cols#0 cols = (byte*) 55296
|
||||
(byte*) main::sc
|
||||
(byte*) main::sc#1 sc zp ZP_WORD:2 22.0
|
||||
(byte*) main::sc#2 sc zp ZP_WORD:2 14.666666666666666
|
||||
(byte*) main::sc#1 sc zp ZP_WORD:2 16.5
|
||||
(byte*) main::sc#4 sc zp ZP_WORD:2 16.5
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = (byte*) 1024
|
||||
|
||||
zp ZP_WORD:2 [ main::sc#2 main::sc#1 ]
|
||||
zp ZP_WORD:4 [ main::cc#2 main::cc#1 ]
|
||||
zp ZP_WORD:2 [ main::sc#4 main::sc#1 ]
|
||||
zp ZP_WORD:4 [ main::cc#4 main::cc#1 ]
|
||||
|
@ -28,30 +28,14 @@ main: {
|
||||
lda header,x
|
||||
cmp #0
|
||||
bne b3
|
||||
lda #<$400
|
||||
lda #'0'
|
||||
sta $400+$28
|
||||
lda #<$400+$28
|
||||
sta screen
|
||||
lda #>$400
|
||||
lda #>$400+$28
|
||||
sta screen+1
|
||||
ldx #0
|
||||
b4:
|
||||
cpx #9+1
|
||||
bcc b5
|
||||
rts
|
||||
b5:
|
||||
lda #$28
|
||||
clc
|
||||
adc screen
|
||||
sta screen
|
||||
bcc !+
|
||||
inc screen+1
|
||||
!:
|
||||
txa
|
||||
clc
|
||||
adc #'0'
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
cpx #5
|
||||
bcs b6
|
||||
b11:
|
||||
lda #'+'
|
||||
ldy #2
|
||||
sta (screen),y
|
||||
@ -81,7 +65,25 @@ main: {
|
||||
sta (screen),y
|
||||
b10:
|
||||
inx
|
||||
jmp b4
|
||||
cpx #9+1
|
||||
bcc b5
|
||||
rts
|
||||
b5:
|
||||
lda #$28
|
||||
clc
|
||||
adc screen
|
||||
sta screen
|
||||
bcc !+
|
||||
inc screen+1
|
||||
!:
|
||||
txa
|
||||
clc
|
||||
adc #'0'
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
cpx #5
|
||||
bcs b6
|
||||
jmp b11
|
||||
b3:
|
||||
lda header,x
|
||||
sta $400,x
|
||||
|
@ -19,52 +19,57 @@ main::@1: scope:[main] from main main::@1
|
||||
main::@2: scope:[main] from main::@1 main::@3
|
||||
[9] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@3/(byte) main::i#1 )
|
||||
[10] if(*((const byte[]) main::header#0 + (byte) main::i#2)!=(byte) 0) goto main::@3
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@10 main::@2
|
||||
[11] (byte*) main::screen#11 ← phi( main::@10/(byte*) main::screen#1 main::@2/(byte*) 1024 )
|
||||
[11] (byte) main::i1#10 ← phi( main::@10/(byte) main::i1#1 main::@2/(byte) 0 )
|
||||
[12] if((byte) main::i1#10<(byte) 9+(byte) 1) goto main::@5
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@4
|
||||
[13] return
|
||||
to:@return
|
||||
main::@5: scope:[main] from main::@4
|
||||
[14] (byte*) main::screen#1 ← (byte*) main::screen#11 + (byte) $28
|
||||
[15] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#10
|
||||
[16] *((byte*) main::screen#1) ← (byte~) main::$4
|
||||
[17] if((byte) main::i1#10>=(byte) 5) goto main::@6
|
||||
to:main::@10_1
|
||||
main::@10_1: scope:[main] from main::@2
|
||||
[11] *((byte*) 1024+(byte) $28) ← (byte) '0'
|
||||
to:main::@11
|
||||
main::@11: scope:[main] from main::@5
|
||||
[18] *((byte*) main::screen#1 + (byte) 2) ← (byte) '+'
|
||||
main::@11: scope:[main] from main::@10_1 main::@5
|
||||
[12] (byte*) main::screen#22 ← phi( main::@5/(byte*) main::screen#1 main::@10_1/(byte*) 1024+(byte) $28 )
|
||||
[12] (byte) main::i1#31 ← phi( main::@5/(byte) main::i1#1 main::@10_1/(byte) 0 )
|
||||
[13] *((byte*) main::screen#22 + (byte) 2) ← (byte) '+'
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@11 main::@5
|
||||
[19] if((byte) main::i1#10>=(byte) 5+(byte) 1) goto main::@7
|
||||
[14] (byte*) main::screen#19 ← phi( main::@5/(byte*) main::screen#1 main::@11/(byte*) main::screen#22 )
|
||||
[14] (byte) main::i1#26 ← phi( main::@5/(byte) main::i1#1 main::@11/(byte) main::i1#31 )
|
||||
[15] if((byte) main::i1#26>=(byte) 5+(byte) 1) goto main::@7
|
||||
to:main::@12
|
||||
main::@12: scope:[main] from main::@6
|
||||
[20] *((byte*) main::screen#1 + (byte) 5) ← (byte) '+'
|
||||
[16] *((byte*) main::screen#19 + (byte) 5) ← (byte) '+'
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@12 main::@6
|
||||
[21] if((byte) main::i1#10!=(byte) 5) goto main::@8
|
||||
[17] if((byte) main::i1#26!=(byte) 5) goto main::@8
|
||||
to:main::@13
|
||||
main::@13: scope:[main] from main::@7
|
||||
[22] *((byte*) main::screen#1 + (byte) 8) ← (byte) '+'
|
||||
[18] *((byte*) main::screen#19 + (byte) 8) ← (byte) '+'
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main::@13 main::@7
|
||||
[23] if((byte) main::i1#10<(byte) 5) goto main::@9
|
||||
[19] if((byte) main::i1#26<(byte) 5) goto main::@9
|
||||
to:main::@14
|
||||
main::@14: scope:[main] from main::@8
|
||||
[24] *((byte*) main::screen#1 + (byte) $b) ← (byte) '+'
|
||||
[20] *((byte*) main::screen#19 + (byte) $b) ← (byte) '+'
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@14 main::@8
|
||||
[25] if((byte) main::i1#10<(byte) 5+(byte) 1) goto main::@10
|
||||
[21] if((byte) main::i1#26<(byte) 5+(byte) 1) goto main::@10
|
||||
to:main::@15
|
||||
main::@15: scope:[main] from main::@9
|
||||
[26] *((byte*) main::screen#1 + (byte) $e) ← (byte) '+'
|
||||
[22] *((byte*) main::screen#19 + (byte) $e) ← (byte) '+'
|
||||
to:main::@10
|
||||
main::@10: scope:[main] from main::@15 main::@9
|
||||
[27] (byte) main::i1#1 ← ++ (byte) main::i1#10
|
||||
[23] (byte) main::i1#1 ← ++ (byte) main::i1#26
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@10
|
||||
[24] if((byte) main::i1#1<(byte) 9+(byte) 1) goto main::@5
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@4
|
||||
[25] return
|
||||
to:@return
|
||||
main::@5: scope:[main] from main::@4
|
||||
[26] (byte*) main::screen#1 ← (byte*) main::screen#19 + (byte) $28
|
||||
[27] (byte~) main::$4 ← (byte) '0' + (byte) main::i1#1
|
||||
[28] *((byte*) main::screen#1) ← (byte~) main::$4
|
||||
[29] if((byte) main::i1#1>=(byte) 5) goto main::@6
|
||||
to:main::@11
|
||||
main::@3: scope:[main] from main::@2
|
||||
[28] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2)
|
||||
[29] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[30] *((byte*) 1024 + (byte) main::i#2) ← *((const byte[]) main::header#0 + (byte) main::i#2)
|
||||
[31] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
to:main::@2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,10 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) main()
|
||||
(byte~) main::$4 reg byte a 22.0
|
||||
(byte~) main::$4 reg byte a 202.0
|
||||
(label) main::@1
|
||||
(label) main::@10
|
||||
(label) main::@10_1
|
||||
(label) main::@11
|
||||
(label) main::@12
|
||||
(label) main::@13
|
||||
@ -25,17 +26,19 @@
|
||||
(byte) main::i#1 reg byte x 22.0
|
||||
(byte) main::i#2 reg byte x 18.333333333333332
|
||||
(byte) main::i1
|
||||
(byte) main::i1#1 reg byte x 22.0
|
||||
(byte) main::i1#10 reg byte x 6.6
|
||||
(byte) main::i1#1 reg byte x 100.99999999999999
|
||||
(byte) main::i1#26 reg byte x 68.55555555555554
|
||||
(byte) main::i1#31 reg byte x 56.0
|
||||
(byte*) main::sc
|
||||
(byte*) main::sc#1 sc zp ZP_WORD:2 16.5
|
||||
(byte*) main::sc#2 sc zp ZP_WORD:2 16.5
|
||||
(byte*) main::screen
|
||||
(byte*) main::screen#1 screen zp ZP_WORD:4 6.285714285714286
|
||||
(byte*) main::screen#11 screen zp ZP_WORD:4 11.0
|
||||
(byte*) main::screen#1 screen zp ZP_WORD:4 101.0
|
||||
(byte*) main::screen#19 screen zp ZP_WORD:4 56.090909090909086
|
||||
(byte*) main::screen#22 screen zp ZP_WORD:4 61.5
|
||||
|
||||
zp ZP_WORD:2 [ main::sc#2 main::sc#1 ]
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte x [ main::i1#10 main::i1#1 ]
|
||||
zp ZP_WORD:4 [ main::screen#11 main::screen#1 ]
|
||||
reg byte x [ main::i1#26 main::i1#31 main::i1#1 ]
|
||||
zp ZP_WORD:4 [ main::screen#19 main::screen#22 main::screen#1 ]
|
||||
reg byte a [ main::$4 ]
|
||||
|
@ -109,8 +109,19 @@ main: {
|
||||
sta src
|
||||
lda #>SCREEN
|
||||
sta src+1
|
||||
b2:
|
||||
ldy #0
|
||||
lda (src),y
|
||||
sta (dst),y
|
||||
inc src
|
||||
bne !+
|
||||
inc src+1
|
||||
!:
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// Copy screen to screen copy
|
||||
b1:
|
||||
lda src+1
|
||||
cmp #>SCREEN+$3e8
|
||||
bne b2
|
||||
@ -153,7 +164,7 @@ main: {
|
||||
bne b3
|
||||
jsr initSprites
|
||||
jsr setupRasterIrq
|
||||
b4:
|
||||
b1:
|
||||
// Main loop
|
||||
jsr getCharToProcess
|
||||
ldy getCharToProcess.return_x
|
||||
@ -170,19 +181,6 @@ main: {
|
||||
b6:
|
||||
sty startProcessing.center_x
|
||||
jsr startProcessing
|
||||
jmp b4
|
||||
b2:
|
||||
ldy #0
|
||||
lda (src),y
|
||||
sta (dst),y
|
||||
inc src
|
||||
bne !+
|
||||
inc src+1
|
||||
!:
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
jmp b1
|
||||
}
|
||||
// Start processing a char - by inserting it into the PROCESSING array
|
||||
@ -621,8 +619,15 @@ initSprites: {
|
||||
sta sp
|
||||
lda #>SPRITE_DATA
|
||||
sta sp+1
|
||||
b2:
|
||||
lda #0
|
||||
tay
|
||||
sta (sp),y
|
||||
inc sp
|
||||
bne !+
|
||||
inc sp+1
|
||||
!:
|
||||
// Clear sprite data
|
||||
b1:
|
||||
lda sp+1
|
||||
cmp #>SPRITE_DATA+NUM_PROCESSING*$40
|
||||
bcc b2
|
||||
@ -644,15 +649,6 @@ initSprites: {
|
||||
sta SPRITES_EXPAND_X
|
||||
sta SPRITES_EXPAND_Y
|
||||
rts
|
||||
b2:
|
||||
lda #0
|
||||
tay
|
||||
sta (sp),y
|
||||
inc sp
|
||||
bne !+
|
||||
inc sp+1
|
||||
!:
|
||||
jmp b1
|
||||
}
|
||||
// Populates 1000 bytes (a screen) with values representing the angle to the center.
|
||||
// Utilizes symmetry around the center
|
||||
@ -690,29 +686,6 @@ init_angle_screen: {
|
||||
sta xb
|
||||
lda #0
|
||||
sta x
|
||||
b2:
|
||||
lda x
|
||||
cmp #$13+1
|
||||
bcc b3
|
||||
lda screen_topline
|
||||
sec
|
||||
sbc #<$28
|
||||
sta screen_topline
|
||||
lda screen_topline+1
|
||||
sbc #>$28
|
||||
sta screen_topline+1
|
||||
lda #$28
|
||||
clc
|
||||
adc screen_bottomline
|
||||
sta screen_bottomline
|
||||
bcc !+
|
||||
inc screen_bottomline+1
|
||||
!:
|
||||
inc y
|
||||
lda #$d
|
||||
cmp y
|
||||
bne b1
|
||||
rts
|
||||
b3:
|
||||
lda x
|
||||
asl
|
||||
@ -753,7 +726,28 @@ init_angle_screen: {
|
||||
sta (screen_bottomline),y
|
||||
inc x
|
||||
dec xb
|
||||
jmp b2
|
||||
lda x
|
||||
cmp #$13+1
|
||||
bcc b3
|
||||
lda screen_topline
|
||||
sec
|
||||
sbc #<$28
|
||||
sta screen_topline
|
||||
lda screen_topline+1
|
||||
sbc #>$28
|
||||
sta screen_topline+1
|
||||
lda #$28
|
||||
clc
|
||||
adc screen_bottomline
|
||||
sta screen_bottomline
|
||||
bcc !+
|
||||
inc screen_bottomline+1
|
||||
!:
|
||||
inc y
|
||||
lda #$d
|
||||
cmp y
|
||||
bne b1
|
||||
rts
|
||||
}
|
||||
// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
|
||||
// Finding the angle requires a binary search using CORDIC_ITERATIONS_16
|
||||
|
@ -24,68 +24,68 @@ main: scope:[main] from @2
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main
|
||||
[11] (byte*) main::dst#0 ← (byte*)(void*) SCREEN_COPY#0
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1 main::@9
|
||||
[12] (byte*) main::dst#4 ← phi( main::@1/(byte*) main::dst#1 main::@9/(byte*) main::dst#0 )
|
||||
[12] (byte*) main::src#4 ← phi( main::@1/(byte*) main::src#1 main::@9/(const byte*) SCREEN#0 )
|
||||
[13] *((byte*) main::dst#4) ← *((byte*) main::src#4)
|
||||
[14] (byte*) main::src#1 ← ++ (byte*) main::src#4
|
||||
[15] (byte*) main::dst#1 ← ++ (byte*) main::dst#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@2 main::@9
|
||||
[12] (byte*) main::dst#2 ← phi( main::@9/(byte*) main::dst#0 main::@2/(byte*) main::dst#1 )
|
||||
[12] (byte*) main::src#2 ← phi( main::@9/(const byte*) SCREEN#0 main::@2/(byte*) main::src#1 )
|
||||
[13] if((byte*) main::src#2!=(const byte*) SCREEN#0+(word) $3e8) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[16] if((byte*) main::src#1!=(const byte*) SCREEN#0+(word) $3e8) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@3
|
||||
[14] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@3/(byte) main::i#1 )
|
||||
[15] (byte) main::$26 ← (byte) main::i#2 << (byte) 1
|
||||
[16] (byte) main::$27 ← (byte) main::$26 + (byte) main::i#2
|
||||
[17] (byte) main::$28 ← (byte) main::$27 << (byte) 1
|
||||
[18] (byte) main::$29 ← (byte) main::$28 + (byte) main::i#2
|
||||
[19] (byte~) main::$16 ← (byte) main::$29 << (byte) 1
|
||||
[20] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0 + (byte~) main::$16) ← (byte) 0
|
||||
[21] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y + (byte~) main::$16) ← (byte) 0
|
||||
[22] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX + (byte~) main::$16) ← (byte) 0
|
||||
[23] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY + (byte~) main::$16) ← (byte) 0
|
||||
[24] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID + (byte~) main::$16) ← (byte) 0
|
||||
[25] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR + (byte~) main::$16) ← (byte) 0
|
||||
[26] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL + (byte~) main::$16) ← (byte) 0
|
||||
[27] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS + (byte~) main::$16) ← (const byte) STATUS_FREE
|
||||
[28] *((byte**)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR + (byte~) main::$16) ← (byte*) 0
|
||||
[29] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[30] if((byte) main::i#1!=(const byte) NUM_PROCESSING#0-(byte) 1+(byte) 1) goto main::@3
|
||||
[17] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@3/(byte) main::i#1 )
|
||||
[18] (byte) main::$26 ← (byte) main::i#2 << (byte) 1
|
||||
[19] (byte) main::$27 ← (byte) main::$26 + (byte) main::i#2
|
||||
[20] (byte) main::$28 ← (byte) main::$27 << (byte) 1
|
||||
[21] (byte) main::$29 ← (byte) main::$28 + (byte) main::i#2
|
||||
[22] (byte~) main::$16 ← (byte) main::$29 << (byte) 1
|
||||
[23] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0 + (byte~) main::$16) ← (byte) 0
|
||||
[24] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y + (byte~) main::$16) ← (byte) 0
|
||||
[25] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX + (byte~) main::$16) ← (byte) 0
|
||||
[26] *((word*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VY + (byte~) main::$16) ← (byte) 0
|
||||
[27] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID + (byte~) main::$16) ← (byte) 0
|
||||
[28] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR + (byte~) main::$16) ← (byte) 0
|
||||
[29] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL + (byte~) main::$16) ← (byte) 0
|
||||
[30] *((byte*)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS + (byte~) main::$16) ← (const byte) STATUS_FREE
|
||||
[31] *((byte**)(const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR + (byte~) main::$16) ← (byte*) 0
|
||||
[32] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[33] if((byte) main::i#1!=(const byte) NUM_PROCESSING#0-(byte) 1+(byte) 1) goto main::@3
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3
|
||||
[31] phi()
|
||||
[32] call initSprites
|
||||
[34] phi()
|
||||
[35] call initSprites
|
||||
to:main::@10
|
||||
main::@10: scope:[main] from main::@4
|
||||
[33] phi()
|
||||
[34] call setupRasterIrq
|
||||
[36] phi()
|
||||
[37] call setupRasterIrq
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@10 main::@6
|
||||
[35] phi()
|
||||
[36] call getCharToProcess
|
||||
[37] (byte) getCharToProcess::return_x#0 ← (byte) getCharToProcess::return_x#1
|
||||
[38] (byte) getCharToProcess::return_y#0 ← (byte) getCharToProcess::return_y#1
|
||||
[39] (byte) getCharToProcess::return_dist#0 ← (byte) getCharToProcess::return_dist#1
|
||||
[38] phi()
|
||||
[39] call getCharToProcess
|
||||
[40] (byte) getCharToProcess::return_x#0 ← (byte) getCharToProcess::return_x#1
|
||||
[41] (byte) getCharToProcess::return_y#0 ← (byte) getCharToProcess::return_y#1
|
||||
[42] (byte) getCharToProcess::return_dist#0 ← (byte) getCharToProcess::return_dist#1
|
||||
to:main::@11
|
||||
main::@11: scope:[main] from main::@5
|
||||
[40] (byte) main::center_x#0 ← (byte) getCharToProcess::return_x#0
|
||||
[41] (byte) main::center_y#0 ← (byte) getCharToProcess::return_y#0
|
||||
[42] (byte) main::center_dist#0 ← (byte) getCharToProcess::return_dist#0
|
||||
[43] if((byte) main::center_dist#0!=(const byte) NOT_FOUND#0) goto main::@6
|
||||
[43] (byte) main::center_x#0 ← (byte) getCharToProcess::return_x#0
|
||||
[44] (byte) main::center_y#0 ← (byte) getCharToProcess::return_y#0
|
||||
[45] (byte) main::center_dist#0 ← (byte) getCharToProcess::return_dist#0
|
||||
[46] if((byte) main::center_dist#0!=(const byte) NOT_FOUND#0) goto main::@6
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@11
|
||||
[44] *((const byte*) SCREEN#0+(word) $3e7) ← (byte) '.'
|
||||
[47] *((const byte*) SCREEN#0+(word) $3e7) ← (byte) '.'
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main::@7 main::@8
|
||||
[45] *((const byte*) COLS#0+(word) $3e7) ← ++ *((const byte*) COLS#0+(word) $3e7)
|
||||
[48] *((const byte*) COLS#0+(word) $3e7) ← ++ *((const byte*) COLS#0+(word) $3e7)
|
||||
to:main::@8
|
||||
main::@6: scope:[main] from main::@11
|
||||
[46] (byte) startProcessing::center_x#0 ← (byte) main::center_x#0
|
||||
[47] (byte) startProcessing::center_y#0 ← (byte) main::center_y#0
|
||||
[48] call startProcessing
|
||||
[49] (byte) startProcessing::center_x#0 ← (byte) main::center_x#0
|
||||
[50] (byte) startProcessing::center_y#0 ← (byte) main::center_y#0
|
||||
[51] call startProcessing
|
||||
to:main::@5
|
||||
main::@2: scope:[main] from main::@1
|
||||
[49] *((byte*) main::dst#2) ← *((byte*) main::src#2)
|
||||
[50] (byte*) main::src#1 ← ++ (byte*) main::src#2
|
||||
[51] (byte*) main::dst#1 ← ++ (byte*) main::dst#2
|
||||
to:main::@1
|
||||
startProcessing: scope:[startProcessing] from main::@6
|
||||
[52] phi()
|
||||
to:startProcessing::@1
|
||||
@ -262,29 +262,29 @@ setupRasterIrq::@return: scope:[setupRasterIrq] from setupRasterIrq::@2
|
||||
to:@return
|
||||
initSprites: scope:[initSprites] from main::@4
|
||||
[156] phi()
|
||||
to:initSprites::@2
|
||||
initSprites::@2: scope:[initSprites] from initSprites initSprites::@1
|
||||
[157] (byte*) initSprites::sp#4 ← phi( initSprites::@1/(byte*) initSprites::sp#1 initSprites/(const byte*) SPRITE_DATA#0 )
|
||||
[158] *((byte*) initSprites::sp#4) ← (byte) 0
|
||||
[159] (byte*) initSprites::sp#1 ← ++ (byte*) initSprites::sp#4
|
||||
to:initSprites::@1
|
||||
initSprites::@1: scope:[initSprites] from initSprites initSprites::@2
|
||||
[157] (byte*) initSprites::sp#2 ← phi( initSprites/(const byte*) SPRITE_DATA#0 initSprites::@2/(byte*) initSprites::sp#1 )
|
||||
[158] if((byte*) initSprites::sp#2<(const byte*) SPRITE_DATA#0+(const byte) NUM_PROCESSING#0*(byte) $40) goto initSprites::@2
|
||||
initSprites::@1: scope:[initSprites] from initSprites::@2
|
||||
[160] if((byte*) initSprites::sp#1<(const byte*) SPRITE_DATA#0+(const byte) NUM_PROCESSING#0*(byte) $40) goto initSprites::@2
|
||||
to:initSprites::@3
|
||||
initSprites::@3: scope:[initSprites] from initSprites::@1 initSprites::@3
|
||||
[159] (byte) initSprites::i#2 ← phi( initSprites::@1/(byte) 0 initSprites::@3/(byte) initSprites::i#1 )
|
||||
[160] *((const byte*) SPRITES_COLS#0 + (byte) initSprites::i#2) ← (const byte) LIGHT_BLUE#0
|
||||
[161] (byte) initSprites::i#1 ← ++ (byte) initSprites::i#2
|
||||
[162] if((byte) initSprites::i#1!=(byte) 8) goto initSprites::@3
|
||||
[161] (byte) initSprites::i#2 ← phi( initSprites::@1/(byte) 0 initSprites::@3/(byte) initSprites::i#1 )
|
||||
[162] *((const byte*) SPRITES_COLS#0 + (byte) initSprites::i#2) ← (const byte) LIGHT_BLUE#0
|
||||
[163] (byte) initSprites::i#1 ← ++ (byte) initSprites::i#2
|
||||
[164] if((byte) initSprites::i#1!=(byte) 8) goto initSprites::@3
|
||||
to:initSprites::@4
|
||||
initSprites::@4: scope:[initSprites] from initSprites::@3
|
||||
[163] *((const byte*) SPRITES_MC#0) ← (byte) 0
|
||||
[164] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0
|
||||
[165] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0
|
||||
[165] *((const byte*) SPRITES_MC#0) ← (byte) 0
|
||||
[166] *((const byte*) SPRITES_EXPAND_X#0) ← (byte) 0
|
||||
[167] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte) 0
|
||||
to:initSprites::@return
|
||||
initSprites::@return: scope:[initSprites] from initSprites::@4
|
||||
[166] return
|
||||
[168] return
|
||||
to:@return
|
||||
initSprites::@2: scope:[initSprites] from initSprites::@1
|
||||
[167] *((byte*) initSprites::sp#2) ← (byte) 0
|
||||
[168] (byte*) initSprites::sp#1 ← ++ (byte*) initSprites::sp#2
|
||||
to:initSprites::@1
|
||||
init_angle_screen: scope:[init_angle_screen] from main
|
||||
[169] (byte*) init_angle_screen::screen_topline#0 ← (byte*) init_angle_screen::screen#0 + (word)(number) $28*(number) $c
|
||||
[170] (byte*) init_angle_screen::screen_bottomline#0 ← (byte*) init_angle_screen::screen#0 + (word)(number) $28*(number) $c
|
||||
@ -293,46 +293,46 @@ init_angle_screen::@1: scope:[init_angle_screen] from init_angle_screen init_an
|
||||
[171] (byte*) init_angle_screen::screen_bottomline#6 ← phi( init_angle_screen/(byte*) init_angle_screen::screen_bottomline#0 init_angle_screen::@4/(byte*) init_angle_screen::screen_bottomline#1 )
|
||||
[171] (byte*) init_angle_screen::screen_topline#6 ← phi( init_angle_screen/(byte*) init_angle_screen::screen_topline#0 init_angle_screen::@4/(byte*) init_angle_screen::screen_topline#1 )
|
||||
[171] (byte) init_angle_screen::y#5 ← phi( init_angle_screen/(byte) 0 init_angle_screen::@4/(byte) init_angle_screen::y#1 )
|
||||
to:init_angle_screen::@2
|
||||
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@5
|
||||
[172] (byte) init_angle_screen::xb#2 ← phi( init_angle_screen::@1/(byte) $27 init_angle_screen::@5/(byte) init_angle_screen::xb#1 )
|
||||
[172] (byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(byte) 0 init_angle_screen::@5/(byte) init_angle_screen::x#1 )
|
||||
[173] if((byte) init_angle_screen::x#2<(byte) $13+(byte) 1) goto init_angle_screen::@3
|
||||
to:init_angle_screen::@4
|
||||
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
|
||||
[174] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#6 - (byte) $28
|
||||
[175] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#6 + (byte) $28
|
||||
[176] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#5
|
||||
[177] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
|
||||
to:init_angle_screen::@return
|
||||
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@4
|
||||
[178] return
|
||||
to:@return
|
||||
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@2
|
||||
[179] (byte~) init_angle_screen::$3 ← (byte) init_angle_screen::x#2 << (byte) 1
|
||||
[180] (byte~) init_angle_screen::$4 ← (byte) $27 - (byte~) init_angle_screen::$3
|
||||
[181] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$4 w= (byte) 0
|
||||
[182] (byte~) init_angle_screen::$7 ← (byte) init_angle_screen::y#5 << (byte) 1
|
||||
[183] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$7 w= (byte) 0
|
||||
[184] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
|
||||
[185] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
|
||||
[186] call atan2_16
|
||||
[187] (word) atan2_16::return#2 ← (word) atan2_16::return#0
|
||||
to:init_angle_screen::@3
|
||||
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@2
|
||||
[172] (byte) init_angle_screen::xb#5 ← phi( init_angle_screen::@2/(byte) init_angle_screen::xb#1 init_angle_screen::@1/(byte) $27 )
|
||||
[172] (byte) init_angle_screen::x#5 ← phi( init_angle_screen::@2/(byte) init_angle_screen::x#1 init_angle_screen::@1/(byte) 0 )
|
||||
[173] (byte~) init_angle_screen::$3 ← (byte) init_angle_screen::x#5 << (byte) 1
|
||||
[174] (byte~) init_angle_screen::$4 ← (byte) $27 - (byte~) init_angle_screen::$3
|
||||
[175] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$4 w= (byte) 0
|
||||
[176] (byte~) init_angle_screen::$7 ← (byte) init_angle_screen::y#5 << (byte) 1
|
||||
[177] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$7 w= (byte) 0
|
||||
[178] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
|
||||
[179] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
|
||||
[180] call atan2_16
|
||||
[181] (word) atan2_16::return#2 ← (word) atan2_16::return#0
|
||||
to:init_angle_screen::@5
|
||||
init_angle_screen::@5: scope:[init_angle_screen] from init_angle_screen::@3
|
||||
[188] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
|
||||
[189] (word~) init_angle_screen::$11 ← (word) init_angle_screen::angle_w#0 + (byte) $80
|
||||
[190] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$11
|
||||
[191] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0
|
||||
[192] (byte~) init_angle_screen::$13 ← - (byte) init_angle_screen::ang_w#0
|
||||
[193] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$13
|
||||
[194] (byte~) init_angle_screen::$14 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
|
||||
[195] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$14
|
||||
[196] (byte~) init_angle_screen::$15 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
|
||||
[197] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$15
|
||||
[198] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2
|
||||
[199] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2
|
||||
[182] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
|
||||
[183] (word~) init_angle_screen::$11 ← (word) init_angle_screen::angle_w#0 + (byte) $80
|
||||
[184] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$11
|
||||
[185] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::xb#5) ← (byte) init_angle_screen::ang_w#0
|
||||
[186] (byte~) init_angle_screen::$13 ← - (byte) init_angle_screen::ang_w#0
|
||||
[187] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::xb#5) ← (byte~) init_angle_screen::$13
|
||||
[188] (byte~) init_angle_screen::$14 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
|
||||
[189] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::x#5) ← (byte~) init_angle_screen::$14
|
||||
[190] (byte~) init_angle_screen::$15 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
|
||||
[191] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::x#5) ← (byte~) init_angle_screen::$15
|
||||
[192] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#5
|
||||
[193] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#5
|
||||
to:init_angle_screen::@2
|
||||
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@5
|
||||
[194] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@3
|
||||
to:init_angle_screen::@4
|
||||
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
|
||||
[195] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#6 - (byte) $28
|
||||
[196] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#6 + (byte) $28
|
||||
[197] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#5
|
||||
[198] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
|
||||
to:init_angle_screen::@return
|
||||
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@4
|
||||
[199] return
|
||||
to:@return
|
||||
atan2_16: scope:[atan2_16] from init_angle_screen::@3
|
||||
[200] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1
|
||||
to:atan2_16::@2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -288,8 +288,8 @@
|
||||
(byte) initSprites::i#1 reg byte x 16.5
|
||||
(byte) initSprites::i#2 reg byte x 16.5
|
||||
(byte*) initSprites::sp
|
||||
(byte*) initSprites::sp#1 sp zp ZP_WORD:28 22.0
|
||||
(byte*) initSprites::sp#2 sp zp ZP_WORD:28 14.666666666666666
|
||||
(byte*) initSprites::sp#1 sp zp ZP_WORD:28 16.5
|
||||
(byte*) initSprites::sp#4 sp zp ZP_WORD:28 16.5
|
||||
(void()) init_angle_screen((byte*) init_angle_screen::screen)
|
||||
(word~) init_angle_screen::$11 $11 zp ZP_WORD:16 202.0
|
||||
(byte~) init_angle_screen::$13 reg byte a 202.0
|
||||
@ -313,17 +313,17 @@
|
||||
(byte*) init_angle_screen::screen_bottomline
|
||||
(byte*) init_angle_screen::screen_bottomline#0 screen_bottomline zp ZP_WORD:24 4.0
|
||||
(byte*) init_angle_screen::screen_bottomline#1 screen_bottomline zp ZP_WORD:24 7.333333333333333
|
||||
(byte*) init_angle_screen::screen_bottomline#6 screen_bottomline zp ZP_WORD:24 9.04
|
||||
(byte*) init_angle_screen::screen_bottomline#6 screen_bottomline zp ZP_WORD:24 9.040000000000001
|
||||
(byte*) init_angle_screen::screen_topline
|
||||
(byte*) init_angle_screen::screen_topline#0 screen_topline zp ZP_WORD:3 2.0
|
||||
(byte*) init_angle_screen::screen_topline#1 screen_topline zp ZP_WORD:3 5.5
|
||||
(byte*) init_angle_screen::screen_topline#6 screen_topline zp ZP_WORD:3 9.416666666666666
|
||||
(byte) init_angle_screen::x
|
||||
(byte) init_angle_screen::x#1 x zp ZP_BYTE:18 101.0
|
||||
(byte) init_angle_screen::x#2 x zp ZP_BYTE:18 28.857142857142858
|
||||
(byte) init_angle_screen::x#5 x zp ZP_BYTE:18 25.25
|
||||
(byte) init_angle_screen::xb
|
||||
(byte) init_angle_screen::xb#1 xb zp ZP_BYTE:23 202.0
|
||||
(byte) init_angle_screen::xb#2 xb zp ZP_BYTE:23 18.363636363636363
|
||||
(byte) init_angle_screen::xb#1 xb zp ZP_BYTE:23 101.0
|
||||
(byte) init_angle_screen::xb#5 xb zp ZP_BYTE:23 19.238095238095237
|
||||
(signed word) init_angle_screen::xw
|
||||
(word) init_angle_screen::xw#0 xw zp ZP_WORD:26 33.666666666666664
|
||||
(byte) init_angle_screen::y
|
||||
@ -367,14 +367,14 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
|
||||
(byte) main::center_y#0 center_y zp ZP_BYTE:11 5.5
|
||||
(byte*) main::dst
|
||||
(byte*) main::dst#0 dst zp ZP_WORD:3 4.0
|
||||
(byte*) main::dst#1 dst zp ZP_WORD:3 22.0
|
||||
(byte*) main::dst#2 dst zp ZP_WORD:3 8.75
|
||||
(byte*) main::dst#1 dst zp ZP_WORD:3 11.0
|
||||
(byte*) main::dst#4 dst zp ZP_WORD:3 11.666666666666666
|
||||
(byte) main::i
|
||||
(byte) main::i#1 i zp ZP_BYTE:2 16.5
|
||||
(byte) main::i#2 i zp ZP_BYTE:2 3.6666666666666665
|
||||
(byte*) main::src
|
||||
(byte*) main::src#1 src zp ZP_WORD:28 11.0
|
||||
(byte*) main::src#2 src zp ZP_WORD:28 14.666666666666666
|
||||
(byte*) main::src#4 src zp ZP_WORD:28 16.5
|
||||
(void*()) malloc((word) malloc::size)
|
||||
(label) malloc::@return
|
||||
(byte*) malloc::mem
|
||||
@ -525,7 +525,7 @@ reg byte y [ getCharToProcess::x#2 getCharToProcess::x#1 ]
|
||||
reg byte x [ getCharToProcess::return_dist#1 getCharToProcess::return_dist#5 getCharToProcess::return_dist#6 getCharToProcess::dist#0 ]
|
||||
reg byte x [ initSprites::i#2 initSprites::i#1 ]
|
||||
zp ZP_BYTE:2 [ init_angle_screen::y#5 init_angle_screen::y#1 getCharToProcess::y#7 getCharToProcess::y#1 startProcessing::freeIdx#2 startProcessing::freeIdx#8 startProcessing::i#2 startProcessing::i#1 main::i#2 main::i#1 ]
|
||||
zp ZP_WORD:3 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#0 init_angle_screen::screen_topline#1 getCharToProcess::dist_line#6 getCharToProcess::dist_line#0 getCharToProcess::dist_line#1 startProcessing::spriteData#2 startProcessing::spriteData#0 startProcessing::spriteData#1 startProcessing::$6 startProcessing::$5 main::dst#2 main::dst#0 main::dst#1 ]
|
||||
zp ZP_WORD:3 [ init_angle_screen::screen_topline#6 init_angle_screen::screen_topline#0 init_angle_screen::screen_topline#1 getCharToProcess::dist_line#6 getCharToProcess::dist_line#0 getCharToProcess::dist_line#1 startProcessing::spriteData#2 startProcessing::spriteData#0 startProcessing::spriteData#1 startProcessing::$6 startProcessing::$5 main::dst#4 main::dst#1 main::dst#0 ]
|
||||
reg byte x [ atan2_16::i#2 atan2_16::i#1 ]
|
||||
reg byte y [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ]
|
||||
zp ZP_BYTE:5 [ processChars::i#10 processChars::i#1 ]
|
||||
@ -551,11 +551,11 @@ reg byte a [ startProcessing::$30 ]
|
||||
zp ZP_WORD:12 [ startProcessing::$0 startProcessing::$48 startProcessing::$1 startProcessing::offset#0 startProcessing::screenPtr#0 atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
|
||||
zp ZP_WORD:14 [ startProcessing::$47 atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
|
||||
zp ZP_WORD:16 [ startProcessing::colPtr#0 atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$11 ]
|
||||
zp ZP_BYTE:18 [ startProcessing::spriteCol#0 init_angle_screen::x#2 init_angle_screen::x#1 getCharToProcess::closest_dist#2 getCharToProcess::closest_dist#8 getCharToProcess::closest_dist#10 getCharToProcess::closest_dist#12 ]
|
||||
zp ZP_BYTE:18 [ startProcessing::spriteCol#0 init_angle_screen::x#5 init_angle_screen::x#1 getCharToProcess::closest_dist#2 getCharToProcess::closest_dist#8 getCharToProcess::closest_dist#10 getCharToProcess::closest_dist#12 ]
|
||||
reg byte a [ startProcessing::ch#0 ]
|
||||
zp ZP_WORD:19 [ startProcessing::$11 startProcessing::$12 startProcessing::$13 startProcessing::spriteX#0 atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ]
|
||||
zp ZP_WORD:21 [ startProcessing::$15 startProcessing::$16 startProcessing::$17 startProcessing::spriteY#0 atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
|
||||
zp ZP_BYTE:23 [ startProcessing::spritePtr#0 init_angle_screen::xb#2 init_angle_screen::xb#1 getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ]
|
||||
zp ZP_BYTE:23 [ startProcessing::spritePtr#0 init_angle_screen::xb#5 init_angle_screen::xb#1 getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ]
|
||||
reg byte a [ startProcessing::$22 ]
|
||||
reg byte a [ startProcessing::$50 ]
|
||||
reg byte a [ startProcessing::$51 ]
|
||||
@ -567,7 +567,7 @@ reg byte a [ init_angle_screen::$3 ]
|
||||
reg byte a [ init_angle_screen::$4 ]
|
||||
zp ZP_WORD:26 [ init_angle_screen::xw#0 atan2_16::x#0 getCharToProcess::$12 ]
|
||||
reg byte a [ init_angle_screen::$7 ]
|
||||
zp ZP_WORD:28 [ init_angle_screen::yw#0 atan2_16::y#0 initSprites::sp#2 initSprites::sp#1 getCharToProcess::screen_line#4 getCharToProcess::screen_line#0 getCharToProcess::screen_line#1 startProcessing::chargenData#2 startProcessing::chargenData#0 startProcessing::chargenData#1 startProcessing::$9 startProcessing::$8 main::src#2 main::src#1 ]
|
||||
zp ZP_WORD:28 [ init_angle_screen::yw#0 atan2_16::y#0 initSprites::sp#4 initSprites::sp#1 getCharToProcess::screen_line#4 getCharToProcess::screen_line#0 getCharToProcess::screen_line#1 startProcessing::chargenData#2 startProcessing::chargenData#0 startProcessing::chargenData#1 startProcessing::$9 startProcessing::$8 main::src#4 main::src#1 ]
|
||||
zp ZP_BYTE:30 [ init_angle_screen::ang_w#0 startProcessing::center_x#0 ]
|
||||
reg byte a [ init_angle_screen::$13 ]
|
||||
reg byte a [ init_angle_screen::$14 ]
|
||||
|
@ -878,18 +878,13 @@ play_spawn_current: {
|
||||
lda #1
|
||||
sta game_over
|
||||
b1:
|
||||
lda #7
|
||||
sta piece_idx
|
||||
b2:
|
||||
lda #7
|
||||
cmp piece_idx
|
||||
beq sid_rnd1
|
||||
rts
|
||||
sid_rnd1:
|
||||
lda SID_VOICE3_OSC
|
||||
and #7
|
||||
sta piece_idx
|
||||
jmp b2
|
||||
lda #7
|
||||
cmp piece_idx
|
||||
beq b1
|
||||
rts
|
||||
}
|
||||
// Update the score based on the number of lines removed
|
||||
// play_update_score(byte register(X) removed)
|
||||
|
@ -93,7 +93,7 @@ main::@15: scope:[main] from main::@14
|
||||
[35] call render_moving
|
||||
to:main::@16
|
||||
main::@16: scope:[main] from main::@15
|
||||
[36] (byte~) next_piece_idx#77 ← (byte) play_spawn_current::piece_idx#2
|
||||
[36] (byte~) next_piece_idx#77 ← (byte) play_spawn_current::piece_idx#1
|
||||
[37] call render_next
|
||||
to:main::@17
|
||||
main::@17: scope:[main] from main::@16
|
||||
@ -108,7 +108,7 @@ main::@1: scope:[main] from main::@17 main::@25 main::@6
|
||||
[40] (byte) current_movedown_counter#16 ← phi( main::@6/(byte) current_movedown_counter#14 main::@17/(byte) 0 main::@25/(byte) current_movedown_counter#14 )
|
||||
[40] (byte) keyboard_events_size#19 ← phi( main::@6/(byte) keyboard_events_size#16 main::@17/(byte) 0 main::@25/(byte) keyboard_events_size#16 )
|
||||
[40] (byte) render_screen_showing#13 ← phi( main::@6/(byte) render_screen_showing#1 main::@17/(byte) render_screen_showing#0 main::@25/(byte) render_screen_showing#1 )
|
||||
[40] (byte) next_piece_idx#10 ← phi( main::@6/(byte) next_piece_idx#16 main::@17/(byte) play_spawn_current::piece_idx#2 main::@25/(byte) next_piece_idx#16 )
|
||||
[40] (byte) next_piece_idx#10 ← phi( main::@6/(byte) next_piece_idx#16 main::@17/(byte) play_spawn_current::piece_idx#1 main::@25/(byte) next_piece_idx#16 )
|
||||
[40] (byte) game_over#10 ← phi( main::@6/(byte) game_over#15 main::@17/(byte) game_over#52 main::@25/(byte) game_over#15 )
|
||||
[40] (byte) current_ypos#11 ← phi( main::@6/(byte) current_ypos#19 main::@17/(byte) current_ypos#6 main::@25/(byte) current_ypos#19 )
|
||||
[40] (byte) current_xpos#14 ← phi( main::@6/(byte) current_xpos#19 main::@17/(byte) current_xpos#100 main::@25/(byte) current_xpos#19 )
|
||||
@ -603,7 +603,7 @@ play_move_down::@17: scope:[play_move_down] from play_move_down::@16
|
||||
[282] (byte*~) current_piece_gfx#117 ← (byte*)*((const word[]) PIECES#0 + (byte~) play_spawn_current::$7)
|
||||
to:play_move_down::@11
|
||||
play_move_down::@11: scope:[play_move_down] from play_move_down::@10 play_move_down::@17
|
||||
[283] (byte) next_piece_idx#30 ← phi( play_move_down::@10/(byte) next_piece_idx#10 play_move_down::@17/(byte) play_spawn_current::piece_idx#2 )
|
||||
[283] (byte) next_piece_idx#30 ← phi( play_move_down::@10/(byte) next_piece_idx#10 play_move_down::@17/(byte) play_spawn_current::piece_idx#1 )
|
||||
[283] (byte) game_over#27 ← phi( play_move_down::@10/(byte) game_over#10 play_move_down::@17/(byte) game_over#52 )
|
||||
[283] (byte) current_xpos#43 ← phi( play_move_down::@10/(byte) current_xpos#14 play_move_down::@17/(byte) current_xpos#100 )
|
||||
[283] (byte*) current_piece_gfx#35 ← phi( play_move_down::@10/(byte*) current_piece_gfx#13 play_move_down::@17/(byte*~) current_piece_gfx#117 )
|
||||
@ -640,7 +640,7 @@ play_move_down::@10: scope:[play_move_down] from play_move_down::@13
|
||||
to:play_move_down::@11
|
||||
play_spawn_current: scope:[play_spawn_current] from main::@12 main::@13 play_move_down::@16
|
||||
[287] (byte) game_over#65 ← phi( main::@12/(byte) 0 main::@13/(byte) game_over#52 play_move_down::@16/(byte) game_over#10 )
|
||||
[287] (byte) next_piece_idx#17 ← phi( main::@12/(byte) 0 main::@13/(byte) play_spawn_current::piece_idx#2 play_move_down::@16/(byte) next_piece_idx#10 )
|
||||
[287] (byte) next_piece_idx#17 ← phi( main::@12/(byte) 0 main::@13/(byte) play_spawn_current::piece_idx#1 play_move_down::@16/(byte) next_piece_idx#10 )
|
||||
[288] (byte) play_spawn_current::current_piece_idx#0 ← (byte) next_piece_idx#17
|
||||
[289] (byte~) play_spawn_current::$7 ← (byte) play_spawn_current::current_piece_idx#0 << (byte) 1
|
||||
[290] (byte) current_piece_char#5 ← *((const byte[]) PIECES_CHARS#0 + (byte) play_spawn_current::current_piece_idx#0)
|
||||
@ -661,563 +661,562 @@ play_spawn_current::@5: scope:[play_spawn_current] from play_spawn_current::@4
|
||||
to:play_spawn_current::@1
|
||||
play_spawn_current::@1: scope:[play_spawn_current] from play_spawn_current::@4 play_spawn_current::@5
|
||||
[301] (byte) game_over#52 ← phi( play_spawn_current::@5/(byte) game_over#65 play_spawn_current::@4/(byte) 1 )
|
||||
to:play_spawn_current::@2
|
||||
play_spawn_current::@2: scope:[play_spawn_current] from play_spawn_current::@1 play_spawn_current::@3
|
||||
[302] (byte) play_spawn_current::piece_idx#2 ← phi( play_spawn_current::@1/(byte) 7 play_spawn_current::@3/(byte) play_spawn_current::piece_idx#1 )
|
||||
[303] if((byte) play_spawn_current::piece_idx#2==(byte) 7) goto play_spawn_current::sid_rnd1
|
||||
to:play_spawn_current::@return
|
||||
play_spawn_current::@return: scope:[play_spawn_current] from play_spawn_current::@2
|
||||
[304] return
|
||||
to:@return
|
||||
play_spawn_current::sid_rnd1: scope:[play_spawn_current] from play_spawn_current::@2
|
||||
[305] (byte) play_spawn_current::sid_rnd1_return#0 ← *((const byte*) SID_VOICE3_OSC#0)
|
||||
to:play_spawn_current::sid_rnd1
|
||||
play_spawn_current::sid_rnd1: scope:[play_spawn_current] from play_spawn_current::@1 play_spawn_current::@2
|
||||
[302] (byte) play_spawn_current::sid_rnd1_return#0 ← *((const byte*) SID_VOICE3_OSC#0)
|
||||
to:play_spawn_current::@3
|
||||
play_spawn_current::@3: scope:[play_spawn_current] from play_spawn_current::sid_rnd1
|
||||
[306] (byte) play_spawn_current::piece_idx#1 ← (byte) play_spawn_current::sid_rnd1_return#0 & (byte) 7
|
||||
[303] (byte) play_spawn_current::piece_idx#1 ← (byte) play_spawn_current::sid_rnd1_return#0 & (byte) 7
|
||||
to:play_spawn_current::@2
|
||||
play_spawn_current::@2: scope:[play_spawn_current] from play_spawn_current::@3
|
||||
[304] if((byte) play_spawn_current::piece_idx#1==(byte) 7) goto play_spawn_current::sid_rnd1
|
||||
to:play_spawn_current::@return
|
||||
play_spawn_current::@return: scope:[play_spawn_current] from play_spawn_current::@2
|
||||
[305] return
|
||||
to:@return
|
||||
play_update_score: scope:[play_update_score] from play_move_down::@15
|
||||
[307] if((byte) play_update_score::removed#0==(byte) 0) goto play_update_score::@return
|
||||
[306] if((byte) play_update_score::removed#0==(byte) 0) goto play_update_score::@return
|
||||
to:play_update_score::@1
|
||||
play_update_score::@1: scope:[play_update_score] from play_update_score
|
||||
[308] (byte~) play_update_score::$2 ← < (word) lines_bcd#19
|
||||
[309] (byte) play_update_score::lines_before#0 ← (byte~) play_update_score::$2 & (byte) $f0
|
||||
[310] (byte~) play_update_score::$9 ← (byte) play_update_score::removed#0 << (byte) 2
|
||||
[311] (dword) play_update_score::add_bcd#0 ← *((const dword[5]) score_add_bcd#0 + (byte~) play_update_score::$9)
|
||||
[307] (byte~) play_update_score::$2 ← < (word) lines_bcd#19
|
||||
[308] (byte) play_update_score::lines_before#0 ← (byte~) play_update_score::$2 & (byte) $f0
|
||||
[309] (byte~) play_update_score::$9 ← (byte) play_update_score::removed#0 << (byte) 2
|
||||
[310] (dword) play_update_score::add_bcd#0 ← *((const dword[5]) score_add_bcd#0 + (byte~) play_update_score::$9)
|
||||
asm { sed }
|
||||
[313] (word) lines_bcd#29 ← (word) lines_bcd#19 + (byte) play_update_score::removed#0
|
||||
[314] (dword) score_bcd#29 ← (dword) score_bcd#18 + (dword) play_update_score::add_bcd#0
|
||||
[312] (word) lines_bcd#29 ← (word) lines_bcd#19 + (byte) play_update_score::removed#0
|
||||
[313] (dword) score_bcd#29 ← (dword) score_bcd#18 + (dword) play_update_score::add_bcd#0
|
||||
asm { cld }
|
||||
[316] (byte~) play_update_score::$4 ← < (word) lines_bcd#29
|
||||
[317] (byte) play_update_score::lines_after#0 ← (byte~) play_update_score::$4 & (byte) $f0
|
||||
[318] if((byte) play_update_score::lines_before#0==(byte) play_update_score::lines_after#0) goto play_update_score::@return
|
||||
[315] (byte~) play_update_score::$4 ← < (word) lines_bcd#29
|
||||
[316] (byte) play_update_score::lines_after#0 ← (byte~) play_update_score::$4 & (byte) $f0
|
||||
[317] if((byte) play_update_score::lines_before#0==(byte) play_update_score::lines_after#0) goto play_update_score::@return
|
||||
to:play_update_score::@2
|
||||
play_update_score::@2: scope:[play_update_score] from play_update_score::@1
|
||||
[319] phi()
|
||||
[320] call play_increase_level
|
||||
[318] phi()
|
||||
[319] call play_increase_level
|
||||
to:play_update_score::@return
|
||||
play_update_score::@return: scope:[play_update_score] from play_update_score play_update_score::@1 play_update_score::@2
|
||||
[321] (byte) level_bcd#19 ← phi( play_update_score/(byte) level_bcd#11 play_update_score::@1/(byte) level_bcd#11 play_update_score::@2/(byte) level_bcd#62 )
|
||||
[321] (byte) current_movedown_slow#23 ← phi( play_update_score/(byte) current_movedown_slow#14 play_update_score::@1/(byte) current_movedown_slow#14 play_update_score::@2/(byte) current_movedown_slow#66 )
|
||||
[321] (byte) level#19 ← phi( play_update_score/(byte) level#10 play_update_score::@1/(byte) level#10 play_update_score::@2/(byte) level#21 )
|
||||
[321] (dword) score_bcd#16 ← phi( play_update_score/(dword) score_bcd#18 play_update_score::@1/(dword) score_bcd#29 play_update_score::@2/(dword) score_bcd#29 )
|
||||
[321] (word) lines_bcd#17 ← phi( play_update_score/(word) lines_bcd#19 play_update_score::@1/(word) lines_bcd#29 play_update_score::@2/(word) lines_bcd#29 )
|
||||
[322] return
|
||||
[320] (byte) level_bcd#19 ← phi( play_update_score/(byte) level_bcd#11 play_update_score::@1/(byte) level_bcd#11 play_update_score::@2/(byte) level_bcd#62 )
|
||||
[320] (byte) current_movedown_slow#23 ← phi( play_update_score/(byte) current_movedown_slow#14 play_update_score::@1/(byte) current_movedown_slow#14 play_update_score::@2/(byte) current_movedown_slow#66 )
|
||||
[320] (byte) level#19 ← phi( play_update_score/(byte) level#10 play_update_score::@1/(byte) level#10 play_update_score::@2/(byte) level#21 )
|
||||
[320] (dword) score_bcd#16 ← phi( play_update_score/(dword) score_bcd#18 play_update_score::@1/(dword) score_bcd#29 play_update_score::@2/(dword) score_bcd#29 )
|
||||
[320] (word) lines_bcd#17 ← phi( play_update_score/(word) lines_bcd#19 play_update_score::@1/(word) lines_bcd#29 play_update_score::@2/(word) lines_bcd#29 )
|
||||
[321] return
|
||||
to:@return
|
||||
play_increase_level: scope:[play_increase_level] from play_update_score::@2
|
||||
[323] (byte) level#21 ← ++ (byte) level#10
|
||||
[324] if((byte) level#21>=(byte) $1d+(byte) 1) goto play_increase_level::@1
|
||||
[322] (byte) level#21 ← ++ (byte) level#10
|
||||
[323] if((byte) level#21>=(byte) $1d+(byte) 1) goto play_increase_level::@1
|
||||
to:play_increase_level::@3
|
||||
play_increase_level::@3: scope:[play_increase_level] from play_increase_level
|
||||
[325] (byte) current_movedown_slow#10 ← *((const byte[]) MOVEDOWN_SLOW_SPEEDS#0 + (byte) level#21)
|
||||
[324] (byte) current_movedown_slow#10 ← *((const byte[]) MOVEDOWN_SLOW_SPEEDS#0 + (byte) level#21)
|
||||
to:play_increase_level::@1
|
||||
play_increase_level::@1: scope:[play_increase_level] from play_increase_level play_increase_level::@3
|
||||
[326] (byte) current_movedown_slow#66 ← phi( play_increase_level/(byte) 1 play_increase_level::@3/(byte) current_movedown_slow#10 )
|
||||
[327] (byte) level_bcd#21 ← ++ (byte) level_bcd#11
|
||||
[328] (byte~) play_increase_level::$1 ← (byte) level_bcd#21 & (byte) $f
|
||||
[329] if((byte~) play_increase_level::$1!=(byte) $a) goto play_increase_level::@2
|
||||
[325] (byte) current_movedown_slow#66 ← phi( play_increase_level/(byte) 1 play_increase_level::@3/(byte) current_movedown_slow#10 )
|
||||
[326] (byte) level_bcd#21 ← ++ (byte) level_bcd#11
|
||||
[327] (byte~) play_increase_level::$1 ← (byte) level_bcd#21 & (byte) $f
|
||||
[328] if((byte~) play_increase_level::$1!=(byte) $a) goto play_increase_level::@2
|
||||
to:play_increase_level::@4
|
||||
play_increase_level::@4: scope:[play_increase_level] from play_increase_level::@1
|
||||
[330] (byte) level_bcd#8 ← (byte) level_bcd#21 + (byte) 6
|
||||
[329] (byte) level_bcd#8 ← (byte) level_bcd#21 + (byte) 6
|
||||
to:play_increase_level::@2
|
||||
play_increase_level::@2: scope:[play_increase_level] from play_increase_level::@1 play_increase_level::@4
|
||||
[331] (byte) level_bcd#62 ← phi( play_increase_level::@1/(byte) level_bcd#21 play_increase_level::@4/(byte) level_bcd#8 )
|
||||
[330] (byte) level_bcd#62 ← phi( play_increase_level::@1/(byte) level_bcd#21 play_increase_level::@4/(byte) level_bcd#8 )
|
||||
asm { sed }
|
||||
to:play_increase_level::@5
|
||||
play_increase_level::@5: scope:[play_increase_level] from play_increase_level::@2 play_increase_level::@5
|
||||
[333] (byte) play_increase_level::b#2 ← phi( play_increase_level::@2/(byte) 0 play_increase_level::@5/(byte) play_increase_level::b#1 )
|
||||
[334] (byte~) play_increase_level::$5 ← (byte) play_increase_level::b#2 << (byte) 2
|
||||
[335] *((const dword[5]) score_add_bcd#0 + (byte~) play_increase_level::$5) ← *((const dword[5]) score_add_bcd#0 + (byte~) play_increase_level::$5) + *((const dword[]) SCORE_BASE_BCD#0 + (byte~) play_increase_level::$5)
|
||||
[336] (byte) play_increase_level::b#1 ← ++ (byte) play_increase_level::b#2
|
||||
[337] if((byte) play_increase_level::b#1!=(byte) 5) goto play_increase_level::@5
|
||||
[332] (byte) play_increase_level::b#2 ← phi( play_increase_level::@2/(byte) 0 play_increase_level::@5/(byte) play_increase_level::b#1 )
|
||||
[333] (byte~) play_increase_level::$5 ← (byte) play_increase_level::b#2 << (byte) 2
|
||||
[334] *((const dword[5]) score_add_bcd#0 + (byte~) play_increase_level::$5) ← *((const dword[5]) score_add_bcd#0 + (byte~) play_increase_level::$5) + *((const dword[]) SCORE_BASE_BCD#0 + (byte~) play_increase_level::$5)
|
||||
[335] (byte) play_increase_level::b#1 ← ++ (byte) play_increase_level::b#2
|
||||
[336] if((byte) play_increase_level::b#1!=(byte) 5) goto play_increase_level::@5
|
||||
to:play_increase_level::@6
|
||||
play_increase_level::@6: scope:[play_increase_level] from play_increase_level::@5
|
||||
asm { cld }
|
||||
to:play_increase_level::@return
|
||||
play_increase_level::@return: scope:[play_increase_level] from play_increase_level::@6
|
||||
[339] return
|
||||
[338] return
|
||||
to:@return
|
||||
play_remove_lines: scope:[play_remove_lines] from play_move_down::@14
|
||||
[340] phi()
|
||||
[339] phi()
|
||||
to:play_remove_lines::@1
|
||||
play_remove_lines::@1: scope:[play_remove_lines] from play_remove_lines play_remove_lines::@6
|
||||
[341] (byte) play_remove_lines::removed#11 ← phi( play_remove_lines/(byte) 0 play_remove_lines::@6/(byte) play_remove_lines::removed#8 )
|
||||
[341] (byte) play_remove_lines::y#8 ← phi( play_remove_lines/(byte) 0 play_remove_lines::@6/(byte) play_remove_lines::y#1 )
|
||||
[341] (byte) play_remove_lines::w#12 ← phi( play_remove_lines/(const byte) PLAYFIELD_LINES#0*(const byte) PLAYFIELD_COLS#0-(byte) 1 play_remove_lines::@6/(byte) play_remove_lines::w#11 )
|
||||
[341] (byte) play_remove_lines::r#3 ← phi( play_remove_lines/(const byte) PLAYFIELD_LINES#0*(const byte) PLAYFIELD_COLS#0-(byte) 1 play_remove_lines::@6/(byte) play_remove_lines::r#1 )
|
||||
[340] (byte) play_remove_lines::removed#11 ← phi( play_remove_lines/(byte) 0 play_remove_lines::@6/(byte) play_remove_lines::removed#8 )
|
||||
[340] (byte) play_remove_lines::y#8 ← phi( play_remove_lines/(byte) 0 play_remove_lines::@6/(byte) play_remove_lines::y#1 )
|
||||
[340] (byte) play_remove_lines::w#12 ← phi( play_remove_lines/(const byte) PLAYFIELD_LINES#0*(const byte) PLAYFIELD_COLS#0-(byte) 1 play_remove_lines::@6/(byte) play_remove_lines::w#11 )
|
||||
[340] (byte) play_remove_lines::r#3 ← phi( play_remove_lines/(const byte) PLAYFIELD_LINES#0*(const byte) PLAYFIELD_COLS#0-(byte) 1 play_remove_lines::@6/(byte) play_remove_lines::r#1 )
|
||||
to:play_remove_lines::@2
|
||||
play_remove_lines::@2: scope:[play_remove_lines] from play_remove_lines::@1 play_remove_lines::@3
|
||||
[342] (byte) play_remove_lines::full#4 ← phi( play_remove_lines::@1/(byte) 1 play_remove_lines::@3/(byte) play_remove_lines::full#2 )
|
||||
[342] (byte) play_remove_lines::x#2 ← phi( play_remove_lines::@1/(byte) 0 play_remove_lines::@3/(byte) play_remove_lines::x#1 )
|
||||
[342] (byte) play_remove_lines::w#4 ← phi( play_remove_lines::@1/(byte) play_remove_lines::w#12 play_remove_lines::@3/(byte) play_remove_lines::w#1 )
|
||||
[342] (byte) play_remove_lines::r#2 ← phi( play_remove_lines::@1/(byte) play_remove_lines::r#3 play_remove_lines::@3/(byte) play_remove_lines::r#1 )
|
||||
[343] (byte) play_remove_lines::c#0 ← *((const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 + (byte) play_remove_lines::r#2)
|
||||
[344] (byte) play_remove_lines::r#1 ← -- (byte) play_remove_lines::r#2
|
||||
[345] if((byte) play_remove_lines::c#0!=(byte) 0) goto play_remove_lines::@9
|
||||
[341] (byte) play_remove_lines::full#4 ← phi( play_remove_lines::@1/(byte) 1 play_remove_lines::@3/(byte) play_remove_lines::full#2 )
|
||||
[341] (byte) play_remove_lines::x#2 ← phi( play_remove_lines::@1/(byte) 0 play_remove_lines::@3/(byte) play_remove_lines::x#1 )
|
||||
[341] (byte) play_remove_lines::w#4 ← phi( play_remove_lines::@1/(byte) play_remove_lines::w#12 play_remove_lines::@3/(byte) play_remove_lines::w#1 )
|
||||
[341] (byte) play_remove_lines::r#2 ← phi( play_remove_lines::@1/(byte) play_remove_lines::r#3 play_remove_lines::@3/(byte) play_remove_lines::r#1 )
|
||||
[342] (byte) play_remove_lines::c#0 ← *((const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 + (byte) play_remove_lines::r#2)
|
||||
[343] (byte) play_remove_lines::r#1 ← -- (byte) play_remove_lines::r#2
|
||||
[344] if((byte) play_remove_lines::c#0!=(byte) 0) goto play_remove_lines::@9
|
||||
to:play_remove_lines::@3
|
||||
play_remove_lines::@9: scope:[play_remove_lines] from play_remove_lines::@2
|
||||
[346] phi()
|
||||
[345] phi()
|
||||
to:play_remove_lines::@3
|
||||
play_remove_lines::@3: scope:[play_remove_lines] from play_remove_lines::@2 play_remove_lines::@9
|
||||
[347] (byte) play_remove_lines::full#2 ← phi( play_remove_lines::@9/(byte) play_remove_lines::full#4 play_remove_lines::@2/(byte) 0 )
|
||||
[348] *((const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 + (byte) play_remove_lines::w#4) ← (byte) play_remove_lines::c#0
|
||||
[349] (byte) play_remove_lines::w#1 ← -- (byte) play_remove_lines::w#4
|
||||
[350] (byte) play_remove_lines::x#1 ← ++ (byte) play_remove_lines::x#2
|
||||
[351] if((byte) play_remove_lines::x#1!=(const byte) PLAYFIELD_COLS#0-(byte) 1+(byte) 1) goto play_remove_lines::@2
|
||||
[346] (byte) play_remove_lines::full#2 ← phi( play_remove_lines::@9/(byte) play_remove_lines::full#4 play_remove_lines::@2/(byte) 0 )
|
||||
[347] *((const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 + (byte) play_remove_lines::w#4) ← (byte) play_remove_lines::c#0
|
||||
[348] (byte) play_remove_lines::w#1 ← -- (byte) play_remove_lines::w#4
|
||||
[349] (byte) play_remove_lines::x#1 ← ++ (byte) play_remove_lines::x#2
|
||||
[350] if((byte) play_remove_lines::x#1!=(const byte) PLAYFIELD_COLS#0-(byte) 1+(byte) 1) goto play_remove_lines::@2
|
||||
to:play_remove_lines::@4
|
||||
play_remove_lines::@4: scope:[play_remove_lines] from play_remove_lines::@3
|
||||
[352] if((byte) play_remove_lines::full#2!=(byte) 1) goto play_remove_lines::@6
|
||||
[351] if((byte) play_remove_lines::full#2!=(byte) 1) goto play_remove_lines::@6
|
||||
to:play_remove_lines::@5
|
||||
play_remove_lines::@5: scope:[play_remove_lines] from play_remove_lines::@4
|
||||
[353] (byte) play_remove_lines::w#2 ← (byte) play_remove_lines::w#1 + (const byte) PLAYFIELD_COLS#0
|
||||
[354] (byte) play_remove_lines::removed#1 ← ++ (byte) play_remove_lines::removed#11
|
||||
[352] (byte) play_remove_lines::w#2 ← (byte) play_remove_lines::w#1 + (const byte) PLAYFIELD_COLS#0
|
||||
[353] (byte) play_remove_lines::removed#1 ← ++ (byte) play_remove_lines::removed#11
|
||||
to:play_remove_lines::@6
|
||||
play_remove_lines::@6: scope:[play_remove_lines] from play_remove_lines::@4 play_remove_lines::@5
|
||||
[355] (byte) play_remove_lines::removed#8 ← phi( play_remove_lines::@4/(byte) play_remove_lines::removed#11 play_remove_lines::@5/(byte) play_remove_lines::removed#1 )
|
||||
[355] (byte) play_remove_lines::w#11 ← phi( play_remove_lines::@4/(byte) play_remove_lines::w#1 play_remove_lines::@5/(byte) play_remove_lines::w#2 )
|
||||
[356] (byte) play_remove_lines::y#1 ← ++ (byte) play_remove_lines::y#8
|
||||
[357] if((byte) play_remove_lines::y#1!=(const byte) PLAYFIELD_LINES#0-(byte) 1+(byte) 1) goto play_remove_lines::@1
|
||||
[354] (byte) play_remove_lines::removed#8 ← phi( play_remove_lines::@4/(byte) play_remove_lines::removed#11 play_remove_lines::@5/(byte) play_remove_lines::removed#1 )
|
||||
[354] (byte) play_remove_lines::w#11 ← phi( play_remove_lines::@4/(byte) play_remove_lines::w#1 play_remove_lines::@5/(byte) play_remove_lines::w#2 )
|
||||
[355] (byte) play_remove_lines::y#1 ← ++ (byte) play_remove_lines::y#8
|
||||
[356] if((byte) play_remove_lines::y#1!=(const byte) PLAYFIELD_LINES#0-(byte) 1+(byte) 1) goto play_remove_lines::@1
|
||||
to:play_remove_lines::@7
|
||||
play_remove_lines::@7: scope:[play_remove_lines] from play_remove_lines::@6 play_remove_lines::@8
|
||||
[358] (byte) play_remove_lines::w#6 ← phi( play_remove_lines::@8/(byte) play_remove_lines::w#3 play_remove_lines::@6/(byte) play_remove_lines::w#11 )
|
||||
[359] if((byte) play_remove_lines::w#6!=(byte) $ff) goto play_remove_lines::@8
|
||||
[357] (byte) play_remove_lines::w#6 ← phi( play_remove_lines::@8/(byte) play_remove_lines::w#3 play_remove_lines::@6/(byte) play_remove_lines::w#11 )
|
||||
[358] if((byte) play_remove_lines::w#6!=(byte) $ff) goto play_remove_lines::@8
|
||||
to:play_remove_lines::@return
|
||||
play_remove_lines::@return: scope:[play_remove_lines] from play_remove_lines::@7
|
||||
[360] return
|
||||
[359] return
|
||||
to:@return
|
||||
play_remove_lines::@8: scope:[play_remove_lines] from play_remove_lines::@7
|
||||
[361] *((const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 + (byte) play_remove_lines::w#6) ← (byte) 0
|
||||
[362] (byte) play_remove_lines::w#3 ← -- (byte) play_remove_lines::w#6
|
||||
[360] *((const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 + (byte) play_remove_lines::w#6) ← (byte) 0
|
||||
[361] (byte) play_remove_lines::w#3 ← -- (byte) play_remove_lines::w#6
|
||||
to:play_remove_lines::@7
|
||||
play_lock_current: scope:[play_lock_current] from play_move_down::@9
|
||||
[363] (byte) play_lock_current::yp#0 ← (byte) current_ypos#11
|
||||
[362] (byte) play_lock_current::yp#0 ← (byte) current_ypos#11
|
||||
to:play_lock_current::@1
|
||||
play_lock_current::@1: scope:[play_lock_current] from play_lock_current play_lock_current::@6
|
||||
[364] (byte) play_lock_current::l#6 ← phi( play_lock_current/(byte) 0 play_lock_current::@6/(byte) play_lock_current::l#1 )
|
||||
[364] (byte) play_lock_current::i#3 ← phi( play_lock_current/(byte) 0 play_lock_current::@6/(byte~) play_lock_current::i#7 )
|
||||
[364] (byte) play_lock_current::yp#2 ← phi( play_lock_current/(byte) play_lock_current::yp#0 play_lock_current::@6/(byte) play_lock_current::yp#1 )
|
||||
[365] (byte~) play_lock_current::$4 ← (byte) play_lock_current::yp#2 << (byte) 1
|
||||
[366] (byte*) play_lock_current::playfield_line#0 ← *((const byte*[PLAYFIELD_LINES#0]) playfield_lines#0 + (byte~) play_lock_current::$4)
|
||||
[367] (byte) play_lock_current::xp#0 ← (byte) current_xpos#14
|
||||
[363] (byte) play_lock_current::l#6 ← phi( play_lock_current/(byte) 0 play_lock_current::@6/(byte) play_lock_current::l#1 )
|
||||
[363] (byte) play_lock_current::i#3 ← phi( play_lock_current/(byte) 0 play_lock_current::@6/(byte~) play_lock_current::i#7 )
|
||||
[363] (byte) play_lock_current::yp#2 ← phi( play_lock_current/(byte) play_lock_current::yp#0 play_lock_current::@6/(byte) play_lock_current::yp#1 )
|
||||
[364] (byte~) play_lock_current::$4 ← (byte) play_lock_current::yp#2 << (byte) 1
|
||||
[365] (byte*) play_lock_current::playfield_line#0 ← *((const byte*[PLAYFIELD_LINES#0]) playfield_lines#0 + (byte~) play_lock_current::$4)
|
||||
[366] (byte) play_lock_current::xp#0 ← (byte) current_xpos#14
|
||||
to:play_lock_current::@2
|
||||
play_lock_current::@2: scope:[play_lock_current] from play_lock_current::@1 play_lock_current::@7
|
||||
[368] (byte) play_lock_current::c#2 ← phi( play_lock_current::@1/(byte) 0 play_lock_current::@7/(byte) play_lock_current::c#1 )
|
||||
[368] (byte) play_lock_current::xp#2 ← phi( play_lock_current::@1/(byte) play_lock_current::xp#0 play_lock_current::@7/(byte) play_lock_current::xp#1 )
|
||||
[368] (byte) play_lock_current::i#2 ← phi( play_lock_current::@1/(byte) play_lock_current::i#3 play_lock_current::@7/(byte~) play_lock_current::i#9 )
|
||||
[369] (byte) play_lock_current::i#1 ← ++ (byte) play_lock_current::i#2
|
||||
[370] if(*((byte*) current_piece_gfx#13 + (byte) play_lock_current::i#2)==(byte) 0) goto play_lock_current::@3
|
||||
[367] (byte) play_lock_current::c#2 ← phi( play_lock_current::@1/(byte) 0 play_lock_current::@7/(byte) play_lock_current::c#1 )
|
||||
[367] (byte) play_lock_current::xp#2 ← phi( play_lock_current::@1/(byte) play_lock_current::xp#0 play_lock_current::@7/(byte) play_lock_current::xp#1 )
|
||||
[367] (byte) play_lock_current::i#2 ← phi( play_lock_current::@1/(byte) play_lock_current::i#3 play_lock_current::@7/(byte~) play_lock_current::i#9 )
|
||||
[368] (byte) play_lock_current::i#1 ← ++ (byte) play_lock_current::i#2
|
||||
[369] if(*((byte*) current_piece_gfx#13 + (byte) play_lock_current::i#2)==(byte) 0) goto play_lock_current::@3
|
||||
to:play_lock_current::@4
|
||||
play_lock_current::@4: scope:[play_lock_current] from play_lock_current::@2
|
||||
[371] *((byte*) play_lock_current::playfield_line#0 + (byte) play_lock_current::xp#2) ← (byte) current_piece_char#10
|
||||
[370] *((byte*) play_lock_current::playfield_line#0 + (byte) play_lock_current::xp#2) ← (byte) current_piece_char#10
|
||||
to:play_lock_current::@3
|
||||
play_lock_current::@3: scope:[play_lock_current] from play_lock_current::@2 play_lock_current::@4
|
||||
[372] (byte) play_lock_current::xp#1 ← ++ (byte) play_lock_current::xp#2
|
||||
[373] (byte) play_lock_current::c#1 ← ++ (byte) play_lock_current::c#2
|
||||
[374] if((byte) play_lock_current::c#1!=(byte) 4) goto play_lock_current::@7
|
||||
[371] (byte) play_lock_current::xp#1 ← ++ (byte) play_lock_current::xp#2
|
||||
[372] (byte) play_lock_current::c#1 ← ++ (byte) play_lock_current::c#2
|
||||
[373] if((byte) play_lock_current::c#1!=(byte) 4) goto play_lock_current::@7
|
||||
to:play_lock_current::@5
|
||||
play_lock_current::@5: scope:[play_lock_current] from play_lock_current::@3
|
||||
[375] (byte) play_lock_current::yp#1 ← ++ (byte) play_lock_current::yp#2
|
||||
[376] (byte) play_lock_current::l#1 ← ++ (byte) play_lock_current::l#6
|
||||
[377] if((byte) play_lock_current::l#1!=(byte) 4) goto play_lock_current::@6
|
||||
[374] (byte) play_lock_current::yp#1 ← ++ (byte) play_lock_current::yp#2
|
||||
[375] (byte) play_lock_current::l#1 ← ++ (byte) play_lock_current::l#6
|
||||
[376] if((byte) play_lock_current::l#1!=(byte) 4) goto play_lock_current::@6
|
||||
to:play_lock_current::@return
|
||||
play_lock_current::@return: scope:[play_lock_current] from play_lock_current::@5
|
||||
[378] return
|
||||
[377] return
|
||||
to:@return
|
||||
play_lock_current::@6: scope:[play_lock_current] from play_lock_current::@5
|
||||
[379] (byte~) play_lock_current::i#7 ← (byte) play_lock_current::i#1
|
||||
[378] (byte~) play_lock_current::i#7 ← (byte) play_lock_current::i#1
|
||||
to:play_lock_current::@1
|
||||
play_lock_current::@7: scope:[play_lock_current] from play_lock_current::@3
|
||||
[380] (byte~) play_lock_current::i#9 ← (byte) play_lock_current::i#1
|
||||
[379] (byte~) play_lock_current::i#9 ← (byte) play_lock_current::i#1
|
||||
to:play_lock_current::@2
|
||||
keyboard_event_pressed: scope:[keyboard_event_pressed] from keyboard_event_scan::@1 keyboard_event_scan::@17 keyboard_event_scan::@2 keyboard_event_scan::@3 play_move_down::@1
|
||||
[381] (byte) keyboard_event_pressed::keycode#5 ← phi( keyboard_event_scan::@1/(const byte) KEY_RSHIFT#0 keyboard_event_scan::@2/(const byte) KEY_CTRL#0 keyboard_event_scan::@17/(const byte) KEY_LSHIFT#0 keyboard_event_scan::@3/(const byte) KEY_COMMODORE#0 play_move_down::@1/(const byte) KEY_SPACE#0 )
|
||||
[382] (byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode#5 >> (byte) 3
|
||||
[383] (byte) keyboard_event_pressed::row_bits#0 ← *((const byte[8]) keyboard_scan_values#0 + (byte~) keyboard_event_pressed::$0)
|
||||
[384] (byte~) keyboard_event_pressed::$1 ← (byte) keyboard_event_pressed::keycode#5 & (byte) 7
|
||||
[385] (byte) keyboard_event_pressed::return#11 ← (byte) keyboard_event_pressed::row_bits#0 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte~) keyboard_event_pressed::$1)
|
||||
[380] (byte) keyboard_event_pressed::keycode#5 ← phi( keyboard_event_scan::@1/(const byte) KEY_RSHIFT#0 keyboard_event_scan::@2/(const byte) KEY_CTRL#0 keyboard_event_scan::@17/(const byte) KEY_LSHIFT#0 keyboard_event_scan::@3/(const byte) KEY_COMMODORE#0 play_move_down::@1/(const byte) KEY_SPACE#0 )
|
||||
[381] (byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode#5 >> (byte) 3
|
||||
[382] (byte) keyboard_event_pressed::row_bits#0 ← *((const byte[8]) keyboard_scan_values#0 + (byte~) keyboard_event_pressed::$0)
|
||||
[383] (byte~) keyboard_event_pressed::$1 ← (byte) keyboard_event_pressed::keycode#5 & (byte) 7
|
||||
[384] (byte) keyboard_event_pressed::return#11 ← (byte) keyboard_event_pressed::row_bits#0 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte~) keyboard_event_pressed::$1)
|
||||
to:keyboard_event_pressed::@return
|
||||
keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_event_pressed
|
||||
[386] return
|
||||
[385] return
|
||||
to:@return
|
||||
keyboard_event_get: scope:[keyboard_event_get] from main::@19
|
||||
[387] if((byte) keyboard_events_size#13==(byte) 0) goto keyboard_event_get::@return
|
||||
[386] if((byte) keyboard_events_size#13==(byte) 0) goto keyboard_event_get::@return
|
||||
to:keyboard_event_get::@1
|
||||
keyboard_event_get::@1: scope:[keyboard_event_get] from keyboard_event_get
|
||||
[388] (byte) keyboard_events_size#4 ← -- (byte) keyboard_events_size#13
|
||||
[389] (byte) keyboard_event_get::return#1 ← *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#4)
|
||||
[387] (byte) keyboard_events_size#4 ← -- (byte) keyboard_events_size#13
|
||||
[388] (byte) keyboard_event_get::return#1 ← *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#4)
|
||||
to:keyboard_event_get::@return
|
||||
keyboard_event_get::@return: scope:[keyboard_event_get] from keyboard_event_get keyboard_event_get::@1
|
||||
[390] (byte) keyboard_events_size#16 ← phi( keyboard_event_get/(byte) keyboard_events_size#13 keyboard_event_get::@1/(byte) keyboard_events_size#4 )
|
||||
[390] (byte) keyboard_event_get::return#2 ← phi( keyboard_event_get/(byte) $ff keyboard_event_get::@1/(byte) keyboard_event_get::return#1 )
|
||||
[391] return
|
||||
[389] (byte) keyboard_events_size#16 ← phi( keyboard_event_get/(byte) keyboard_events_size#13 keyboard_event_get::@1/(byte) keyboard_events_size#4 )
|
||||
[389] (byte) keyboard_event_get::return#2 ← phi( keyboard_event_get/(byte) $ff keyboard_event_get::@1/(byte) keyboard_event_get::return#1 )
|
||||
[390] return
|
||||
to:@return
|
||||
keyboard_event_scan: scope:[keyboard_event_scan] from main::@18
|
||||
[392] phi()
|
||||
[391] phi()
|
||||
to:keyboard_event_scan::@7
|
||||
keyboard_event_scan::@7: scope:[keyboard_event_scan] from keyboard_event_scan keyboard_event_scan::@8
|
||||
[393] (byte) keyboard_events_size#30 ← phi( keyboard_event_scan/(byte) keyboard_events_size#19 keyboard_event_scan::@8/(byte) keyboard_events_size#13 )
|
||||
[393] (byte) keyboard_event_scan::keycode#11 ← phi( keyboard_event_scan/(byte) 0 keyboard_event_scan::@8/(byte) keyboard_event_scan::keycode#13 )
|
||||
[393] (byte) keyboard_event_scan::row#2 ← phi( keyboard_event_scan/(byte) 0 keyboard_event_scan::@8/(byte) keyboard_event_scan::row#1 )
|
||||
[394] (byte) keyboard_matrix_read::rowid#0 ← (byte) keyboard_event_scan::row#2
|
||||
[395] call keyboard_matrix_read
|
||||
[396] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0
|
||||
[392] (byte) keyboard_events_size#30 ← phi( keyboard_event_scan/(byte) keyboard_events_size#19 keyboard_event_scan::@8/(byte) keyboard_events_size#13 )
|
||||
[392] (byte) keyboard_event_scan::keycode#11 ← phi( keyboard_event_scan/(byte) 0 keyboard_event_scan::@8/(byte) keyboard_event_scan::keycode#13 )
|
||||
[392] (byte) keyboard_event_scan::row#2 ← phi( keyboard_event_scan/(byte) 0 keyboard_event_scan::@8/(byte) keyboard_event_scan::row#1 )
|
||||
[393] (byte) keyboard_matrix_read::rowid#0 ← (byte) keyboard_event_scan::row#2
|
||||
[394] call keyboard_matrix_read
|
||||
[395] (byte) keyboard_matrix_read::return#2 ← (byte) keyboard_matrix_read::return#0
|
||||
to:keyboard_event_scan::@19
|
||||
keyboard_event_scan::@19: scope:[keyboard_event_scan] from keyboard_event_scan::@7
|
||||
[397] (byte) keyboard_event_scan::row_scan#0 ← (byte) keyboard_matrix_read::return#2
|
||||
[398] if((byte) keyboard_event_scan::row_scan#0!=*((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2)) goto keyboard_event_scan::@9
|
||||
[396] (byte) keyboard_event_scan::row_scan#0 ← (byte) keyboard_matrix_read::return#2
|
||||
[397] if((byte) keyboard_event_scan::row_scan#0!=*((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2)) goto keyboard_event_scan::@9
|
||||
to:keyboard_event_scan::@16
|
||||
keyboard_event_scan::@16: scope:[keyboard_event_scan] from keyboard_event_scan::@19
|
||||
[399] (byte) keyboard_event_scan::keycode#1 ← (byte) keyboard_event_scan::keycode#11 + (byte) 8
|
||||
[398] (byte) keyboard_event_scan::keycode#1 ← (byte) keyboard_event_scan::keycode#11 + (byte) 8
|
||||
to:keyboard_event_scan::@8
|
||||
keyboard_event_scan::@8: scope:[keyboard_event_scan] from keyboard_event_scan::@15 keyboard_event_scan::@16
|
||||
[400] (byte) keyboard_events_size#13 ← phi( keyboard_event_scan::@15/(byte) keyboard_events_size#29 keyboard_event_scan::@16/(byte) keyboard_events_size#30 )
|
||||
[400] (byte) keyboard_event_scan::keycode#13 ← phi( keyboard_event_scan::@15/(byte) keyboard_event_scan::keycode#14 keyboard_event_scan::@16/(byte) keyboard_event_scan::keycode#1 )
|
||||
[401] (byte) keyboard_event_scan::row#1 ← ++ (byte) keyboard_event_scan::row#2
|
||||
[402] if((byte) keyboard_event_scan::row#1!=(byte) 8) goto keyboard_event_scan::@7
|
||||
[399] (byte) keyboard_events_size#13 ← phi( keyboard_event_scan::@15/(byte) keyboard_events_size#29 keyboard_event_scan::@16/(byte) keyboard_events_size#30 )
|
||||
[399] (byte) keyboard_event_scan::keycode#13 ← phi( keyboard_event_scan::@15/(byte) keyboard_event_scan::keycode#14 keyboard_event_scan::@16/(byte) keyboard_event_scan::keycode#1 )
|
||||
[400] (byte) keyboard_event_scan::row#1 ← ++ (byte) keyboard_event_scan::row#2
|
||||
[401] if((byte) keyboard_event_scan::row#1!=(byte) 8) goto keyboard_event_scan::@7
|
||||
to:keyboard_event_scan::@17
|
||||
keyboard_event_scan::@17: scope:[keyboard_event_scan] from keyboard_event_scan::@8
|
||||
[403] phi()
|
||||
[404] call keyboard_event_pressed
|
||||
[405] (byte) keyboard_event_pressed::return#0 ← (byte) keyboard_event_pressed::return#11
|
||||
[402] phi()
|
||||
[403] call keyboard_event_pressed
|
||||
[404] (byte) keyboard_event_pressed::return#0 ← (byte) keyboard_event_pressed::return#11
|
||||
to:keyboard_event_scan::@20
|
||||
keyboard_event_scan::@20: scope:[keyboard_event_scan] from keyboard_event_scan::@17
|
||||
[406] (byte~) keyboard_event_scan::$0 ← (byte) keyboard_event_pressed::return#0
|
||||
[407] if((byte~) keyboard_event_scan::$0==(byte) 0) goto keyboard_event_scan::@1
|
||||
[405] (byte~) keyboard_event_scan::$0 ← (byte) keyboard_event_pressed::return#0
|
||||
[406] if((byte~) keyboard_event_scan::$0==(byte) 0) goto keyboard_event_scan::@1
|
||||
to:keyboard_event_scan::@18
|
||||
keyboard_event_scan::@18: scope:[keyboard_event_scan] from keyboard_event_scan::@20
|
||||
[408] phi()
|
||||
[407] phi()
|
||||
to:keyboard_event_scan::@1
|
||||
keyboard_event_scan::@1: scope:[keyboard_event_scan] from keyboard_event_scan::@18 keyboard_event_scan::@20
|
||||
[409] phi()
|
||||
[410] call keyboard_event_pressed
|
||||
[411] (byte) keyboard_event_pressed::return#1 ← (byte) keyboard_event_pressed::return#11
|
||||
[408] phi()
|
||||
[409] call keyboard_event_pressed
|
||||
[410] (byte) keyboard_event_pressed::return#1 ← (byte) keyboard_event_pressed::return#11
|
||||
to:keyboard_event_scan::@21
|
||||
keyboard_event_scan::@21: scope:[keyboard_event_scan] from keyboard_event_scan::@1
|
||||
[412] (byte~) keyboard_event_scan::$3 ← (byte) keyboard_event_pressed::return#1
|
||||
[413] if((byte~) keyboard_event_scan::$3==(byte) 0) goto keyboard_event_scan::@2
|
||||
[411] (byte~) keyboard_event_scan::$3 ← (byte) keyboard_event_pressed::return#1
|
||||
[412] if((byte~) keyboard_event_scan::$3==(byte) 0) goto keyboard_event_scan::@2
|
||||
to:keyboard_event_scan::@4
|
||||
keyboard_event_scan::@4: scope:[keyboard_event_scan] from keyboard_event_scan::@21
|
||||
[414] phi()
|
||||
[413] phi()
|
||||
to:keyboard_event_scan::@2
|
||||
keyboard_event_scan::@2: scope:[keyboard_event_scan] from keyboard_event_scan::@21 keyboard_event_scan::@4
|
||||
[415] phi()
|
||||
[416] call keyboard_event_pressed
|
||||
[417] (byte) keyboard_event_pressed::return#2 ← (byte) keyboard_event_pressed::return#11
|
||||
[414] phi()
|
||||
[415] call keyboard_event_pressed
|
||||
[416] (byte) keyboard_event_pressed::return#2 ← (byte) keyboard_event_pressed::return#11
|
||||
to:keyboard_event_scan::@22
|
||||
keyboard_event_scan::@22: scope:[keyboard_event_scan] from keyboard_event_scan::@2
|
||||
[418] (byte~) keyboard_event_scan::$6 ← (byte) keyboard_event_pressed::return#2
|
||||
[419] if((byte~) keyboard_event_scan::$6==(byte) 0) goto keyboard_event_scan::@3
|
||||
[417] (byte~) keyboard_event_scan::$6 ← (byte) keyboard_event_pressed::return#2
|
||||
[418] if((byte~) keyboard_event_scan::$6==(byte) 0) goto keyboard_event_scan::@3
|
||||
to:keyboard_event_scan::@5
|
||||
keyboard_event_scan::@5: scope:[keyboard_event_scan] from keyboard_event_scan::@22
|
||||
[420] phi()
|
||||
[419] phi()
|
||||
to:keyboard_event_scan::@3
|
||||
keyboard_event_scan::@3: scope:[keyboard_event_scan] from keyboard_event_scan::@22 keyboard_event_scan::@5
|
||||
[421] phi()
|
||||
[422] call keyboard_event_pressed
|
||||
[423] (byte) keyboard_event_pressed::return#10 ← (byte) keyboard_event_pressed::return#11
|
||||
[420] phi()
|
||||
[421] call keyboard_event_pressed
|
||||
[422] (byte) keyboard_event_pressed::return#10 ← (byte) keyboard_event_pressed::return#11
|
||||
to:keyboard_event_scan::@23
|
||||
keyboard_event_scan::@23: scope:[keyboard_event_scan] from keyboard_event_scan::@3
|
||||
[424] (byte~) keyboard_event_scan::$9 ← (byte) keyboard_event_pressed::return#10
|
||||
[425] if((byte~) keyboard_event_scan::$9==(byte) 0) goto keyboard_event_scan::@return
|
||||
[423] (byte~) keyboard_event_scan::$9 ← (byte) keyboard_event_pressed::return#10
|
||||
[424] if((byte~) keyboard_event_scan::$9==(byte) 0) goto keyboard_event_scan::@return
|
||||
to:keyboard_event_scan::@6
|
||||
keyboard_event_scan::@6: scope:[keyboard_event_scan] from keyboard_event_scan::@23
|
||||
[426] phi()
|
||||
[425] phi()
|
||||
to:keyboard_event_scan::@return
|
||||
keyboard_event_scan::@return: scope:[keyboard_event_scan] from keyboard_event_scan::@23 keyboard_event_scan::@6
|
||||
[427] return
|
||||
[426] return
|
||||
to:@return
|
||||
keyboard_event_scan::@9: scope:[keyboard_event_scan] from keyboard_event_scan::@10 keyboard_event_scan::@19
|
||||
[428] (byte) keyboard_events_size#10 ← phi( keyboard_event_scan::@10/(byte) keyboard_events_size#29 keyboard_event_scan::@19/(byte) keyboard_events_size#30 )
|
||||
[428] (byte) keyboard_event_scan::keycode#10 ← phi( keyboard_event_scan::@10/(byte) keyboard_event_scan::keycode#14 keyboard_event_scan::@19/(byte) keyboard_event_scan::keycode#11 )
|
||||
[428] (byte) keyboard_event_scan::col#2 ← phi( keyboard_event_scan::@10/(byte) keyboard_event_scan::col#1 keyboard_event_scan::@19/(byte) 0 )
|
||||
[429] (byte~) keyboard_event_scan::$15 ← (byte) keyboard_event_scan::row_scan#0 ^ *((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2)
|
||||
[430] (byte~) keyboard_event_scan::$16 ← (byte~) keyboard_event_scan::$15 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte) keyboard_event_scan::col#2)
|
||||
[431] if((byte~) keyboard_event_scan::$16==(byte) 0) goto keyboard_event_scan::@10
|
||||
[427] (byte) keyboard_events_size#10 ← phi( keyboard_event_scan::@10/(byte) keyboard_events_size#29 keyboard_event_scan::@19/(byte) keyboard_events_size#30 )
|
||||
[427] (byte) keyboard_event_scan::keycode#10 ← phi( keyboard_event_scan::@10/(byte) keyboard_event_scan::keycode#14 keyboard_event_scan::@19/(byte) keyboard_event_scan::keycode#11 )
|
||||
[427] (byte) keyboard_event_scan::col#2 ← phi( keyboard_event_scan::@10/(byte) keyboard_event_scan::col#1 keyboard_event_scan::@19/(byte) 0 )
|
||||
[428] (byte~) keyboard_event_scan::$15 ← (byte) keyboard_event_scan::row_scan#0 ^ *((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2)
|
||||
[429] (byte~) keyboard_event_scan::$16 ← (byte~) keyboard_event_scan::$15 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte) keyboard_event_scan::col#2)
|
||||
[430] if((byte~) keyboard_event_scan::$16==(byte) 0) goto keyboard_event_scan::@10
|
||||
to:keyboard_event_scan::@12
|
||||
keyboard_event_scan::@12: scope:[keyboard_event_scan] from keyboard_event_scan::@9
|
||||
[432] if((byte) keyboard_events_size#10==(byte) 8) goto keyboard_event_scan::@10
|
||||
[431] if((byte) keyboard_events_size#10==(byte) 8) goto keyboard_event_scan::@10
|
||||
to:keyboard_event_scan::@13
|
||||
keyboard_event_scan::@13: scope:[keyboard_event_scan] from keyboard_event_scan::@12
|
||||
[433] (byte) keyboard_event_scan::event_type#0 ← (byte) keyboard_event_scan::row_scan#0 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte) keyboard_event_scan::col#2)
|
||||
[434] if((byte) keyboard_event_scan::event_type#0==(byte) 0) goto keyboard_event_scan::@11
|
||||
[432] (byte) keyboard_event_scan::event_type#0 ← (byte) keyboard_event_scan::row_scan#0 & *((const byte[8]) keyboard_matrix_col_bitmask#0 + (byte) keyboard_event_scan::col#2)
|
||||
[433] if((byte) keyboard_event_scan::event_type#0==(byte) 0) goto keyboard_event_scan::@11
|
||||
to:keyboard_event_scan::@14
|
||||
keyboard_event_scan::@14: scope:[keyboard_event_scan] from keyboard_event_scan::@13
|
||||
[435] *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#10) ← (byte) keyboard_event_scan::keycode#10
|
||||
[436] (byte) keyboard_events_size#2 ← ++ (byte) keyboard_events_size#10
|
||||
[434] *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#10) ← (byte) keyboard_event_scan::keycode#10
|
||||
[435] (byte) keyboard_events_size#2 ← ++ (byte) keyboard_events_size#10
|
||||
to:keyboard_event_scan::@10
|
||||
keyboard_event_scan::@10: scope:[keyboard_event_scan] from keyboard_event_scan::@11 keyboard_event_scan::@12 keyboard_event_scan::@14 keyboard_event_scan::@9
|
||||
[437] (byte) keyboard_events_size#29 ← phi( keyboard_event_scan::@9/(byte) keyboard_events_size#10 keyboard_event_scan::@11/(byte) keyboard_events_size#1 keyboard_event_scan::@12/(byte) keyboard_events_size#10 keyboard_event_scan::@14/(byte) keyboard_events_size#2 )
|
||||
[438] (byte) keyboard_event_scan::keycode#14 ← ++ (byte) keyboard_event_scan::keycode#10
|
||||
[439] (byte) keyboard_event_scan::col#1 ← ++ (byte) keyboard_event_scan::col#2
|
||||
[440] if((byte) keyboard_event_scan::col#1!=(byte) 8) goto keyboard_event_scan::@9
|
||||
[436] (byte) keyboard_events_size#29 ← phi( keyboard_event_scan::@9/(byte) keyboard_events_size#10 keyboard_event_scan::@11/(byte) keyboard_events_size#1 keyboard_event_scan::@12/(byte) keyboard_events_size#10 keyboard_event_scan::@14/(byte) keyboard_events_size#2 )
|
||||
[437] (byte) keyboard_event_scan::keycode#14 ← ++ (byte) keyboard_event_scan::keycode#10
|
||||
[438] (byte) keyboard_event_scan::col#1 ← ++ (byte) keyboard_event_scan::col#2
|
||||
[439] if((byte) keyboard_event_scan::col#1!=(byte) 8) goto keyboard_event_scan::@9
|
||||
to:keyboard_event_scan::@15
|
||||
keyboard_event_scan::@15: scope:[keyboard_event_scan] from keyboard_event_scan::@10
|
||||
[441] *((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2) ← (byte) keyboard_event_scan::row_scan#0
|
||||
[440] *((const byte[8]) keyboard_scan_values#0 + (byte) keyboard_event_scan::row#2) ← (byte) keyboard_event_scan::row_scan#0
|
||||
to:keyboard_event_scan::@8
|
||||
keyboard_event_scan::@11: scope:[keyboard_event_scan] from keyboard_event_scan::@13
|
||||
[442] (byte~) keyboard_event_scan::$23 ← (byte) keyboard_event_scan::keycode#10 | (byte) $40
|
||||
[443] *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#10) ← (byte~) keyboard_event_scan::$23
|
||||
[444] (byte) keyboard_events_size#1 ← ++ (byte) keyboard_events_size#10
|
||||
[441] (byte~) keyboard_event_scan::$23 ← (byte) keyboard_event_scan::keycode#10 | (byte) $40
|
||||
[442] *((const byte[8]) keyboard_events#0 + (byte) keyboard_events_size#10) ← (byte~) keyboard_event_scan::$23
|
||||
[443] (byte) keyboard_events_size#1 ← ++ (byte) keyboard_events_size#10
|
||||
to:keyboard_event_scan::@10
|
||||
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_event_scan::@7
|
||||
[445] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0)
|
||||
[446] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0)
|
||||
[444] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0)
|
||||
[445] (byte) keyboard_matrix_read::return#0 ← ~ *((const byte*) CIA1_PORT_B#0)
|
||||
to:keyboard_matrix_read::@return
|
||||
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
|
||||
[447] return
|
||||
[446] return
|
||||
to:@return
|
||||
render_show: scope:[render_show] from main::@3
|
||||
[448] if((byte) render_screen_show#16==(byte) 0) goto render_show::toD0181
|
||||
[447] if((byte) render_screen_show#16==(byte) 0) goto render_show::toD0181
|
||||
to:render_show::toD0182
|
||||
render_show::toD0182: scope:[render_show] from render_show
|
||||
[449] phi()
|
||||
[448] phi()
|
||||
to:render_show::@1
|
||||
render_show::@1: scope:[render_show] from render_show::toD0181 render_show::toD0182
|
||||
[450] (byte) render_show::d018val#3 ← phi( render_show::toD0181/(const byte) render_show::toD0181_return#0 render_show::toD0182/(const byte) render_show::toD0182_return#0 )
|
||||
[451] *((const byte*) D018#0) ← (byte) render_show::d018val#3
|
||||
[452] *((const byte*) BGCOL2#0) ← *((const byte[]) PIECES_COLORS_1#0 + (byte) level#10)
|
||||
[453] *((const byte*) BGCOL3#0) ← *((const byte[]) PIECES_COLORS_2#0 + (byte) level#10)
|
||||
[454] (byte) render_screen_showing#1 ← (byte) render_screen_show#16
|
||||
[449] (byte) render_show::d018val#3 ← phi( render_show::toD0181/(const byte) render_show::toD0181_return#0 render_show::toD0182/(const byte) render_show::toD0182_return#0 )
|
||||
[450] *((const byte*) D018#0) ← (byte) render_show::d018val#3
|
||||
[451] *((const byte*) BGCOL2#0) ← *((const byte[]) PIECES_COLORS_1#0 + (byte) level#10)
|
||||
[452] *((const byte*) BGCOL3#0) ← *((const byte[]) PIECES_COLORS_2#0 + (byte) level#10)
|
||||
[453] (byte) render_screen_showing#1 ← (byte) render_screen_show#16
|
||||
to:render_show::@return
|
||||
render_show::@return: scope:[render_show] from render_show::@1
|
||||
[455] return
|
||||
[454] return
|
||||
to:@return
|
||||
render_show::toD0181: scope:[render_show] from render_show
|
||||
[456] phi()
|
||||
[455] phi()
|
||||
to:render_show::@1
|
||||
play_init: scope:[play_init] from main::@11
|
||||
[457] phi()
|
||||
[456] phi()
|
||||
to:play_init::@1
|
||||
play_init::@1: scope:[play_init] from play_init play_init::@1
|
||||
[458] (byte) play_init::idx#2 ← phi( play_init/(byte) 0 play_init::@1/(byte) play_init::idx#1 )
|
||||
[458] (byte*) play_init::pli#2 ← phi( play_init/(const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 play_init::@1/(byte*) play_init::pli#1 )
|
||||
[458] (byte) play_init::j#2 ← phi( play_init/(byte) 0 play_init::@1/(byte) play_init::j#1 )
|
||||
[459] (byte~) play_init::$4 ← (byte) play_init::j#2 << (byte) 1
|
||||
[460] *((const byte*[PLAYFIELD_LINES#0]) playfield_lines#0 + (byte~) play_init::$4) ← (byte*) play_init::pli#2
|
||||
[461] *((const byte[PLAYFIELD_LINES#0+1]) playfield_lines_idx#0 + (byte) play_init::j#2) ← (byte) play_init::idx#2
|
||||
[462] (byte*) play_init::pli#1 ← (byte*) play_init::pli#2 + (const byte) PLAYFIELD_COLS#0
|
||||
[463] (byte) play_init::idx#1 ← (byte) play_init::idx#2 + (const byte) PLAYFIELD_COLS#0
|
||||
[464] (byte) play_init::j#1 ← ++ (byte) play_init::j#2
|
||||
[465] if((byte) play_init::j#1!=(const byte) PLAYFIELD_LINES#0-(byte) 1+(byte) 1) goto play_init::@1
|
||||
[457] (byte) play_init::idx#2 ← phi( play_init/(byte) 0 play_init::@1/(byte) play_init::idx#1 )
|
||||
[457] (byte*) play_init::pli#2 ← phi( play_init/(const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 play_init::@1/(byte*) play_init::pli#1 )
|
||||
[457] (byte) play_init::j#2 ← phi( play_init/(byte) 0 play_init::@1/(byte) play_init::j#1 )
|
||||
[458] (byte~) play_init::$4 ← (byte) play_init::j#2 << (byte) 1
|
||||
[459] *((const byte*[PLAYFIELD_LINES#0]) playfield_lines#0 + (byte~) play_init::$4) ← (byte*) play_init::pli#2
|
||||
[460] *((const byte[PLAYFIELD_LINES#0+1]) playfield_lines_idx#0 + (byte) play_init::j#2) ← (byte) play_init::idx#2
|
||||
[461] (byte*) play_init::pli#1 ← (byte*) play_init::pli#2 + (const byte) PLAYFIELD_COLS#0
|
||||
[462] (byte) play_init::idx#1 ← (byte) play_init::idx#2 + (const byte) PLAYFIELD_COLS#0
|
||||
[463] (byte) play_init::j#1 ← ++ (byte) play_init::j#2
|
||||
[464] if((byte) play_init::j#1!=(const byte) PLAYFIELD_LINES#0-(byte) 1+(byte) 1) goto play_init::@1
|
||||
to:play_init::@2
|
||||
play_init::@2: scope:[play_init] from play_init::@1
|
||||
[466] *((const byte[PLAYFIELD_LINES#0+1]) playfield_lines_idx#0+(const byte) PLAYFIELD_LINES#0) ← (const byte) PLAYFIELD_COLS#0*(const byte) PLAYFIELD_LINES#0
|
||||
[467] (byte) current_movedown_slow#1 ← *((const byte[]) MOVEDOWN_SLOW_SPEEDS#0)
|
||||
[465] *((const byte[PLAYFIELD_LINES#0+1]) playfield_lines_idx#0+(const byte) PLAYFIELD_LINES#0) ← (const byte) PLAYFIELD_COLS#0*(const byte) PLAYFIELD_LINES#0
|
||||
[466] (byte) current_movedown_slow#1 ← *((const byte[]) MOVEDOWN_SLOW_SPEEDS#0)
|
||||
to:play_init::@3
|
||||
play_init::@3: scope:[play_init] from play_init::@2 play_init::@3
|
||||
[468] (byte) play_init::b#2 ← phi( play_init::@2/(byte) 0 play_init::@3/(byte) play_init::b#1 )
|
||||
[469] (byte~) play_init::$5 ← (byte) play_init::b#2 << (byte) 2
|
||||
[470] *((const dword[5]) score_add_bcd#0 + (byte~) play_init::$5) ← *((const dword[]) SCORE_BASE_BCD#0 + (byte~) play_init::$5)
|
||||
[471] (byte) play_init::b#1 ← ++ (byte) play_init::b#2
|
||||
[472] if((byte) play_init::b#1!=(byte) 5) goto play_init::@3
|
||||
[467] (byte) play_init::b#2 ← phi( play_init::@2/(byte) 0 play_init::@3/(byte) play_init::b#1 )
|
||||
[468] (byte~) play_init::$5 ← (byte) play_init::b#2 << (byte) 2
|
||||
[469] *((const dword[5]) score_add_bcd#0 + (byte~) play_init::$5) ← *((const dword[]) SCORE_BASE_BCD#0 + (byte~) play_init::$5)
|
||||
[470] (byte) play_init::b#1 ← ++ (byte) play_init::b#2
|
||||
[471] if((byte) play_init::b#1!=(byte) 5) goto play_init::@3
|
||||
to:play_init::@return
|
||||
play_init::@return: scope:[play_init] from play_init::@3
|
||||
[473] return
|
||||
[472] return
|
||||
to:@return
|
||||
sprites_irq_init: scope:[sprites_irq_init] from main::@10
|
||||
asm { sei }
|
||||
[475] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
[474] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
asm { ldaCIA1_INTERRUPT }
|
||||
[477] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0
|
||||
[478] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
|
||||
[479] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0
|
||||
[480] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte) $7f
|
||||
[481] *((const byte*) RASTER#0) ← (const byte) IRQ_RASTER_FIRST#0
|
||||
[482] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0
|
||||
[483] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
|
||||
[476] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0
|
||||
[477] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0
|
||||
[478] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0
|
||||
[479] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte) $7f
|
||||
[480] *((const byte*) RASTER#0) ← (const byte) IRQ_RASTER_FIRST#0
|
||||
[481] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0
|
||||
[482] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
|
||||
asm { cli }
|
||||
to:sprites_irq_init::@return
|
||||
sprites_irq_init::@return: scope:[sprites_irq_init] from sprites_irq_init
|
||||
[485] return
|
||||
[484] return
|
||||
to:@return
|
||||
sprites_init: scope:[sprites_init] from main::@9
|
||||
[486] *((const byte*) SPRITES_ENABLE#0) ← (byte) $f
|
||||
[487] *((const byte*) SPRITES_MC#0) ← (byte) 0
|
||||
[488] *((const byte*) SPRITES_EXPAND_Y#0) ← *((const byte*) SPRITES_MC#0)
|
||||
[489] *((const byte*) SPRITES_EXPAND_X#0) ← *((const byte*) SPRITES_EXPAND_Y#0)
|
||||
[485] *((const byte*) SPRITES_ENABLE#0) ← (byte) $f
|
||||
[486] *((const byte*) SPRITES_MC#0) ← (byte) 0
|
||||
[487] *((const byte*) SPRITES_EXPAND_Y#0) ← *((const byte*) SPRITES_MC#0)
|
||||
[488] *((const byte*) SPRITES_EXPAND_X#0) ← *((const byte*) SPRITES_EXPAND_Y#0)
|
||||
to:sprites_init::@1
|
||||
sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1
|
||||
[490] (byte) sprites_init::xpos#2 ← phi( sprites_init/(byte)(number) $18+(number) $f*(number) 8 sprites_init::@1/(byte) sprites_init::xpos#1 )
|
||||
[490] (byte) sprites_init::s#2 ← phi( sprites_init/(byte) 0 sprites_init::@1/(byte) sprites_init::s#1 )
|
||||
[491] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1
|
||||
[492] *((const byte*) SPRITES_XPOS#0 + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2
|
||||
[493] *((const byte*) SPRITES_COLS#0 + (byte) sprites_init::s#2) ← (const byte) BLACK#0
|
||||
[494] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18
|
||||
[495] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2
|
||||
[496] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1
|
||||
[489] (byte) sprites_init::xpos#2 ← phi( sprites_init/(byte)(number) $18+(number) $f*(number) 8 sprites_init::@1/(byte) sprites_init::xpos#1 )
|
||||
[489] (byte) sprites_init::s#2 ← phi( sprites_init/(byte) 0 sprites_init::@1/(byte) sprites_init::s#1 )
|
||||
[490] (byte) sprites_init::s2#0 ← (byte) sprites_init::s#2 << (byte) 1
|
||||
[491] *((const byte*) SPRITES_XPOS#0 + (byte) sprites_init::s2#0) ← (byte) sprites_init::xpos#2
|
||||
[492] *((const byte*) SPRITES_COLS#0 + (byte) sprites_init::s#2) ← (const byte) BLACK#0
|
||||
[493] (byte) sprites_init::xpos#1 ← (byte) sprites_init::xpos#2 + (byte) $18
|
||||
[494] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2
|
||||
[495] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1
|
||||
to:sprites_init::@return
|
||||
sprites_init::@return: scope:[sprites_init] from sprites_init::@1
|
||||
[497] return
|
||||
[496] return
|
||||
to:@return
|
||||
render_init: scope:[render_init] from main::@8
|
||||
[498] phi()
|
||||
[497] phi()
|
||||
to:render_init::vicSelectGfxBank1
|
||||
render_init::vicSelectGfxBank1: scope:[render_init] from render_init
|
||||
[499] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte) 3
|
||||
[498] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte) 3
|
||||
to:render_init::vicSelectGfxBank1_toDd001
|
||||
render_init::vicSelectGfxBank1_toDd001: scope:[render_init] from render_init::vicSelectGfxBank1
|
||||
[500] phi()
|
||||
[499] phi()
|
||||
to:render_init::vicSelectGfxBank1_@1
|
||||
render_init::vicSelectGfxBank1_@1: scope:[render_init] from render_init::vicSelectGfxBank1_toDd001
|
||||
[501] *((const byte*) CIA2_PORT_A#0) ← (const byte) render_init::vicSelectGfxBank1_toDd001_return#0
|
||||
[500] *((const byte*) CIA2_PORT_A#0) ← (const byte) render_init::vicSelectGfxBank1_toDd001_return#0
|
||||
to:render_init::@2
|
||||
render_init::@2: scope:[render_init] from render_init::vicSelectGfxBank1_@1
|
||||
[502] *((const byte*) D011#0) ← (const byte) VIC_ECM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3
|
||||
[503] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0
|
||||
[504] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0
|
||||
[505] *((const byte*) BGCOL2#0) ← *((const byte[]) PIECES_COLORS_1#0)
|
||||
[506] *((const byte*) BGCOL3#0) ← *((const byte[]) PIECES_COLORS_2#0)
|
||||
[507] *((const byte*) BGCOL4#0) ← (const byte) GREY#0
|
||||
[508] call render_screen_original
|
||||
[501] *((const byte*) D011#0) ← (const byte) VIC_ECM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte) 3
|
||||
[502] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0
|
||||
[503] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0
|
||||
[504] *((const byte*) BGCOL2#0) ← *((const byte[]) PIECES_COLORS_1#0)
|
||||
[505] *((const byte*) BGCOL3#0) ← *((const byte[]) PIECES_COLORS_2#0)
|
||||
[506] *((const byte*) BGCOL4#0) ← (const byte) GREY#0
|
||||
[507] call render_screen_original
|
||||
to:render_init::@3
|
||||
render_init::@3: scope:[render_init] from render_init::@2
|
||||
[509] phi()
|
||||
[510] call render_screen_original
|
||||
[508] phi()
|
||||
[509] call render_screen_original
|
||||
to:render_init::@1
|
||||
render_init::@1: scope:[render_init] from render_init::@1 render_init::@3
|
||||
[511] (byte*) render_init::li_2#2 ← phi( render_init::@1/(byte*) render_init::li_2#1 render_init::@3/(const byte*) PLAYFIELD_SCREEN_2#0+(byte)(number) 2*(number) $28+(byte) $10 )
|
||||
[511] (byte*) render_init::li_1#2 ← phi( render_init::@1/(byte*) render_init::li_1#1 render_init::@3/(const byte*) PLAYFIELD_SCREEN_1#0+(byte)(number) 2*(number) $28+(byte) $10 )
|
||||
[511] (byte) render_init::i#2 ← phi( render_init::@1/(byte) render_init::i#1 render_init::@3/(byte) 0 )
|
||||
[512] (byte~) render_init::$13 ← (byte) render_init::i#2 << (byte) 1
|
||||
[513] *((const byte*[PLAYFIELD_LINES#0]) screen_lines_1#0 + (byte~) render_init::$13) ← (byte*) render_init::li_1#2
|
||||
[514] *((const byte*[PLAYFIELD_LINES#0]) screen_lines_2#0 + (byte~) render_init::$13) ← (byte*) render_init::li_2#2
|
||||
[515] (byte*) render_init::li_1#1 ← (byte*) render_init::li_1#2 + (byte) $28
|
||||
[516] (byte*) render_init::li_2#1 ← (byte*) render_init::li_2#2 + (byte) $28
|
||||
[517] (byte) render_init::i#1 ← ++ (byte) render_init::i#2
|
||||
[518] if((byte) render_init::i#1!=(const byte) PLAYFIELD_LINES#0-(byte) 1+(byte) 1) goto render_init::@1
|
||||
[510] (byte*) render_init::li_2#2 ← phi( render_init::@1/(byte*) render_init::li_2#1 render_init::@3/(const byte*) PLAYFIELD_SCREEN_2#0+(byte)(number) 2*(number) $28+(byte) $10 )
|
||||
[510] (byte*) render_init::li_1#2 ← phi( render_init::@1/(byte*) render_init::li_1#1 render_init::@3/(const byte*) PLAYFIELD_SCREEN_1#0+(byte)(number) 2*(number) $28+(byte) $10 )
|
||||
[510] (byte) render_init::i#2 ← phi( render_init::@1/(byte) render_init::i#1 render_init::@3/(byte) 0 )
|
||||
[511] (byte~) render_init::$13 ← (byte) render_init::i#2 << (byte) 1
|
||||
[512] *((const byte*[PLAYFIELD_LINES#0]) screen_lines_1#0 + (byte~) render_init::$13) ← (byte*) render_init::li_1#2
|
||||
[513] *((const byte*[PLAYFIELD_LINES#0]) screen_lines_2#0 + (byte~) render_init::$13) ← (byte*) render_init::li_2#2
|
||||
[514] (byte*) render_init::li_1#1 ← (byte*) render_init::li_1#2 + (byte) $28
|
||||
[515] (byte*) render_init::li_2#1 ← (byte*) render_init::li_2#2 + (byte) $28
|
||||
[516] (byte) render_init::i#1 ← ++ (byte) render_init::i#2
|
||||
[517] if((byte) render_init::i#1!=(const byte) PLAYFIELD_LINES#0-(byte) 1+(byte) 1) goto render_init::@1
|
||||
to:render_init::@return
|
||||
render_init::@return: scope:[render_init] from render_init::@1
|
||||
[519] return
|
||||
[518] return
|
||||
to:@return
|
||||
render_screen_original: scope:[render_screen_original] from render_init::@2 render_init::@3
|
||||
[520] (byte*) render_screen_original::screen#9 ← phi( render_init::@2/(const byte*) PLAYFIELD_SCREEN_1#0 render_init::@3/(const byte*) PLAYFIELD_SCREEN_2#0 )
|
||||
[519] (byte*) render_screen_original::screen#9 ← phi( render_init::@2/(const byte*) PLAYFIELD_SCREEN_1#0 render_init::@3/(const byte*) PLAYFIELD_SCREEN_2#0 )
|
||||
to:render_screen_original::@1
|
||||
render_screen_original::@1: scope:[render_screen_original] from render_screen_original render_screen_original::@5
|
||||
[521] (byte) render_screen_original::y#6 ← phi( render_screen_original/(byte) 0 render_screen_original::@5/(byte) render_screen_original::y#1 )
|
||||
[521] (byte*) render_screen_original::ocols#4 ← phi( render_screen_original/(const byte*) PLAYFIELD_COLORS_ORIGINAL#0+(byte)(number) $20*(number) 2 render_screen_original::@5/(byte*) render_screen_original::ocols#1 )
|
||||
[521] (byte*) render_screen_original::oscr#4 ← phi( render_screen_original/(const byte*) PLAYFIELD_SCREEN_ORIGINAL#0+(byte)(number) $20*(number) 2 render_screen_original::@5/(byte*) render_screen_original::oscr#1 )
|
||||
[521] (byte*) render_screen_original::cols#7 ← phi( render_screen_original/(const byte*) COLS#0 render_screen_original::@5/(byte*) render_screen_original::cols#3 )
|
||||
[521] (byte*) render_screen_original::screen#8 ← phi( render_screen_original/(byte*) render_screen_original::screen#9 render_screen_original::@5/(byte*) render_screen_original::screen#10 )
|
||||
[520] (byte) render_screen_original::y#6 ← phi( render_screen_original/(byte) 0 render_screen_original::@5/(byte) render_screen_original::y#1 )
|
||||
[520] (byte*) render_screen_original::ocols#4 ← phi( render_screen_original/(const byte*) PLAYFIELD_COLORS_ORIGINAL#0+(byte)(number) $20*(number) 2 render_screen_original::@5/(byte*) render_screen_original::ocols#1 )
|
||||
[520] (byte*) render_screen_original::oscr#4 ← phi( render_screen_original/(const byte*) PLAYFIELD_SCREEN_ORIGINAL#0+(byte)(number) $20*(number) 2 render_screen_original::@5/(byte*) render_screen_original::oscr#1 )
|
||||
[520] (byte*) render_screen_original::cols#7 ← phi( render_screen_original/(const byte*) COLS#0 render_screen_original::@5/(byte*) render_screen_original::cols#3 )
|
||||
[520] (byte*) render_screen_original::screen#8 ← phi( render_screen_original/(byte*) render_screen_original::screen#9 render_screen_original::@5/(byte*) render_screen_original::screen#10 )
|
||||
to:render_screen_original::@2
|
||||
render_screen_original::@2: scope:[render_screen_original] from render_screen_original::@1 render_screen_original::@2
|
||||
[522] (byte) render_screen_original::x#4 ← phi( render_screen_original::@1/(byte) 0 render_screen_original::@2/(byte) render_screen_original::x#1 )
|
||||
[522] (byte*) render_screen_original::cols#4 ← phi( render_screen_original::@1/(byte*) render_screen_original::cols#7 render_screen_original::@2/(byte*) render_screen_original::cols#1 )
|
||||
[522] (byte*) render_screen_original::screen#5 ← phi( render_screen_original::@1/(byte*) render_screen_original::screen#8 render_screen_original::@2/(byte*) render_screen_original::screen#2 )
|
||||
[523] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0
|
||||
[524] (byte*) render_screen_original::screen#2 ← ++ (byte*) render_screen_original::screen#5
|
||||
[525] *((byte*) render_screen_original::cols#4) ← (const byte) BLACK#0
|
||||
[526] (byte*) render_screen_original::cols#1 ← ++ (byte*) render_screen_original::cols#4
|
||||
[527] (byte) render_screen_original::x#1 ← ++ (byte) render_screen_original::x#4
|
||||
[528] if((byte) render_screen_original::x#1!=(byte) 4) goto render_screen_original::@2
|
||||
[521] (byte) render_screen_original::x#4 ← phi( render_screen_original::@1/(byte) 0 render_screen_original::@2/(byte) render_screen_original::x#1 )
|
||||
[521] (byte*) render_screen_original::cols#4 ← phi( render_screen_original::@1/(byte*) render_screen_original::cols#7 render_screen_original::@2/(byte*) render_screen_original::cols#1 )
|
||||
[521] (byte*) render_screen_original::screen#5 ← phi( render_screen_original::@1/(byte*) render_screen_original::screen#8 render_screen_original::@2/(byte*) render_screen_original::screen#2 )
|
||||
[522] *((byte*) render_screen_original::screen#5) ← (const byte) render_screen_original::SPACE#0
|
||||
[523] (byte*) render_screen_original::screen#2 ← ++ (byte*) render_screen_original::screen#5
|
||||
[524] *((byte*) render_screen_original::cols#4) ← (const byte) BLACK#0
|
||||
[525] (byte*) render_screen_original::cols#1 ← ++ (byte*) render_screen_original::cols#4
|
||||
[526] (byte) render_screen_original::x#1 ← ++ (byte) render_screen_original::x#4
|
||||
[527] if((byte) render_screen_original::x#1!=(byte) 4) goto render_screen_original::@2
|
||||
to:render_screen_original::@3
|
||||
render_screen_original::@3: scope:[render_screen_original] from render_screen_original::@2 render_screen_original::@3
|
||||
[529] (byte) render_screen_original::x#5 ← phi( render_screen_original::@2/(byte) render_screen_original::x#1 render_screen_original::@3/(byte) render_screen_original::x#2 )
|
||||
[529] (byte*) render_screen_original::cols#5 ← phi( render_screen_original::@2/(byte*) render_screen_original::cols#1 render_screen_original::@3/(byte*) render_screen_original::cols#2 )
|
||||
[529] (byte*) render_screen_original::ocols#2 ← phi( render_screen_original::@2/(byte*) render_screen_original::ocols#4 render_screen_original::@3/(byte*) render_screen_original::ocols#1 )
|
||||
[529] (byte*) render_screen_original::screen#6 ← phi( render_screen_original::@2/(byte*) render_screen_original::screen#2 render_screen_original::@3/(byte*) render_screen_original::screen#3 )
|
||||
[529] (byte*) render_screen_original::oscr#2 ← phi( render_screen_original::@2/(byte*) render_screen_original::oscr#4 render_screen_original::@3/(byte*) render_screen_original::oscr#1 )
|
||||
[530] *((byte*) render_screen_original::screen#6) ← *((byte*) render_screen_original::oscr#2)
|
||||
[531] (byte*) render_screen_original::screen#3 ← ++ (byte*) render_screen_original::screen#6
|
||||
[532] (byte*) render_screen_original::oscr#1 ← ++ (byte*) render_screen_original::oscr#2
|
||||
[533] *((byte*) render_screen_original::cols#5) ← *((byte*) render_screen_original::ocols#2)
|
||||
[534] (byte*) render_screen_original::cols#2 ← ++ (byte*) render_screen_original::cols#5
|
||||
[535] (byte*) render_screen_original::ocols#1 ← ++ (byte*) render_screen_original::ocols#2
|
||||
[536] (byte) render_screen_original::x#2 ← ++ (byte) render_screen_original::x#5
|
||||
[537] if((byte) render_screen_original::x#2!=(byte) $24) goto render_screen_original::@3
|
||||
[528] (byte) render_screen_original::x#5 ← phi( render_screen_original::@2/(byte) render_screen_original::x#1 render_screen_original::@3/(byte) render_screen_original::x#2 )
|
||||
[528] (byte*) render_screen_original::cols#5 ← phi( render_screen_original::@2/(byte*) render_screen_original::cols#1 render_screen_original::@3/(byte*) render_screen_original::cols#2 )
|
||||
[528] (byte*) render_screen_original::ocols#2 ← phi( render_screen_original::@2/(byte*) render_screen_original::ocols#4 render_screen_original::@3/(byte*) render_screen_original::ocols#1 )
|
||||
[528] (byte*) render_screen_original::screen#6 ← phi( render_screen_original::@2/(byte*) render_screen_original::screen#2 render_screen_original::@3/(byte*) render_screen_original::screen#3 )
|
||||
[528] (byte*) render_screen_original::oscr#2 ← phi( render_screen_original::@2/(byte*) render_screen_original::oscr#4 render_screen_original::@3/(byte*) render_screen_original::oscr#1 )
|
||||
[529] *((byte*) render_screen_original::screen#6) ← *((byte*) render_screen_original::oscr#2)
|
||||
[530] (byte*) render_screen_original::screen#3 ← ++ (byte*) render_screen_original::screen#6
|
||||
[531] (byte*) render_screen_original::oscr#1 ← ++ (byte*) render_screen_original::oscr#2
|
||||
[532] *((byte*) render_screen_original::cols#5) ← *((byte*) render_screen_original::ocols#2)
|
||||
[533] (byte*) render_screen_original::cols#2 ← ++ (byte*) render_screen_original::cols#5
|
||||
[534] (byte*) render_screen_original::ocols#1 ← ++ (byte*) render_screen_original::ocols#2
|
||||
[535] (byte) render_screen_original::x#2 ← ++ (byte) render_screen_original::x#5
|
||||
[536] if((byte) render_screen_original::x#2!=(byte) $24) goto render_screen_original::@3
|
||||
to:render_screen_original::@4
|
||||
render_screen_original::@4: scope:[render_screen_original] from render_screen_original::@3 render_screen_original::@4
|
||||
[538] (byte) render_screen_original::x#6 ← phi( render_screen_original::@3/(byte) render_screen_original::x#2 render_screen_original::@4/(byte) render_screen_original::x#3 )
|
||||
[538] (byte*) render_screen_original::cols#6 ← phi( render_screen_original::@3/(byte*) render_screen_original::cols#2 render_screen_original::@4/(byte*) render_screen_original::cols#3 )
|
||||
[538] (byte*) render_screen_original::screen#7 ← phi( render_screen_original::@3/(byte*) render_screen_original::screen#3 render_screen_original::@4/(byte*) render_screen_original::screen#10 )
|
||||
[539] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0
|
||||
[540] (byte*) render_screen_original::screen#10 ← ++ (byte*) render_screen_original::screen#7
|
||||
[541] *((byte*) render_screen_original::cols#6) ← (const byte) BLACK#0
|
||||
[542] (byte*) render_screen_original::cols#3 ← ++ (byte*) render_screen_original::cols#6
|
||||
[543] (byte) render_screen_original::x#3 ← ++ (byte) render_screen_original::x#6
|
||||
[544] if((byte) render_screen_original::x#3!=(byte) $28) goto render_screen_original::@4
|
||||
[537] (byte) render_screen_original::x#6 ← phi( render_screen_original::@3/(byte) render_screen_original::x#2 render_screen_original::@4/(byte) render_screen_original::x#3 )
|
||||
[537] (byte*) render_screen_original::cols#6 ← phi( render_screen_original::@3/(byte*) render_screen_original::cols#2 render_screen_original::@4/(byte*) render_screen_original::cols#3 )
|
||||
[537] (byte*) render_screen_original::screen#7 ← phi( render_screen_original::@3/(byte*) render_screen_original::screen#3 render_screen_original::@4/(byte*) render_screen_original::screen#10 )
|
||||
[538] *((byte*) render_screen_original::screen#7) ← (const byte) render_screen_original::SPACE#0
|
||||
[539] (byte*) render_screen_original::screen#10 ← ++ (byte*) render_screen_original::screen#7
|
||||
[540] *((byte*) render_screen_original::cols#6) ← (const byte) BLACK#0
|
||||
[541] (byte*) render_screen_original::cols#3 ← ++ (byte*) render_screen_original::cols#6
|
||||
[542] (byte) render_screen_original::x#3 ← ++ (byte) render_screen_original::x#6
|
||||
[543] if((byte) render_screen_original::x#3!=(byte) $28) goto render_screen_original::@4
|
||||
to:render_screen_original::@5
|
||||
render_screen_original::@5: scope:[render_screen_original] from render_screen_original::@4
|
||||
[545] (byte) render_screen_original::y#1 ← ++ (byte) render_screen_original::y#6
|
||||
[546] if((byte) render_screen_original::y#1!=(byte) $19) goto render_screen_original::@1
|
||||
[544] (byte) render_screen_original::y#1 ← ++ (byte) render_screen_original::y#6
|
||||
[545] if((byte) render_screen_original::y#1!=(byte) $19) goto render_screen_original::@1
|
||||
to:render_screen_original::@return
|
||||
render_screen_original::@return: scope:[render_screen_original] from render_screen_original::@5
|
||||
[547] return
|
||||
[546] return
|
||||
to:@return
|
||||
sid_rnd_init: scope:[sid_rnd_init] from main
|
||||
[548] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff
|
||||
[549] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
[547] *((const word*) SID_VOICE3_FREQ#0) ← (word) $ffff
|
||||
[548] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
to:sid_rnd_init::@return
|
||||
sid_rnd_init::@return: scope:[sid_rnd_init] from sid_rnd_init
|
||||
[550] return
|
||||
[549] return
|
||||
to:@return
|
||||
sprites_irq: scope:[sprites_irq] from
|
||||
asm { cld }
|
||||
[552] (byte) sprites_irq::ypos#0 ← (byte) irq_sprite_ypos#0
|
||||
[553] *((const byte*) SPRITES_YPOS#0) ← (byte) sprites_irq::ypos#0
|
||||
[554] *((const byte*) SPRITES_YPOS#0+(byte) 2) ← (byte) sprites_irq::ypos#0
|
||||
[555] *((const byte*) SPRITES_YPOS#0+(byte) 4) ← (byte) sprites_irq::ypos#0
|
||||
[556] *((const byte*) SPRITES_YPOS#0+(byte) 6) ← (byte) sprites_irq::ypos#0
|
||||
[557] (byte~) sprites_irq::$0 ← (byte) irq_raster_next#0 + (byte) 1
|
||||
[558] (byte) sprites_irq::raster_sprite_gfx_modify#0 ← (byte~) sprites_irq::$0
|
||||
[551] (byte) sprites_irq::ypos#0 ← (byte) irq_sprite_ypos#0
|
||||
[552] *((const byte*) SPRITES_YPOS#0) ← (byte) sprites_irq::ypos#0
|
||||
[553] *((const byte*) SPRITES_YPOS#0+(byte) 2) ← (byte) sprites_irq::ypos#0
|
||||
[554] *((const byte*) SPRITES_YPOS#0+(byte) 4) ← (byte) sprites_irq::ypos#0
|
||||
[555] *((const byte*) SPRITES_YPOS#0+(byte) 6) ← (byte) sprites_irq::ypos#0
|
||||
[556] (byte~) sprites_irq::$0 ← (byte) irq_raster_next#0 + (byte) 1
|
||||
[557] (byte) sprites_irq::raster_sprite_gfx_modify#0 ← (byte~) sprites_irq::$0
|
||||
to:sprites_irq::@8
|
||||
sprites_irq::@8: scope:[sprites_irq] from sprites_irq sprites_irq::@8
|
||||
[559] if(*((const byte*) RASTER#0)<(byte) sprites_irq::raster_sprite_gfx_modify#0) goto sprites_irq::@8
|
||||
[558] if(*((const byte*) RASTER#0)<(byte) sprites_irq::raster_sprite_gfx_modify#0) goto sprites_irq::@8
|
||||
to:sprites_irq::@9
|
||||
sprites_irq::@9: scope:[sprites_irq] from sprites_irq::@8
|
||||
[560] (byte) sprites_irq::ptr#0 ← (byte) irq_sprite_ptr#0
|
||||
[561] if((byte) render_screen_showing#0==(byte) 0) goto sprites_irq::@1
|
||||
[559] (byte) sprites_irq::ptr#0 ← (byte) irq_sprite_ptr#0
|
||||
[560] if((byte) render_screen_showing#0==(byte) 0) goto sprites_irq::@1
|
||||
to:sprites_irq::@10
|
||||
sprites_irq::@10: scope:[sprites_irq] from sprites_irq::@9
|
||||
[562] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0) ← (byte) sprites_irq::ptr#0
|
||||
[563] (byte) sprites_irq::ptr#3 ← ++ (byte) sprites_irq::ptr#0
|
||||
[564] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0+(byte) 1) ← (byte) sprites_irq::ptr#3
|
||||
[565] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0+(byte) 2) ← (byte) sprites_irq::ptr#3
|
||||
[566] (byte) sprites_irq::ptr#4 ← ++ (byte) sprites_irq::ptr#3
|
||||
[567] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0+(byte) 3) ← (byte) sprites_irq::ptr#4
|
||||
[561] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0) ← (byte) sprites_irq::ptr#0
|
||||
[562] (byte) sprites_irq::ptr#3 ← ++ (byte) sprites_irq::ptr#0
|
||||
[563] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0+(byte) 1) ← (byte) sprites_irq::ptr#3
|
||||
[564] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0+(byte) 2) ← (byte) sprites_irq::ptr#3
|
||||
[565] (byte) sprites_irq::ptr#4 ← ++ (byte) sprites_irq::ptr#3
|
||||
[566] *((const byte*) PLAYFIELD_SPRITE_PTRS_2#0+(byte) 3) ← (byte) sprites_irq::ptr#4
|
||||
to:sprites_irq::@2
|
||||
sprites_irq::@2: scope:[sprites_irq] from sprites_irq::@1 sprites_irq::@10
|
||||
[568] (byte) irq_cnt#1 ← ++ (byte) irq_cnt#0
|
||||
[569] if((byte) irq_cnt#1==(byte) 9) goto sprites_irq::@3
|
||||
[567] (byte) irq_cnt#1 ← ++ (byte) irq_cnt#0
|
||||
[568] if((byte) irq_cnt#1==(byte) 9) goto sprites_irq::@3
|
||||
to:sprites_irq::@6
|
||||
sprites_irq::@6: scope:[sprites_irq] from sprites_irq::@2
|
||||
[570] if((byte) irq_cnt#1==(byte) $a) goto sprites_irq::@4
|
||||
[569] if((byte) irq_cnt#1==(byte) $a) goto sprites_irq::@4
|
||||
to:sprites_irq::@7
|
||||
sprites_irq::@7: scope:[sprites_irq] from sprites_irq::@6
|
||||
[571] (byte) irq_raster_next#3 ← (byte) irq_raster_next#0 + (byte) $14
|
||||
[572] (byte) irq_sprite_ypos#3 ← (byte) irq_sprite_ypos#0 + (byte) $15
|
||||
[573] (byte) irq_sprite_ptr#3 ← (byte) irq_sprite_ptr#0 + (byte) 3
|
||||
[570] (byte) irq_raster_next#3 ← (byte) irq_raster_next#0 + (byte) $14
|
||||
[571] (byte) irq_sprite_ypos#3 ← (byte) irq_sprite_ypos#0 + (byte) $15
|
||||
[572] (byte) irq_sprite_ptr#3 ← (byte) irq_sprite_ptr#0 + (byte) 3
|
||||
to:sprites_irq::@5
|
||||
sprites_irq::@5: scope:[sprites_irq] from sprites_irq::@11 sprites_irq::@4 sprites_irq::@7
|
||||
[574] (byte) irq_sprite_ptr#11 ← phi( sprites_irq::@11/(byte) irq_sprite_ptr#1 sprites_irq::@4/(byte) irq_sprite_ptr#2 sprites_irq::@7/(byte) irq_sprite_ptr#3 )
|
||||
[574] (byte) irq_sprite_ypos#11 ← phi( sprites_irq::@11/(byte) irq_sprite_ypos#1 sprites_irq::@4/(byte) irq_sprite_ypos#2 sprites_irq::@7/(byte) irq_sprite_ypos#3 )
|
||||
[574] (byte) irq_cnt#3 ← phi( sprites_irq::@11/(byte) irq_cnt#1 sprites_irq::@4/(byte) irq_cnt#2 sprites_irq::@7/(byte) irq_cnt#1 )
|
||||
[574] (byte) irq_raster_next#4 ← phi( sprites_irq::@11/(byte) irq_raster_next#1 sprites_irq::@4/(byte) irq_raster_next#2 sprites_irq::@7/(byte) irq_raster_next#3 )
|
||||
[575] *((const byte*) RASTER#0) ← (byte) irq_raster_next#4
|
||||
[576] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
[573] (byte) irq_sprite_ptr#11 ← phi( sprites_irq::@11/(byte) irq_sprite_ptr#1 sprites_irq::@4/(byte) irq_sprite_ptr#2 sprites_irq::@7/(byte) irq_sprite_ptr#3 )
|
||||
[573] (byte) irq_sprite_ypos#11 ← phi( sprites_irq::@11/(byte) irq_sprite_ypos#1 sprites_irq::@4/(byte) irq_sprite_ypos#2 sprites_irq::@7/(byte) irq_sprite_ypos#3 )
|
||||
[573] (byte) irq_cnt#3 ← phi( sprites_irq::@11/(byte) irq_cnt#1 sprites_irq::@4/(byte) irq_cnt#2 sprites_irq::@7/(byte) irq_cnt#1 )
|
||||
[573] (byte) irq_raster_next#4 ← phi( sprites_irq::@11/(byte) irq_raster_next#1 sprites_irq::@4/(byte) irq_raster_next#2 sprites_irq::@7/(byte) irq_raster_next#3 )
|
||||
[574] *((const byte*) RASTER#0) ← (byte) irq_raster_next#4
|
||||
[575] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
|
||||
to:sprites_irq::@return
|
||||
sprites_irq::@return: scope:[sprites_irq] from sprites_irq::@5
|
||||
[577] return
|
||||
[576] return
|
||||
to:@return
|
||||
sprites_irq::@4: scope:[sprites_irq] from sprites_irq::@6
|
||||
[578] (byte) irq_cnt#2 ← (byte) 0
|
||||
[579] (byte) irq_raster_next#2 ← (const byte) IRQ_RASTER_FIRST#0
|
||||
[580] (byte) irq_sprite_ypos#2 ← (byte) irq_sprite_ypos#0 + (byte) $15
|
||||
[581] (byte) irq_sprite_ptr#2 ← (byte) irq_sprite_ptr#0 + (byte) 3
|
||||
[577] (byte) irq_cnt#2 ← (byte) 0
|
||||
[578] (byte) irq_raster_next#2 ← (const byte) IRQ_RASTER_FIRST#0
|
||||
[579] (byte) irq_sprite_ypos#2 ← (byte) irq_sprite_ypos#0 + (byte) $15
|
||||
[580] (byte) irq_sprite_ptr#2 ← (byte) irq_sprite_ptr#0 + (byte) 3
|
||||
to:sprites_irq::@5
|
||||
sprites_irq::@3: scope:[sprites_irq] from sprites_irq::@2
|
||||
[582] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15
|
||||
[583] (byte) irq_sprite_ypos#1 ← (const byte) SPRITES_FIRST_YPOS#0
|
||||
[581] (byte) irq_raster_next#1 ← (byte) irq_raster_next#0 + (byte) $15
|
||||
[582] (byte) irq_sprite_ypos#1 ← (const byte) SPRITES_FIRST_YPOS#0
|
||||
to:sprites_irq::toSpritePtr2
|
||||
sprites_irq::toSpritePtr2: scope:[sprites_irq] from sprites_irq::@3
|
||||
[584] phi()
|
||||
[583] phi()
|
||||
to:sprites_irq::@11
|
||||
sprites_irq::@11: scope:[sprites_irq] from sprites_irq::toSpritePtr2
|
||||
[585] (byte) irq_sprite_ptr#1 ← (const byte) sprites_irq::toSpritePtr2_return#0
|
||||
[584] (byte) irq_sprite_ptr#1 ← (const byte) sprites_irq::toSpritePtr2_return#0
|
||||
to:sprites_irq::@5
|
||||
sprites_irq::@1: scope:[sprites_irq] from sprites_irq::@9
|
||||
[586] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0) ← (byte) sprites_irq::ptr#0
|
||||
[587] (byte) sprites_irq::ptr#1 ← ++ (byte) sprites_irq::ptr#0
|
||||
[588] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0+(byte) 1) ← (byte) sprites_irq::ptr#1
|
||||
[589] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0+(byte) 2) ← (byte) sprites_irq::ptr#1
|
||||
[590] (byte) sprites_irq::ptr#2 ← ++ (byte) sprites_irq::ptr#1
|
||||
[591] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0+(byte) 3) ← (byte) sprites_irq::ptr#2
|
||||
[585] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0) ← (byte) sprites_irq::ptr#0
|
||||
[586] (byte) sprites_irq::ptr#1 ← ++ (byte) sprites_irq::ptr#0
|
||||
[587] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0+(byte) 1) ← (byte) sprites_irq::ptr#1
|
||||
[588] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0+(byte) 2) ← (byte) sprites_irq::ptr#1
|
||||
[589] (byte) sprites_irq::ptr#2 ← ++ (byte) sprites_irq::ptr#1
|
||||
[590] *((const byte*) PLAYFIELD_SPRITE_PTRS_1#0+(byte) 3) ← (byte) sprites_irq::ptr#2
|
||||
to:sprites_irq::@2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -234,7 +234,7 @@
|
||||
(byte~) current_piece_char#101 current_piece_char#101 zp ZP_BYTE:15 22.0
|
||||
(byte) current_piece_char#16 current_piece_char zp ZP_BYTE:38 3.4324324324324325
|
||||
(byte) current_piece_char#29 current_piece_char zp ZP_BYTE:38 6.0
|
||||
(byte) current_piece_char#5 current_piece_char zp ZP_BYTE:38 0.25
|
||||
(byte) current_piece_char#5 current_piece_char zp ZP_BYTE:38 0.25806451612903225
|
||||
(byte) current_piece_char#68 current_piece_char#68 zp ZP_BYTE:15 48.285714285714285
|
||||
(byte*) current_piece_gfx
|
||||
(byte*~) current_piece_gfx#112 current_piece_gfx#112 zp ZP_WORD:36 2.0
|
||||
@ -249,7 +249,7 @@
|
||||
(byte*) current_piece_gfx#64 current_piece_gfx#64 zp ZP_WORD:36 48.285714285714285
|
||||
(byte*) current_piece_gfx#7 current_piece_gfx zp ZP_WORD:25 4.0
|
||||
(byte) current_xpos
|
||||
(byte) current_xpos#100 current_xpos zp ZP_BYTE:43 0.3225806451612903
|
||||
(byte) current_xpos#100 current_xpos zp ZP_BYTE:43 0.3333333333333333
|
||||
(byte~) current_xpos#119 current_xpos#119 zp ZP_BYTE:14 1.3333333333333333
|
||||
(byte~) current_xpos#120 current_xpos#120 zp ZP_BYTE:14 7.333333333333333
|
||||
(byte) current_xpos#14 current_xpos zp ZP_BYTE:43 20.38181818181818
|
||||
@ -266,14 +266,14 @@
|
||||
(byte) current_ypos#19 current_ypos zp ZP_BYTE:24 1.7051282051282046
|
||||
(byte) current_ypos#3 current_ypos zp ZP_BYTE:24 4.0
|
||||
(byte) current_ypos#38 current_ypos zp ZP_BYTE:24 6.0
|
||||
(byte) current_ypos#6 current_ypos zp ZP_BYTE:24 0.3333333333333333
|
||||
(byte) current_ypos#6 current_ypos zp ZP_BYTE:24 0.3448275862068966
|
||||
(byte~) current_ypos#98 reg byte x 1.0
|
||||
(byte~) current_ypos#99 reg byte x 4.4
|
||||
(byte) game_over
|
||||
(byte) game_over#10 game_over zp ZP_BYTE:11 4.804347826086958
|
||||
(byte) game_over#15 game_over zp ZP_BYTE:11 3.189189189189189
|
||||
(byte) game_over#27 game_over zp ZP_BYTE:11 6.0
|
||||
(byte) game_over#52 game_over zp ZP_BYTE:11 0.34782608695652173
|
||||
(byte) game_over#52 game_over zp ZP_BYTE:11 0.36363636363636365
|
||||
(byte) game_over#65 game_over zp ZP_BYTE:11 0.42857142857142855
|
||||
(byte) irq_cnt
|
||||
(byte) irq_cnt#0 irq_cnt zp ZP_BYTE:31 0.17391304347826086
|
||||
@ -710,7 +710,7 @@
|
||||
(byte) play_remove_lines::y#8 y zp ZP_BYTE:12 133.46666666666667
|
||||
(void()) play_spawn_current()
|
||||
(byte~) play_spawn_current::$1 reg byte a 4.0
|
||||
(byte~) play_spawn_current::$7 $7 zp ZP_BYTE:46 0.06451612903225806
|
||||
(byte~) play_spawn_current::$7 $7 zp ZP_BYTE:46 0.06666666666666667
|
||||
(label) play_spawn_current::@1
|
||||
(label) play_spawn_current::@2
|
||||
(label) play_spawn_current::@3
|
||||
@ -720,8 +720,7 @@
|
||||
(byte) play_spawn_current::current_piece_idx
|
||||
(byte) play_spawn_current::current_piece_idx#0 reg byte x 2.5
|
||||
(byte) play_spawn_current::piece_idx
|
||||
(byte) play_spawn_current::piece_idx#1 piece_idx zp ZP_BYTE:10 2002.0
|
||||
(byte) play_spawn_current::piece_idx#2 piece_idx zp ZP_BYTE:10 100.5
|
||||
(byte) play_spawn_current::piece_idx#1 piece_idx zp ZP_BYTE:10 100.5
|
||||
(label) play_spawn_current::sid_rnd1
|
||||
(byte) play_spawn_current::sid_rnd1_return
|
||||
(byte) play_spawn_current::sid_rnd1_return#0 reg byte a 2002.0
|
||||
@ -1098,7 +1097,7 @@ zp ZP_BYTE:7 [ level#33 level#10 level#17 level#19 level#21 ]
|
||||
zp ZP_BYTE:8 [ current_movedown_slow#37 current_movedown_slow#14 current_movedown_slow#21 current_movedown_slow#1 current_movedown_slow#23 current_movedown_slow#66 current_movedown_slow#10 ]
|
||||
zp ZP_BYTE:9 [ level_bcd#31 level_bcd#11 level_bcd#17 level_bcd#19 level_bcd#62 level_bcd#21 level_bcd#8 ]
|
||||
reg byte x [ play_move_down::return#3 ]
|
||||
zp ZP_BYTE:10 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#2 play_spawn_current::piece_idx#1 ]
|
||||
zp ZP_BYTE:10 [ next_piece_idx#17 next_piece_idx#30 next_piece_idx#10 next_piece_idx#16 play_spawn_current::piece_idx#1 ]
|
||||
zp ZP_BYTE:11 [ game_over#65 game_over#27 game_over#10 game_over#15 game_over#52 ]
|
||||
reg byte x [ play_increase_level::b#2 play_increase_level::b#1 ]
|
||||
zp ZP_BYTE:12 [ play_remove_lines::y#8 play_remove_lines::y#1 current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 ]
|
||||
|
@ -10,37 +10,18 @@ main: {
|
||||
sta SCREEN
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
ldy #2
|
||||
ldx #0
|
||||
// loop byte
|
||||
b3:
|
||||
cpx #0
|
||||
beq b4
|
||||
lda #'+'
|
||||
sta SCREEN,y
|
||||
iny
|
||||
ldy #0
|
||||
ldx #2
|
||||
b4:
|
||||
inx
|
||||
cpx #3
|
||||
iny
|
||||
cpy #3
|
||||
bne b3
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
iny
|
||||
sta SCREEN,x
|
||||
inx
|
||||
lda #<0
|
||||
sta i1
|
||||
sta i1+1
|
||||
// loop word
|
||||
b7:
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne !+
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
beq b8
|
||||
!:
|
||||
lda #'+'
|
||||
sta SCREEN,y
|
||||
iny
|
||||
b8:
|
||||
inc i1
|
||||
bne !+
|
||||
@ -53,4 +34,25 @@ main: {
|
||||
cmp #<3
|
||||
bne b7
|
||||
rts
|
||||
// loop word
|
||||
b7:
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne !+
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
beq b8
|
||||
!:
|
||||
lda #'+'
|
||||
sta SCREEN,x
|
||||
inx
|
||||
jmp b8
|
||||
// loop byte
|
||||
b3:
|
||||
cpy #0
|
||||
beq b4
|
||||
lda #'+'
|
||||
sta SCREEN,x
|
||||
inx
|
||||
jmp b4
|
||||
}
|
||||
|
@ -15,39 +15,37 @@ main::@2: scope:[main] from main
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@2
|
||||
[6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' '
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@4
|
||||
[7] (byte) main::idx#10 ← phi( main::@1/(byte) 2 main::@4/(byte) main::idx#11 )
|
||||
[7] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@4/(byte) main::i#1 )
|
||||
[8] if((byte) 0==(byte) main::i#2) goto main::@4
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@3
|
||||
[9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+'
|
||||
[10] (byte) main::idx#4 ← ++ (byte) main::idx#10
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@5
|
||||
[11] (byte) main::idx#11 ← phi( main::@3/(byte) main::idx#10 main::@5/(byte) main::idx#4 )
|
||||
[12] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[13] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
main::@4: scope:[main] from main::@1 main::@3 main::@5
|
||||
[7] (byte) main::i#5 ← phi( main::@3/(byte) main::i#1 main::@1/(byte) 0 main::@5/(byte) main::i#1 )
|
||||
[7] (byte) main::idx#10 ← phi( main::@3/(byte) main::idx#10 main::@1/(byte) 2 main::@5/(byte) main::idx#4 )
|
||||
[8] (byte) main::i#1 ← ++ (byte) main::i#5
|
||||
[9] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@4
|
||||
[14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' '
|
||||
[15] (byte) main::idx#5 ← ++ (byte) main::idx#11
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@6 main::@8
|
||||
[16] (byte) main::idx#12 ← phi( main::@8/(byte) main::idx#17 main::@6/(byte) main::idx#5 )
|
||||
[16] (word) main::i1#2 ← phi( main::@8/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[17] if((byte) 0==(word) main::i1#2) goto main::@8
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@7
|
||||
[18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+'
|
||||
[19] (byte) main::idx#6 ← ++ (byte) main::idx#12
|
||||
[10] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) ' '
|
||||
[11] (byte) main::idx#21 ← ++ (byte) main::idx#10
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main::@7 main::@9
|
||||
[20] (byte) main::idx#17 ← phi( main::@9/(byte) main::idx#6 main::@7/(byte) main::idx#12 )
|
||||
[21] (word) main::i1#1 ← ++ (word) main::i1#2
|
||||
[22] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
main::@8: scope:[main] from main::@6 main::@7 main::@9
|
||||
[12] (word) main::i1#5 ← phi( main::@9/(word) main::i1#1 main::@7/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[12] (byte) main::idx#12 ← phi( main::@9/(byte) main::idx#6 main::@7/(byte) main::idx#12 main::@6/(byte) main::idx#21 )
|
||||
[13] (word) main::i1#1 ← ++ (word) main::i1#5
|
||||
[14] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@8
|
||||
[23] return
|
||||
[15] return
|
||||
to:@return
|
||||
main::@7: scope:[main] from main::@8
|
||||
[16] if((byte) 0==(word) main::i1#1) goto main::@8
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@7
|
||||
[17] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+'
|
||||
[18] (byte) main::idx#6 ← ++ (byte) main::idx#12
|
||||
to:main::@8
|
||||
main::@3: scope:[main] from main::@4
|
||||
[19] if((byte) 0==(byte) main::i#1) goto main::@4
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@3
|
||||
[20] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+'
|
||||
[21] (byte) main::idx#4 ← ++ (byte) main::idx#10
|
||||
to:main::@4
|
||||
|
@ -208,6 +208,8 @@ Eliminating variable (byte) main::idx#1 from unused block main::@3
|
||||
Removing PHI-reference to removed block (main::@3) in block main::@1
|
||||
Removing unused block main::@3
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Adding number conversion cast (unumber) 3 in if((byte) main::i#1!=(number) 3) goto main::@5
|
||||
Adding number conversion cast (unumber) 3 in if((word) main::i1#1!=(number) 3) goto main::@9
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
@ -218,28 +220,48 @@ Finalized unsigned number type (byte) 3
|
||||
Finalized unsigned number type (byte) 3
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias (byte) main::idx#3 = (byte) main::idx#8
|
||||
Alias (byte) main::i#1 = (byte) main::i#2
|
||||
Alias (byte) main::idx#10 = (byte) main::idx#11
|
||||
Alias (word) main::i1#1 = (word) main::i1#2
|
||||
Alias (byte) main::idx#12 = (byte) main::idx#17
|
||||
Alias (byte) main::idx#19 = (byte) main::idx#2
|
||||
Alias (byte) main::idx#21 = (byte) main::idx#5
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) main::idx#13 (const byte) main::idx#0
|
||||
Identical Phi Values (byte) main::i#7 (const byte) main::i#0
|
||||
Identical Phi Values (word) main::i1#7 (const word) main::i1#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Constant right-side identified [5] (byte) main::idx#3 ← ++ (const byte) main::idx#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte) main::idx#3 = ++main::idx#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Removing PHI-reference to removed block (main::@5_1) in block main::@7
|
||||
Removing PHI-reference to removed block (main::@5_1) in block main::@7
|
||||
if() condition always true - replacing block destination [27] if((byte) 0==(const byte) main::i#0) goto main::@6
|
||||
Removing PHI-reference to removed block (main::@9_1) in block main::@11
|
||||
Removing PHI-reference to removed block (main::@9_1) in block main::@11
|
||||
if() condition always true - replacing block destination [29] if((byte) 0==(const word) main::i1#0) goto main::@10
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Simplifying expression containing zero SCREEN#0 in [4] *((const byte*) SCREEN#0 + (const byte) main::idx#0) ← (byte) '+'
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Constant right-side identified [1] (byte) main::idx#2 ← ++ (const byte) main::idx#3
|
||||
Alias (byte) main::i#1 = (byte) main::i#6
|
||||
Alias (byte) main::idx#10 = (byte) main::idx#18
|
||||
Alias (word) main::i1#1 = (word) main::i1#6
|
||||
Alias (byte) main::idx#12 = (byte) main::idx#20
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Constant right-side identified [1] (byte) main::idx#19 ← ++ (const byte) main::idx#3
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte) main::idx#2 = ++main::idx#3
|
||||
Constant (const byte) main::idx#19 = ++main::idx#3
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings (const byte) main::idx#0
|
||||
Inlining constant with var siblings (const byte) main::i#0
|
||||
Inlining constant with var siblings (const word) main::i1#0
|
||||
Inlining constant with var siblings (const byte) main::idx#3
|
||||
Inlining constant with var siblings (const byte) main::idx#2
|
||||
Inlining constant with var siblings (const byte) main::idx#19
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Constant inlined main::i1#0 = (word) 0
|
||||
Constant inlined main::idx#0 = (byte) 0
|
||||
Constant inlined main::idx#2 = ++++(byte) 0
|
||||
Constant inlined main::idx#19 = ++++(byte) 0
|
||||
Constant inlined main::idx#3 = ++(byte) 0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN#0+++0)
|
||||
@ -249,36 +271,35 @@ Simplifying constant integer increment ++0
|
||||
Successful SSA optimization Pass2ConstantSimplification
|
||||
Simplifying constant integer increment ++1
|
||||
Successful SSA optimization Pass2ConstantSimplification
|
||||
Added new block during phi lifting main::@13(between main::@6 and main::@5)
|
||||
Added new block during phi lifting main::@14(between main::@5 and main::@6)
|
||||
Added new block during phi lifting main::@15(between main::@10 and main::@9)
|
||||
Added new block during phi lifting main::@16(between main::@9 and main::@10)
|
||||
Added new block during phi lifting main::@13(between main::@5 and main::@6)
|
||||
Added new block during phi lifting main::@14(between main::@9 and main::@10)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1
|
||||
Adding NOP phi() at start of main::@5_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 6 initial phi equivalence classes
|
||||
Coalesced [13] main::idx#20 ← main::idx#4
|
||||
Coalesced [19] main::idx#22 ← main::idx#5
|
||||
Coalesced [24] main::idx#23 ← main::idx#6
|
||||
Coalesced [29] main::i1#5 ← main::i1#1
|
||||
Coalesced [30] main::idx#21 ← main::idx#17
|
||||
Coalesced (already) [31] main::idx#24 ← main::idx#12
|
||||
Coalesced [32] main::i#5 ← main::i#1
|
||||
Coalesced [33] main::idx#18 ← main::idx#11
|
||||
Coalesced (already) [34] main::idx#19 ← main::idx#10
|
||||
Created 4 initial phi equivalence classes
|
||||
Coalesced [15] main::idx#26 ← main::idx#21
|
||||
Coalesced [23] main::idx#24 ← main::idx#6
|
||||
Coalesced [24] main::i1#8 ← main::i1#1
|
||||
Coalesced (already) [25] main::idx#25 ← main::idx#12
|
||||
Coalesced (already) [26] main::i1#9 ← main::i1#1
|
||||
Coalesced [30] main::idx#23 ← main::idx#4
|
||||
Coalesced [31] main::i#9 ← main::i#1
|
||||
Coalesced (already) [32] main::idx#22 ← main::idx#10
|
||||
Coalesced (already) [33] main::i#8 ← main::i#1
|
||||
Coalesced down to 4 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1
|
||||
Culled Empty Block (label) main::@15
|
||||
Culled Empty Block (label) main::@16
|
||||
Culled Empty Block (label) main::@13
|
||||
Culled Empty Block (label) main::@5_1
|
||||
Culled Empty Block (label) main::@9_1
|
||||
Culled Empty Block (label) main::@14
|
||||
Culled Empty Block (label) main::@13
|
||||
Renumbering block main::@2 to main::@1
|
||||
Renumbering block main::@4 to main::@2
|
||||
Renumbering block main::@5 to main::@3
|
||||
@ -311,76 +332,72 @@ main::@2: scope:[main] from main
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@2
|
||||
[6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' '
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@4
|
||||
[7] (byte) main::idx#10 ← phi( main::@1/(byte) 2 main::@4/(byte) main::idx#11 )
|
||||
[7] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@4/(byte) main::i#1 )
|
||||
[8] if((byte) 0==(byte) main::i#2) goto main::@4
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@3
|
||||
[9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+'
|
||||
[10] (byte) main::idx#4 ← ++ (byte) main::idx#10
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@5
|
||||
[11] (byte) main::idx#11 ← phi( main::@3/(byte) main::idx#10 main::@5/(byte) main::idx#4 )
|
||||
[12] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[13] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
main::@4: scope:[main] from main::@1 main::@3 main::@5
|
||||
[7] (byte) main::i#5 ← phi( main::@3/(byte) main::i#1 main::@1/(byte) 0 main::@5/(byte) main::i#1 )
|
||||
[7] (byte) main::idx#10 ← phi( main::@3/(byte) main::idx#10 main::@1/(byte) 2 main::@5/(byte) main::idx#4 )
|
||||
[8] (byte) main::i#1 ← ++ (byte) main::i#5
|
||||
[9] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@4
|
||||
[14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' '
|
||||
[15] (byte) main::idx#5 ← ++ (byte) main::idx#11
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@6 main::@8
|
||||
[16] (byte) main::idx#12 ← phi( main::@8/(byte) main::idx#17 main::@6/(byte) main::idx#5 )
|
||||
[16] (word) main::i1#2 ← phi( main::@8/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[17] if((byte) 0==(word) main::i1#2) goto main::@8
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@7
|
||||
[18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+'
|
||||
[19] (byte) main::idx#6 ← ++ (byte) main::idx#12
|
||||
[10] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) ' '
|
||||
[11] (byte) main::idx#21 ← ++ (byte) main::idx#10
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main::@7 main::@9
|
||||
[20] (byte) main::idx#17 ← phi( main::@9/(byte) main::idx#6 main::@7/(byte) main::idx#12 )
|
||||
[21] (word) main::i1#1 ← ++ (word) main::i1#2
|
||||
[22] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
main::@8: scope:[main] from main::@6 main::@7 main::@9
|
||||
[12] (word) main::i1#5 ← phi( main::@9/(word) main::i1#1 main::@7/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[12] (byte) main::idx#12 ← phi( main::@9/(byte) main::idx#6 main::@7/(byte) main::idx#12 main::@6/(byte) main::idx#21 )
|
||||
[13] (word) main::i1#1 ← ++ (word) main::i1#5
|
||||
[14] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@8
|
||||
[23] return
|
||||
[15] return
|
||||
to:@return
|
||||
main::@7: scope:[main] from main::@8
|
||||
[16] if((byte) 0==(word) main::i1#1) goto main::@8
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@7
|
||||
[17] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+'
|
||||
[18] (byte) main::idx#6 ← ++ (byte) main::idx#12
|
||||
to:main::@8
|
||||
main::@3: scope:[main] from main::@4
|
||||
[19] if((byte) 0==(byte) main::i#1) goto main::@4
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@3
|
||||
[20] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+'
|
||||
[21] (byte) main::idx#4 ← ++ (byte) main::idx#10
|
||||
to:main::@4
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte*) SCREEN
|
||||
(void()) main()
|
||||
(byte) main::i
|
||||
(byte) main::i#1 16.5
|
||||
(byte) main::i#2 6.6000000000000005
|
||||
(byte) main::i#1 83.0
|
||||
(byte) main::i#5 213.0
|
||||
(word) main::i1
|
||||
(word) main::i1#1 16.5
|
||||
(word) main::i1#2 6.6000000000000005
|
||||
(word) main::i1#1 83.0
|
||||
(word) main::i1#5 213.0
|
||||
(byte) main::idx
|
||||
(byte) main::idx#10 14.666666666666666
|
||||
(byte) main::idx#11 9.25
|
||||
(byte) main::idx#12 15.333333333333332
|
||||
(byte) main::idx#17 11.0
|
||||
(byte) main::idx#10 39.83333333333334
|
||||
(byte) main::idx#12 47.400000000000006
|
||||
(byte) main::idx#21 4.0
|
||||
(byte) main::idx#4 22.0
|
||||
(byte) main::idx#5 4.0
|
||||
(byte) main::idx#6 22.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
[ main::i1#2 main::i1#1 ]
|
||||
[ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
[ main::idx#10 main::idx#4 ]
|
||||
[ main::i#5 main::i#1 ]
|
||||
[ main::idx#12 main::idx#6 main::idx#21 ]
|
||||
[ main::i1#5 main::i1#1 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
[ main::i1#2 main::i1#1 ]
|
||||
[ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
Allocated zp ZP_WORD:4 [ main::i1#2 main::i1#1 ]
|
||||
Allocated zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
[ main::idx#10 main::idx#4 ]
|
||||
[ main::i#5 main::i#1 ]
|
||||
[ main::idx#12 main::idx#6 main::idx#21 ]
|
||||
[ main::i1#5 main::i1#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::idx#10 main::idx#4 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::i#5 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:4 [ main::idx#12 main::idx#6 main::idx#21 ]
|
||||
Allocated zp ZP_WORD:5 [ main::i1#5 main::i1#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -411,13 +428,12 @@ bend_from_b1:
|
||||
bend:
|
||||
// main
|
||||
main: {
|
||||
.label i = 2
|
||||
.label idx = 3
|
||||
.label idx_5 = 6
|
||||
.label i1 = 4
|
||||
.label idx_6 = 6
|
||||
.label idx_12 = 6
|
||||
.label idx_17 = 6
|
||||
.label i = 3
|
||||
.label idx = 2
|
||||
.label i1 = 5
|
||||
.label idx_6 = 4
|
||||
.label idx_12 = 4
|
||||
.label idx_21 = 4
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
@ -430,78 +446,78 @@ main: {
|
||||
// [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' -- _deref_pbuc1=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@3#0] -- vbuz1=vbuc1
|
||||
lda #2
|
||||
sta idx
|
||||
// [7] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@3#1] -- vbuz1=vbuc1
|
||||
// [7] phi from main::@1 to main::@4 [phi:main::@1->main::@4]
|
||||
b4_from_b1:
|
||||
// [7] phi (byte) main::i#5 = (byte) 0 [phi:main::@1->main::@4#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta i
|
||||
jmp b3
|
||||
// loop byte
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#11 [phi:main::@4->main::@3#0] -- register_copy
|
||||
// [7] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@4->main::@3#1] -- register_copy
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [8] if((byte) 0==(byte) main::i#2) goto main::@4 -- vbuc1_eq_vbuz1_then_la1
|
||||
lda #0
|
||||
cmp i
|
||||
beq b4_from_b3
|
||||
jmp b5
|
||||
// main::@5
|
||||
b5:
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #'+'
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [10] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuz1=_inc_vbuz1
|
||||
inc idx
|
||||
// [11] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@4#1] -- vbuz1=vbuc1
|
||||
lda #2
|
||||
sta idx
|
||||
jmp b4
|
||||
// [7] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
b4_from_b3:
|
||||
b4_from_b5:
|
||||
// [11] phi (byte) main::idx#11 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [7] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#1] -- register_copy
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
|
||||
// [8] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuz1=_inc_vbuz1
|
||||
inc i
|
||||
// [13] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuz1_neq_vbuc1_then_la1
|
||||
// [9] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuz1_neq_vbuc1_then_la1
|
||||
lda #3
|
||||
cmp i
|
||||
bne b3_from_b4
|
||||
bne b3
|
||||
jmp b6
|
||||
// main::@6
|
||||
b6:
|
||||
// [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [15] (byte) main::idx#5 ← ++ (byte) main::idx#11 -- vbuz1=_inc_vbuz2
|
||||
// [11] (byte) main::idx#21 ← ++ (byte) main::idx#10 -- vbuz1=_inc_vbuz2
|
||||
ldy idx
|
||||
iny
|
||||
sty idx_5
|
||||
// [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
b7_from_b6:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#5 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) 0 [phi:main::@6->main::@7#1] -- vwuz1=vwuc1
|
||||
sty idx_21
|
||||
// [12] phi from main::@6 to main::@8 [phi:main::@6->main::@8]
|
||||
b8_from_b6:
|
||||
// [12] phi (word) main::i1#5 = (word) 0 [phi:main::@6->main::@8#0] -- vwuz1=vwuc1
|
||||
lda #<0
|
||||
sta i1
|
||||
lda #>0
|
||||
sta i1+1
|
||||
jmp b7
|
||||
// [12] phi (byte) main::idx#12 = (byte) main::idx#21 [phi:main::@6->main::@8#1] -- register_copy
|
||||
jmp b8
|
||||
// [12] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [12] phi (word) main::i1#5 = (word) main::i1#1 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
// [12] phi (byte) main::idx#12 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#1] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [13] (word) main::i1#1 ← ++ (word) main::i1#5 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [14] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [15] return
|
||||
rts
|
||||
// loop word
|
||||
// [16] phi from main::@8 to main::@7 [phi:main::@8->main::@7]
|
||||
b7_from_b8:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#17 [phi:main::@8->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) main::i1#1 [phi:main::@8->main::@7#1] -- register_copy
|
||||
jmp b7
|
||||
// main::@7
|
||||
b7:
|
||||
// [17] if((byte) 0==(word) main::i1#2) goto main::@8 -- vwuc1_eq_vwuz1_then_la1
|
||||
// [16] if((byte) 0==(word) main::i1#1) goto main::@8 -- vwuc1_eq_vwuz1_then_la1
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne !+
|
||||
@ -512,69 +528,63 @@ main: {
|
||||
jmp b9
|
||||
// main::@9
|
||||
b9:
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [17] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #'+'
|
||||
ldy idx_12
|
||||
sta SCREEN,y
|
||||
// [19] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuz1=_inc_vbuz1
|
||||
// [18] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuz1=_inc_vbuz1
|
||||
inc idx_6
|
||||
// [20] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [20] phi (byte) main::idx#17 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [21] (word) main::i1#1 ← ++ (word) main::i1#2 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [22] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7_from_b8
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7_from_b8
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [23] return
|
||||
rts
|
||||
jmp b8_from_b9
|
||||
// loop byte
|
||||
// main::@3
|
||||
b3:
|
||||
// [19] if((byte) 0==(byte) main::i#1) goto main::@4 -- vbuc1_eq_vbuz1_then_la1
|
||||
lda #0
|
||||
cmp i
|
||||
beq b4_from_b3
|
||||
jmp b5
|
||||
// main::@5
|
||||
b5:
|
||||
// [20] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #'+'
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [21] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuz1=_inc_vbuz1
|
||||
inc idx
|
||||
jmp b4_from_b5
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [5] *((const byte*) SCREEN#0) ← (byte) '+' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' [ main::i#2 main::idx#10 ] ( main:2 [ main::i#2 main::idx#10 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
Statement [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' [ main::idx#11 ] ( main:2 [ main::idx#11 ] ) always clobbers reg byte a
|
||||
Statement [17] if((byte) 0==(word) main::i1#2) goto main::@8 [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
Statement [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Statement [22] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::i1#1 main::idx#17 ] ( main:2 [ main::i1#1 main::idx#17 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) ' ' [ main::idx#10 ] ( main:2 [ main::idx#10 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::idx#10 main::idx#4 ]
|
||||
Statement [14] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::idx#12 main::i1#1 ] ( main:2 [ main::idx#12 main::i1#1 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::idx#12 main::idx#6 main::idx#21 ]
|
||||
Statement [16] if((byte) 0==(word) main::i1#1) goto main::@8 [ main::idx#12 main::i1#1 ] ( main:2 [ main::idx#12 main::i1#1 ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' [ main::idx#12 main::i1#1 ] ( main:2 [ main::idx#12 main::i1#1 ] ) always clobbers reg byte a
|
||||
Statement [20] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' [ main::idx#10 main::i#1 ] ( main:2 [ main::idx#10 main::i#1 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::i#5 main::i#1 ]
|
||||
Statement [5] *((const byte*) SCREEN#0) ← (byte) '+' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' [ main::i#2 main::idx#10 ] ( main:2 [ main::i#2 main::idx#10 ] ) always clobbers reg byte a
|
||||
Statement [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' [ main::idx#11 ] ( main:2 [ main::idx#11 ] ) always clobbers reg byte a
|
||||
Statement [17] if((byte) 0==(word) main::i1#2) goto main::@8 [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Statement [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Statement [22] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::i1#1 main::idx#17 ] ( main:2 [ main::i1#1 main::idx#17 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_WORD:4 [ main::i1#2 main::i1#1 ] : zp ZP_WORD:4 ,
|
||||
Potential registers zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] : zp ZP_BYTE:6 , reg byte x , reg byte y ,
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) ' ' [ main::idx#10 ] ( main:2 [ main::idx#10 ] ) always clobbers reg byte a
|
||||
Statement [14] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::idx#12 main::i1#1 ] ( main:2 [ main::idx#12 main::i1#1 ] ) always clobbers reg byte a
|
||||
Statement [16] if((byte) 0==(word) main::i1#1) goto main::@8 [ main::idx#12 main::i1#1 ] ( main:2 [ main::idx#12 main::i1#1 ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' [ main::idx#12 main::i1#1 ] ( main:2 [ main::idx#12 main::i1#1 ] ) always clobbers reg byte a
|
||||
Statement [20] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' [ main::idx#10 main::i#1 ] ( main:2 [ main::idx#10 main::i#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::idx#10 main::idx#4 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::i#5 main::i#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::idx#12 main::idx#6 main::idx#21 ] : zp ZP_BYTE:4 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_WORD:5 [ main::i1#5 main::i1#1 ] : zp ZP_WORD:5 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 52.33: zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] 45.92: zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ] 23.1: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 23.1: zp ZP_WORD:4 [ main::i1#2 main::i1#1 ]
|
||||
Uplift Scope [main] 296: zp ZP_BYTE:3 [ main::i#5 main::i#1 ] 296: zp ZP_WORD:5 [ main::i1#5 main::i1#1 ] 73.4: zp ZP_BYTE:4 [ main::idx#12 main::idx#6 main::idx#21 ] 61.83: zp ZP_BYTE:2 [ main::idx#10 main::idx#4 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 1227 combination reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] reg byte y [ main::idx#10 main::idx#11 main::idx#4 ] reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:4 [ main::i1#2 main::i1#1 ]
|
||||
Uplifting [] best 1227 combination
|
||||
Allocated (was zp ZP_WORD:4) zp ZP_WORD:2 [ main::i1#2 main::i1#1 ]
|
||||
Uplifting [main] best 9462 combination reg byte y [ main::i#5 main::i#1 ] zp ZP_WORD:5 [ main::i1#5 main::i1#1 ] reg byte x [ main::idx#12 main::idx#6 main::idx#21 ] reg byte x [ main::idx#10 main::idx#4 ]
|
||||
Uplifting [] best 9462 combination
|
||||
Allocated (was zp ZP_WORD:5) zp ZP_WORD:2 [ main::i1#5 main::i1#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -617,70 +627,72 @@ main: {
|
||||
// [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' -- _deref_pbuc1=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@3#0] -- vbuyy=vbuc1
|
||||
ldy #2
|
||||
// [7] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@3#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
jmp b3
|
||||
// loop byte
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#11 [phi:main::@4->main::@3#0] -- register_copy
|
||||
// [7] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@4->main::@3#1] -- register_copy
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [8] if((byte) 0==(byte) main::i#2) goto main::@4 -- vbuc1_eq_vbuxx_then_la1
|
||||
cpx #0
|
||||
beq b4_from_b3
|
||||
jmp b5
|
||||
// main::@5
|
||||
b5:
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
lda #'+'
|
||||
sta SCREEN,y
|
||||
// [10] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [11] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
// [7] phi from main::@1 to main::@4 [phi:main::@1->main::@4]
|
||||
b4_from_b1:
|
||||
// [7] phi (byte) main::i#5 = (byte) 0 [phi:main::@1->main::@4#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@4#1] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
jmp b4
|
||||
// [7] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
b4_from_b3:
|
||||
b4_from_b5:
|
||||
// [11] phi (byte) main::idx#11 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [7] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#1] -- register_copy
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [13] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuxx_neq_vbuc1_then_la1
|
||||
cpx #3
|
||||
bne b3_from_b4
|
||||
// [8] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [9] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #3
|
||||
bne b3
|
||||
jmp b6
|
||||
// main::@6
|
||||
b6:
|
||||
// [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
// [15] (byte) main::idx#5 ← ++ (byte) main::idx#11 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
b7_from_b6:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#5 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) 0 [phi:main::@6->main::@7#1] -- vwuz1=vwuc1
|
||||
sta SCREEN,x
|
||||
// [11] (byte) main::idx#21 ← ++ (byte) main::idx#10 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [12] phi from main::@6 to main::@8 [phi:main::@6->main::@8]
|
||||
b8_from_b6:
|
||||
// [12] phi (word) main::i1#5 = (word) 0 [phi:main::@6->main::@8#0] -- vwuz1=vwuc1
|
||||
lda #<0
|
||||
sta i1
|
||||
lda #>0
|
||||
sta i1+1
|
||||
jmp b7
|
||||
// [12] phi (byte) main::idx#12 = (byte) main::idx#21 [phi:main::@6->main::@8#1] -- register_copy
|
||||
jmp b8
|
||||
// [12] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [12] phi (word) main::i1#5 = (word) main::i1#1 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
// [12] phi (byte) main::idx#12 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#1] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [13] (word) main::i1#1 ← ++ (word) main::i1#5 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [14] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [15] return
|
||||
rts
|
||||
// loop word
|
||||
// [16] phi from main::@8 to main::@7 [phi:main::@8->main::@7]
|
||||
b7_from_b8:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#17 [phi:main::@8->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) main::i1#1 [phi:main::@8->main::@7#1] -- register_copy
|
||||
jmp b7
|
||||
// main::@7
|
||||
b7:
|
||||
// [17] if((byte) 0==(word) main::i1#2) goto main::@8 -- vwuc1_eq_vwuz1_then_la1
|
||||
// [16] if((byte) 0==(word) main::i1#1) goto main::@8 -- vwuc1_eq_vwuz1_then_la1
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne !+
|
||||
@ -691,35 +703,27 @@ main: {
|
||||
jmp b9
|
||||
// main::@9
|
||||
b9:
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [17] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'+'
|
||||
sta SCREEN,y
|
||||
// [19] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [20] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [20] phi (byte) main::idx#17 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [21] (word) main::i1#1 ← ++ (word) main::i1#2 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [22] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7_from_b8
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7_from_b8
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [23] return
|
||||
rts
|
||||
sta SCREEN,x
|
||||
// [18] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
jmp b8_from_b9
|
||||
// loop byte
|
||||
// main::@3
|
||||
b3:
|
||||
// [19] if((byte) 0==(byte) main::i#1) goto main::@4 -- vbuc1_eq_vbuyy_then_la1
|
||||
cpy #0
|
||||
beq b4_from_b3
|
||||
jmp b5
|
||||
// main::@5
|
||||
b5:
|
||||
// [20] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'+'
|
||||
sta SCREEN,x
|
||||
// [21] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
jmp b4_from_b5
|
||||
}
|
||||
// File Data
|
||||
|
||||
@ -728,48 +732,43 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b5
|
||||
Removing instruction jmp b4
|
||||
Removing instruction jmp b6
|
||||
Removing instruction jmp b7
|
||||
Removing instruction jmp b9
|
||||
Removing instruction jmp b8
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp b9
|
||||
Removing instruction jmp b5
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #>0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label b4_from_b3 with b4
|
||||
Replacing label b3_from_b4 with b3
|
||||
Replacing label b8_from_b7 with b8
|
||||
Replacing label b7_from_b8 with b7
|
||||
Replacing label b7_from_b8 with b7
|
||||
Replacing label b8_from_b9 with b8
|
||||
Replacing label b4_from_b3 with b4
|
||||
Replacing label b4_from_b5 with b4
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b3_from_b4:
|
||||
Removing instruction b4_from_b3:
|
||||
Removing instruction b4_from_b5:
|
||||
Removing instruction b7_from_b8:
|
||||
Removing instruction b8_from_b7:
|
||||
Removing instruction b8_from_b9:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b2:
|
||||
Removing instruction b1:
|
||||
Removing instruction b3_from_b1:
|
||||
Removing instruction b5:
|
||||
Removing instruction b4_from_b1:
|
||||
Removing instruction b6:
|
||||
Removing instruction b7_from_b6:
|
||||
Removing instruction b9:
|
||||
Removing instruction b8_from_b6:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b9:
|
||||
Removing instruction b5:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b7
|
||||
Removing instruction jmp b4
|
||||
Removing instruction jmp b8
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
@ -792,28 +791,26 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@9
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 6.6000000000000005
|
||||
(byte) main::i#1 reg byte y 83.0
|
||||
(byte) main::i#5 reg byte y 213.0
|
||||
(word) main::i1
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 16.5
|
||||
(word) main::i1#2 i1 zp ZP_WORD:2 6.6000000000000005
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 83.0
|
||||
(word) main::i1#5 i1 zp ZP_WORD:2 213.0
|
||||
(byte) main::idx
|
||||
(byte) main::idx#10 reg byte y 14.666666666666666
|
||||
(byte) main::idx#11 reg byte y 9.25
|
||||
(byte) main::idx#12 reg byte y 15.333333333333332
|
||||
(byte) main::idx#17 reg byte y 11.0
|
||||
(byte) main::idx#4 reg byte y 22.0
|
||||
(byte) main::idx#5 reg byte y 4.0
|
||||
(byte) main::idx#6 reg byte y 22.0
|
||||
(byte) main::idx#10 reg byte x 39.83333333333334
|
||||
(byte) main::idx#12 reg byte x 47.400000000000006
|
||||
(byte) main::idx#21 reg byte x 4.0
|
||||
(byte) main::idx#4 reg byte x 22.0
|
||||
(byte) main::idx#6 reg byte x 22.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
zp ZP_WORD:2 [ main::i1#2 main::i1#1 ]
|
||||
reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
reg byte x [ main::idx#10 main::idx#4 ]
|
||||
reg byte y [ main::i#5 main::i#1 ]
|
||||
reg byte x [ main::idx#12 main::idx#6 main::idx#21 ]
|
||||
zp ZP_WORD:2 [ main::i1#5 main::i1#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 862
|
||||
Score: 6817
|
||||
|
||||
// File Comments
|
||||
// Tests using integer conditions in if()
|
||||
@ -844,61 +841,63 @@ main: {
|
||||
// [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' -- _deref_pbuc1=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@3#0] -- vbuyy=vbuc1
|
||||
ldy #2
|
||||
// [7] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@3#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// loop byte
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#11 [phi:main::@4->main::@3#0] -- register_copy
|
||||
// [7] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@4->main::@3#1] -- register_copy
|
||||
// main::@3
|
||||
b3:
|
||||
// if(i)
|
||||
// [8] if((byte) 0==(byte) main::i#2) goto main::@4 -- vbuc1_eq_vbuxx_then_la1
|
||||
cpx #0
|
||||
beq b4
|
||||
// main::@5
|
||||
// SCREEN[idx++] = '+'
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
lda #'+'
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = '+';
|
||||
// [10] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [11] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
// [11] phi (byte) main::idx#11 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [7] phi from main::@1 to main::@4 [phi:main::@1->main::@4]
|
||||
// [7] phi (byte) main::i#5 = (byte) 0 [phi:main::@1->main::@4#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@4#1] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
// [7] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
// [7] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#1] -- register_copy
|
||||
// main::@4
|
||||
b4:
|
||||
// for( byte i:0..2)
|
||||
// [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [13] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuxx_neq_vbuc1_then_la1
|
||||
cpx #3
|
||||
// [8] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [9] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #3
|
||||
bne b3
|
||||
// main::@6
|
||||
// SCREEN[idx++] = ' '
|
||||
// [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
// [15] (byte) main::idx#5 ← ++ (byte) main::idx#11 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#5 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) 0 [phi:main::@6->main::@7#1] -- vwuz1=vwuc1
|
||||
// [11] (byte) main::idx#21 ← ++ (byte) main::idx#10 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [12] phi from main::@6 to main::@8 [phi:main::@6->main::@8]
|
||||
// [12] phi (word) main::i1#5 = (word) 0 [phi:main::@6->main::@8#0] -- vwuz1=vwuc1
|
||||
lda #<0
|
||||
sta i1
|
||||
sta i1+1
|
||||
// [12] phi (byte) main::idx#12 = (byte) main::idx#21 [phi:main::@6->main::@8#1] -- register_copy
|
||||
// [12] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
// [12] phi (word) main::i1#5 = (word) main::i1#1 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
// [12] phi (byte) main::idx#12 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#1] -- register_copy
|
||||
// main::@8
|
||||
b8:
|
||||
// for( word i:0..2)
|
||||
// [13] (word) main::i1#1 ← ++ (word) main::i1#5 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [14] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7
|
||||
// main::@return
|
||||
// }
|
||||
// [15] return
|
||||
rts
|
||||
// loop word
|
||||
// [16] phi from main::@8 to main::@7 [phi:main::@8->main::@7]
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#17 [phi:main::@8->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) main::i1#1 [phi:main::@8->main::@7#1] -- register_copy
|
||||
// main::@7
|
||||
b7:
|
||||
// if(i)
|
||||
// [17] if((byte) 0==(word) main::i1#2) goto main::@8 -- vwuc1_eq_vwuz1_then_la1
|
||||
// [16] if((byte) 0==(word) main::i1#1) goto main::@8 -- vwuc1_eq_vwuz1_then_la1
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne !+
|
||||
@ -908,33 +907,29 @@ main: {
|
||||
!:
|
||||
// main::@9
|
||||
// SCREEN[idx++] = '+'
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [17] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '+' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'+'
|
||||
sta SCREEN,y
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = '+';
|
||||
// [19] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [20] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
// [20] phi (byte) main::idx#17 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
// main::@8
|
||||
b8:
|
||||
// for( word i:0..2)
|
||||
// [21] (word) main::i1#1 ← ++ (word) main::i1#2 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [22] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7
|
||||
// main::@return
|
||||
// }
|
||||
// [23] return
|
||||
rts
|
||||
// [18] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
jmp b8
|
||||
// loop byte
|
||||
// main::@3
|
||||
b3:
|
||||
// if(i)
|
||||
// [19] if((byte) 0==(byte) main::i#1) goto main::@4 -- vbuc1_eq_vbuyy_then_la1
|
||||
cpy #0
|
||||
beq b4
|
||||
// main::@5
|
||||
// SCREEN[idx++] = '+'
|
||||
// [20] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '+' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'+'
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = '+';
|
||||
// [21] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
jmp b4
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -15,21 +15,19 @@
|
||||
(label) main::@9
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 6.6000000000000005
|
||||
(byte) main::i#1 reg byte y 83.0
|
||||
(byte) main::i#5 reg byte y 213.0
|
||||
(word) main::i1
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 16.5
|
||||
(word) main::i1#2 i1 zp ZP_WORD:2 6.6000000000000005
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 83.0
|
||||
(word) main::i1#5 i1 zp ZP_WORD:2 213.0
|
||||
(byte) main::idx
|
||||
(byte) main::idx#10 reg byte y 14.666666666666666
|
||||
(byte) main::idx#11 reg byte y 9.25
|
||||
(byte) main::idx#12 reg byte y 15.333333333333332
|
||||
(byte) main::idx#17 reg byte y 11.0
|
||||
(byte) main::idx#4 reg byte y 22.0
|
||||
(byte) main::idx#5 reg byte y 4.0
|
||||
(byte) main::idx#6 reg byte y 22.0
|
||||
(byte) main::idx#10 reg byte x 39.83333333333334
|
||||
(byte) main::idx#12 reg byte x 47.400000000000006
|
||||
(byte) main::idx#21 reg byte x 4.0
|
||||
(byte) main::idx#4 reg byte x 22.0
|
||||
(byte) main::idx#6 reg byte x 22.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
zp ZP_WORD:2 [ main::i1#2 main::i1#1 ]
|
||||
reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
reg byte x [ main::idx#10 main::idx#4 ]
|
||||
reg byte y [ main::i#5 main::i#1 ]
|
||||
reg byte x [ main::idx#12 main::idx#6 main::idx#21 ]
|
||||
zp ZP_WORD:2 [ main::i1#5 main::i1#1 ]
|
||||
|
@ -10,36 +10,26 @@ main: {
|
||||
sta SCREEN
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
ldy #2
|
||||
ldx #0
|
||||
// loop byte
|
||||
b3:
|
||||
cpx #0
|
||||
bne b4
|
||||
ldx #2
|
||||
ldy #0
|
||||
b5:
|
||||
lda #'0'
|
||||
sta SCREEN,y
|
||||
iny
|
||||
b4:
|
||||
sta SCREEN,x
|
||||
inx
|
||||
cpx #3
|
||||
b4:
|
||||
iny
|
||||
cpy #3
|
||||
bne b3
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
iny
|
||||
sta SCREEN,x
|
||||
inx
|
||||
lda #<0
|
||||
sta i1
|
||||
sta i1+1
|
||||
// loop word
|
||||
b7:
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
bne b8
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne b8
|
||||
b9:
|
||||
lda #'0'
|
||||
sta SCREEN,y
|
||||
iny
|
||||
sta SCREEN,x
|
||||
inx
|
||||
b8:
|
||||
inc i1
|
||||
bne !+
|
||||
@ -52,4 +42,18 @@ main: {
|
||||
cmp #<3
|
||||
bne b7
|
||||
rts
|
||||
// loop word
|
||||
b7:
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
bne b8
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne b8
|
||||
jmp b9
|
||||
// loop byte
|
||||
b3:
|
||||
cpy #0
|
||||
bne b4
|
||||
jmp b5
|
||||
}
|
||||
|
@ -15,39 +15,39 @@ main::@2: scope:[main] from main
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@2
|
||||
[6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' '
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@4
|
||||
[7] (byte) main::idx#10 ← phi( main::@1/(byte) 2 main::@4/(byte) main::idx#11 )
|
||||
[7] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@4/(byte) main::i#1 )
|
||||
[8] if((byte) 0!=(byte) main::i#2) goto main::@4
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@3
|
||||
[9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '0'
|
||||
[10] (byte) main::idx#4 ← ++ (byte) main::idx#10
|
||||
main::@5: scope:[main] from main::@1 main::@3
|
||||
[7] (byte) main::idx#18 ← phi( main::@3/(byte) main::idx#4 main::@1/(byte) 2 )
|
||||
[7] (byte) main::i#6 ← phi( main::@3/(byte) main::i#1 main::@1/(byte) 0 )
|
||||
[8] *((const byte*) SCREEN#0 + (byte) main::idx#18) ← (byte) '0'
|
||||
[9] (byte) main::idx#4 ← ++ (byte) main::idx#18
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@5
|
||||
[11] (byte) main::idx#11 ← phi( main::@3/(byte) main::idx#10 main::@5/(byte) main::idx#4 )
|
||||
[12] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[13] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
[10] (byte) main::i#5 ← phi( main::@3/(byte) main::i#1 main::@5/(byte) main::i#6 )
|
||||
[11] (byte) main::i#1 ← ++ (byte) main::i#5
|
||||
[12] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@4
|
||||
[14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' '
|
||||
[15] (byte) main::idx#5 ← ++ (byte) main::idx#11
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@6 main::@8
|
||||
[16] (byte) main::idx#12 ← phi( main::@8/(byte) main::idx#17 main::@6/(byte) main::idx#5 )
|
||||
[16] (word) main::i1#2 ← phi( main::@8/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[17] if((byte) 0!=(word) main::i1#2) goto main::@8
|
||||
[13] *((const byte*) SCREEN#0 + (byte) main::idx#4) ← (byte) ' '
|
||||
[14] (byte) main::idx#21 ← ++ (byte) main::idx#4
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@7
|
||||
[18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '0'
|
||||
[19] (byte) main::idx#6 ← ++ (byte) main::idx#12
|
||||
main::@9: scope:[main] from main::@6 main::@7
|
||||
[15] (byte) main::idx#20 ← phi( main::@7/(byte) main::idx#6 main::@6/(byte) main::idx#21 )
|
||||
[15] (word) main::i1#6 ← phi( main::@7/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[16] *((const byte*) SCREEN#0 + (byte) main::idx#20) ← (byte) '0'
|
||||
[17] (byte) main::idx#6 ← ++ (byte) main::idx#20
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main::@7 main::@9
|
||||
[20] (byte) main::idx#17 ← phi( main::@9/(byte) main::idx#6 main::@7/(byte) main::idx#12 )
|
||||
[21] (word) main::i1#1 ← ++ (word) main::i1#2
|
||||
[22] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
[18] (word) main::i1#5 ← phi( main::@9/(word) main::i1#6 main::@7/(word) main::i1#1 )
|
||||
[19] (word) main::i1#1 ← ++ (word) main::i1#5
|
||||
[20] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@8
|
||||
[23] return
|
||||
[21] return
|
||||
to:@return
|
||||
main::@7: scope:[main] from main::@8
|
||||
[22] if((byte) 0!=(word) main::i1#1) goto main::@8
|
||||
to:main::@9
|
||||
main::@3: scope:[main] from main::@4
|
||||
[23] if((byte) 0!=(byte) main::i#1) goto main::@4
|
||||
to:main::@5
|
||||
|
@ -214,6 +214,8 @@ Eliminating variable (byte) main::idx#3 from unused block main::@4
|
||||
Removing PHI-reference to removed block (main::@4) in block main::@2
|
||||
Removing unused block main::@4
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Adding number conversion cast (unumber) 3 in if((byte) main::i#1!=(number) 3) goto main::@5
|
||||
Adding number conversion cast (unumber) 3 in if((word) main::i1#1!=(number) 3) goto main::@9
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
@ -224,25 +226,44 @@ Finalized unsigned number type (byte) 3
|
||||
Finalized unsigned number type (byte) 3
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias (byte) main::idx#1 = (byte) main::idx#13 (byte) main::idx#8
|
||||
Alias (byte) main::i#1 = (byte) main::i#2
|
||||
Alias (byte) main::idx#10 = (byte) main::idx#11
|
||||
Alias (word) main::i1#1 = (word) main::i1#2
|
||||
Alias (byte) main::idx#12 = (byte) main::idx#17
|
||||
Alias (byte) main::idx#19 = (byte) main::idx#2
|
||||
Alias (byte) main::idx#21 = (byte) main::idx#5
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) main::i#7 (const byte) main::i#0
|
||||
Identical Phi Values (word) main::i1#7 (const word) main::i1#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Constant right-side identified [2] (byte) main::idx#1 ← ++ (const byte) main::idx#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte) main::idx#1 = ++main::idx#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant right-side identified [2] (byte) main::idx#2 ← ++ (const byte) main::idx#1
|
||||
Removing PHI-reference to removed block (main::@5_1) in block main::@6
|
||||
Removing PHI-reference to removed block (main::@5_1) in block main::@6
|
||||
if() condition always false - eliminating [27] if((byte) 0!=(const byte) main::i#0) goto main::@6
|
||||
Removing PHI-reference to removed block (main::@9_1) in block main::@10
|
||||
Removing PHI-reference to removed block (main::@9_1) in block main::@10
|
||||
if() condition always false - eliminating [29] if((byte) 0!=(const word) main::i1#0) goto main::@10
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Identical Phi Values (byte) main::idx#10 (byte) main::idx#4
|
||||
Identical Phi Values (byte) main::idx#12 (byte) main::idx#6
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Constant right-side identified [2] (byte) main::idx#19 ← ++ (const byte) main::idx#1
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte) main::idx#2 = ++main::idx#1
|
||||
Constant (const byte) main::idx#19 = ++main::idx#1
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings (const byte) main::idx#0
|
||||
Inlining constant with var siblings (const byte) main::i#0
|
||||
Inlining constant with var siblings (const word) main::i1#0
|
||||
Inlining constant with var siblings (const byte) main::idx#1
|
||||
Inlining constant with var siblings (const byte) main::idx#2
|
||||
Inlining constant with var siblings (const byte) main::idx#19
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Constant inlined main::i1#0 = (word) 0
|
||||
Constant inlined main::idx#0 = (byte) 0
|
||||
Constant inlined main::idx#1 = ++(byte) 0
|
||||
Constant inlined main::idx#2 = ++++(byte) 0
|
||||
Constant inlined main::idx#19 = ++++(byte) 0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN#0+++0)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
@ -251,36 +272,39 @@ Simplifying constant integer increment ++0
|
||||
Successful SSA optimization Pass2ConstantSimplification
|
||||
Simplifying constant integer increment ++1
|
||||
Successful SSA optimization Pass2ConstantSimplification
|
||||
Added new block during phi lifting main::@13(between main::@6 and main::@5)
|
||||
Added new block during phi lifting main::@14(between main::@5 and main::@6)
|
||||
Added new block during phi lifting main::@15(between main::@10 and main::@9)
|
||||
Added new block during phi lifting main::@16(between main::@9 and main::@10)
|
||||
Added new block during phi lifting main::@13(between main::@5 and main::@6)
|
||||
Added new block during phi lifting main::@14(between main::@5 and main::@7)
|
||||
Added new block during phi lifting main::@15(between main::@9 and main::@10)
|
||||
Added new block during phi lifting main::@16(between main::@9 and main::@11)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1
|
||||
Adding NOP phi() at start of main::@5_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 6 initial phi equivalence classes
|
||||
Coalesced [13] main::idx#20 ← main::idx#4
|
||||
Coalesced [19] main::idx#22 ← main::idx#5
|
||||
Coalesced [24] main::idx#23 ← main::idx#6
|
||||
Coalesced [29] main::i1#5 ← main::i1#1
|
||||
Coalesced [30] main::idx#21 ← main::idx#17
|
||||
Coalesced (already) [31] main::idx#24 ← main::idx#12
|
||||
Coalesced [32] main::i#5 ← main::i#1
|
||||
Coalesced [33] main::idx#18 ← main::idx#11
|
||||
Coalesced (already) [34] main::idx#19 ← main::idx#10
|
||||
Coalesced [13] main::i#9 ← main::i#6
|
||||
Coalesced [19] main::idx#24 ← main::idx#21
|
||||
Coalesced [23] main::i1#8 ← main::i1#6
|
||||
Coalesced [29] main::i1#10 ← main::i1#1
|
||||
Coalesced [30] main::idx#23 ← main::idx#6
|
||||
Coalesced (already) [31] main::i1#9 ← main::i1#1
|
||||
Coalesced [33] main::i#10 ← main::i#1
|
||||
Coalesced [34] main::idx#22 ← main::idx#4
|
||||
Coalesced (already) [35] main::i#8 ← main::i#1
|
||||
Coalesced down to 4 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1
|
||||
Culled Empty Block (label) main::@15
|
||||
Culled Empty Block (label) main::@5_1
|
||||
Culled Empty Block (label) main::@9_1
|
||||
Culled Empty Block (label) main::@16
|
||||
Culled Empty Block (label) main::@13
|
||||
Culled Empty Block (label) main::@15
|
||||
Culled Empty Block (label) main::@14
|
||||
Culled Empty Block (label) main::@13
|
||||
Renumbering block main::@2 to main::@1
|
||||
Renumbering block main::@3 to main::@2
|
||||
Renumbering block main::@5 to main::@3
|
||||
@ -313,76 +337,76 @@ main::@2: scope:[main] from main
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main::@2
|
||||
[6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' '
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@4
|
||||
[7] (byte) main::idx#10 ← phi( main::@1/(byte) 2 main::@4/(byte) main::idx#11 )
|
||||
[7] (byte) main::i#2 ← phi( main::@1/(byte) 0 main::@4/(byte) main::i#1 )
|
||||
[8] if((byte) 0!=(byte) main::i#2) goto main::@4
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@3
|
||||
[9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '0'
|
||||
[10] (byte) main::idx#4 ← ++ (byte) main::idx#10
|
||||
main::@5: scope:[main] from main::@1 main::@3
|
||||
[7] (byte) main::idx#18 ← phi( main::@3/(byte) main::idx#4 main::@1/(byte) 2 )
|
||||
[7] (byte) main::i#6 ← phi( main::@3/(byte) main::i#1 main::@1/(byte) 0 )
|
||||
[8] *((const byte*) SCREEN#0 + (byte) main::idx#18) ← (byte) '0'
|
||||
[9] (byte) main::idx#4 ← ++ (byte) main::idx#18
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@5
|
||||
[11] (byte) main::idx#11 ← phi( main::@3/(byte) main::idx#10 main::@5/(byte) main::idx#4 )
|
||||
[12] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[13] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
[10] (byte) main::i#5 ← phi( main::@3/(byte) main::i#1 main::@5/(byte) main::i#6 )
|
||||
[11] (byte) main::i#1 ← ++ (byte) main::i#5
|
||||
[12] if((byte) main::i#1!=(byte) 3) goto main::@3
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@4
|
||||
[14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' '
|
||||
[15] (byte) main::idx#5 ← ++ (byte) main::idx#11
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@6 main::@8
|
||||
[16] (byte) main::idx#12 ← phi( main::@8/(byte) main::idx#17 main::@6/(byte) main::idx#5 )
|
||||
[16] (word) main::i1#2 ← phi( main::@8/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[17] if((byte) 0!=(word) main::i1#2) goto main::@8
|
||||
[13] *((const byte*) SCREEN#0 + (byte) main::idx#4) ← (byte) ' '
|
||||
[14] (byte) main::idx#21 ← ++ (byte) main::idx#4
|
||||
to:main::@9
|
||||
main::@9: scope:[main] from main::@7
|
||||
[18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '0'
|
||||
[19] (byte) main::idx#6 ← ++ (byte) main::idx#12
|
||||
main::@9: scope:[main] from main::@6 main::@7
|
||||
[15] (byte) main::idx#20 ← phi( main::@7/(byte) main::idx#6 main::@6/(byte) main::idx#21 )
|
||||
[15] (word) main::i1#6 ← phi( main::@7/(word) main::i1#1 main::@6/(word) 0 )
|
||||
[16] *((const byte*) SCREEN#0 + (byte) main::idx#20) ← (byte) '0'
|
||||
[17] (byte) main::idx#6 ← ++ (byte) main::idx#20
|
||||
to:main::@8
|
||||
main::@8: scope:[main] from main::@7 main::@9
|
||||
[20] (byte) main::idx#17 ← phi( main::@9/(byte) main::idx#6 main::@7/(byte) main::idx#12 )
|
||||
[21] (word) main::i1#1 ← ++ (word) main::i1#2
|
||||
[22] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
[18] (word) main::i1#5 ← phi( main::@9/(word) main::i1#6 main::@7/(word) main::i1#1 )
|
||||
[19] (word) main::i1#1 ← ++ (word) main::i1#5
|
||||
[20] if((word) main::i1#1!=(byte) 3) goto main::@7
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@8
|
||||
[23] return
|
||||
[21] return
|
||||
to:@return
|
||||
main::@7: scope:[main] from main::@8
|
||||
[22] if((byte) 0!=(word) main::i1#1) goto main::@8
|
||||
to:main::@9
|
||||
main::@3: scope:[main] from main::@4
|
||||
[23] if((byte) 0!=(byte) main::i#1) goto main::@4
|
||||
to:main::@5
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte*) SCREEN
|
||||
(void()) main()
|
||||
(byte) main::i
|
||||
(byte) main::i#1 16.5
|
||||
(byte) main::i#2 6.6000000000000005
|
||||
(byte) main::i#1 168.33333333333331
|
||||
(byte) main::i#5 213.0
|
||||
(byte) main::i#6 37.33333333333333
|
||||
(word) main::i1
|
||||
(word) main::i1#1 16.5
|
||||
(word) main::i1#2 6.6000000000000005
|
||||
(word) main::i1#1 168.33333333333331
|
||||
(word) main::i1#5 213.0
|
||||
(word) main::i1#6 37.33333333333333
|
||||
(byte) main::idx
|
||||
(byte) main::idx#10 14.666666666666666
|
||||
(byte) main::idx#11 9.25
|
||||
(byte) main::idx#12 15.333333333333332
|
||||
(byte) main::idx#17 11.0
|
||||
(byte) main::idx#4 22.0
|
||||
(byte) main::idx#5 4.0
|
||||
(byte) main::idx#6 22.0
|
||||
(byte) main::idx#18 61.5
|
||||
(byte) main::idx#20 62.5
|
||||
(byte) main::idx#21 4.0
|
||||
(byte) main::idx#4 19.33333333333333
|
||||
(byte) main::idx#6 22.4
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
[ main::i1#2 main::i1#1 ]
|
||||
[ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
[ main::idx#18 main::idx#4 ]
|
||||
[ main::i#5 main::i#6 main::i#1 ]
|
||||
[ main::idx#20 main::idx#6 main::idx#21 ]
|
||||
[ main::i1#5 main::i1#6 main::i1#1 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
[ main::i1#2 main::i1#1 ]
|
||||
[ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
Allocated zp ZP_WORD:4 [ main::i1#2 main::i1#1 ]
|
||||
Allocated zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
[ main::idx#18 main::idx#4 ]
|
||||
[ main::i#5 main::i#6 main::i#1 ]
|
||||
[ main::idx#20 main::idx#6 main::idx#21 ]
|
||||
[ main::i1#5 main::i1#6 main::i1#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::idx#18 main::idx#4 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::i#5 main::i#6 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:4 [ main::idx#20 main::idx#6 main::idx#21 ]
|
||||
Allocated zp ZP_WORD:5 [ main::i1#5 main::i1#6 main::i1#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -413,13 +437,12 @@ bend_from_b1:
|
||||
bend:
|
||||
// main
|
||||
main: {
|
||||
.label i = 2
|
||||
.label idx = 3
|
||||
.label idx_5 = 6
|
||||
.label i1 = 4
|
||||
.label idx_6 = 6
|
||||
.label idx_12 = 6
|
||||
.label idx_17 = 6
|
||||
.label i = 3
|
||||
.label idx = 2
|
||||
.label i1 = 5
|
||||
.label idx_6 = 4
|
||||
.label idx_20 = 4
|
||||
.label idx_21 = 4
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
@ -432,150 +455,148 @@ main: {
|
||||
// [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' -- _deref_pbuc1=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@3#0] -- vbuz1=vbuc1
|
||||
// [7] phi from main::@1 to main::@5 [phi:main::@1->main::@5]
|
||||
b5_from_b1:
|
||||
// [7] phi (byte) main::idx#18 = (byte) 2 [phi:main::@1->main::@5#0] -- vbuz1=vbuc1
|
||||
lda #2
|
||||
sta idx
|
||||
// [7] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@3#1] -- vbuz1=vbuc1
|
||||
// [7] phi (byte) main::i#6 = (byte) 0 [phi:main::@1->main::@5#1] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta i
|
||||
jmp b3
|
||||
// loop byte
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#11 [phi:main::@4->main::@3#0] -- register_copy
|
||||
// [7] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@4->main::@3#1] -- register_copy
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [8] if((byte) 0!=(byte) main::i#2) goto main::@4 -- vbuc1_neq_vbuz1_then_la1
|
||||
lda #0
|
||||
cmp i
|
||||
bne b4_from_b3
|
||||
jmp b5
|
||||
// main::@5
|
||||
b5:
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '0' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [8] *((const byte*) SCREEN#0 + (byte) main::idx#18) ← (byte) '0' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #'0'
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [10] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuz1=_inc_vbuz1
|
||||
// [9] (byte) main::idx#4 ← ++ (byte) main::idx#18 -- vbuz1=_inc_vbuz1
|
||||
inc idx
|
||||
// [11] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
// [10] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
b4_from_b3:
|
||||
b4_from_b5:
|
||||
// [11] phi (byte) main::idx#11 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [10] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
|
||||
// [11] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuz1=_inc_vbuz1
|
||||
inc i
|
||||
// [13] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuz1_neq_vbuc1_then_la1
|
||||
// [12] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuz1_neq_vbuc1_then_la1
|
||||
lda #3
|
||||
cmp i
|
||||
bne b3_from_b4
|
||||
bne b3
|
||||
jmp b6
|
||||
// main::@6
|
||||
b6:
|
||||
// [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [13] *((const byte*) SCREEN#0 + (byte) main::idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [15] (byte) main::idx#5 ← ++ (byte) main::idx#11 -- vbuz1=_inc_vbuz2
|
||||
// [14] (byte) main::idx#21 ← ++ (byte) main::idx#4 -- vbuz1=_inc_vbuz2
|
||||
ldy idx
|
||||
iny
|
||||
sty idx_5
|
||||
// [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
b7_from_b6:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#5 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) 0 [phi:main::@6->main::@7#1] -- vwuz1=vwuc1
|
||||
sty idx_21
|
||||
// [15] phi from main::@6 to main::@9 [phi:main::@6->main::@9]
|
||||
b9_from_b6:
|
||||
// [15] phi (byte) main::idx#20 = (byte) main::idx#21 [phi:main::@6->main::@9#0] -- register_copy
|
||||
// [15] phi (word) main::i1#6 = (word) 0 [phi:main::@6->main::@9#1] -- vwuz1=vwuc1
|
||||
lda #<0
|
||||
sta i1
|
||||
lda #>0
|
||||
sta i1+1
|
||||
jmp b7
|
||||
jmp b9
|
||||
// main::@9
|
||||
b9:
|
||||
// [16] *((const byte*) SCREEN#0 + (byte) main::idx#20) ← (byte) '0' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #'0'
|
||||
ldy idx_20
|
||||
sta SCREEN,y
|
||||
// [17] (byte) main::idx#6 ← ++ (byte) main::idx#20 -- vbuz1=_inc_vbuz1
|
||||
inc idx_6
|
||||
// [18] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [18] phi (word) main::i1#5 = (word) main::i1#1 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [19] (word) main::i1#1 ← ++ (word) main::i1#5 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [20] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [21] return
|
||||
rts
|
||||
// loop word
|
||||
// [16] phi from main::@8 to main::@7 [phi:main::@8->main::@7]
|
||||
b7_from_b8:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#17 [phi:main::@8->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) main::i1#1 [phi:main::@8->main::@7#1] -- register_copy
|
||||
jmp b7
|
||||
// main::@7
|
||||
b7:
|
||||
// [17] if((byte) 0!=(word) main::i1#2) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
|
||||
// [22] if((byte) 0!=(word) main::i1#1) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
bne b8_from_b7
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne b8_from_b7
|
||||
// [15] phi from main::@7 to main::@9 [phi:main::@7->main::@9]
|
||||
b9_from_b7:
|
||||
// [15] phi (byte) main::idx#20 = (byte) main::idx#6 [phi:main::@7->main::@9#0] -- register_copy
|
||||
// [15] phi (word) main::i1#6 = (word) main::i1#1 [phi:main::@7->main::@9#1] -- register_copy
|
||||
jmp b9
|
||||
// main::@9
|
||||
b9:
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '0' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #'0'
|
||||
ldy idx_12
|
||||
sta SCREEN,y
|
||||
// [19] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuz1=_inc_vbuz1
|
||||
inc idx_6
|
||||
// [20] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [20] phi (byte) main::idx#17 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [21] (word) main::i1#1 ← ++ (word) main::i1#2 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [22] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7_from_b8
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7_from_b8
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [23] return
|
||||
rts
|
||||
// loop byte
|
||||
// main::@3
|
||||
b3:
|
||||
// [23] if((byte) 0!=(byte) main::i#1) goto main::@4 -- vbuc1_neq_vbuz1_then_la1
|
||||
lda #0
|
||||
cmp i
|
||||
bne b4_from_b3
|
||||
// [7] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
|
||||
b5_from_b3:
|
||||
// [7] phi (byte) main::idx#18 = (byte) main::idx#4 [phi:main::@3->main::@5#0] -- register_copy
|
||||
// [7] phi (byte) main::i#6 = (byte) main::i#1 [phi:main::@3->main::@5#1] -- register_copy
|
||||
jmp b5
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [5] *((const byte*) SCREEN#0) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '0' [ main::i#2 main::idx#10 ] ( main:2 [ main::i#2 main::idx#10 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
Statement [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' [ main::idx#11 ] ( main:2 [ main::idx#11 ] ) always clobbers reg byte a
|
||||
Statement [17] if((byte) 0!=(word) main::i1#2) goto main::@8 [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
Statement [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '0' [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Statement [22] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::i1#1 main::idx#17 ] ( main:2 [ main::i1#1 main::idx#17 ] ) always clobbers reg byte a
|
||||
Statement [8] *((const byte*) SCREEN#0 + (byte) main::idx#18) ← (byte) '0' [ main::i#6 main::idx#18 ] ( main:2 [ main::i#6 main::idx#18 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::i#5 main::i#6 main::i#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::idx#18 main::idx#4 ]
|
||||
Statement [13] *((const byte*) SCREEN#0 + (byte) main::idx#4) ← (byte) ' ' [ main::idx#4 ] ( main:2 [ main::idx#4 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) SCREEN#0 + (byte) main::idx#20) ← (byte) '0' [ main::i1#6 main::idx#20 ] ( main:2 [ main::i1#6 main::idx#20 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::idx#20 main::idx#6 main::idx#21 ]
|
||||
Statement [20] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::i1#1 main::idx#6 ] ( main:2 [ main::i1#1 main::idx#6 ] ) always clobbers reg byte a
|
||||
Statement [22] if((byte) 0!=(word) main::i1#1) goto main::@8 [ main::i1#1 main::idx#6 ] ( main:2 [ main::i1#1 main::idx#6 ] ) always clobbers reg byte a
|
||||
Statement [5] *((const byte*) SCREEN#0) ← (byte) '0' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '0' [ main::i#2 main::idx#10 ] ( main:2 [ main::i#2 main::idx#10 ] ) always clobbers reg byte a
|
||||
Statement [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' [ main::idx#11 ] ( main:2 [ main::idx#11 ] ) always clobbers reg byte a
|
||||
Statement [17] if((byte) 0!=(word) main::i1#2) goto main::@8 [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Statement [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '0' [ main::i1#2 main::idx#12 ] ( main:2 [ main::i1#2 main::idx#12 ] ) always clobbers reg byte a
|
||||
Statement [22] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::i1#1 main::idx#17 ] ( main:2 [ main::i1#1 main::idx#17 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_WORD:4 [ main::i1#2 main::i1#1 ] : zp ZP_WORD:4 ,
|
||||
Potential registers zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] : zp ZP_BYTE:6 , reg byte x , reg byte y ,
|
||||
Statement [8] *((const byte*) SCREEN#0 + (byte) main::idx#18) ← (byte) '0' [ main::i#6 main::idx#18 ] ( main:2 [ main::i#6 main::idx#18 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) SCREEN#0 + (byte) main::idx#4) ← (byte) ' ' [ main::idx#4 ] ( main:2 [ main::idx#4 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) SCREEN#0 + (byte) main::idx#20) ← (byte) '0' [ main::i1#6 main::idx#20 ] ( main:2 [ main::i1#6 main::idx#20 ] ) always clobbers reg byte a
|
||||
Statement [20] if((word) main::i1#1!=(byte) 3) goto main::@7 [ main::i1#1 main::idx#6 ] ( main:2 [ main::i1#1 main::idx#6 ] ) always clobbers reg byte a
|
||||
Statement [22] if((byte) 0!=(word) main::i1#1) goto main::@8 [ main::i1#1 main::idx#6 ] ( main:2 [ main::i1#1 main::idx#6 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::idx#18 main::idx#4 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::i#5 main::i#6 main::i#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::idx#20 main::idx#6 main::idx#21 ] : zp ZP_BYTE:4 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_WORD:5 [ main::i1#5 main::i1#6 main::i1#1 ] : zp ZP_WORD:5 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 52.33: zp ZP_BYTE:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] 45.92: zp ZP_BYTE:3 [ main::idx#10 main::idx#11 main::idx#4 ] 23.1: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 23.1: zp ZP_WORD:4 [ main::i1#2 main::i1#1 ]
|
||||
Uplift Scope [main] 418.67: zp ZP_BYTE:3 [ main::i#5 main::i#6 main::i#1 ] 418.67: zp ZP_WORD:5 [ main::i1#5 main::i1#6 main::i1#1 ] 88.9: zp ZP_BYTE:4 [ main::idx#20 main::idx#6 main::idx#21 ] 80.83: zp ZP_BYTE:2 [ main::idx#18 main::idx#4 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 1227 combination reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] reg byte y [ main::idx#10 main::idx#11 main::idx#4 ] reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:4 [ main::i1#2 main::i1#1 ]
|
||||
Uplifting [] best 1227 combination
|
||||
Allocated (was zp ZP_WORD:4) zp ZP_WORD:2 [ main::i1#2 main::i1#1 ]
|
||||
Uplifting [main] best 7062 combination reg byte y [ main::i#5 main::i#6 main::i#1 ] zp ZP_WORD:5 [ main::i1#5 main::i1#6 main::i1#1 ] reg byte x [ main::idx#20 main::idx#6 main::idx#21 ] reg byte x [ main::idx#18 main::idx#4 ]
|
||||
Uplifting [] best 7062 combination
|
||||
Allocated (was zp ZP_WORD:5) zp ZP_WORD:2 [ main::i1#5 main::i1#6 main::i1#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -618,108 +639,106 @@ main: {
|
||||
// [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' -- _deref_pbuc1=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@3#0] -- vbuyy=vbuc1
|
||||
ldy #2
|
||||
// [7] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@3#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
jmp b3
|
||||
// loop byte
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
b3_from_b4:
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#11 [phi:main::@4->main::@3#0] -- register_copy
|
||||
// [7] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@4->main::@3#1] -- register_copy
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [8] if((byte) 0!=(byte) main::i#2) goto main::@4 -- vbuc1_neq_vbuxx_then_la1
|
||||
cpx #0
|
||||
bne b4_from_b3
|
||||
// [7] phi from main::@1 to main::@5 [phi:main::@1->main::@5]
|
||||
b5_from_b1:
|
||||
// [7] phi (byte) main::idx#18 = (byte) 2 [phi:main::@1->main::@5#0] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
// [7] phi (byte) main::i#6 = (byte) 0 [phi:main::@1->main::@5#1] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
jmp b5
|
||||
// main::@5
|
||||
b5:
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '0' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [8] *((const byte*) SCREEN#0 + (byte) main::idx#18) ← (byte) '0' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'0'
|
||||
sta SCREEN,y
|
||||
// [10] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [11] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
sta SCREEN,x
|
||||
// [9] (byte) main::idx#4 ← ++ (byte) main::idx#18 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [10] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
b4_from_b3:
|
||||
b4_from_b5:
|
||||
// [11] phi (byte) main::idx#11 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [10] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [13] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuxx_neq_vbuc1_then_la1
|
||||
cpx #3
|
||||
bne b3_from_b4
|
||||
// [11] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [12] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #3
|
||||
bne b3
|
||||
jmp b6
|
||||
// main::@6
|
||||
b6:
|
||||
// [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [13] *((const byte*) SCREEN#0 + (byte) main::idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
// [15] (byte) main::idx#5 ← ++ (byte) main::idx#11 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
b7_from_b6:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#5 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) 0 [phi:main::@6->main::@7#1] -- vwuz1=vwuc1
|
||||
sta SCREEN,x
|
||||
// [14] (byte) main::idx#21 ← ++ (byte) main::idx#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [15] phi from main::@6 to main::@9 [phi:main::@6->main::@9]
|
||||
b9_from_b6:
|
||||
// [15] phi (byte) main::idx#20 = (byte) main::idx#21 [phi:main::@6->main::@9#0] -- register_copy
|
||||
// [15] phi (word) main::i1#6 = (word) 0 [phi:main::@6->main::@9#1] -- vwuz1=vwuc1
|
||||
lda #<0
|
||||
sta i1
|
||||
lda #>0
|
||||
sta i1+1
|
||||
jmp b7
|
||||
jmp b9
|
||||
// main::@9
|
||||
b9:
|
||||
// [16] *((const byte*) SCREEN#0 + (byte) main::idx#20) ← (byte) '0' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'0'
|
||||
sta SCREEN,x
|
||||
// [17] (byte) main::idx#6 ← ++ (byte) main::idx#20 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [18] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [18] phi (word) main::i1#5 = (word) main::i1#1 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [19] (word) main::i1#1 ← ++ (word) main::i1#5 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [20] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [21] return
|
||||
rts
|
||||
// loop word
|
||||
// [16] phi from main::@8 to main::@7 [phi:main::@8->main::@7]
|
||||
b7_from_b8:
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#17 [phi:main::@8->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) main::i1#1 [phi:main::@8->main::@7#1] -- register_copy
|
||||
jmp b7
|
||||
// main::@7
|
||||
b7:
|
||||
// [17] if((byte) 0!=(word) main::i1#2) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
|
||||
// [22] if((byte) 0!=(word) main::i1#1) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
bne b8_from_b7
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne b8_from_b7
|
||||
// [15] phi from main::@7 to main::@9 [phi:main::@7->main::@9]
|
||||
b9_from_b7:
|
||||
// [15] phi (byte) main::idx#20 = (byte) main::idx#6 [phi:main::@7->main::@9#0] -- register_copy
|
||||
// [15] phi (word) main::i1#6 = (word) main::i1#1 [phi:main::@7->main::@9#1] -- register_copy
|
||||
jmp b9
|
||||
// main::@9
|
||||
b9:
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '0' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
lda #'0'
|
||||
sta SCREEN,y
|
||||
// [19] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [20] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
b8_from_b7:
|
||||
b8_from_b9:
|
||||
// [20] phi (byte) main::idx#17 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
jmp b8
|
||||
// main::@8
|
||||
b8:
|
||||
// [21] (word) main::i1#1 ← ++ (word) main::i1#2 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [22] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7_from_b8
|
||||
lda i1
|
||||
cmp #<3
|
||||
bne b7_from_b8
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [23] return
|
||||
rts
|
||||
// loop byte
|
||||
// main::@3
|
||||
b3:
|
||||
// [23] if((byte) 0!=(byte) main::i#1) goto main::@4 -- vbuc1_neq_vbuyy_then_la1
|
||||
cpy #0
|
||||
bne b4_from_b3
|
||||
// [7] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
|
||||
b5_from_b3:
|
||||
// [7] phi (byte) main::idx#18 = (byte) main::idx#4 [phi:main::@3->main::@5#0] -- register_copy
|
||||
// [7] phi (byte) main::i#6 = (byte) main::i#1 [phi:main::@3->main::@5#1] -- register_copy
|
||||
jmp b5
|
||||
}
|
||||
// File Data
|
||||
|
||||
@ -728,50 +747,40 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b5
|
||||
Removing instruction jmp b4
|
||||
Removing instruction jmp b6
|
||||
Removing instruction jmp b7
|
||||
Removing instruction jmp b9
|
||||
Removing instruction jmp b8
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #>0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label b8_from_b7 with b8
|
||||
Replacing label b8_from_b7 with b8
|
||||
Replacing label b4_from_b3 with b4
|
||||
Replacing label b3_from_b4 with b3
|
||||
Replacing label b8_from_b7 with b8
|
||||
Replacing label b8_from_b7 with b8
|
||||
Replacing label b7_from_b8 with b7
|
||||
Replacing label b7_from_b8 with b7
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b3_from_b4:
|
||||
Removing instruction b4_from_b3:
|
||||
Removing instruction b4_from_b5:
|
||||
Removing instruction b7_from_b8:
|
||||
Removing instruction b8_from_b7:
|
||||
Removing instruction b8_from_b9:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b2:
|
||||
Removing instruction b1:
|
||||
Removing instruction b3_from_b1:
|
||||
Removing instruction b5:
|
||||
Removing instruction b5_from_b1:
|
||||
Removing instruction b6:
|
||||
Removing instruction b7_from_b6:
|
||||
Removing instruction b9:
|
||||
Removing instruction b9_from_b6:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b9_from_b7:
|
||||
Removing instruction b5_from_b3:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b7
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -793,28 +802,28 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@9
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 6.6000000000000005
|
||||
(byte) main::i#1 reg byte y 168.33333333333331
|
||||
(byte) main::i#5 reg byte y 213.0
|
||||
(byte) main::i#6 reg byte y 37.33333333333333
|
||||
(word) main::i1
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 16.5
|
||||
(word) main::i1#2 i1 zp ZP_WORD:2 6.6000000000000005
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 168.33333333333331
|
||||
(word) main::i1#5 i1 zp ZP_WORD:2 213.0
|
||||
(word) main::i1#6 i1 zp ZP_WORD:2 37.33333333333333
|
||||
(byte) main::idx
|
||||
(byte) main::idx#10 reg byte y 14.666666666666666
|
||||
(byte) main::idx#11 reg byte y 9.25
|
||||
(byte) main::idx#12 reg byte y 15.333333333333332
|
||||
(byte) main::idx#17 reg byte y 11.0
|
||||
(byte) main::idx#4 reg byte y 22.0
|
||||
(byte) main::idx#5 reg byte y 4.0
|
||||
(byte) main::idx#6 reg byte y 22.0
|
||||
(byte) main::idx#18 reg byte x 61.5
|
||||
(byte) main::idx#20 reg byte x 62.5
|
||||
(byte) main::idx#21 reg byte x 4.0
|
||||
(byte) main::idx#4 reg byte x 19.33333333333333
|
||||
(byte) main::idx#6 reg byte x 22.4
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
zp ZP_WORD:2 [ main::i1#2 main::i1#1 ]
|
||||
reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
reg byte x [ main::idx#18 main::idx#4 ]
|
||||
reg byte y [ main::i#5 main::i#6 main::i#1 ]
|
||||
reg byte x [ main::idx#20 main::idx#6 main::idx#21 ]
|
||||
zp ZP_WORD:2 [ main::i1#5 main::i1#6 main::i1#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 862
|
||||
Score: 5737
|
||||
|
||||
// File Comments
|
||||
// Tests using integer conditions in if()
|
||||
@ -845,86 +854,64 @@ main: {
|
||||
// [6] *((const byte*) SCREEN#0+(byte) 1) ← (byte) ' ' -- _deref_pbuc1=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN+1
|
||||
// [7] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
// [7] phi (byte) main::idx#10 = (byte) 2 [phi:main::@1->main::@3#0] -- vbuyy=vbuc1
|
||||
ldy #2
|
||||
// [7] phi (byte) main::i#2 = (byte) 0 [phi:main::@1->main::@3#1] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// loop byte
|
||||
// [7] phi from main::@4 to main::@3 [phi:main::@4->main::@3]
|
||||
// [7] phi (byte) main::idx#10 = (byte) main::idx#11 [phi:main::@4->main::@3#0] -- register_copy
|
||||
// [7] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@4->main::@3#1] -- register_copy
|
||||
// main::@3
|
||||
b3:
|
||||
// if(!i)
|
||||
// [8] if((byte) 0!=(byte) main::i#2) goto main::@4 -- vbuc1_neq_vbuxx_then_la1
|
||||
cpx #0
|
||||
bne b4
|
||||
// [7] phi from main::@1 to main::@5 [phi:main::@1->main::@5]
|
||||
// [7] phi (byte) main::idx#18 = (byte) 2 [phi:main::@1->main::@5#0] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
// [7] phi (byte) main::i#6 = (byte) 0 [phi:main::@1->main::@5#1] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
// main::@5
|
||||
b5:
|
||||
// SCREEN[idx++] = '0'
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#10) ← (byte) '0' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [8] *((const byte*) SCREEN#0 + (byte) main::idx#18) ← (byte) '0' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'0'
|
||||
sta SCREEN,y
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = '0';
|
||||
// [10] (byte) main::idx#4 ← ++ (byte) main::idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [11] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
// [11] phi (byte) main::idx#11 = (byte) main::idx#10 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// [9] (byte) main::idx#4 ← ++ (byte) main::idx#18 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [10] phi from main::@3 main::@5 to main::@4 [phi:main::@3/main::@5->main::@4]
|
||||
// [10] phi (byte) main::i#5 = (byte) main::i#1 [phi:main::@3/main::@5->main::@4#0] -- register_copy
|
||||
// main::@4
|
||||
b4:
|
||||
// for( byte i:0..2)
|
||||
// [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [13] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuxx_neq_vbuc1_then_la1
|
||||
cpx #3
|
||||
// [11] (byte) main::i#1 ← ++ (byte) main::i#5 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [12] if((byte) main::i#1!=(byte) 3) goto main::@3 -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #3
|
||||
bne b3
|
||||
// main::@6
|
||||
// SCREEN[idx++] = ' '
|
||||
// [14] *((const byte*) SCREEN#0 + (byte) main::idx#11) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [13] *((const byte*) SCREEN#0 + (byte) main::idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
// [15] (byte) main::idx#5 ← ++ (byte) main::idx#11 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [16] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#5 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) 0 [phi:main::@6->main::@7#1] -- vwuz1=vwuc1
|
||||
// [14] (byte) main::idx#21 ← ++ (byte) main::idx#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [15] phi from main::@6 to main::@9 [phi:main::@6->main::@9]
|
||||
// [15] phi (byte) main::idx#20 = (byte) main::idx#21 [phi:main::@6->main::@9#0] -- register_copy
|
||||
// [15] phi (word) main::i1#6 = (word) 0 [phi:main::@6->main::@9#1] -- vwuz1=vwuc1
|
||||
lda #<0
|
||||
sta i1
|
||||
sta i1+1
|
||||
// loop word
|
||||
// [16] phi from main::@8 to main::@7 [phi:main::@8->main::@7]
|
||||
// [16] phi (byte) main::idx#12 = (byte) main::idx#17 [phi:main::@8->main::@7#0] -- register_copy
|
||||
// [16] phi (word) main::i1#2 = (word) main::i1#1 [phi:main::@8->main::@7#1] -- register_copy
|
||||
// main::@7
|
||||
b7:
|
||||
// if(!i)
|
||||
// [17] if((byte) 0!=(word) main::i1#2) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
bne b8
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne b8
|
||||
// main::@9
|
||||
b9:
|
||||
// SCREEN[idx++] = '0'
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) main::idx#12) ← (byte) '0' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [16] *((const byte*) SCREEN#0 + (byte) main::idx#20) ← (byte) '0' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #'0'
|
||||
sta SCREEN,y
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = '0';
|
||||
// [19] (byte) main::idx#6 ← ++ (byte) main::idx#12 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [20] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
// [20] phi (byte) main::idx#17 = (byte) main::idx#12 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
// [17] (byte) main::idx#6 ← ++ (byte) main::idx#20 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [18] phi from main::@7 main::@9 to main::@8 [phi:main::@7/main::@9->main::@8]
|
||||
// [18] phi (word) main::i1#5 = (word) main::i1#1 [phi:main::@7/main::@9->main::@8#0] -- register_copy
|
||||
// main::@8
|
||||
b8:
|
||||
// for( word i:0..2)
|
||||
// [21] (word) main::i1#1 ← ++ (word) main::i1#2 -- vwuz1=_inc_vwuz1
|
||||
// [19] (word) main::i1#1 ← ++ (word) main::i1#5 -- vwuz1=_inc_vwuz1
|
||||
inc i1
|
||||
bne !+
|
||||
inc i1+1
|
||||
!:
|
||||
// [22] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
// [20] if((word) main::i1#1!=(byte) 3) goto main::@7 -- vwuz1_neq_vwuc1_then_la1
|
||||
lda i1+1
|
||||
cmp #>3
|
||||
bne b7
|
||||
@ -933,8 +920,34 @@ main: {
|
||||
bne b7
|
||||
// main::@return
|
||||
// }
|
||||
// [23] return
|
||||
// [21] return
|
||||
rts
|
||||
// loop word
|
||||
// main::@7
|
||||
b7:
|
||||
// if(!i)
|
||||
// [22] if((byte) 0!=(word) main::i1#1) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
|
||||
lda i1+1
|
||||
cmp #>0
|
||||
bne b8
|
||||
lda i1
|
||||
cmp #<0
|
||||
bne b8
|
||||
// [15] phi from main::@7 to main::@9 [phi:main::@7->main::@9]
|
||||
// [15] phi (byte) main::idx#20 = (byte) main::idx#6 [phi:main::@7->main::@9#0] -- register_copy
|
||||
// [15] phi (word) main::i1#6 = (word) main::i1#1 [phi:main::@7->main::@9#1] -- register_copy
|
||||
jmp b9
|
||||
// loop byte
|
||||
// main::@3
|
||||
b3:
|
||||
// if(!i)
|
||||
// [23] if((byte) 0!=(byte) main::i#1) goto main::@4 -- vbuc1_neq_vbuyy_then_la1
|
||||
cpy #0
|
||||
bne b4
|
||||
// [7] phi from main::@3 to main::@5 [phi:main::@3->main::@5]
|
||||
// [7] phi (byte) main::idx#18 = (byte) main::idx#4 [phi:main::@3->main::@5#0] -- register_copy
|
||||
// [7] phi (byte) main::i#6 = (byte) main::i#1 [phi:main::@3->main::@5#1] -- register_copy
|
||||
jmp b5
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -15,21 +15,21 @@
|
||||
(label) main::@9
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 6.6000000000000005
|
||||
(byte) main::i#1 reg byte y 168.33333333333331
|
||||
(byte) main::i#5 reg byte y 213.0
|
||||
(byte) main::i#6 reg byte y 37.33333333333333
|
||||
(word) main::i1
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 16.5
|
||||
(word) main::i1#2 i1 zp ZP_WORD:2 6.6000000000000005
|
||||
(word) main::i1#1 i1 zp ZP_WORD:2 168.33333333333331
|
||||
(word) main::i1#5 i1 zp ZP_WORD:2 213.0
|
||||
(word) main::i1#6 i1 zp ZP_WORD:2 37.33333333333333
|
||||
(byte) main::idx
|
||||
(byte) main::idx#10 reg byte y 14.666666666666666
|
||||
(byte) main::idx#11 reg byte y 9.25
|
||||
(byte) main::idx#12 reg byte y 15.333333333333332
|
||||
(byte) main::idx#17 reg byte y 11.0
|
||||
(byte) main::idx#4 reg byte y 22.0
|
||||
(byte) main::idx#5 reg byte y 4.0
|
||||
(byte) main::idx#6 reg byte y 22.0
|
||||
(byte) main::idx#18 reg byte x 61.5
|
||||
(byte) main::idx#20 reg byte x 62.5
|
||||
(byte) main::idx#21 reg byte x 4.0
|
||||
(byte) main::idx#4 reg byte x 19.33333333333333
|
||||
(byte) main::idx#6 reg byte x 22.4
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ main::idx#10 main::idx#11 main::idx#4 ]
|
||||
zp ZP_WORD:2 [ main::i1#2 main::i1#1 ]
|
||||
reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
|
||||
reg byte x [ main::idx#18 main::idx#4 ]
|
||||
reg byte y [ main::i#5 main::i#6 main::i#1 ]
|
||||
reg byte x [ main::idx#20 main::idx#6 main::idx#21 ]
|
||||
zp ZP_WORD:2 [ main::i1#5 main::i1#6 main::i1#1 ]
|
||||
|
@ -7,8 +7,12 @@
|
||||
main: {
|
||||
ldy #0
|
||||
ldx #2
|
||||
b2:
|
||||
txa
|
||||
sta SCREEN,y
|
||||
iny
|
||||
dex
|
||||
// for()
|
||||
b1:
|
||||
cpx #0
|
||||
bne b2
|
||||
lda #' '
|
||||
@ -36,10 +40,4 @@ main: {
|
||||
sta SCREEN,y
|
||||
iny
|
||||
jmp b4
|
||||
b2:
|
||||
txa
|
||||
sta SCREEN,y
|
||||
iny
|
||||
dex
|
||||
jmp b1
|
||||
}
|
||||
|
@ -9,43 +9,43 @@
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) idx#19 ← phi( main::@1/(byte) idx#1 main/(byte) 0 )
|
||||
[5] (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main/(byte) 2 )
|
||||
[6] *((const byte*) SCREEN#0 + (byte) idx#19) ← (byte) main::i#4
|
||||
[7] (byte) idx#1 ← ++ (byte) idx#19
|
||||
[8] (byte) main::i#1 ← -- (byte) main::i#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) idx#15 ← phi( main/(byte) 0 main::@2/(byte) idx#1 )
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 )
|
||||
[6] if((byte) 0!=(byte) main::i#2) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((byte) 0!=(byte) main::i#1) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1
|
||||
[7] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' '
|
||||
[8] (byte) idx#2 ← ++ (byte) idx#15
|
||||
[10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' '
|
||||
[11] (byte) idx#2 ← ++ (byte) idx#1
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@5
|
||||
[9] (byte) idx#10 ← phi( main::@3/(byte) idx#2 main::@5/(byte) idx#3 )
|
||||
[9] (byte) main::j#2 ← phi( main::@3/(byte) 3 main::@5/(byte) main::j#1 )
|
||||
[10] (byte) main::j#1 ← -- (byte) main::j#2
|
||||
[11] if((byte) 0!=(byte) main::j#1) goto main::@5
|
||||
[12] (byte) idx#10 ← phi( main::@3/(byte) idx#2 main::@5/(byte) idx#3 )
|
||||
[12] (byte) main::j#2 ← phi( main::@3/(byte) 3 main::@5/(byte) main::j#1 )
|
||||
[13] (byte) main::j#1 ← -- (byte) main::j#2
|
||||
[14] if((byte) 0!=(byte) main::j#1) goto main::@5
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@4
|
||||
[12] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' '
|
||||
[13] (byte) idx#4 ← ++ (byte) idx#10
|
||||
[15] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' '
|
||||
[16] (byte) idx#4 ← ++ (byte) idx#10
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@6 main::@7
|
||||
[14] (byte) idx#12 ← phi( main::@7/(byte) idx#13 main::@6/(byte) idx#4 )
|
||||
[14] (byte) main::k#2 ← phi( main::@7/(byte) main::k#1 main::@6/(byte) 2 )
|
||||
[15] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2
|
||||
[16] (byte) idx#13 ← ++ (byte) idx#12
|
||||
[17] (byte) main::k#1 ← -- (byte) main::k#2
|
||||
[18] if((byte) 0!=(byte) main::k#1) goto main::@7
|
||||
[17] (byte) idx#12 ← phi( main::@7/(byte) idx#13 main::@6/(byte) idx#4 )
|
||||
[17] (byte) main::k#2 ← phi( main::@7/(byte) main::k#1 main::@6/(byte) 2 )
|
||||
[18] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2
|
||||
[19] (byte) idx#13 ← ++ (byte) idx#12
|
||||
[20] (byte) main::k#1 ← -- (byte) main::k#2
|
||||
[21] if((byte) 0!=(byte) main::k#1) goto main::@7
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@7
|
||||
[19] return
|
||||
[22] return
|
||||
to:@return
|
||||
main::@5: scope:[main] from main::@4
|
||||
[20] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1
|
||||
[21] (byte) idx#3 ← ++ (byte) idx#10
|
||||
[23] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1
|
||||
[24] (byte) idx#3 ← ++ (byte) idx#10
|
||||
to:main::@4
|
||||
main::@2: scope:[main] from main::@1
|
||||
[22] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) main::i#2
|
||||
[23] (byte) idx#1 ← ++ (byte) idx#15
|
||||
[24] (byte) main::i#1 ← -- (byte) main::i#2
|
||||
to:main::@1
|
||||
|
@ -186,6 +186,18 @@ Constant (const byte) main::i#0 = 2
|
||||
Constant (const byte) main::j#0 = 3
|
||||
Constant (const byte) main::k#0 = 2
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte) main::i#1 = (byte) main::i#2
|
||||
Alias (byte) idx#1 = (byte) idx#15
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) main::i#5 (const byte) main::i#0
|
||||
Identical Phi Values (byte) idx#21 (const byte) idx#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Removing PHI-reference to removed block (main::@1_1) in block main::@3
|
||||
if() condition always true - replacing block destination [24] if((byte) 0!=(const byte) main::i#0) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Alias (byte) idx#1 = (byte) idx#20
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Inlining constant with var siblings (const byte) main::i#0
|
||||
Inlining constant with var siblings (const byte) main::j#0
|
||||
Inlining constant with var siblings (const byte) main::k#0
|
||||
@ -195,26 +207,30 @@ Constant inlined main::k#0 = (byte) 2
|
||||
Constant inlined main::j#0 = (byte) 3
|
||||
Constant inlined idx#0 = (byte) 0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@15(between main::@13 and main::@13)
|
||||
Added new block during phi lifting main::@15(between main::@1 and main::@2)
|
||||
Added new block during phi lifting main::@16(between main::@13 and main::@13)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 6 initial phi equivalence classes
|
||||
Coalesced [10] idx#20 ← idx#2
|
||||
Coalesced [16] idx#23 ← idx#4
|
||||
Coalesced [23] main::k#3 ← main::k#1
|
||||
Coalesced [24] idx#22 ← idx#13
|
||||
Coalesced [27] main::j#4 ← main::j#1
|
||||
Coalesced [28] idx#21 ← idx#3
|
||||
Coalesced [32] main::i#4 ← main::i#1
|
||||
Coalesced [33] idx#19 ← idx#1
|
||||
Coalesced [14] idx#23 ← idx#2
|
||||
Coalesced [20] idx#26 ← idx#4
|
||||
Coalesced [27] main::k#3 ← main::k#1
|
||||
Coalesced [28] idx#25 ← idx#13
|
||||
Coalesced [31] main::j#4 ← main::j#1
|
||||
Coalesced [32] idx#24 ← idx#3
|
||||
Coalesced [33] main::i#6 ← main::i#1
|
||||
Coalesced [34] idx#22 ← idx#1
|
||||
Coalesced down to 6 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1_1
|
||||
Culled Empty Block (label) main::@16
|
||||
Culled Empty Block (label) main::@15
|
||||
Renumbering block main::@7 to main::@4
|
||||
Renumbering block main::@8 to main::@5
|
||||
@ -237,63 +253,63 @@ FINAL CONTROL FLOW GRAPH
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) idx#19 ← phi( main::@1/(byte) idx#1 main/(byte) 0 )
|
||||
[5] (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main/(byte) 2 )
|
||||
[6] *((const byte*) SCREEN#0 + (byte) idx#19) ← (byte) main::i#4
|
||||
[7] (byte) idx#1 ← ++ (byte) idx#19
|
||||
[8] (byte) main::i#1 ← -- (byte) main::i#4
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) idx#15 ← phi( main/(byte) 0 main::@2/(byte) idx#1 )
|
||||
[5] (byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 )
|
||||
[6] if((byte) 0!=(byte) main::i#2) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((byte) 0!=(byte) main::i#1) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1
|
||||
[7] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' '
|
||||
[8] (byte) idx#2 ← ++ (byte) idx#15
|
||||
[10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' '
|
||||
[11] (byte) idx#2 ← ++ (byte) idx#1
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@5
|
||||
[9] (byte) idx#10 ← phi( main::@3/(byte) idx#2 main::@5/(byte) idx#3 )
|
||||
[9] (byte) main::j#2 ← phi( main::@3/(byte) 3 main::@5/(byte) main::j#1 )
|
||||
[10] (byte) main::j#1 ← -- (byte) main::j#2
|
||||
[11] if((byte) 0!=(byte) main::j#1) goto main::@5
|
||||
[12] (byte) idx#10 ← phi( main::@3/(byte) idx#2 main::@5/(byte) idx#3 )
|
||||
[12] (byte) main::j#2 ← phi( main::@3/(byte) 3 main::@5/(byte) main::j#1 )
|
||||
[13] (byte) main::j#1 ← -- (byte) main::j#2
|
||||
[14] if((byte) 0!=(byte) main::j#1) goto main::@5
|
||||
to:main::@6
|
||||
main::@6: scope:[main] from main::@4
|
||||
[12] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' '
|
||||
[13] (byte) idx#4 ← ++ (byte) idx#10
|
||||
[15] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' '
|
||||
[16] (byte) idx#4 ← ++ (byte) idx#10
|
||||
to:main::@7
|
||||
main::@7: scope:[main] from main::@6 main::@7
|
||||
[14] (byte) idx#12 ← phi( main::@7/(byte) idx#13 main::@6/(byte) idx#4 )
|
||||
[14] (byte) main::k#2 ← phi( main::@7/(byte) main::k#1 main::@6/(byte) 2 )
|
||||
[15] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2
|
||||
[16] (byte) idx#13 ← ++ (byte) idx#12
|
||||
[17] (byte) main::k#1 ← -- (byte) main::k#2
|
||||
[18] if((byte) 0!=(byte) main::k#1) goto main::@7
|
||||
[17] (byte) idx#12 ← phi( main::@7/(byte) idx#13 main::@6/(byte) idx#4 )
|
||||
[17] (byte) main::k#2 ← phi( main::@7/(byte) main::k#1 main::@6/(byte) 2 )
|
||||
[18] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2
|
||||
[19] (byte) idx#13 ← ++ (byte) idx#12
|
||||
[20] (byte) main::k#1 ← -- (byte) main::k#2
|
||||
[21] if((byte) 0!=(byte) main::k#1) goto main::@7
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@7
|
||||
[19] return
|
||||
[22] return
|
||||
to:@return
|
||||
main::@5: scope:[main] from main::@4
|
||||
[20] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1
|
||||
[21] (byte) idx#3 ← ++ (byte) idx#10
|
||||
[23] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1
|
||||
[24] (byte) idx#3 ← ++ (byte) idx#10
|
||||
to:main::@4
|
||||
main::@2: scope:[main] from main::@1
|
||||
[22] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) main::i#2
|
||||
[23] (byte) idx#1 ← ++ (byte) idx#15
|
||||
[24] (byte) main::i#1 ← -- (byte) main::i#2
|
||||
to:main::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte*) SCREEN
|
||||
(byte) idx
|
||||
(byte) idx#1 11.0
|
||||
(byte) idx#1 6.5
|
||||
(byte) idx#10 7.8
|
||||
(byte) idx#12 17.5
|
||||
(byte) idx#13 7.333333333333333
|
||||
(byte) idx#15 9.25
|
||||
(byte) idx#19 16.5
|
||||
(byte) idx#2 4.0
|
||||
(byte) idx#3 22.0
|
||||
(byte) idx#4 4.0
|
||||
(void()) main()
|
||||
(byte) main::i
|
||||
(byte) main::i#1 22.0
|
||||
(byte) main::i#2 11.0
|
||||
(byte) main::i#1 16.5
|
||||
(byte) main::i#4 11.0
|
||||
(byte) main::j
|
||||
(byte) main::j#1 11.0
|
||||
(byte) main::j#2 22.0
|
||||
@ -302,21 +318,21 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte) main::k#2 11.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ idx#15 idx#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
[ idx#19 idx#1 ]
|
||||
[ main::j#2 main::j#1 ]
|
||||
[ idx#10 idx#2 idx#3 ]
|
||||
[ main::k#2 main::k#1 ]
|
||||
[ idx#12 idx#13 idx#4 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ idx#15 idx#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
[ idx#19 idx#1 ]
|
||||
[ main::j#2 main::j#1 ]
|
||||
[ idx#10 idx#2 idx#3 ]
|
||||
[ main::k#2 main::k#1 ]
|
||||
[ idx#12 idx#13 idx#4 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ idx#15 idx#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#4 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ idx#19 idx#1 ]
|
||||
Allocated zp ZP_BYTE:4 [ main::j#2 main::j#1 ]
|
||||
Allocated zp ZP_BYTE:5 [ idx#10 idx#2 idx#3 ]
|
||||
Allocated zp ZP_BYTE:6 [ main::k#2 main::k#1 ]
|
||||
@ -361,141 +377,142 @@ main: {
|
||||
.label i = 2
|
||||
.label j = 4
|
||||
.label k = 6
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) idx#15 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) idx#19 = (byte) 0 [phi:main->main::@2#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta idx
|
||||
// [5] phi (byte) main::i#2 = (byte) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 2 [phi:main->main::@2#1] -- vbuz1=vbuc1
|
||||
lda #2
|
||||
sta i
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) idx#19 = (byte) idx#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [6] *((const byte*) SCREEN#0 + (byte) idx#19) ← (byte) main::i#4 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda i
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [7] (byte) idx#1 ← ++ (byte) idx#19 -- vbuz1=_inc_vbuz1
|
||||
inc idx
|
||||
// [8] (byte) main::i#1 ← -- (byte) main::i#4 -- vbuz1=_dec_vbuz1
|
||||
dec i
|
||||
jmp b1
|
||||
// for()
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte) 0!=(byte) main::i#2) goto main::@2 -- vbuc1_neq_vbuz1_then_la1
|
||||
// [9] if((byte) 0!=(byte) main::i#1) goto main::@2 -- vbuc1_neq_vbuz1_then_la1
|
||||
lda #0
|
||||
cmp i
|
||||
bne b2
|
||||
bne b2_from_b1
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [7] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [8] (byte) idx#2 ← ++ (byte) idx#15 -- vbuz1=_inc_vbuz2
|
||||
// [11] (byte) idx#2 ← ++ (byte) idx#1 -- vbuz1=_inc_vbuz2
|
||||
ldy idx
|
||||
iny
|
||||
sty idx_2
|
||||
// [9] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
// [12] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
b4_from_b3:
|
||||
// [9] phi (byte) idx#10 = (byte) idx#2 [phi:main::@3->main::@4#0] -- register_copy
|
||||
// [9] phi (byte) main::j#2 = (byte) 3 [phi:main::@3->main::@4#1] -- vbuz1=vbuc1
|
||||
// [12] phi (byte) idx#10 = (byte) idx#2 [phi:main::@3->main::@4#0] -- register_copy
|
||||
// [12] phi (byte) main::j#2 = (byte) 3 [phi:main::@3->main::@4#1] -- vbuz1=vbuc1
|
||||
lda #3
|
||||
sta j
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [10] (byte) main::j#1 ← -- (byte) main::j#2 -- vbuz1=_dec_vbuz1
|
||||
// [13] (byte) main::j#1 ← -- (byte) main::j#2 -- vbuz1=_dec_vbuz1
|
||||
dec j
|
||||
// [11] if((byte) 0!=(byte) main::j#1) goto main::@5 -- vbuc1_neq_vbuz1_then_la1
|
||||
// [14] if((byte) 0!=(byte) main::j#1) goto main::@5 -- vbuc1_neq_vbuz1_then_la1
|
||||
lda #0
|
||||
cmp j
|
||||
bne b5
|
||||
jmp b6
|
||||
// main::@6
|
||||
b6:
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy idx_10
|
||||
sta SCREEN,y
|
||||
// [13] (byte) idx#4 ← ++ (byte) idx#10 -- vbuz1=_inc_vbuz2
|
||||
// [16] (byte) idx#4 ← ++ (byte) idx#10 -- vbuz1=_inc_vbuz2
|
||||
ldy idx_10
|
||||
iny
|
||||
sty idx_4
|
||||
// [14] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
// [17] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
b7_from_b6:
|
||||
// [14] phi (byte) idx#12 = (byte) idx#4 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [14] phi (byte) main::k#2 = (byte) 2 [phi:main::@6->main::@7#1] -- vbuz1=vbuc1
|
||||
// [17] phi (byte) idx#12 = (byte) idx#4 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [17] phi (byte) main::k#2 = (byte) 2 [phi:main::@6->main::@7#1] -- vbuz1=vbuc1
|
||||
lda #2
|
||||
sta k
|
||||
jmp b7
|
||||
// [14] phi from main::@7 to main::@7 [phi:main::@7->main::@7]
|
||||
// [17] phi from main::@7 to main::@7 [phi:main::@7->main::@7]
|
||||
b7_from_b7:
|
||||
// [14] phi (byte) idx#12 = (byte) idx#13 [phi:main::@7->main::@7#0] -- register_copy
|
||||
// [14] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@7->main::@7#1] -- register_copy
|
||||
// [17] phi (byte) idx#12 = (byte) idx#13 [phi:main::@7->main::@7#0] -- register_copy
|
||||
// [17] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@7->main::@7#1] -- register_copy
|
||||
jmp b7
|
||||
// main::@7
|
||||
b7:
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda k
|
||||
ldy idx_12
|
||||
sta SCREEN,y
|
||||
// [16] (byte) idx#13 ← ++ (byte) idx#12 -- vbuz1=_inc_vbuz1
|
||||
// [19] (byte) idx#13 ← ++ (byte) idx#12 -- vbuz1=_inc_vbuz1
|
||||
inc idx_13
|
||||
// [17] (byte) main::k#1 ← -- (byte) main::k#2 -- vbuz1=_dec_vbuz1
|
||||
// [20] (byte) main::k#1 ← -- (byte) main::k#2 -- vbuz1=_dec_vbuz1
|
||||
dec k
|
||||
// [18] if((byte) 0!=(byte) main::k#1) goto main::@7 -- vbuc1_neq_vbuz1_then_la1
|
||||
// [21] if((byte) 0!=(byte) main::k#1) goto main::@7 -- vbuc1_neq_vbuz1_then_la1
|
||||
lda #0
|
||||
cmp k
|
||||
bne b7_from_b7
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [19] return
|
||||
// [22] return
|
||||
rts
|
||||
// main::@5
|
||||
b5:
|
||||
// [20] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
// [23] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda j
|
||||
ldy idx_10
|
||||
sta SCREEN,y
|
||||
// [21] (byte) idx#3 ← ++ (byte) idx#10 -- vbuz1=_inc_vbuz1
|
||||
// [24] (byte) idx#3 ← ++ (byte) idx#10 -- vbuz1=_inc_vbuz1
|
||||
inc idx_3
|
||||
// [9] phi from main::@5 to main::@4 [phi:main::@5->main::@4]
|
||||
// [12] phi from main::@5 to main::@4 [phi:main::@5->main::@4]
|
||||
b4_from_b5:
|
||||
// [9] phi (byte) idx#10 = (byte) idx#3 [phi:main::@5->main::@4#0] -- register_copy
|
||||
// [9] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@4#1] -- register_copy
|
||||
// [12] phi (byte) idx#10 = (byte) idx#3 [phi:main::@5->main::@4#0] -- register_copy
|
||||
// [12] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@4#1] -- register_copy
|
||||
jmp b4
|
||||
// main::@2
|
||||
b2:
|
||||
// [22] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda i
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [23] (byte) idx#1 ← ++ (byte) idx#15 -- vbuz1=_inc_vbuz1
|
||||
inc idx
|
||||
// [24] (byte) main::i#1 ← -- (byte) main::i#2 -- vbuz1=_dec_vbuz1
|
||||
dec i
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) idx#15 = (byte) idx#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [7] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' ' [ idx#15 ] ( main:2 [ idx#15 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ idx#15 idx#1 ]
|
||||
Statement [12] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' [ idx#10 ] ( main:2 [ idx#10 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' ' [ idx#1 ] ( main:2 [ idx#1 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ idx#19 idx#1 ]
|
||||
Statement [15] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' [ idx#10 ] ( main:2 [ idx#10 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ idx#10 idx#2 idx#3 ]
|
||||
Statement [7] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' ' [ idx#15 ] ( main:2 [ idx#15 ] ) always clobbers reg byte a
|
||||
Statement [12] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' [ idx#10 ] ( main:2 [ idx#10 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ idx#15 idx#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' ' [ idx#1 ] ( main:2 [ idx#1 ] ) always clobbers reg byte a
|
||||
Statement [15] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' [ idx#10 ] ( main:2 [ idx#10 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#4 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ idx#19 idx#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::j#2 main::j#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:5 [ idx#10 idx#2 idx#3 ] : zp ZP_BYTE:5 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:6 [ main::k#2 main::k#1 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:7 [ idx#12 idx#13 idx#4 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 33: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 33: zp ZP_BYTE:4 [ main::j#2 main::j#1 ] 27.5: zp ZP_BYTE:6 [ main::k#2 main::k#1 ]
|
||||
Uplift Scope [] 33.8: zp ZP_BYTE:5 [ idx#10 idx#2 idx#3 ] 28.83: zp ZP_BYTE:7 [ idx#12 idx#13 idx#4 ] 20.25: zp ZP_BYTE:3 [ idx#15 idx#1 ]
|
||||
Uplift Scope [main] 33: zp ZP_BYTE:4 [ main::j#2 main::j#1 ] 27.5: zp ZP_BYTE:2 [ main::i#4 main::i#1 ] 27.5: zp ZP_BYTE:6 [ main::k#2 main::k#1 ]
|
||||
Uplift Scope [] 33.8: zp ZP_BYTE:5 [ idx#10 idx#2 idx#3 ] 28.83: zp ZP_BYTE:7 [ idx#12 idx#13 idx#4 ] 23: zp ZP_BYTE:3 [ idx#19 idx#1 ]
|
||||
|
||||
Uplifting [main] best 1079 combination reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::j#2 main::j#1 ] reg byte a [ main::k#2 main::k#1 ]
|
||||
Uplifting [] best 851 combination reg byte y [ idx#10 idx#2 idx#3 ] reg byte y [ idx#12 idx#13 idx#4 ] reg byte y [ idx#15 idx#1 ]
|
||||
Uplifting [main] best 1109 combination reg byte a [ main::j#2 main::j#1 ] reg byte x [ main::i#4 main::i#1 ] reg byte a [ main::k#2 main::k#1 ]
|
||||
Uplifting [] best 881 combination reg byte y [ idx#10 idx#2 idx#3 ] reg byte y [ idx#12 idx#13 idx#4 ] reg byte y [ idx#19 idx#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -525,108 +542,110 @@ bend_from_b1:
|
||||
bend:
|
||||
// main
|
||||
main: {
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) idx#15 = (byte) 0 [phi:main->main::@1#0] -- vbuyy=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) idx#19 = (byte) 0 [phi:main->main::@2#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
// [5] phi (byte) main::i#2 = (byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 2 [phi:main->main::@2#1] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) idx#19 = (byte) idx#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [6] *((const byte*) SCREEN#0 + (byte) idx#19) ← (byte) main::i#4 -- pbuc1_derefidx_vbuyy=vbuxx
|
||||
txa
|
||||
sta SCREEN,y
|
||||
// [7] (byte) idx#1 ← ++ (byte) idx#19 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [8] (byte) main::i#1 ← -- (byte) main::i#4 -- vbuxx=_dec_vbuxx
|
||||
dex
|
||||
jmp b1
|
||||
// for()
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((byte) 0!=(byte) main::i#2) goto main::@2 -- vbuc1_neq_vbuxx_then_la1
|
||||
// [9] if((byte) 0!=(byte) main::i#1) goto main::@2 -- vbuc1_neq_vbuxx_then_la1
|
||||
cpx #0
|
||||
bne b2
|
||||
bne b2_from_b1
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [7] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
// [8] (byte) idx#2 ← ++ (byte) idx#15 -- vbuyy=_inc_vbuyy
|
||||
// [11] (byte) idx#2 ← ++ (byte) idx#1 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [9] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
// [12] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
b4_from_b3:
|
||||
// [9] phi (byte) idx#10 = (byte) idx#2 [phi:main::@3->main::@4#0] -- register_copy
|
||||
// [9] phi (byte) main::j#2 = (byte) 3 [phi:main::@3->main::@4#1] -- vbuaa=vbuc1
|
||||
// [12] phi (byte) idx#10 = (byte) idx#2 [phi:main::@3->main::@4#0] -- register_copy
|
||||
// [12] phi (byte) main::j#2 = (byte) 3 [phi:main::@3->main::@4#1] -- vbuaa=vbuc1
|
||||
lda #3
|
||||
jmp b4
|
||||
// main::@4
|
||||
b4:
|
||||
// [10] (byte) main::j#1 ← -- (byte) main::j#2 -- vbuaa=_dec_vbuaa
|
||||
// [13] (byte) main::j#1 ← -- (byte) main::j#2 -- vbuaa=_dec_vbuaa
|
||||
sec
|
||||
sbc #1
|
||||
// [11] if((byte) 0!=(byte) main::j#1) goto main::@5 -- vbuc1_neq_vbuaa_then_la1
|
||||
// [14] if((byte) 0!=(byte) main::j#1) goto main::@5 -- vbuc1_neq_vbuaa_then_la1
|
||||
cmp #0
|
||||
bne b5
|
||||
jmp b6
|
||||
// main::@6
|
||||
b6:
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
// [13] (byte) idx#4 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
// [16] (byte) idx#4 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [14] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
// [17] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
b7_from_b6:
|
||||
// [14] phi (byte) idx#12 = (byte) idx#4 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [14] phi (byte) main::k#2 = (byte) 2 [phi:main::@6->main::@7#1] -- vbuaa=vbuc1
|
||||
// [17] phi (byte) idx#12 = (byte) idx#4 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [17] phi (byte) main::k#2 = (byte) 2 [phi:main::@6->main::@7#1] -- vbuaa=vbuc1
|
||||
lda #2
|
||||
jmp b7
|
||||
// [14] phi from main::@7 to main::@7 [phi:main::@7->main::@7]
|
||||
// [17] phi from main::@7 to main::@7 [phi:main::@7->main::@7]
|
||||
b7_from_b7:
|
||||
// [14] phi (byte) idx#12 = (byte) idx#13 [phi:main::@7->main::@7#0] -- register_copy
|
||||
// [14] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@7->main::@7#1] -- register_copy
|
||||
// [17] phi (byte) idx#12 = (byte) idx#13 [phi:main::@7->main::@7#0] -- register_copy
|
||||
// [17] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@7->main::@7#1] -- register_copy
|
||||
jmp b7
|
||||
// main::@7
|
||||
b7:
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
sta SCREEN,y
|
||||
// [16] (byte) idx#13 ← ++ (byte) idx#12 -- vbuyy=_inc_vbuyy
|
||||
// [19] (byte) idx#13 ← ++ (byte) idx#12 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [17] (byte) main::k#1 ← -- (byte) main::k#2 -- vbuaa=_dec_vbuaa
|
||||
// [20] (byte) main::k#1 ← -- (byte) main::k#2 -- vbuaa=_dec_vbuaa
|
||||
sec
|
||||
sbc #1
|
||||
// [18] if((byte) 0!=(byte) main::k#1) goto main::@7 -- vbuc1_neq_vbuaa_then_la1
|
||||
// [21] if((byte) 0!=(byte) main::k#1) goto main::@7 -- vbuc1_neq_vbuaa_then_la1
|
||||
cmp #0
|
||||
bne b7_from_b7
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [19] return
|
||||
// [22] return
|
||||
rts
|
||||
// main::@5
|
||||
b5:
|
||||
// [20] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
// [23] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
sta SCREEN,y
|
||||
// [21] (byte) idx#3 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
// [24] (byte) idx#3 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [9] phi from main::@5 to main::@4 [phi:main::@5->main::@4]
|
||||
// [12] phi from main::@5 to main::@4 [phi:main::@5->main::@4]
|
||||
b4_from_b5:
|
||||
// [9] phi (byte) idx#10 = (byte) idx#3 [phi:main::@5->main::@4#0] -- register_copy
|
||||
// [9] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@4#1] -- register_copy
|
||||
// [12] phi (byte) idx#10 = (byte) idx#3 [phi:main::@5->main::@4#0] -- register_copy
|
||||
// [12] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@4#1] -- register_copy
|
||||
jmp b4
|
||||
// main::@2
|
||||
b2:
|
||||
// [22] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) main::i#2 -- pbuc1_derefidx_vbuyy=vbuxx
|
||||
txa
|
||||
sta SCREEN,y
|
||||
// [23] (byte) idx#1 ← ++ (byte) idx#15 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [24] (byte) main::i#1 ← -- (byte) main::i#2 -- vbuxx=_dec_vbuxx
|
||||
dex
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (byte) idx#15 = (byte) idx#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b4
|
||||
@ -634,26 +653,29 @@ Removing instruction jmp b6
|
||||
Removing instruction jmp b7
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b7_from_b7 with b7
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction b7_from_b7:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b2_from_main:
|
||||
Removing instruction b1:
|
||||
Removing instruction b3:
|
||||
Removing instruction b4_from_b3:
|
||||
Removing instruction b6:
|
||||
Removing instruction b7_from_b6:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b4_from_b5:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b7
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
@ -666,11 +688,11 @@ FINAL SYMBOL TABLE
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(byte) idx
|
||||
(byte) idx#1 reg byte y 11.0
|
||||
(byte) idx#1 reg byte y 6.5
|
||||
(byte) idx#10 reg byte y 7.8
|
||||
(byte) idx#12 reg byte y 17.5
|
||||
(byte) idx#13 reg byte y 7.333333333333333
|
||||
(byte) idx#15 reg byte y 9.25
|
||||
(byte) idx#19 reg byte y 16.5
|
||||
(byte) idx#2 reg byte y 4.0
|
||||
(byte) idx#3 reg byte y 22.0
|
||||
(byte) idx#4 reg byte y 4.0
|
||||
@ -684,8 +706,8 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@7
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 22.0
|
||||
(byte) main::i#2 reg byte x 11.0
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#4 reg byte x 11.0
|
||||
(byte) main::j
|
||||
(byte) main::j#1 reg byte a 11.0
|
||||
(byte) main::j#2 reg byte a 22.0
|
||||
@ -693,8 +715,8 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::k#1 reg byte a 16.5
|
||||
(byte) main::k#2 reg byte a 11.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ idx#15 idx#1 ]
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte y [ idx#19 idx#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte y [ idx#10 idx#2 idx#3 ]
|
||||
reg byte a [ main::k#2 main::k#1 ]
|
||||
@ -702,7 +724,7 @@ reg byte y [ idx#12 idx#13 idx#4 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 629
|
||||
Score: 599
|
||||
|
||||
// File Comments
|
||||
// Tests using integer conditions in while() / for() / do..while
|
||||
@ -722,101 +744,98 @@ Score: 629
|
||||
// @end
|
||||
// main
|
||||
main: {
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
// [5] phi (byte) idx#15 = (byte) 0 [phi:main->main::@1#0] -- vbuyy=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
// [5] phi (byte) idx#19 = (byte) 0 [phi:main->main::@2#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
// [5] phi (byte) main::i#2 = (byte) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
// [5] phi (byte) main::i#4 = (byte) 2 [phi:main->main::@2#1] -- vbuxx=vbuc1
|
||||
ldx #2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
// [5] phi (byte) idx#19 = (byte) idx#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (byte) main::i#4 = (byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
// main::@2
|
||||
b2:
|
||||
// SCREEN[idx++] = i
|
||||
// [6] *((const byte*) SCREEN#0 + (byte) idx#19) ← (byte) main::i#4 -- pbuc1_derefidx_vbuyy=vbuxx
|
||||
txa
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = i;
|
||||
// [7] (byte) idx#1 ← ++ (byte) idx#19 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// for( byte i=2;i;i--)
|
||||
// [8] (byte) main::i#1 ← -- (byte) main::i#4 -- vbuxx=_dec_vbuxx
|
||||
dex
|
||||
// for()
|
||||
// main::@1
|
||||
b1:
|
||||
// for( byte i=2;i;i--)
|
||||
// [6] if((byte) 0!=(byte) main::i#2) goto main::@2 -- vbuc1_neq_vbuxx_then_la1
|
||||
// [9] if((byte) 0!=(byte) main::i#1) goto main::@2 -- vbuc1_neq_vbuxx_then_la1
|
||||
cpx #0
|
||||
bne b2
|
||||
// main::@3
|
||||
// SCREEN[idx++] = ' '
|
||||
// [7] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#1) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = ' ';
|
||||
// [8] (byte) idx#2 ← ++ (byte) idx#15 -- vbuyy=_inc_vbuyy
|
||||
// [11] (byte) idx#2 ← ++ (byte) idx#1 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [9] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
// [9] phi (byte) idx#10 = (byte) idx#2 [phi:main::@3->main::@4#0] -- register_copy
|
||||
// [9] phi (byte) main::j#2 = (byte) 3 [phi:main::@3->main::@4#1] -- vbuaa=vbuc1
|
||||
// [12] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
// [12] phi (byte) idx#10 = (byte) idx#2 [phi:main::@3->main::@4#0] -- register_copy
|
||||
// [12] phi (byte) main::j#2 = (byte) 3 [phi:main::@3->main::@4#1] -- vbuaa=vbuc1
|
||||
lda #3
|
||||
// main::@4
|
||||
b4:
|
||||
// while( j-- )
|
||||
// [10] (byte) main::j#1 ← -- (byte) main::j#2 -- vbuaa=_dec_vbuaa
|
||||
// [13] (byte) main::j#1 ← -- (byte) main::j#2 -- vbuaa=_dec_vbuaa
|
||||
sec
|
||||
sbc #1
|
||||
// [11] if((byte) 0!=(byte) main::j#1) goto main::@5 -- vbuc1_neq_vbuaa_then_la1
|
||||
// [14] if((byte) 0!=(byte) main::j#1) goto main::@5 -- vbuc1_neq_vbuaa_then_la1
|
||||
cmp #0
|
||||
bne b5
|
||||
// main::@6
|
||||
// SCREEN[idx++] = ' '
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) ' ' -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = ' ';
|
||||
// [13] (byte) idx#4 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
// [16] (byte) idx#4 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [14] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
// [14] phi (byte) idx#12 = (byte) idx#4 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [14] phi (byte) main::k#2 = (byte) 2 [phi:main::@6->main::@7#1] -- vbuaa=vbuc1
|
||||
// [17] phi from main::@6 to main::@7 [phi:main::@6->main::@7]
|
||||
// [17] phi (byte) idx#12 = (byte) idx#4 [phi:main::@6->main::@7#0] -- register_copy
|
||||
// [17] phi (byte) main::k#2 = (byte) 2 [phi:main::@6->main::@7#1] -- vbuaa=vbuc1
|
||||
lda #2
|
||||
// [14] phi from main::@7 to main::@7 [phi:main::@7->main::@7]
|
||||
// [14] phi (byte) idx#12 = (byte) idx#13 [phi:main::@7->main::@7#0] -- register_copy
|
||||
// [14] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@7->main::@7#1] -- register_copy
|
||||
// [17] phi from main::@7 to main::@7 [phi:main::@7->main::@7]
|
||||
// [17] phi (byte) idx#12 = (byte) idx#13 [phi:main::@7->main::@7#0] -- register_copy
|
||||
// [17] phi (byte) main::k#2 = (byte) main::k#1 [phi:main::@7->main::@7#1] -- register_copy
|
||||
// main::@7
|
||||
b7:
|
||||
// SCREEN[idx++] = k
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) idx#12) ← (byte) main::k#2 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = k;
|
||||
// [16] (byte) idx#13 ← ++ (byte) idx#12 -- vbuyy=_inc_vbuyy
|
||||
// [19] (byte) idx#13 ← ++ (byte) idx#12 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// while(k--)
|
||||
// [17] (byte) main::k#1 ← -- (byte) main::k#2 -- vbuaa=_dec_vbuaa
|
||||
// [20] (byte) main::k#1 ← -- (byte) main::k#2 -- vbuaa=_dec_vbuaa
|
||||
sec
|
||||
sbc #1
|
||||
// [18] if((byte) 0!=(byte) main::k#1) goto main::@7 -- vbuc1_neq_vbuaa_then_la1
|
||||
// [21] if((byte) 0!=(byte) main::k#1) goto main::@7 -- vbuc1_neq_vbuaa_then_la1
|
||||
cmp #0
|
||||
bne b7
|
||||
// main::@return
|
||||
// }
|
||||
// [19] return
|
||||
// [22] return
|
||||
rts
|
||||
// main::@5
|
||||
b5:
|
||||
// SCREEN[idx++] = j
|
||||
// [20] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
// [23] *((const byte*) SCREEN#0 + (byte) idx#10) ← (byte) main::j#1 -- pbuc1_derefidx_vbuyy=vbuaa
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = j;
|
||||
// [21] (byte) idx#3 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
// [24] (byte) idx#3 ← ++ (byte) idx#10 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [9] phi from main::@5 to main::@4 [phi:main::@5->main::@4]
|
||||
// [9] phi (byte) idx#10 = (byte) idx#3 [phi:main::@5->main::@4#0] -- register_copy
|
||||
// [9] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@4#1] -- register_copy
|
||||
// [12] phi from main::@5 to main::@4 [phi:main::@5->main::@4]
|
||||
// [12] phi (byte) idx#10 = (byte) idx#3 [phi:main::@5->main::@4#0] -- register_copy
|
||||
// [12] phi (byte) main::j#2 = (byte) main::j#1 [phi:main::@5->main::@4#1] -- register_copy
|
||||
jmp b4
|
||||
// main::@2
|
||||
b2:
|
||||
// SCREEN[idx++] = i
|
||||
// [22] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte) main::i#2 -- pbuc1_derefidx_vbuyy=vbuxx
|
||||
txa
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = i;
|
||||
// [23] (byte) idx#1 ← ++ (byte) idx#15 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// for( byte i=2;i;i--)
|
||||
// [24] (byte) main::i#1 ← -- (byte) main::i#2 -- vbuxx=_dec_vbuxx
|
||||
dex
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
// [5] phi (byte) idx#15 = (byte) idx#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -4,11 +4,11 @@
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(byte) idx
|
||||
(byte) idx#1 reg byte y 11.0
|
||||
(byte) idx#1 reg byte y 6.5
|
||||
(byte) idx#10 reg byte y 7.8
|
||||
(byte) idx#12 reg byte y 17.5
|
||||
(byte) idx#13 reg byte y 7.333333333333333
|
||||
(byte) idx#15 reg byte y 9.25
|
||||
(byte) idx#19 reg byte y 16.5
|
||||
(byte) idx#2 reg byte y 4.0
|
||||
(byte) idx#3 reg byte y 22.0
|
||||
(byte) idx#4 reg byte y 4.0
|
||||
@ -22,8 +22,8 @@
|
||||
(label) main::@7
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 22.0
|
||||
(byte) main::i#2 reg byte x 11.0
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#4 reg byte x 11.0
|
||||
(byte) main::j
|
||||
(byte) main::j#1 reg byte a 11.0
|
||||
(byte) main::j#2 reg byte a 22.0
|
||||
@ -31,8 +31,8 @@
|
||||
(byte) main::k#1 reg byte a 16.5
|
||||
(byte) main::k#2 reg byte a 11.0
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ idx#15 idx#1 ]
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte y [ idx#19 idx#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte y [ idx#10 idx#2 idx#3 ]
|
||||
reg byte a [ main::k#2 main::k#1 ]
|
||||
|
@ -7,11 +7,6 @@
|
||||
main: {
|
||||
ldx #0
|
||||
ldy #-2
|
||||
b1:
|
||||
cpy #0
|
||||
bne b2
|
||||
lda #'0'
|
||||
jmp b3
|
||||
b2:
|
||||
lda #'+'
|
||||
b3:
|
||||
@ -21,4 +16,9 @@ main: {
|
||||
cpy #3
|
||||
bne b1
|
||||
rts
|
||||
b1:
|
||||
cpy #0
|
||||
bne b2
|
||||
lda #'0'
|
||||
jmp b3
|
||||
}
|
||||
|
@ -9,22 +9,23 @@
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@3
|
||||
[5] (byte) main::idx#2 ← phi( main/(byte) 0 main::@3/(byte) main::idx#1 )
|
||||
[5] (signed byte) main::i#2 ← phi( main/(signed byte) -2 main::@3/(signed byte) main::i#1 )
|
||||
[6] if((signed byte) 0!=(signed byte) main::i#2) goto main::@2
|
||||
to:main::@3
|
||||
main::@2: scope:[main] from main::@1
|
||||
[7] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) main::idx#7 ← phi( main::@1/(byte) main::idx#1 main/(byte) 0 )
|
||||
[5] (signed byte) main::i#7 ← phi( main::@1/(signed byte) main::i#1 main/(signed byte) -2 )
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@2
|
||||
[8] (byte) main::j#0 ← phi( main::@2/(byte) '+' main::@1/(byte) '0' )
|
||||
[9] *((const byte*) SCREEN#0 + (byte) main::idx#2) ← (byte) main::j#0
|
||||
[10] (byte) main::idx#1 ← ++ (byte) main::idx#2
|
||||
[11] (signed byte) main::i#1 ← ++ (signed byte) main::i#2
|
||||
[12] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1
|
||||
[6] (byte) main::idx#6 ← phi( main::@2/(byte) main::idx#7 main::@1/(byte) main::idx#1 )
|
||||
[6] (signed byte) main::i#6 ← phi( main::@2/(signed byte) main::i#7 main::@1/(signed byte) main::i#1 )
|
||||
[6] (byte) main::j#0 ← phi( main::@2/(byte) '+' main::@1/(byte) '0' )
|
||||
[7] *((const byte*) SCREEN#0 + (byte) main::idx#6) ← (byte) main::j#0
|
||||
[8] (byte) main::idx#1 ← ++ (byte) main::idx#6
|
||||
[9] (signed byte) main::i#1 ← ++ (signed byte) main::i#6
|
||||
[10] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@3
|
||||
[13] return
|
||||
[11] return
|
||||
to:@return
|
||||
main::@1: scope:[main] from main::@3
|
||||
[12] if((signed byte) 0!=(signed byte) main::i#1) goto main::@2
|
||||
to:main::@3
|
||||
|
@ -114,12 +114,26 @@ Constant (const byte) main::$0 = '0'
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Resolved ranged next value [14] main::i#1 ← ++ main::i#2 to ++
|
||||
Resolved ranged comparison value [16] if(main::i#1!=rangelast(-2,2)) goto main::@1 to (number) 3
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Adding number conversion cast (snumber) 3 in if((signed byte) main::i#1!=(number) 3) goto main::@1
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant integer cast 3
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized signed number type (signed byte) 3
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias (signed byte) main::i#1 = (signed byte) main::i#2
|
||||
Alias (byte) main::idx#1 = (byte) main::idx#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (signed byte) main::i#9 (const signed byte) main::i#0
|
||||
Identical Phi Values (byte) main::idx#9 (const byte) main::idx#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Removing PHI-reference to removed block (main::@1_1) in block main::@3
|
||||
Removing PHI-reference to removed block (main::@1_1) in block main::@3
|
||||
if() condition always true - replacing block destination [12] if((signed byte) 0!=(const signed byte) main::i#0) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Alias (signed byte) main::i#1 = (signed byte) main::i#8
|
||||
Alias (byte) main::idx#1 = (byte) main::idx#8
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Inlining constant with var siblings (const byte) main::idx#0
|
||||
Inlining constant with var siblings (const signed byte) main::i#0
|
||||
Constant inlined main::i#0 = (signed byte) -2
|
||||
@ -127,22 +141,26 @@ Constant inlined main::idx#0 = (byte) 0
|
||||
Constant inlined main::$1 = (byte) '+'
|
||||
Constant inlined main::$0 = (byte) '0'
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@8(between main::@4 and main::@1)
|
||||
Added new block during phi lifting main::@8(between main::@1 and main::@2)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@3
|
||||
Adding NOP phi() at start of main::@2
|
||||
Adding NOP phi() at start of main::@1_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 3 initial phi equivalence classes
|
||||
Coalesced [15] main::i#6 ← main::i#1
|
||||
Coalesced [16] main::idx#6 ← main::idx#1
|
||||
Created 5 initial phi equivalence classes
|
||||
Coalesced [8] main::i#11 ← main::i#7
|
||||
Coalesced [9] main::idx#11 ← main::idx#7
|
||||
Coalesced [17] main::i#12 ← main::i#1
|
||||
Coalesced [18] main::idx#12 ← main::idx#1
|
||||
Coalesced (already) [19] main::i#10 ← main::i#1
|
||||
Coalesced (already) [20] main::idx#10 ← main::idx#1
|
||||
Coalesced down to 3 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1_1
|
||||
Culled Empty Block (label) main::@3
|
||||
Culled Empty Block (label) main::@8
|
||||
Renumbering block main::@4 to main::@3
|
||||
@ -150,7 +168,6 @@ Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@2
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
@begin: scope:[] from
|
||||
@ -164,50 +181,53 @@ FINAL CONTROL FLOW GRAPH
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@3
|
||||
[5] (byte) main::idx#2 ← phi( main/(byte) 0 main::@3/(byte) main::idx#1 )
|
||||
[5] (signed byte) main::i#2 ← phi( main/(signed byte) -2 main::@3/(signed byte) main::i#1 )
|
||||
[6] if((signed byte) 0!=(signed byte) main::i#2) goto main::@2
|
||||
to:main::@3
|
||||
main::@2: scope:[main] from main::@1
|
||||
[7] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (byte) main::idx#7 ← phi( main::@1/(byte) main::idx#1 main/(byte) 0 )
|
||||
[5] (signed byte) main::i#7 ← phi( main::@1/(signed byte) main::i#1 main/(signed byte) -2 )
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1 main::@2
|
||||
[8] (byte) main::j#0 ← phi( main::@2/(byte) '+' main::@1/(byte) '0' )
|
||||
[9] *((const byte*) SCREEN#0 + (byte) main::idx#2) ← (byte) main::j#0
|
||||
[10] (byte) main::idx#1 ← ++ (byte) main::idx#2
|
||||
[11] (signed byte) main::i#1 ← ++ (signed byte) main::i#2
|
||||
[12] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1
|
||||
[6] (byte) main::idx#6 ← phi( main::@2/(byte) main::idx#7 main::@1/(byte) main::idx#1 )
|
||||
[6] (signed byte) main::i#6 ← phi( main::@2/(signed byte) main::i#7 main::@1/(signed byte) main::i#1 )
|
||||
[6] (byte) main::j#0 ← phi( main::@2/(byte) '+' main::@1/(byte) '0' )
|
||||
[7] *((const byte*) SCREEN#0 + (byte) main::idx#6) ← (byte) main::j#0
|
||||
[8] (byte) main::idx#1 ← ++ (byte) main::idx#6
|
||||
[9] (signed byte) main::i#1 ← ++ (signed byte) main::i#6
|
||||
[10] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@3
|
||||
[13] return
|
||||
[11] return
|
||||
to:@return
|
||||
main::@1: scope:[main] from main::@3
|
||||
[12] if((signed byte) 0!=(signed byte) main::i#1) goto main::@2
|
||||
to:main::@3
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte*) SCREEN
|
||||
(void()) main()
|
||||
(signed byte) main::i
|
||||
(signed byte) main::i#1 16.5
|
||||
(signed byte) main::i#2 5.5
|
||||
(signed byte) main::i#1 168.33333333333331
|
||||
(signed byte) main::i#6 71.0
|
||||
(signed byte) main::i#7 112.0
|
||||
(byte) main::idx
|
||||
(byte) main::idx#1 7.333333333333333
|
||||
(byte) main::idx#2 6.6000000000000005
|
||||
(byte) main::idx#1 75.75
|
||||
(byte) main::idx#6 157.0
|
||||
(byte) main::idx#7 112.0
|
||||
(byte) main::j
|
||||
(byte) main::j#0 11.0
|
||||
(byte) main::j#0 101.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::idx#2 main::idx#1 ]
|
||||
[ main::j#0 ]
|
||||
[ main::i#6 main::i#7 main::i#1 ]
|
||||
[ main::idx#6 main::idx#7 main::idx#1 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::idx#2 main::idx#1 ]
|
||||
[ main::j#0 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::idx#2 main::idx#1 ]
|
||||
Allocated zp ZP_BYTE:4 [ main::j#0 ]
|
||||
[ main::i#6 main::i#7 main::i#1 ]
|
||||
[ main::idx#6 main::idx#7 main::idx#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::j#0 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::i#6 main::i#7 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:4 [ main::idx#6 main::idx#7 main::idx#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -238,79 +258,80 @@ bend_from_b1:
|
||||
bend:
|
||||
// main
|
||||
main: {
|
||||
.label j = 4
|
||||
.label idx = 3
|
||||
.label i = 2
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::idx#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
.label j = 2
|
||||
.label idx = 4
|
||||
.label i = 3
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) main::idx#7 = (byte) 0 [phi:main->main::@2#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta idx
|
||||
// [5] phi (signed byte) main::i#2 = (signed byte) -2 [phi:main->main::@1#1] -- vbsz1=vbsc1
|
||||
// [5] phi (signed byte) main::i#7 = (signed byte) -2 [phi:main->main::@2#1] -- vbsz1=vbsc1
|
||||
lda #-2
|
||||
sta i
|
||||
jmp b1
|
||||
// [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
|
||||
b1_from_b3:
|
||||
// [5] phi (byte) main::idx#2 = (byte) main::idx#1 [phi:main::@3->main::@1#0] -- register_copy
|
||||
// [5] phi (signed byte) main::i#2 = (signed byte) main::i#1 [phi:main::@3->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((signed byte) 0!=(signed byte) main::i#2) goto main::@2 -- vbsc1_neq_vbsz1_then_la1
|
||||
lda #0
|
||||
cmp i
|
||||
bne b2_from_b1
|
||||
// [8] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [8] phi (byte) main::j#0 = (byte) '0' [phi:main::@1->main::@3#0] -- vbuz1=vbuc1
|
||||
lda #'0'
|
||||
sta j
|
||||
jmp b3
|
||||
// [7] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) main::idx#7 = (byte) main::idx#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (signed byte) main::i#7 = (signed byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
||||
// [6] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
||||
b3_from_b2:
|
||||
// [8] phi (byte) main::j#0 = (byte) '+' [phi:main::@2->main::@3#0] -- vbuz1=vbuc1
|
||||
// [6] phi (byte) main::idx#6 = (byte) main::idx#7 [phi:main::@2->main::@3#0] -- register_copy
|
||||
// [6] phi (signed byte) main::i#6 = (signed byte) main::i#7 [phi:main::@2->main::@3#1] -- register_copy
|
||||
// [6] phi (byte) main::j#0 = (byte) '+' [phi:main::@2->main::@3#2] -- vbuz1=vbuc1
|
||||
lda #'+'
|
||||
sta j
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#2) ← (byte) main::j#0 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
// [7] *((const byte*) SCREEN#0 + (byte) main::idx#6) ← (byte) main::j#0 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda j
|
||||
ldy idx
|
||||
sta SCREEN,y
|
||||
// [10] (byte) main::idx#1 ← ++ (byte) main::idx#2 -- vbuz1=_inc_vbuz1
|
||||
// [8] (byte) main::idx#1 ← ++ (byte) main::idx#6 -- vbuz1=_inc_vbuz1
|
||||
inc idx
|
||||
// [11] (signed byte) main::i#1 ← ++ (signed byte) main::i#2 -- vbsz1=_inc_vbsz1
|
||||
// [9] (signed byte) main::i#1 ← ++ (signed byte) main::i#6 -- vbsz1=_inc_vbsz1
|
||||
inc i
|
||||
// [12] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1 -- vbsz1_neq_vbsc1_then_la1
|
||||
// [10] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1 -- vbsz1_neq_vbsc1_then_la1
|
||||
lda #3
|
||||
cmp i
|
||||
bne b1_from_b3
|
||||
bne b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [13] return
|
||||
// [11] return
|
||||
rts
|
||||
// main::@1
|
||||
b1:
|
||||
// [12] if((signed byte) 0!=(signed byte) main::i#1) goto main::@2 -- vbsc1_neq_vbsz1_then_la1
|
||||
lda #0
|
||||
cmp i
|
||||
bne b2_from_b1
|
||||
// [6] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [6] phi (byte) main::idx#6 = (byte) main::idx#1 [phi:main::@1->main::@3#0] -- register_copy
|
||||
// [6] phi (signed byte) main::i#6 = (signed byte) main::i#1 [phi:main::@1->main::@3#1] -- register_copy
|
||||
// [6] phi (byte) main::j#0 = (byte) '0' [phi:main::@1->main::@3#2] -- vbuz1=vbuc1
|
||||
lda #'0'
|
||||
sta j
|
||||
jmp b3
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::idx#2 main::idx#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::j#0 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:2 [ main::j#0 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::i#6 main::i#7 main::i#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::idx#6 main::idx#7 main::idx#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 22: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 13.93: zp ZP_BYTE:3 [ main::idx#2 main::idx#1 ] 11: zp ZP_BYTE:4 [ main::j#0 ]
|
||||
Uplift Scope [main] 351.33: zp ZP_BYTE:3 [ main::i#6 main::i#7 main::i#1 ] 344.75: zp ZP_BYTE:4 [ main::idx#6 main::idx#7 main::idx#1 ] 101: zp ZP_BYTE:2 [ main::j#0 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 458 combination reg byte y [ main::i#2 main::i#1 ] reg byte x [ main::idx#2 main::idx#1 ] reg byte a [ main::j#0 ]
|
||||
Uplifting [] best 458 combination
|
||||
Uplifting [main] best 3218 combination reg byte y [ main::i#6 main::i#7 main::i#1 ] reg byte x [ main::idx#6 main::idx#7 main::idx#1 ] reg byte a [ main::j#0 ]
|
||||
Uplifting [] best 3218 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -340,84 +361,82 @@ bend_from_b1:
|
||||
bend:
|
||||
// main
|
||||
main: {
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (byte) main::idx#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (byte) main::idx#7 = (byte) 0 [phi:main->main::@2#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// [5] phi (signed byte) main::i#2 = (signed byte) -2 [phi:main->main::@1#1] -- vbsyy=vbsc1
|
||||
// [5] phi (signed byte) main::i#7 = (signed byte) -2 [phi:main->main::@2#1] -- vbsyy=vbsc1
|
||||
ldy #-2
|
||||
jmp b1
|
||||
// [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
|
||||
b1_from_b3:
|
||||
// [5] phi (byte) main::idx#2 = (byte) main::idx#1 [phi:main::@3->main::@1#0] -- register_copy
|
||||
// [5] phi (signed byte) main::i#2 = (signed byte) main::i#1 [phi:main::@3->main::@1#1] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((signed byte) 0!=(signed byte) main::i#2) goto main::@2 -- vbsc1_neq_vbsyy_then_la1
|
||||
cpy #0
|
||||
bne b2_from_b1
|
||||
// [8] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [8] phi (byte) main::j#0 = (byte) '0' [phi:main::@1->main::@3#0] -- vbuaa=vbuc1
|
||||
lda #'0'
|
||||
jmp b3
|
||||
// [7] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (byte) main::idx#7 = (byte) main::idx#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (signed byte) main::i#7 = (signed byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
||||
// [6] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
||||
b3_from_b2:
|
||||
// [8] phi (byte) main::j#0 = (byte) '+' [phi:main::@2->main::@3#0] -- vbuaa=vbuc1
|
||||
// [6] phi (byte) main::idx#6 = (byte) main::idx#7 [phi:main::@2->main::@3#0] -- register_copy
|
||||
// [6] phi (signed byte) main::i#6 = (signed byte) main::i#7 [phi:main::@2->main::@3#1] -- register_copy
|
||||
// [6] phi (byte) main::j#0 = (byte) '+' [phi:main::@2->main::@3#2] -- vbuaa=vbuc1
|
||||
lda #'+'
|
||||
jmp b3
|
||||
// main::@3
|
||||
b3:
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#2) ← (byte) main::j#0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
// [7] *((const byte*) SCREEN#0 + (byte) main::idx#6) ← (byte) main::j#0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// [10] (byte) main::idx#1 ← ++ (byte) main::idx#2 -- vbuxx=_inc_vbuxx
|
||||
// [8] (byte) main::idx#1 ← ++ (byte) main::idx#6 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [11] (signed byte) main::i#1 ← ++ (signed byte) main::i#2 -- vbsyy=_inc_vbsyy
|
||||
// [9] (signed byte) main::i#1 ← ++ (signed byte) main::i#6 -- vbsyy=_inc_vbsyy
|
||||
iny
|
||||
// [12] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1 -- vbsyy_neq_vbsc1_then_la1
|
||||
// [10] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1 -- vbsyy_neq_vbsc1_then_la1
|
||||
cpy #3
|
||||
bne b1_from_b3
|
||||
bne b1
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [13] return
|
||||
// [11] return
|
||||
rts
|
||||
// main::@1
|
||||
b1:
|
||||
// [12] if((signed byte) 0!=(signed byte) main::i#1) goto main::@2 -- vbsc1_neq_vbsyy_then_la1
|
||||
cpy #0
|
||||
bne b2_from_b1
|
||||
// [6] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
b3_from_b1:
|
||||
// [6] phi (byte) main::idx#6 = (byte) main::idx#1 [phi:main::@1->main::@3#0] -- register_copy
|
||||
// [6] phi (signed byte) main::i#6 = (signed byte) main::i#1 [phi:main::@1->main::@3#1] -- register_copy
|
||||
// [6] phi (byte) main::j#0 = (byte) '0' [phi:main::@1->main::@3#2] -- vbuaa=vbuc1
|
||||
lda #'0'
|
||||
jmp b3
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b1_from_b3 with b1
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b1_from_b3:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction b3_from_b2:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b3_from_b1:
|
||||
Removing instruction b2_from_main:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b3_from_b1:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
@ -434,21 +453,23 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@3
|
||||
(label) main::@return
|
||||
(signed byte) main::i
|
||||
(signed byte) main::i#1 reg byte y 16.5
|
||||
(signed byte) main::i#2 reg byte y 5.5
|
||||
(signed byte) main::i#1 reg byte y 168.33333333333331
|
||||
(signed byte) main::i#6 reg byte y 71.0
|
||||
(signed byte) main::i#7 reg byte y 112.0
|
||||
(byte) main::idx
|
||||
(byte) main::idx#1 reg byte x 7.333333333333333
|
||||
(byte) main::idx#2 reg byte x 6.6000000000000005
|
||||
(byte) main::idx#1 reg byte x 75.75
|
||||
(byte) main::idx#6 reg byte x 157.0
|
||||
(byte) main::idx#7 reg byte x 112.0
|
||||
(byte) main::j
|
||||
(byte) main::j#0 reg byte a 11.0
|
||||
(byte) main::j#0 reg byte a 101.0
|
||||
|
||||
reg byte y [ main::i#2 main::i#1 ]
|
||||
reg byte x [ main::idx#2 main::idx#1 ]
|
||||
reg byte a [ main::j#0 ]
|
||||
reg byte y [ main::i#6 main::i#7 main::i#1 ]
|
||||
reg byte x [ main::idx#6 main::idx#7 main::idx#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 296
|
||||
Score: 2546
|
||||
|
||||
// File Comments
|
||||
// Tests using integer conditions in ternary operator
|
||||
@ -468,48 +489,51 @@ Score: 296
|
||||
// @end
|
||||
// main
|
||||
main: {
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
// [5] phi (byte) main::idx#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
// [5] phi (byte) main::idx#7 = (byte) 0 [phi:main->main::@2#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// [5] phi (signed byte) main::i#2 = (signed byte) -2 [phi:main->main::@1#1] -- vbsyy=vbsc1
|
||||
// [5] phi (signed byte) main::i#7 = (signed byte) -2 [phi:main->main::@2#1] -- vbsyy=vbsc1
|
||||
ldy #-2
|
||||
// [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
|
||||
// [5] phi (byte) main::idx#2 = (byte) main::idx#1 [phi:main::@3->main::@1#0] -- register_copy
|
||||
// [5] phi (signed byte) main::i#2 = (signed byte) main::i#1 [phi:main::@3->main::@1#1] -- register_copy
|
||||
// main::@1
|
||||
b1:
|
||||
// i?'+':'0'
|
||||
// [6] if((signed byte) 0!=(signed byte) main::i#2) goto main::@2 -- vbsc1_neq_vbsyy_then_la1
|
||||
cpy #0
|
||||
bne b2
|
||||
// [8] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
// [8] phi (byte) main::j#0 = (byte) '0' [phi:main::@1->main::@3#0] -- vbuaa=vbuc1
|
||||
lda #'0'
|
||||
jmp b3
|
||||
// [7] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
// [5] phi (byte) main::idx#7 = (byte) main::idx#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// [5] phi (signed byte) main::i#7 = (signed byte) main::i#1 [phi:main::@1->main::@2#1] -- register_copy
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
||||
// [8] phi (byte) main::j#0 = (byte) '+' [phi:main::@2->main::@3#0] -- vbuaa=vbuc1
|
||||
// [6] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
||||
// [6] phi (byte) main::idx#6 = (byte) main::idx#7 [phi:main::@2->main::@3#0] -- register_copy
|
||||
// [6] phi (signed byte) main::i#6 = (signed byte) main::i#7 [phi:main::@2->main::@3#1] -- register_copy
|
||||
// [6] phi (byte) main::j#0 = (byte) '+' [phi:main::@2->main::@3#2] -- vbuaa=vbuc1
|
||||
lda #'+'
|
||||
// main::@3
|
||||
b3:
|
||||
// SCREEN[idx++] = j
|
||||
// [9] *((const byte*) SCREEN#0 + (byte) main::idx#2) ← (byte) main::j#0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
// [7] *((const byte*) SCREEN#0 + (byte) main::idx#6) ← (byte) main::j#0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = j;
|
||||
// [10] (byte) main::idx#1 ← ++ (byte) main::idx#2 -- vbuxx=_inc_vbuxx
|
||||
// [8] (byte) main::idx#1 ← ++ (byte) main::idx#6 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// for( signed byte i: -2..2)
|
||||
// [11] (signed byte) main::i#1 ← ++ (signed byte) main::i#2 -- vbsyy=_inc_vbsyy
|
||||
// [9] (signed byte) main::i#1 ← ++ (signed byte) main::i#6 -- vbsyy=_inc_vbsyy
|
||||
iny
|
||||
// [12] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1 -- vbsyy_neq_vbsc1_then_la1
|
||||
// [10] if((signed byte) main::i#1!=(signed byte) 3) goto main::@1 -- vbsyy_neq_vbsc1_then_la1
|
||||
cpy #3
|
||||
bne b1
|
||||
// main::@return
|
||||
// }
|
||||
// [13] return
|
||||
// [11] return
|
||||
rts
|
||||
// main::@1
|
||||
b1:
|
||||
// i?'+':'0'
|
||||
// [12] if((signed byte) 0!=(signed byte) main::i#1) goto main::@2 -- vbsc1_neq_vbsyy_then_la1
|
||||
cpy #0
|
||||
bne b2
|
||||
// [6] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
|
||||
// [6] phi (byte) main::idx#6 = (byte) main::idx#1 [phi:main::@1->main::@3#0] -- register_copy
|
||||
// [6] phi (signed byte) main::i#6 = (signed byte) main::i#1 [phi:main::@1->main::@3#1] -- register_copy
|
||||
// [6] phi (byte) main::j#0 = (byte) '0' [phi:main::@1->main::@3#2] -- vbuaa=vbuc1
|
||||
lda #'0'
|
||||
jmp b3
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -9,14 +9,16 @@
|
||||
(label) main::@3
|
||||
(label) main::@return
|
||||
(signed byte) main::i
|
||||
(signed byte) main::i#1 reg byte y 16.5
|
||||
(signed byte) main::i#2 reg byte y 5.5
|
||||
(signed byte) main::i#1 reg byte y 168.33333333333331
|
||||
(signed byte) main::i#6 reg byte y 71.0
|
||||
(signed byte) main::i#7 reg byte y 112.0
|
||||
(byte) main::idx
|
||||
(byte) main::idx#1 reg byte x 7.333333333333333
|
||||
(byte) main::idx#2 reg byte x 6.6000000000000005
|
||||
(byte) main::idx#1 reg byte x 75.75
|
||||
(byte) main::idx#6 reg byte x 157.0
|
||||
(byte) main::idx#7 reg byte x 112.0
|
||||
(byte) main::j
|
||||
(byte) main::j#0 reg byte a 11.0
|
||||
(byte) main::j#0 reg byte a 101.0
|
||||
|
||||
reg byte y [ main::i#2 main::i#1 ]
|
||||
reg byte x [ main::idx#2 main::idx#1 ]
|
||||
reg byte a [ main::j#0 ]
|
||||
reg byte y [ main::i#6 main::i#7 main::i#1 ]
|
||||
reg byte x [ main::idx#6 main::idx#7 main::idx#1 ]
|
||||
|
@ -21,14 +21,12 @@ line: {
|
||||
.const x0 = 0
|
||||
.const x1 = $a
|
||||
ldy #x0
|
||||
b1:
|
||||
cpy #x1+1
|
||||
bcc b2
|
||||
rts
|
||||
b2:
|
||||
jsr plot
|
||||
iny
|
||||
jmp b1
|
||||
cpy #x1+1
|
||||
bcc b2
|
||||
rts
|
||||
}
|
||||
// plot(byte register(Y) x)
|
||||
plot: {
|
||||
|
@ -23,21 +23,21 @@ main::@2: scope:[main] from main::@1 main::@2
|
||||
to:main::@2
|
||||
line: scope:[line] from main::@2
|
||||
[12] phi()
|
||||
to:line::@1
|
||||
line::@1: scope:[line] from line line::@3
|
||||
[13] (byte) line::x#2 ← phi( line/(const byte) line::x0#0 line::@3/(byte) line::x#1 )
|
||||
[14] if((byte) line::x#2<(const byte) line::x1#0+(byte) 1) goto line::@2
|
||||
to:line::@return
|
||||
line::@return: scope:[line] from line::@1
|
||||
[15] return
|
||||
to:@return
|
||||
line::@2: scope:[line] from line::@1
|
||||
[16] (byte) plot::x#1 ← (byte) line::x#2
|
||||
[17] call plot
|
||||
to:line::@2
|
||||
line::@2: scope:[line] from line line::@1
|
||||
[13] (byte) line::x#5 ← phi( line::@1/(byte) line::x#1 line/(const byte) line::x0#0 )
|
||||
[14] (byte) plot::x#1 ← (byte) line::x#5
|
||||
[15] call plot
|
||||
to:line::@3
|
||||
line::@3: scope:[line] from line::@2
|
||||
[18] (byte) line::x#1 ← ++ (byte) line::x#2
|
||||
[16] (byte) line::x#1 ← ++ (byte) line::x#5
|
||||
to:line::@1
|
||||
line::@1: scope:[line] from line::@3
|
||||
[17] if((byte) line::x#1<(const byte) line::x1#0+(byte) 1) goto line::@2
|
||||
to:line::@return
|
||||
line::@return: scope:[line] from line::@1
|
||||
[18] return
|
||||
to:@return
|
||||
plot: scope:[plot] from line::@2
|
||||
[19] (byte) plot::idx#0 ← *((const byte*) plots#0 + (byte) plot::x#1)
|
||||
[20] (byte~) plot::$0 ← *((const byte*) SCREEN#0 + (byte) plot::idx#0) + (byte) 1
|
||||
|
@ -204,6 +204,7 @@ Removing PHI-reference to removed block (line::@3) in block plot
|
||||
Removing unused block line::@3
|
||||
Removing unused block line::@11
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Adding number conversion cast (unumber) $28 in if((byte) main::i#1!=(number) $28) goto main::@1
|
||||
Adding number conversion cast (unumber) line::x1#0+1 in if((byte) line::x#2<(const byte) line::x1#0+(number) 1) goto line::@6
|
||||
Adding number conversion cast (unumber) 1 in if((byte) line::x#2<(unumber)(const byte) line::x1#0+(number) 1) goto line::@6
|
||||
@ -215,14 +216,21 @@ Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) $28
|
||||
Finalized unsigned number type (byte) 1
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias (byte) line::x#1 = (byte) line::x#2
|
||||
Alias (byte) line::x#5 = (byte) line::x#6
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte) plot::x#2 (byte) plot::x#1
|
||||
Identical Phi Values (byte) line::x#7 (const byte) line::x0#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
if() condition always true - replacing block destination [22] if((const byte) line::x0#0<(const byte) line::x1#0+(byte) 1) goto line::@6
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Eliminating unused constant (const byte) plot::x#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Inlining constant with var siblings (const byte) main::i#0
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@6(between main::@1 and main::@1)
|
||||
Added new block during phi lifting line::@13(between line::@5 and line::@6)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @3
|
||||
Adding NOP phi() at start of @4
|
||||
@ -232,19 +240,22 @@ Adding NOP phi() at start of main::@3
|
||||
Adding NOP phi() at start of main::@5
|
||||
Adding NOP phi() at start of line
|
||||
Adding NOP phi() at start of line::@1
|
||||
Adding NOP phi() at start of line::@5_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
Calls in [main] to line:12
|
||||
Calls in [line] to plot:21
|
||||
Calls in [line] to plot:20
|
||||
|
||||
Created 2 initial phi equivalence classes
|
||||
Coalesced [14] main::i#3 ← main::i#1
|
||||
Coalesced [23] line::x#5 ← line::x#1
|
||||
Coalesced [24] line::x#8 ← line::x#1
|
||||
Coalesced down to 2 phi equivalence classes
|
||||
Culled Empty Block (label) @4
|
||||
Culled Empty Block (label) main::@5
|
||||
Culled Empty Block (label) main::@6
|
||||
Culled Empty Block (label) line::@1
|
||||
Culled Empty Block (label) line::@5_1
|
||||
Culled Empty Block (label) line::@13
|
||||
Renumbering block @3 to @1
|
||||
Renumbering block main::@3 to main::@2
|
||||
Renumbering block line::@5 to line::@1
|
||||
@ -283,21 +294,21 @@ main::@2: scope:[main] from main::@1 main::@2
|
||||
to:main::@2
|
||||
line: scope:[line] from main::@2
|
||||
[12] phi()
|
||||
to:line::@1
|
||||
line::@1: scope:[line] from line line::@3
|
||||
[13] (byte) line::x#2 ← phi( line/(const byte) line::x0#0 line::@3/(byte) line::x#1 )
|
||||
[14] if((byte) line::x#2<(const byte) line::x1#0+(byte) 1) goto line::@2
|
||||
to:line::@return
|
||||
line::@return: scope:[line] from line::@1
|
||||
[15] return
|
||||
to:@return
|
||||
line::@2: scope:[line] from line::@1
|
||||
[16] (byte) plot::x#1 ← (byte) line::x#2
|
||||
[17] call plot
|
||||
to:line::@2
|
||||
line::@2: scope:[line] from line line::@1
|
||||
[13] (byte) line::x#5 ← phi( line::@1/(byte) line::x#1 line/(const byte) line::x0#0 )
|
||||
[14] (byte) plot::x#1 ← (byte) line::x#5
|
||||
[15] call plot
|
||||
to:line::@3
|
||||
line::@3: scope:[line] from line::@2
|
||||
[18] (byte) line::x#1 ← ++ (byte) line::x#2
|
||||
[16] (byte) line::x#1 ← ++ (byte) line::x#5
|
||||
to:line::@1
|
||||
line::@1: scope:[line] from line::@3
|
||||
[17] if((byte) line::x#1<(const byte) line::x1#0+(byte) 1) goto line::@2
|
||||
to:line::@return
|
||||
line::@return: scope:[line] from line::@1
|
||||
[18] return
|
||||
to:@return
|
||||
plot: scope:[plot] from line::@2
|
||||
[19] (byte) plot::idx#0 ← *((const byte*) plots#0 + (byte) plot::x#1)
|
||||
[20] (byte~) plot::$0 ← *((const byte*) SCREEN#0 + (byte) plot::idx#0) + (byte) 1
|
||||
@ -312,8 +323,8 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte*) SCREEN
|
||||
(void()) line((byte) line::x0 , (byte) line::x1)
|
||||
(byte) line::x
|
||||
(byte) line::x#1 202.0
|
||||
(byte) line::x#2 101.0
|
||||
(byte) line::x#1 151.5
|
||||
(byte) line::x#5 101.0
|
||||
(byte) line::x0
|
||||
(byte) line::x1
|
||||
(void()) main()
|
||||
@ -330,18 +341,18 @@ VARIABLE REGISTER WEIGHTS
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ line::x#2 line::x#1 ]
|
||||
[ line::x#5 line::x#1 ]
|
||||
Added variable plot::x#1 to zero page equivalence class [ plot::x#1 ]
|
||||
Added variable plot::idx#0 to zero page equivalence class [ plot::idx#0 ]
|
||||
Added variable plot::$0 to zero page equivalence class [ plot::$0 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ line::x#2 line::x#1 ]
|
||||
[ line::x#5 line::x#1 ]
|
||||
[ plot::x#1 ]
|
||||
[ plot::idx#0 ]
|
||||
[ plot::$0 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ line::x#2 line::x#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ line::x#5 line::x#1 ]
|
||||
Allocated zp ZP_BYTE:4 [ plot::x#1 ]
|
||||
Allocated zp ZP_BYTE:5 [ plot::idx#0 ]
|
||||
Allocated zp ZP_BYTE:6 [ plot::$0 ]
|
||||
@ -418,39 +429,40 @@ line: {
|
||||
.const x0 = 0
|
||||
.const x1 = $a
|
||||
.label x = 3
|
||||
// [13] phi from line to line::@1 [phi:line->line::@1]
|
||||
b1_from_line:
|
||||
// [13] phi (byte) line::x#2 = (const byte) line::x0#0 [phi:line->line::@1#0] -- vbuz1=vbuc1
|
||||
// [13] phi from line to line::@2 [phi:line->line::@2]
|
||||
b2_from_line:
|
||||
// [13] phi (byte) line::x#5 = (const byte) line::x0#0 [phi:line->line::@2#0] -- vbuz1=vbuc1
|
||||
lda #x0
|
||||
sta x
|
||||
jmp b1
|
||||
// line::@1
|
||||
b1:
|
||||
// [14] if((byte) line::x#2<(const byte) line::x1#0+(byte) 1) goto line::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda x
|
||||
cmp #x1+1
|
||||
bcc b2
|
||||
jmp breturn
|
||||
// line::@return
|
||||
breturn:
|
||||
// [15] return
|
||||
rts
|
||||
jmp b2
|
||||
// [13] phi from line::@1 to line::@2 [phi:line::@1->line::@2]
|
||||
b2_from_b1:
|
||||
// [13] phi (byte) line::x#5 = (byte) line::x#1 [phi:line::@1->line::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// line::@2
|
||||
b2:
|
||||
// [16] (byte) plot::x#1 ← (byte) line::x#2 -- vbuz1=vbuz2
|
||||
// [14] (byte) plot::x#1 ← (byte) line::x#5 -- vbuz1=vbuz2
|
||||
lda x
|
||||
sta plot.x
|
||||
// [17] call plot
|
||||
// [15] call plot
|
||||
jsr plot
|
||||
jmp b3
|
||||
// line::@3
|
||||
b3:
|
||||
// [18] (byte) line::x#1 ← ++ (byte) line::x#2 -- vbuz1=_inc_vbuz1
|
||||
// [16] (byte) line::x#1 ← ++ (byte) line::x#5 -- vbuz1=_inc_vbuz1
|
||||
inc x
|
||||
// [13] phi from line::@3 to line::@1 [phi:line::@3->line::@1]
|
||||
b1_from_b3:
|
||||
// [13] phi (byte) line::x#2 = (byte) line::x#1 [phi:line::@3->line::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// line::@1
|
||||
b1:
|
||||
// [17] if((byte) line::x#1<(const byte) line::x1#0+(byte) 1) goto line::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda x
|
||||
cmp #x1+1
|
||||
bcc b2_from_b1
|
||||
jmp breturn
|
||||
// line::@return
|
||||
breturn:
|
||||
// [18] return
|
||||
rts
|
||||
}
|
||||
// plot
|
||||
// plot(byte zeropage(4) x)
|
||||
@ -485,23 +497,23 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ ma
|
||||
Statement [6] *((const byte*) plots#0 + (byte) main::i#2) ← (byte) main::i#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Statement [7] *((const byte*) SCREEN#0 + (byte) main::i#2) ← (byte) 0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ line::x#2 line::x#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ line::x#5 line::x#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ plot::x#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:5 [ plot::idx#0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:6 [ plot::$0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [line] 303: zp ZP_BYTE:3 [ line::x#2 line::x#1 ]
|
||||
Uplift Scope [line] 252.5: zp ZP_BYTE:3 [ line::x#5 line::x#1 ]
|
||||
Uplift Scope [plot] 103: zp ZP_BYTE:4 [ plot::x#1 ] 4: zp ZP_BYTE:6 [ plot::$0 ] 3: zp ZP_BYTE:5 [ plot::idx#0 ]
|
||||
Uplift Scope [main] 34.83: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [line] best 4684 combination zp ZP_BYTE:3 [ line::x#2 line::x#1 ]
|
||||
Uplifting [plot] best 4368 combination reg byte y [ plot::x#1 ] reg byte a [ plot::$0 ] reg byte x [ plot::idx#0 ]
|
||||
Uplifting [main] best 4218 combination reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 4218 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ line::x#2 line::x#1 ]
|
||||
Uplifting [line] best 3018 combination reg byte y [ line::x#2 line::x#1 ]
|
||||
Uplifting [line] best 4984 combination zp ZP_BYTE:3 [ line::x#5 line::x#1 ]
|
||||
Uplifting [plot] best 4668 combination reg byte y [ plot::x#1 ] reg byte a [ plot::$0 ] reg byte x [ plot::idx#0 ]
|
||||
Uplifting [main] best 4518 combination reg byte x [ main::i#2 main::i#1 ]
|
||||
Uplifting [] best 4518 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ line::x#5 line::x#1 ]
|
||||
Uplifting [line] best 3318 combination reg byte y [ line::x#5 line::x#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -568,35 +580,36 @@ main: {
|
||||
line: {
|
||||
.const x0 = 0
|
||||
.const x1 = $a
|
||||
// [13] phi from line to line::@1 [phi:line->line::@1]
|
||||
b1_from_line:
|
||||
// [13] phi (byte) line::x#2 = (const byte) line::x0#0 [phi:line->line::@1#0] -- vbuyy=vbuc1
|
||||
// [13] phi from line to line::@2 [phi:line->line::@2]
|
||||
b2_from_line:
|
||||
// [13] phi (byte) line::x#5 = (const byte) line::x0#0 [phi:line->line::@2#0] -- vbuyy=vbuc1
|
||||
ldy #x0
|
||||
jmp b1
|
||||
// line::@1
|
||||
b1:
|
||||
// [14] if((byte) line::x#2<(const byte) line::x1#0+(byte) 1) goto line::@2 -- vbuyy_lt_vbuc1_then_la1
|
||||
cpy #x1+1
|
||||
bcc b2
|
||||
jmp breturn
|
||||
// line::@return
|
||||
breturn:
|
||||
// [15] return
|
||||
rts
|
||||
jmp b2
|
||||
// [13] phi from line::@1 to line::@2 [phi:line::@1->line::@2]
|
||||
b2_from_b1:
|
||||
// [13] phi (byte) line::x#5 = (byte) line::x#1 [phi:line::@1->line::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// line::@2
|
||||
b2:
|
||||
// [16] (byte) plot::x#1 ← (byte) line::x#2
|
||||
// [17] call plot
|
||||
// [14] (byte) plot::x#1 ← (byte) line::x#5
|
||||
// [15] call plot
|
||||
jsr plot
|
||||
jmp b3
|
||||
// line::@3
|
||||
b3:
|
||||
// [18] (byte) line::x#1 ← ++ (byte) line::x#2 -- vbuyy=_inc_vbuyy
|
||||
// [16] (byte) line::x#1 ← ++ (byte) line::x#5 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [13] phi from line::@3 to line::@1 [phi:line::@3->line::@1]
|
||||
b1_from_b3:
|
||||
// [13] phi (byte) line::x#2 = (byte) line::x#1 [phi:line::@3->line::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// line::@1
|
||||
b1:
|
||||
// [17] if((byte) line::x#1<(const byte) line::x1#0+(byte) 1) goto line::@2 -- vbuyy_lt_vbuc1_then_la1
|
||||
cpy #x1+1
|
||||
bcc b2_from_b1
|
||||
jmp breturn
|
||||
// line::@return
|
||||
breturn:
|
||||
// [18] return
|
||||
rts
|
||||
}
|
||||
// plot
|
||||
// plot(byte register(Y) x)
|
||||
@ -622,13 +635,15 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b1_from_b1 with b1
|
||||
Replacing label b2_from_b2 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
@ -637,19 +652,21 @@ Removing instruction b1_from_b1:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction b2_from_b2:
|
||||
Removing instruction line_from_b2:
|
||||
Removing instruction b2_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b1_from_line:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b2_from_line:
|
||||
Removing instruction b3:
|
||||
Removing instruction b1_from_b3:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
@ -666,8 +683,8 @@ FINAL SYMBOL TABLE
|
||||
(label) line::@3
|
||||
(label) line::@return
|
||||
(byte) line::x
|
||||
(byte) line::x#1 reg byte y 202.0
|
||||
(byte) line::x#2 reg byte y 101.0
|
||||
(byte) line::x#1 reg byte y 151.5
|
||||
(byte) line::x#5 reg byte y 101.0
|
||||
(byte) line::x0
|
||||
(const byte) line::x0#0 x0 = (byte) 0
|
||||
(byte) line::x1
|
||||
@ -689,14 +706,14 @@ FINAL SYMBOL TABLE
|
||||
(const byte*) plots#0 plots = (byte*) 4096
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ line::x#2 line::x#1 ]
|
||||
reg byte y [ line::x#5 line::x#1 ]
|
||||
reg byte y [ plot::x#1 ]
|
||||
reg byte x [ plot::idx#0 ]
|
||||
reg byte a [ plot::$0 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 2013
|
||||
Score: 1713
|
||||
|
||||
// File Comments
|
||||
// Upstart
|
||||
@ -749,32 +766,29 @@ main: {
|
||||
line: {
|
||||
.const x0 = 0
|
||||
.const x1 = $a
|
||||
// [13] phi from line to line::@1 [phi:line->line::@1]
|
||||
// [13] phi (byte) line::x#2 = (const byte) line::x0#0 [phi:line->line::@1#0] -- vbuyy=vbuc1
|
||||
// [13] phi from line to line::@2 [phi:line->line::@2]
|
||||
// [13] phi (byte) line::x#5 = (const byte) line::x0#0 [phi:line->line::@2#0] -- vbuyy=vbuc1
|
||||
ldy #x0
|
||||
// line::@1
|
||||
b1:
|
||||
// [13] phi from line::@1 to line::@2 [phi:line::@1->line::@2]
|
||||
// [13] phi (byte) line::x#5 = (byte) line::x#1 [phi:line::@1->line::@2#0] -- register_copy
|
||||
// line::@2
|
||||
b2:
|
||||
// plot(x)
|
||||
// [14] (byte) plot::x#1 ← (byte) line::x#5
|
||||
// [15] call plot
|
||||
jsr plot
|
||||
// line::@3
|
||||
// for(byte x = x0; x<=x1; x++)
|
||||
// [14] if((byte) line::x#2<(const byte) line::x1#0+(byte) 1) goto line::@2 -- vbuyy_lt_vbuc1_then_la1
|
||||
// [16] (byte) line::x#1 ← ++ (byte) line::x#5 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// line::@1
|
||||
// [17] if((byte) line::x#1<(const byte) line::x1#0+(byte) 1) goto line::@2 -- vbuyy_lt_vbuc1_then_la1
|
||||
cpy #x1+1
|
||||
bcc b2
|
||||
// line::@return
|
||||
// }
|
||||
// [15] return
|
||||
// [18] return
|
||||
rts
|
||||
// line::@2
|
||||
b2:
|
||||
// plot(x)
|
||||
// [16] (byte) plot::x#1 ← (byte) line::x#2
|
||||
// [17] call plot
|
||||
jsr plot
|
||||
// line::@3
|
||||
// for(byte x = x0; x<=x1; x++)
|
||||
// [18] (byte) line::x#1 ← ++ (byte) line::x#2 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [13] phi from line::@3 to line::@1 [phi:line::@3->line::@1]
|
||||
// [13] phi (byte) line::x#2 = (byte) line::x#1 [phi:line::@3->line::@1#0] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// plot
|
||||
// plot(byte register(Y) x)
|
||||
|
@ -9,8 +9,8 @@
|
||||
(label) line::@3
|
||||
(label) line::@return
|
||||
(byte) line::x
|
||||
(byte) line::x#1 reg byte y 202.0
|
||||
(byte) line::x#2 reg byte y 101.0
|
||||
(byte) line::x#1 reg byte y 151.5
|
||||
(byte) line::x#5 reg byte y 101.0
|
||||
(byte) line::x0
|
||||
(const byte) line::x0#0 x0 = (byte) 0
|
||||
(byte) line::x1
|
||||
@ -32,7 +32,7 @@
|
||||
(const byte*) plots#0 plots = (byte*) 4096
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
reg byte y [ line::x#2 line::x#1 ]
|
||||
reg byte y [ line::x#5 line::x#1 ]
|
||||
reg byte y [ plot::x#1 ]
|
||||
reg byte x [ plot::idx#0 ]
|
||||
reg byte a [ plot::$0 ]
|
||||
|
@ -238,14 +238,6 @@ memset: {
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
b1:
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
b2:
|
||||
lda #c
|
||||
ldy #0
|
||||
@ -254,7 +246,13 @@ memset: {
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
jmp b1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
}
|
||||
msg: .text "0=0@"
|
||||
msg1: .text "0+2=2@"
|
||||
|
@ -158,15 +158,15 @@ print_cls::@return: scope:[print_cls] from print_cls
|
||||
to:@return
|
||||
memset: scope:[memset] from print_cls
|
||||
[71] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[72] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[73] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[74] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[72] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[73] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[75] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[74] return
|
||||
[76] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[75] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[76] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
|
@ -1162,10 +1162,17 @@ Constant (const signed byte) assert_sbyte::b#3 = test_sbytes::be#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte)test_bytes::$4 in [28] (byte) test_bytes::bd#0 ← (byte)(const signed byte) test_bytes::$4
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte*) memset::dst#1 = (byte*) memset::dst#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte*) memset::dst#5 (const byte*) memset::dst#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Constant (const byte) test_bytes::bd#0 = (byte)test_bytes::$4
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const byte) assert_byte::b#2 = test_bytes::bd#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always true - replacing block destination [60] if((const byte*) memset::dst#0!=(const byte*) memset::end#0) goto memset::@5
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Inlining constant with var siblings (const byte*) memset::dst#0
|
||||
Inlining constant with var siblings (const byte*) print_str::str#2
|
||||
Inlining constant with var siblings (const byte*) print_str::str#3
|
||||
@ -1244,6 +1251,7 @@ Constant inlined print_str::str#8 = (const string) str2
|
||||
Constant inlined print_str::str#7 = (const string) str1
|
||||
Constant inlined print_str::str#6 = (const string) str
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting memset::@10(between memset::@4 and memset::@5)
|
||||
Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @12
|
||||
@ -1273,6 +1281,7 @@ Adding NOP phi() at start of print_cls
|
||||
Adding NOP phi() at start of print_cls::@1
|
||||
Adding NOP phi() at start of memset
|
||||
Adding NOP phi() at start of memset::@2
|
||||
Adding NOP phi() at start of memset::@4_1
|
||||
Adding NOP phi() at start of memset::@1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:4
|
||||
@ -1306,7 +1315,7 @@ Coalesced (already) [80] print_char_cursor#85 ← print_char_cursor#2
|
||||
Coalesced (already) [83] print_char_cursor#84 ← print_char_cursor#2
|
||||
Coalesced (already) [86] print_line_cursor#69 ← print_line_cursor#50
|
||||
Coalesced (already) [91] print_char_cursor#83 ← print_char_cursor#2
|
||||
Coalesced [106] memset::dst#4 ← memset::dst#1
|
||||
Coalesced [107] memset::dst#6 ← memset::dst#1
|
||||
Coalesced down to 10 phi equivalence classes
|
||||
Culled Empty Block (label) @12
|
||||
Culled Empty Block (label) @36
|
||||
@ -1324,7 +1333,9 @@ Culled Empty Block (label) assert_byte::@9
|
||||
Culled Empty Block (label) assert_byte::@7
|
||||
Culled Empty Block (label) print_cls::@1
|
||||
Culled Empty Block (label) memset::@2
|
||||
Culled Empty Block (label) memset::@4_1
|
||||
Culled Empty Block (label) memset::@1
|
||||
Culled Empty Block (label) memset::@10
|
||||
Renumbering block @41 to @1
|
||||
Renumbering block memset::@4 to memset::@1
|
||||
Renumbering block memset::@5 to memset::@2
|
||||
@ -1513,18 +1524,18 @@ print_cls::@return: scope:[print_cls] from print_cls
|
||||
to:@return
|
||||
memset: scope:[memset] from print_cls
|
||||
[71] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[72] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[73] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[74] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[72] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[73] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[75] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[74] return
|
||||
[76] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[75] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[76] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
@ -1549,8 +1560,8 @@ VARIABLE REGISTER WEIGHTS
|
||||
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
|
||||
(byte) memset::c
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 22.0
|
||||
(byte*) memset::dst#2 14.666666666666666
|
||||
(byte*) memset::dst#1 16.5
|
||||
(byte*) memset::dst#4 16.5
|
||||
(byte*) memset::end
|
||||
(word) memset::num
|
||||
(void*) memset::return
|
||||
@ -1599,7 +1610,7 @@ Initial phi equivalence classes
|
||||
[ assert_byte::msg#3 ]
|
||||
[ assert_byte::b#3 ]
|
||||
[ assert_byte::c#3 ]
|
||||
[ memset::dst#2 memset::dst#1 ]
|
||||
[ memset::dst#4 memset::dst#1 ]
|
||||
Complete equivalence classes
|
||||
[ assert_sbyte::msg#5 ]
|
||||
[ assert_sbyte::b#5 ]
|
||||
@ -1610,7 +1621,7 @@ Complete equivalence classes
|
||||
[ assert_byte::msg#3 ]
|
||||
[ assert_byte::b#3 ]
|
||||
[ assert_byte::c#3 ]
|
||||
[ memset::dst#2 memset::dst#1 ]
|
||||
[ memset::dst#4 memset::dst#1 ]
|
||||
Allocated zp ZP_WORD:2 [ assert_sbyte::msg#5 ]
|
||||
Allocated zp ZP_BYTE:4 [ assert_sbyte::b#5 ]
|
||||
Allocated zp ZP_BYTE:5 [ assert_sbyte::c#5 ]
|
||||
@ -1620,7 +1631,7 @@ Allocated zp ZP_WORD:10 [ print_line_cursor#24 print_line_cursor#47 print_line_c
|
||||
Allocated zp ZP_WORD:12 [ assert_byte::msg#3 ]
|
||||
Allocated zp ZP_BYTE:14 [ assert_byte::b#3 ]
|
||||
Allocated zp ZP_BYTE:15 [ assert_byte::c#3 ]
|
||||
Allocated zp ZP_WORD:16 [ memset::dst#2 memset::dst#1 ]
|
||||
Allocated zp ZP_WORD:16 [ memset::dst#4 memset::dst#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -2157,43 +2168,44 @@ memset: {
|
||||
.label str = $400
|
||||
.label end = str+num
|
||||
.label dst = $10
|
||||
// [72] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
b1_from_memset:
|
||||
// [72] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [72] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
b2_from_memset:
|
||||
// [72] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [73] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [74] return
|
||||
rts
|
||||
jmp b2
|
||||
// [72] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
b2_from_b1:
|
||||
// [72] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// memset::@2
|
||||
b2:
|
||||
// [75] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
// [73] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// [76] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
// [74] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [72] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
b1_from_b2:
|
||||
// [72] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [75] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2_from_b1
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2_from_b1
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [76] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
msg: .text "0=0@"
|
||||
@ -2223,8 +2235,8 @@ Statement [50] (byte*~) print_char_cursor#92 ← (byte*) print_line_cursor#1 [ p
|
||||
Statement [52] (byte*~) print_char_cursor#93 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#93 ] ( main:2::test_bytes:7 [ print_line_cursor#1 print_char_cursor#93 ] ) always clobbers reg byte a
|
||||
Statement [56] (byte*) print_str::str#1 ← (byte*) assert_byte::msg#3 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] ( main:2::test_bytes:7::assert_byte:49 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] main:2::test_bytes:7::assert_byte:51 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] main:2::test_bytes:7::assert_byte:53 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] ) always clobbers reg byte a
|
||||
Statement [66] *((const byte*) BGCOL#0) ← (const byte) RED#0 [ print_char_cursor#2 print_line_cursor#50 ] ( main:2::test_bytes:7::assert_byte:49 [ print_char_cursor#2 print_line_cursor#50 ] main:2::test_bytes:7::assert_byte:51 [ print_char_cursor#2 print_line_cursor#50 ] main:2::test_bytes:7::assert_byte:53 [ print_char_cursor#2 print_line_cursor#50 ] ) always clobbers reg byte a
|
||||
Statement [73] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:5::memset:69 [ memset::dst#2 ] ) always clobbers reg byte a
|
||||
Statement [75] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:69 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [73] *((byte*) memset::dst#4) ← (const byte) memset::c#0 [ memset::dst#4 ] ( main:2::print_cls:5::memset:69 [ memset::dst#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [75] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#1 ] ( main:2::print_cls:5::memset:69 [ memset::dst#1 ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte*) BGCOL#0) ← (const byte) GREEN#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [23] (byte*) print_str::str#5 ← (byte*) assert_sbyte::msg#5 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_line_cursor#1 ] ( main:2::test_sbytes:9::assert_sbyte:12 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:14 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:16 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:18 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:20 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_line_cursor#1 ] ) always clobbers reg byte a
|
||||
Statement [24] (byte*~) print_char_cursor#86 ← (byte*) print_line_cursor#1 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#86 print_line_cursor#1 ] ( main:2::test_sbytes:9::assert_sbyte:12 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#86 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:14 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#86 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:16 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#86 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:18 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#86 print_line_cursor#1 ] main:2::test_sbytes:9::assert_sbyte:20 [ assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#86 print_line_cursor#1 ] ) always clobbers reg byte a
|
||||
@ -2237,8 +2249,8 @@ Statement [50] (byte*~) print_char_cursor#92 ← (byte*) print_line_cursor#1 [ p
|
||||
Statement [52] (byte*~) print_char_cursor#93 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#93 ] ( main:2::test_bytes:7 [ print_line_cursor#1 print_char_cursor#93 ] ) always clobbers reg byte a
|
||||
Statement [56] (byte*) print_str::str#1 ← (byte*) assert_byte::msg#3 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] ( main:2::test_bytes:7::assert_byte:49 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] main:2::test_bytes:7::assert_byte:51 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] main:2::test_bytes:7::assert_byte:53 [ print_str::str#1 print_char_cursor#70 print_line_cursor#50 assert_byte::b#3 assert_byte::c#3 ] ) always clobbers reg byte a
|
||||
Statement [66] *((const byte*) BGCOL#0) ← (const byte) RED#0 [ print_char_cursor#2 print_line_cursor#50 ] ( main:2::test_bytes:7::assert_byte:49 [ print_char_cursor#2 print_line_cursor#50 ] main:2::test_bytes:7::assert_byte:51 [ print_char_cursor#2 print_line_cursor#50 ] main:2::test_bytes:7::assert_byte:53 [ print_char_cursor#2 print_line_cursor#50 ] ) always clobbers reg byte a
|
||||
Statement [73] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::print_cls:5::memset:69 [ memset::dst#2 ] ) always clobbers reg byte a
|
||||
Statement [75] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::print_cls:5::memset:69 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [73] *((byte*) memset::dst#4) ← (const byte) memset::c#0 [ memset::dst#4 ] ( main:2::print_cls:5::memset:69 [ memset::dst#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [75] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#1 ] ( main:2::print_cls:5::memset:69 [ memset::dst#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ assert_sbyte::msg#5 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_BYTE:4 [ assert_sbyte::b#5 ] : zp ZP_BYTE:4 , reg byte x ,
|
||||
Potential registers zp ZP_BYTE:5 [ assert_sbyte::c#5 ] : zp ZP_BYTE:5 , reg byte x ,
|
||||
@ -2248,12 +2260,12 @@ Potential registers zp ZP_WORD:10 [ print_line_cursor#24 print_line_cursor#47 pr
|
||||
Potential registers zp ZP_WORD:12 [ assert_byte::msg#3 ] : zp ZP_WORD:12 ,
|
||||
Potential registers zp ZP_BYTE:14 [ assert_byte::b#3 ] : zp ZP_BYTE:14 , reg byte x ,
|
||||
Potential registers zp ZP_BYTE:15 [ assert_byte::c#3 ] : zp ZP_BYTE:15 , reg byte x ,
|
||||
Potential registers zp ZP_WORD:16 [ memset::dst#2 memset::dst#1 ] : zp ZP_WORD:16 ,
|
||||
Potential registers zp ZP_WORD:16 [ memset::dst#4 memset::dst#1 ] : zp ZP_WORD:16 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [] 46.23: zp ZP_WORD:6 [ print_char_cursor#80 print_char_cursor#70 print_char_cursor#2 print_char_cursor#86 print_char_cursor#1 print_char_cursor#92 print_char_cursor#93 ] 31.8: zp ZP_WORD:10 [ print_line_cursor#24 print_line_cursor#47 print_line_cursor#50 print_line_cursor#1 ]
|
||||
Uplift Scope [print_str] 45.5: zp ZP_WORD:8 [ print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 ]
|
||||
Uplift Scope [memset] 36.67: zp ZP_WORD:16 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplift Scope [memset] 33: zp ZP_WORD:16 [ memset::dst#4 memset::dst#1 ]
|
||||
Uplift Scope [assert_byte] 2: zp ZP_WORD:12 [ assert_byte::msg#3 ] 0.4: zp ZP_BYTE:14 [ assert_byte::b#3 ] 0.4: zp ZP_BYTE:15 [ assert_byte::c#3 ]
|
||||
Uplift Scope [assert_sbyte] 2: zp ZP_WORD:2 [ assert_sbyte::msg#5 ] 0.33: zp ZP_BYTE:4 [ assert_sbyte::b#5 ] 0.33: zp ZP_BYTE:5 [ assert_sbyte::c#5 ]
|
||||
Uplift Scope [RADIX]
|
||||
@ -2263,29 +2275,29 @@ Uplift Scope [main]
|
||||
Uplift Scope [test_bytes]
|
||||
Uplift Scope [test_sbytes]
|
||||
|
||||
Uplifting [] best 2214 combination zp ZP_WORD:6 [ print_char_cursor#80 print_char_cursor#70 print_char_cursor#2 print_char_cursor#86 print_char_cursor#1 print_char_cursor#92 print_char_cursor#93 ] zp ZP_WORD:10 [ print_line_cursor#24 print_line_cursor#47 print_line_cursor#50 print_line_cursor#1 ]
|
||||
Uplifting [print_str] best 2214 combination zp ZP_WORD:8 [ print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 ]
|
||||
Uplifting [memset] best 2214 combination zp ZP_WORD:16 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplifting [assert_byte] best 2202 combination zp ZP_WORD:12 [ assert_byte::msg#3 ] reg byte x [ assert_byte::b#3 ] zp ZP_BYTE:15 [ assert_byte::c#3 ]
|
||||
Uplifting [assert_sbyte] best 2184 combination zp ZP_WORD:2 [ assert_sbyte::msg#5 ] reg byte x [ assert_sbyte::b#5 ] zp ZP_BYTE:5 [ assert_sbyte::c#5 ]
|
||||
Uplifting [RADIX] best 2184 combination
|
||||
Uplifting [print_ln] best 2184 combination
|
||||
Uplifting [print_cls] best 2184 combination
|
||||
Uplifting [main] best 2184 combination
|
||||
Uplifting [test_bytes] best 2184 combination
|
||||
Uplifting [test_sbytes] best 2184 combination
|
||||
Uplifting [] best 2244 combination zp ZP_WORD:6 [ print_char_cursor#80 print_char_cursor#70 print_char_cursor#2 print_char_cursor#86 print_char_cursor#1 print_char_cursor#92 print_char_cursor#93 ] zp ZP_WORD:10 [ print_line_cursor#24 print_line_cursor#47 print_line_cursor#50 print_line_cursor#1 ]
|
||||
Uplifting [print_str] best 2244 combination zp ZP_WORD:8 [ print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 ]
|
||||
Uplifting [memset] best 2244 combination zp ZP_WORD:16 [ memset::dst#4 memset::dst#1 ]
|
||||
Uplifting [assert_byte] best 2232 combination zp ZP_WORD:12 [ assert_byte::msg#3 ] reg byte x [ assert_byte::b#3 ] zp ZP_BYTE:15 [ assert_byte::c#3 ]
|
||||
Uplifting [assert_sbyte] best 2214 combination zp ZP_WORD:2 [ assert_sbyte::msg#5 ] reg byte x [ assert_sbyte::b#5 ] zp ZP_BYTE:5 [ assert_sbyte::c#5 ]
|
||||
Uplifting [RADIX] best 2214 combination
|
||||
Uplifting [print_ln] best 2214 combination
|
||||
Uplifting [print_cls] best 2214 combination
|
||||
Uplifting [main] best 2214 combination
|
||||
Uplifting [test_bytes] best 2214 combination
|
||||
Uplifting [test_sbytes] best 2214 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:15 [ assert_byte::c#3 ]
|
||||
Uplifting [assert_byte] best 2184 combination zp ZP_BYTE:15 [ assert_byte::c#3 ]
|
||||
Uplifting [assert_byte] best 2214 combination zp ZP_BYTE:15 [ assert_byte::c#3 ]
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ assert_sbyte::c#5 ]
|
||||
Uplifting [assert_sbyte] best 2184 combination zp ZP_BYTE:5 [ assert_sbyte::c#5 ]
|
||||
Uplifting [assert_sbyte] best 2214 combination zp ZP_BYTE:5 [ assert_sbyte::c#5 ]
|
||||
Coalescing zero page register [ zp ZP_WORD:2 [ assert_sbyte::msg#5 ] ] with [ zp ZP_WORD:8 [ print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 ] ] - score: 1
|
||||
Coalescing zero page register [ zp ZP_WORD:2 [ assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 ] ] with [ zp ZP_WORD:12 [ assert_byte::msg#3 ] ] - score: 1
|
||||
Coalescing zero page register [ zp ZP_BYTE:15 [ assert_byte::c#3 ] ] with [ zp ZP_BYTE:5 [ assert_sbyte::c#5 ] ]
|
||||
Coalescing zero page register [ zp ZP_WORD:16 [ memset::dst#2 memset::dst#1 ] ] with [ zp ZP_WORD:2 [ assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ] ]
|
||||
Coalescing zero page register [ zp ZP_WORD:16 [ memset::dst#4 memset::dst#1 ] ] with [ zp ZP_WORD:2 [ assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ] ]
|
||||
Allocated (was zp ZP_WORD:6) zp ZP_WORD:2 [ print_char_cursor#80 print_char_cursor#70 print_char_cursor#2 print_char_cursor#86 print_char_cursor#1 print_char_cursor#92 print_char_cursor#93 ]
|
||||
Allocated (was zp ZP_WORD:10) zp ZP_WORD:4 [ print_line_cursor#24 print_line_cursor#47 print_line_cursor#50 print_line_cursor#1 ]
|
||||
Allocated (was zp ZP_BYTE:15) zp ZP_BYTE:6 [ assert_byte::c#3 assert_sbyte::c#5 ]
|
||||
Allocated (was zp ZP_WORD:16) zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ]
|
||||
Allocated (was zp ZP_WORD:16) zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -2801,43 +2813,44 @@ memset: {
|
||||
.label str = $400
|
||||
.label end = str+num
|
||||
.label dst = 7
|
||||
// [72] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
b1_from_memset:
|
||||
// [72] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [72] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
b2_from_memset:
|
||||
// [72] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [73] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [74] return
|
||||
rts
|
||||
jmp b2
|
||||
// [72] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
b2_from_b1:
|
||||
// [72] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// memset::@2
|
||||
b2:
|
||||
// [75] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
// [73] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// [76] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
// [74] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [72] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
b1_from_b2:
|
||||
// [72] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [75] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2_from_b1
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2_from_b1
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [76] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
msg: .text "0=0@"
|
||||
@ -2875,6 +2888,7 @@ Removing instruction jmp b3
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
@ -2885,6 +2899,8 @@ Replacing label b1_from_b2 with b1
|
||||
Replacing label b1_from_b1 with b1
|
||||
Replacing label b1_from_b1 with b1
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
@ -2917,6 +2933,7 @@ Removing instruction print_str_from_b3:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction b2_from_b3:
|
||||
Removing instruction print_ln_from_b2:
|
||||
Removing instruction b2_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction print_cls_from_main:
|
||||
@ -2952,13 +2969,15 @@ Removing instruction breturn:
|
||||
Removing instruction print_str_from_b1:
|
||||
Removing instruction memset_from_print_cls:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_memset:
|
||||
Removing instruction b2_from_memset:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -3013,8 +3032,8 @@ FINAL SYMBOL TABLE
|
||||
(byte) memset::c
|
||||
(const byte) memset::c#0 c = (byte) ' '
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:7 22.0
|
||||
(byte*) memset::dst#2 dst zp ZP_WORD:7 14.666666666666666
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:7 16.5
|
||||
(byte*) memset::dst#4 dst zp ZP_WORD:7 16.5
|
||||
(byte*) memset::end
|
||||
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||
(word) memset::num
|
||||
@ -3092,11 +3111,11 @@ zp ZP_WORD:2 [ print_char_cursor#80 print_char_cursor#70 print_char_cursor#2 pri
|
||||
zp ZP_WORD:4 [ print_line_cursor#24 print_line_cursor#47 print_line_cursor#50 print_line_cursor#1 ]
|
||||
reg byte x [ assert_byte::b#3 ]
|
||||
zp ZP_BYTE:6 [ assert_byte::c#3 assert_sbyte::c#5 ]
|
||||
zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ]
|
||||
zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 1882
|
||||
Score: 1852
|
||||
|
||||
// File Comments
|
||||
// Upstart
|
||||
@ -3555,16 +3574,29 @@ memset: {
|
||||
.label str = $400
|
||||
.label end = str+num
|
||||
.label dst = 7
|
||||
// [72] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
// [72] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [72] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
// [72] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [72] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
// [72] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
// memset::@2
|
||||
b2:
|
||||
// *dst = c
|
||||
// [73] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// for(char* dst = str; dst!=end; dst++)
|
||||
// [73] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
// [74] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// memset::@1
|
||||
// [75] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
@ -3573,24 +3605,8 @@ memset: {
|
||||
bne b2
|
||||
// memset::@return
|
||||
// }
|
||||
// [74] return
|
||||
// [76] return
|
||||
rts
|
||||
// memset::@2
|
||||
b2:
|
||||
// *dst = c
|
||||
// [75] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// for(char* dst = str; dst!=end; dst++)
|
||||
// [76] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [72] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
// [72] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
msg: .text "0=0@"
|
||||
|
@ -48,8 +48,8 @@
|
||||
(byte) memset::c
|
||||
(const byte) memset::c#0 c = (byte) ' '
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:7 22.0
|
||||
(byte*) memset::dst#2 dst zp ZP_WORD:7 14.666666666666666
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:7 16.5
|
||||
(byte*) memset::dst#4 dst zp ZP_WORD:7 16.5
|
||||
(byte*) memset::end
|
||||
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||
(word) memset::num
|
||||
@ -127,4 +127,4 @@ zp ZP_WORD:2 [ print_char_cursor#80 print_char_cursor#70 print_char_cursor#2 pri
|
||||
zp ZP_WORD:4 [ print_line_cursor#24 print_line_cursor#47 print_line_cursor#50 print_line_cursor#1 ]
|
||||
reg byte x [ assert_byte::b#3 ]
|
||||
zp ZP_BYTE:6 [ assert_byte::c#3 assert_sbyte::c#5 ]
|
||||
zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ]
|
||||
zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 assert_sbyte::msg#5 print_str::str#10 print_str::str#11 print_str::str#1 print_str::str#5 print_str::str#0 assert_byte::msg#3 ]
|
||||
|
@ -69,29 +69,6 @@ init_angle_screen: {
|
||||
sta xb
|
||||
lda #0
|
||||
sta x
|
||||
b2:
|
||||
lda x
|
||||
cmp #$13+1
|
||||
bcc b3
|
||||
lda screen_topline
|
||||
sec
|
||||
sbc #<$28
|
||||
sta screen_topline
|
||||
lda screen_topline+1
|
||||
sbc #>$28
|
||||
sta screen_topline+1
|
||||
lda #$28
|
||||
clc
|
||||
adc screen_bottomline
|
||||
sta screen_bottomline
|
||||
bcc !+
|
||||
inc screen_bottomline+1
|
||||
!:
|
||||
inc y
|
||||
lda #$d
|
||||
cmp y
|
||||
bne b1
|
||||
rts
|
||||
b3:
|
||||
lda x
|
||||
asl
|
||||
@ -134,7 +111,28 @@ init_angle_screen: {
|
||||
sta (screen_bottomline),y
|
||||
inc x
|
||||
dec xb
|
||||
jmp b2
|
||||
lda x
|
||||
cmp #$13+1
|
||||
bcc b3
|
||||
lda screen_topline
|
||||
sec
|
||||
sbc #<$28
|
||||
sta screen_topline
|
||||
lda screen_topline+1
|
||||
sbc #>$28
|
||||
sta screen_topline+1
|
||||
lda #$28
|
||||
clc
|
||||
adc screen_bottomline
|
||||
sta screen_bottomline
|
||||
bcc !+
|
||||
inc screen_bottomline+1
|
||||
!:
|
||||
inc y
|
||||
lda #$d
|
||||
cmp y
|
||||
bne b1
|
||||
rts
|
||||
}
|
||||
// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
|
||||
// Finding the angle requires a binary search using CORDIC_ITERATIONS_16
|
||||
|
@ -38,46 +38,46 @@ init_angle_screen::@1: scope:[init_angle_screen] from init_angle_screen init_an
|
||||
[15] (byte*) init_angle_screen::screen_bottomline#6 ← phi( init_angle_screen/(const byte*) SCREEN#0+(word)(number) $28*(number) $c init_angle_screen::@4/(byte*) init_angle_screen::screen_bottomline#1 )
|
||||
[15] (byte*) init_angle_screen::screen_topline#6 ← phi( init_angle_screen/(const byte*) SCREEN#0+(word)(number) $28*(number) $c init_angle_screen::@4/(byte*) init_angle_screen::screen_topline#1 )
|
||||
[15] (byte) init_angle_screen::y#5 ← phi( init_angle_screen/(byte) 0 init_angle_screen::@4/(byte) init_angle_screen::y#1 )
|
||||
to:init_angle_screen::@2
|
||||
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@5
|
||||
[16] (byte) init_angle_screen::xb#2 ← phi( init_angle_screen::@1/(byte) $27 init_angle_screen::@5/(byte) init_angle_screen::xb#1 )
|
||||
[16] (byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(byte) 0 init_angle_screen::@5/(byte) init_angle_screen::x#1 )
|
||||
[17] if((byte) init_angle_screen::x#2<(byte) $13+(byte) 1) goto init_angle_screen::@3
|
||||
to:init_angle_screen::@4
|
||||
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
|
||||
[18] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#6 - (byte) $28
|
||||
[19] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#6 + (byte) $28
|
||||
[20] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#5
|
||||
[21] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
|
||||
to:init_angle_screen::@return
|
||||
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@4
|
||||
[22] return
|
||||
to:@return
|
||||
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@2
|
||||
[23] (byte~) init_angle_screen::$3 ← (byte) init_angle_screen::x#2 << (byte) 1
|
||||
[24] (byte~) init_angle_screen::$4 ← (byte) $27 - (byte~) init_angle_screen::$3
|
||||
[25] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$4 w= (byte) 0
|
||||
[26] (byte~) init_angle_screen::$7 ← (byte) init_angle_screen::y#5 << (byte) 1
|
||||
[27] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$7 w= (byte) 0
|
||||
[28] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
|
||||
[29] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
|
||||
[30] call atan2_16
|
||||
[31] (word) atan2_16::return#2 ← (word) atan2_16::return#0
|
||||
to:init_angle_screen::@3
|
||||
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@2
|
||||
[16] (byte) init_angle_screen::xb#5 ← phi( init_angle_screen::@2/(byte) init_angle_screen::xb#1 init_angle_screen::@1/(byte) $27 )
|
||||
[16] (byte) init_angle_screen::x#5 ← phi( init_angle_screen::@2/(byte) init_angle_screen::x#1 init_angle_screen::@1/(byte) 0 )
|
||||
[17] (byte~) init_angle_screen::$3 ← (byte) init_angle_screen::x#5 << (byte) 1
|
||||
[18] (byte~) init_angle_screen::$4 ← (byte) $27 - (byte~) init_angle_screen::$3
|
||||
[19] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$4 w= (byte) 0
|
||||
[20] (byte~) init_angle_screen::$7 ← (byte) init_angle_screen::y#5 << (byte) 1
|
||||
[21] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$7 w= (byte) 0
|
||||
[22] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
|
||||
[23] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
|
||||
[24] call atan2_16
|
||||
[25] (word) atan2_16::return#2 ← (word) atan2_16::return#0
|
||||
to:init_angle_screen::@5
|
||||
init_angle_screen::@5: scope:[init_angle_screen] from init_angle_screen::@3
|
||||
[32] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
|
||||
[33] (word~) init_angle_screen::$11 ← (word) init_angle_screen::angle_w#0 + (byte) $80
|
||||
[34] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$11
|
||||
[35] (byte~) init_angle_screen::$13 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
|
||||
[36] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13
|
||||
[37] (byte~) init_angle_screen::$14 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
|
||||
[38] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$14
|
||||
[39] (byte~) init_angle_screen::$15 ← - (byte) init_angle_screen::ang_w#0
|
||||
[40] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$15
|
||||
[41] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0
|
||||
[42] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2
|
||||
[43] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2
|
||||
[26] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
|
||||
[27] (word~) init_angle_screen::$11 ← (word) init_angle_screen::angle_w#0 + (byte) $80
|
||||
[28] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$11
|
||||
[29] (byte~) init_angle_screen::$13 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
|
||||
[30] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::x#5) ← (byte~) init_angle_screen::$13
|
||||
[31] (byte~) init_angle_screen::$14 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
|
||||
[32] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::x#5) ← (byte~) init_angle_screen::$14
|
||||
[33] (byte~) init_angle_screen::$15 ← - (byte) init_angle_screen::ang_w#0
|
||||
[34] *((byte*) init_angle_screen::screen_topline#6 + (byte) init_angle_screen::xb#5) ← (byte~) init_angle_screen::$15
|
||||
[35] *((byte*) init_angle_screen::screen_bottomline#6 + (byte) init_angle_screen::xb#5) ← (byte) init_angle_screen::ang_w#0
|
||||
[36] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#5
|
||||
[37] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#5
|
||||
to:init_angle_screen::@2
|
||||
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@5
|
||||
[38] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@3
|
||||
to:init_angle_screen::@4
|
||||
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
|
||||
[39] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#6 - (byte) $28
|
||||
[40] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#6 + (byte) $28
|
||||
[41] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#5
|
||||
[42] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
|
||||
to:init_angle_screen::@return
|
||||
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@4
|
||||
[43] return
|
||||
to:@return
|
||||
atan2_16: scope:[atan2_16] from init_angle_screen::@3
|
||||
[44] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1
|
||||
to:atan2_16::@2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -115,16 +115,16 @@
|
||||
(byte*) init_angle_screen::screen
|
||||
(byte*) init_angle_screen::screen_bottomline
|
||||
(byte*) init_angle_screen::screen_bottomline#1 screen_bottomline zp ZP_WORD:10 7.333333333333333
|
||||
(byte*) init_angle_screen::screen_bottomline#6 screen_bottomline zp ZP_WORD:10 8.96
|
||||
(byte*) init_angle_screen::screen_bottomline#6 screen_bottomline zp ZP_WORD:10 8.959999999999999
|
||||
(byte*) init_angle_screen::screen_topline
|
||||
(byte*) init_angle_screen::screen_topline#1 screen_topline zp ZP_WORD:2 5.5
|
||||
(byte*) init_angle_screen::screen_topline#6 screen_topline zp ZP_WORD:2 9.333333333333332
|
||||
(byte*) init_angle_screen::screen_topline#6 screen_topline zp ZP_WORD:2 9.333333333333334
|
||||
(byte) init_angle_screen::x
|
||||
(byte) init_angle_screen::x#1 x zp ZP_BYTE:17 101.0
|
||||
(byte) init_angle_screen::x#2 x zp ZP_BYTE:17 28.857142857142858
|
||||
(byte) init_angle_screen::x#5 x zp ZP_BYTE:17 25.25
|
||||
(byte) init_angle_screen::xb
|
||||
(byte) init_angle_screen::xb#1 xb zp ZP_BYTE:18 202.0
|
||||
(byte) init_angle_screen::xb#2 xb zp ZP_BYTE:18 18.363636363636363
|
||||
(byte) init_angle_screen::xb#1 xb zp ZP_BYTE:18 101.0
|
||||
(byte) init_angle_screen::xb#5 xb zp ZP_BYTE:18 19.238095238095237
|
||||
(signed word) init_angle_screen::xw
|
||||
(word) init_angle_screen::xw#0 xw zp ZP_WORD:19 33.666666666666664
|
||||
(byte) init_angle_screen::y
|
||||
@ -199,9 +199,9 @@ zp ZP_WORD:10 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 init_angle_s
|
||||
zp ZP_BYTE:12 [ init_font_hex::c#6 init_font_hex::c#1 init_angle_screen::y#5 init_angle_screen::y#1 ]
|
||||
zp ZP_WORD:13 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
|
||||
zp ZP_WORD:15 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
|
||||
zp ZP_BYTE:17 [ init_font_hex::c1#4 init_font_hex::c1#1 init_angle_screen::x#2 init_angle_screen::x#1 ]
|
||||
zp ZP_BYTE:17 [ init_font_hex::c1#4 init_font_hex::c1#1 init_angle_screen::x#5 init_angle_screen::x#1 ]
|
||||
reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ]
|
||||
zp ZP_BYTE:18 [ init_font_hex::idx#5 init_font_hex::idx#2 init_angle_screen::xb#2 init_angle_screen::xb#1 ]
|
||||
zp ZP_BYTE:18 [ init_font_hex::idx#5 init_font_hex::idx#2 init_angle_screen::xb#5 init_angle_screen::xb#1 ]
|
||||
reg byte a [ init_angle_screen::$3 ]
|
||||
reg byte a [ init_angle_screen::$4 ]
|
||||
zp ZP_WORD:19 [ init_angle_screen::xw#0 atan2_16::x#0 ]
|
||||
|
@ -54,14 +54,6 @@ memset: {
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
b1:
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
b2:
|
||||
lda #c
|
||||
ldy #0
|
||||
@ -70,5 +62,11 @@ memset: {
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
jmp b1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
}
|
||||
|
@ -36,15 +36,15 @@ main::@return: scope:[main] from main::@3
|
||||
to:@return
|
||||
memset: scope:[memset] from main
|
||||
[17] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[18] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[19] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[18] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[20] return
|
||||
[22] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[21] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[22] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
|
@ -294,6 +294,13 @@ Constant right-side identified [0] (byte*) memset::end#0 ← (const byte*) memse
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) memset::end#0 = memset::$2+memset::num#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (byte*) memset::dst#1 = (byte*) memset::dst#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (byte*) memset::dst#5 (const byte*) memset::dst#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
if() condition always true - replacing block destination [21] if((const byte*) memset::dst#0!=(const byte*) memset::end#0) goto memset::@5
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Inlining constant with var siblings (const byte*) memset::dst#0
|
||||
Inlining constant with var siblings (const byte) main::ch#0
|
||||
Inlining constant with var siblings (const byte) main::x#0
|
||||
@ -307,6 +314,7 @@ Constant inlined main::x#0 = (byte) 0
|
||||
Constant inlined main::y#0 = (byte) 0
|
||||
Constant inlined main::ch#0 = (byte) 0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting memset::@10(between memset::@4 and memset::@5)
|
||||
Added new block during phi lifting main::@6(between main::@3 and main::@1)
|
||||
Added new block during phi lifting main::@7(between main::@2 and main::@2)
|
||||
Adding NOP phi() at start of @begin
|
||||
@ -318,6 +326,7 @@ Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@5
|
||||
Adding NOP phi() at start of memset
|
||||
Adding NOP phi() at start of memset::@2
|
||||
Adding NOP phi() at start of memset::@4_1
|
||||
Adding NOP phi() at start of memset::@1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:3
|
||||
@ -332,7 +341,7 @@ Coalesced [24] main::x#5 ← main::x#1
|
||||
Coalesced (already) [25] main::ch#7 ← main::ch#1
|
||||
Coalesced [26] main::screen#8 ← main::screen#1
|
||||
Coalesced [27] main::y#3 ← main::y#1
|
||||
Coalesced [36] memset::dst#4 ← memset::dst#1
|
||||
Coalesced [37] memset::dst#6 ← memset::dst#1
|
||||
Coalesced down to 5 phi equivalence classes
|
||||
Culled Empty Block (label) @4
|
||||
Culled Empty Block (label) @6
|
||||
@ -340,7 +349,9 @@ Culled Empty Block (label) main::@5
|
||||
Culled Empty Block (label) main::@6
|
||||
Culled Empty Block (label) main::@7
|
||||
Culled Empty Block (label) memset::@2
|
||||
Culled Empty Block (label) memset::@4_1
|
||||
Culled Empty Block (label) memset::@1
|
||||
Culled Empty Block (label) memset::@10
|
||||
Renumbering block @5 to @1
|
||||
Renumbering block memset::@4 to memset::@1
|
||||
Renumbering block memset::@5 to memset::@2
|
||||
@ -389,18 +400,18 @@ main::@return: scope:[main] from main::@3
|
||||
to:@return
|
||||
memset: scope:[memset] from main
|
||||
[17] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[18] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[19] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[18] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[20] return
|
||||
[22] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[21] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[22] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
@ -424,8 +435,8 @@ VARIABLE REGISTER WEIGHTS
|
||||
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
|
||||
(byte) memset::c
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 22.0
|
||||
(byte*) memset::dst#2 14.666666666666666
|
||||
(byte*) memset::dst#1 16.5
|
||||
(byte*) memset::dst#4 16.5
|
||||
(byte*) memset::end
|
||||
(word) memset::num
|
||||
(void*) memset::return
|
||||
@ -436,18 +447,18 @@ Initial phi equivalence classes
|
||||
[ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
[ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
[ main::y#2 main::y#1 ]
|
||||
[ memset::dst#2 memset::dst#1 ]
|
||||
[ memset::dst#4 memset::dst#1 ]
|
||||
Complete equivalence classes
|
||||
[ main::x#4 main::x#1 ]
|
||||
[ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
[ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
[ main::y#2 main::y#1 ]
|
||||
[ memset::dst#2 memset::dst#1 ]
|
||||
[ memset::dst#4 memset::dst#1 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Allocated zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
Allocated zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
Allocated zp ZP_BYTE:6 [ main::y#2 main::y#1 ]
|
||||
Allocated zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ]
|
||||
Allocated zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic
|
||||
@ -571,43 +582,44 @@ memset: {
|
||||
.label str = SCREEN
|
||||
.label end = str+num
|
||||
.label dst = 7
|
||||
// [18] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
b1_from_memset:
|
||||
// [18] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [18] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
b2_from_memset:
|
||||
// [18] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [20] return
|
||||
rts
|
||||
jmp b2
|
||||
// [18] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
b2_from_b1:
|
||||
// [18] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// memset::@2
|
||||
b2:
|
||||
// [21] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
// [19] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// [22] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
// [20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [18] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
b1_from_b2:
|
||||
// [18] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2_from_b1
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2_from_b1
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [22] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
@ -619,37 +631,37 @@ Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ ma
|
||||
Statement [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 [ main::x#4 main::ch#1 main::screen#2 ] ( main:2 [ main::x#4 main::ch#1 main::screen#2 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
Statement [19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a
|
||||
Statement [21] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [19] *((byte*) memset::dst#4) ← (const byte) memset::c#0 [ memset::dst#4 ] ( main:2::memset:5 [ memset::dst#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#1 ] ( main:2::memset:5 [ memset::dst#1 ] ) always clobbers reg byte a
|
||||
Statement [8] *((byte*) main::screen#3) ← (byte) main::ch#2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ( main:2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::y#2 main::y#1 ]
|
||||
Statement [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 [ main::x#4 main::ch#1 main::screen#2 ] ( main:2 [ main::x#4 main::ch#1 main::screen#2 ] ) always clobbers reg byte a
|
||||
Statement [19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a
|
||||
Statement [21] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [19] *((byte*) memset::dst#4) ← (const byte) memset::c#0 [ memset::dst#4 ] ( main:2::memset:5 [ memset::dst#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#1 ] ( main:2::memset:5 [ memset::dst#1 ] ) always clobbers reg byte a
|
||||
Statement [8] *((byte*) main::screen#3) ← (byte) main::ch#2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ( main:2 [ main::x#4 main::ch#2 main::screen#3 main::y#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [13] (byte*) main::screen#2 ← (byte*) main::screen#1 + (byte)(number) $28-(number) $10 [ main::x#4 main::ch#1 main::screen#2 ] ( main:2 [ main::x#4 main::ch#1 main::screen#2 ] ) always clobbers reg byte a
|
||||
Statement [19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a
|
||||
Statement [21] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::memset:5 [ memset::dst#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [19] *((byte*) memset::dst#4) ← (const byte) memset::c#0 [ memset::dst#4 ] ( main:2::memset:5 [ memset::dst#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#1 ] ( main:2::memset:5 [ memset::dst#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::x#4 main::x#1 ] : zp ZP_BYTE:2 , reg byte x ,
|
||||
Potential registers zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] : zp ZP_BYTE:3 , reg byte x ,
|
||||
Potential registers zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] : zp ZP_WORD:4 ,
|
||||
Potential registers zp ZP_BYTE:6 [ main::y#2 main::y#1 ] : zp ZP_BYTE:6 , reg byte x ,
|
||||
Potential registers zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ] : zp ZP_WORD:7 ,
|
||||
Potential registers zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 ] : zp ZP_WORD:7 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 239.58: zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] 202: zp ZP_BYTE:6 [ main::y#2 main::y#1 ] 162.17: zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] 19.25: zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Uplift Scope [memset] 36.67: zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplift Scope [memset] 33: zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 5785 combination zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] reg byte x [ main::y#2 main::y#1 ] zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Uplifting [memset] best 5785 combination zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplifting [] best 5785 combination
|
||||
Uplifting [main] best 5815 combination zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] reg byte x [ main::y#2 main::y#1 ] zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ] zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Uplifting [memset] best 5815 combination zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 ]
|
||||
Uplifting [] best 5815 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
Uplifting [main] best 5785 combination zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
Uplifting [main] best 5815 combination zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Uplifting [main] best 5785 combination zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Coalescing zero page register [ zp ZP_WORD:7 [ memset::dst#2 memset::dst#1 ] ] with [ zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] ]
|
||||
Allocated (was zp ZP_WORD:7) zp ZP_WORD:4 [ memset::dst#2 memset::dst#1 main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
Uplifting [main] best 5815 combination zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
Coalescing zero page register [ zp ZP_WORD:7 [ memset::dst#4 memset::dst#1 ] ] with [ zp ZP_WORD:4 [ main::screen#3 main::screen#5 main::screen#2 main::screen#1 ] ]
|
||||
Allocated (was zp ZP_WORD:7) zp ZP_WORD:4 [ memset::dst#4 memset::dst#1 main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -769,43 +781,44 @@ memset: {
|
||||
.label str = SCREEN
|
||||
.label end = str+num
|
||||
.label dst = 4
|
||||
// [18] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
b1_from_memset:
|
||||
// [18] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [18] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
b2_from_memset:
|
||||
// [18] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [20] return
|
||||
rts
|
||||
jmp b2
|
||||
// [18] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
b2_from_b1:
|
||||
// [18] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// memset::@2
|
||||
b2:
|
||||
// [21] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
// [19] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// [22] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
// [20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [18] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
b1_from_b2:
|
||||
// [18] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2_from_b1
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2_from_b1
|
||||
jmp breturn
|
||||
// memset::@return
|
||||
breturn:
|
||||
// [22] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
@ -816,11 +829,14 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b3
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b2_from_b2 with b2
|
||||
Replacing label b1_from_b3 with b1
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
@ -828,21 +844,23 @@ Removing instruction bend_from_b1:
|
||||
Removing instruction b1_from_b3:
|
||||
Removing instruction b2_from_b1:
|
||||
Removing instruction b2_from_b2:
|
||||
Removing instruction b2_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction memset_from_main:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b3:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_memset:
|
||||
Removing instruction b2_from_memset:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
@ -880,8 +898,8 @@ FINAL SYMBOL TABLE
|
||||
(byte) memset::c
|
||||
(const byte) memset::c#0 c = (byte) ' '
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:4 22.0
|
||||
(byte*) memset::dst#2 dst zp ZP_WORD:4 14.666666666666666
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:4 16.5
|
||||
(byte*) memset::dst#4 dst zp ZP_WORD:4 16.5
|
||||
(byte*) memset::end
|
||||
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||
(word) memset::num
|
||||
@ -893,11 +911,11 @@ FINAL SYMBOL TABLE
|
||||
zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
reg byte x [ main::y#2 main::y#1 ]
|
||||
zp ZP_WORD:4 [ memset::dst#2 memset::dst#1 main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
zp ZP_WORD:4 [ memset::dst#4 memset::dst#1 main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 4723
|
||||
Score: 4693
|
||||
|
||||
// File Comments
|
||||
// Show default font on screen
|
||||
@ -1001,16 +1019,29 @@ memset: {
|
||||
.label str = SCREEN
|
||||
.label end = str+num
|
||||
.label dst = 4
|
||||
// [18] phi from memset to memset::@1 [phi:memset->memset::@1]
|
||||
// [18] phi (byte*) memset::dst#2 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
|
||||
// [18] phi from memset to memset::@2 [phi:memset->memset::@2]
|
||||
// [18] phi (byte*) memset::dst#4 = (byte*)(const void*) memset::str#0 [phi:memset->memset::@2#0] -- pbuz1=pbuc1
|
||||
lda #<str
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
// memset::@1
|
||||
b1:
|
||||
// [18] phi from memset::@1 to memset::@2 [phi:memset::@1->memset::@2]
|
||||
// [18] phi (byte*) memset::dst#4 = (byte*) memset::dst#1 [phi:memset::@1->memset::@2#0] -- register_copy
|
||||
// memset::@2
|
||||
b2:
|
||||
// *dst = c
|
||||
// [19] *((byte*) memset::dst#4) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// for(char* dst = str; dst!=end; dst++)
|
||||
// [19] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
// [20] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// memset::@1
|
||||
// [21] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
@ -1019,24 +1050,8 @@ memset: {
|
||||
bne b2
|
||||
// memset::@return
|
||||
// }
|
||||
// [20] return
|
||||
// [22] return
|
||||
rts
|
||||
// memset::@2
|
||||
b2:
|
||||
// *dst = c
|
||||
// [21] *((byte*) memset::dst#2) ← (const byte) memset::c#0 -- _deref_pbuz1=vbuc1
|
||||
lda #c
|
||||
ldy #0
|
||||
sta (dst),y
|
||||
// for(char* dst = str; dst!=end; dst++)
|
||||
// [22] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
|
||||
inc dst
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
// [18] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
|
||||
// [18] phi (byte*) memset::dst#2 = (byte*) memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -30,8 +30,8 @@
|
||||
(byte) memset::c
|
||||
(const byte) memset::c#0 c = (byte) ' '
|
||||
(byte*) memset::dst
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:4 22.0
|
||||
(byte*) memset::dst#2 dst zp ZP_WORD:4 14.666666666666666
|
||||
(byte*) memset::dst#1 dst zp ZP_WORD:4 16.5
|
||||
(byte*) memset::dst#4 dst zp ZP_WORD:4 16.5
|
||||
(byte*) memset::end
|
||||
(const byte*) memset::end#0 end = (byte*)(const void*) memset::str#0+(const word) memset::num#0
|
||||
(word) memset::num
|
||||
@ -43,4 +43,4 @@
|
||||
zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
zp ZP_BYTE:3 [ main::ch#2 main::ch#3 main::ch#1 ]
|
||||
reg byte x [ main::y#2 main::y#1 ]
|
||||
zp ZP_WORD:4 [ memset::dst#2 memset::dst#1 main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
zp ZP_WORD:4 [ memset::dst#4 memset::dst#1 main::screen#3 main::screen#5 main::screen#2 main::screen#1 ]
|
||||
|
@ -9,16 +9,6 @@ main: {
|
||||
lda #<0
|
||||
sta i
|
||||
sta i+1
|
||||
b1:
|
||||
lda i+1
|
||||
cmp #>$3e8
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<$3e8
|
||||
bcc b2
|
||||
!:
|
||||
rts
|
||||
b2:
|
||||
lda i
|
||||
clc
|
||||
@ -37,5 +27,13 @@ main: {
|
||||
bcc !+
|
||||
inc i+1
|
||||
!:
|
||||
jmp b1
|
||||
lda i+1
|
||||
cmp #>$3e8
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<$3e8
|
||||
bcc b2
|
||||
!:
|
||||
rts
|
||||
}
|
||||
|
@ -9,16 +9,16 @@
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (word) main::i#4 ← phi( main::@1/(word) main::i#1 main/(byte) 0 )
|
||||
[6] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#4
|
||||
[7] *((byte*~) main::$1) ← (byte) 'a'
|
||||
[8] (word) main::i#1 ← (word) main::i#4 + (byte) $28
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (word) main::i#2 ← phi( main/(byte) 0 main::@2/(word) main::i#1 )
|
||||
[6] if((word) main::i#2<(word) $3e8) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((word) main::i#1<(word) $3e8) goto main::@2
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@1
|
||||
[7] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@2: scope:[main] from main::@1
|
||||
[8] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#2
|
||||
[9] *((byte*~) main::$1) ← (byte) 'a'
|
||||
[10] (word) main::i#1 ← (word) main::i#2 + (byte) $28
|
||||
to:main::@1
|
||||
|
@ -73,21 +73,32 @@ Constant (const word) main::i#0 = 0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
De-inlining pointer[w] to *(pointer+w) [6] *((const byte*) main::screen#0 + (word) main::i#2) ← (byte) 'a'
|
||||
Successful SSA optimization Pass2DeInlineWordDerefIdx
|
||||
Successful SSA optimization Pass2LoopHeadConstantIdentification
|
||||
Alias (word) main::i#1 = (word) main::i#2
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values (word) main::i#5 (const word) main::i#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
if() condition always true - replacing block destination [10] if((const word) main::i#0<(word) $3e8) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Inlining constant with var siblings (const word) main::i#0
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Added new block during phi lifting main::@7(between main::@1 and main::@2)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
Adding NOP phi() at start of main::@1_1
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 1 initial phi equivalence classes
|
||||
Coalesced [12] main::i#4 ← main::i#1
|
||||
Coalesced [13] main::i#6 ← main::i#1
|
||||
Coalesced down to 1 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Culled Empty Block (label) main::@1_1
|
||||
Culled Empty Block (label) main::@7
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
@ -105,36 +116,36 @@ FINAL CONTROL FLOW GRAPH
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main main::@1
|
||||
[5] (word) main::i#4 ← phi( main::@1/(word) main::i#1 main/(byte) 0 )
|
||||
[6] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#4
|
||||
[7] *((byte*~) main::$1) ← (byte) 'a'
|
||||
[8] (word) main::i#1 ← (word) main::i#4 + (byte) $28
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@2
|
||||
[5] (word) main::i#2 ← phi( main/(byte) 0 main::@2/(word) main::i#1 )
|
||||
[6] if((word) main::i#2<(word) $3e8) goto main::@2
|
||||
main::@1: scope:[main] from main::@2
|
||||
[9] if((word) main::i#1<(word) $3e8) goto main::@2
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@1
|
||||
[7] return
|
||||
[10] return
|
||||
to:@return
|
||||
main::@2: scope:[main] from main::@1
|
||||
[8] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#2
|
||||
[9] *((byte*~) main::$1) ← (byte) 'a'
|
||||
[10] (word) main::i#1 ← (word) main::i#2 + (byte) $28
|
||||
to:main::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(void()) main()
|
||||
(byte*~) main::$1 22.0
|
||||
(word) main::i
|
||||
(word) main::i#1 22.0
|
||||
(word) main::i#2 11.0
|
||||
(word) main::i#1 16.5
|
||||
(word) main::i#4 11.0
|
||||
(byte*) main::screen
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
Added variable main::$1 to zero page equivalence class [ main::$1 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::i#4 main::i#1 ]
|
||||
[ main::$1 ]
|
||||
Allocated zp ZP_WORD:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_WORD:2 [ main::i#4 main::i#1 ]
|
||||
Allocated zp ZP_WORD:4 [ main::$1 ]
|
||||
|
||||
INITIAL ASM
|
||||
@ -167,33 +178,21 @@ main: {
|
||||
.label screen = $400
|
||||
.label i = 2
|
||||
.label _1 = 4
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (word) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vwuz1=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (word) main::i#4 = (byte) 0 [phi:main->main::@2#0] -- vwuz1=vbuc1
|
||||
lda #<0
|
||||
sta i
|
||||
lda #>0
|
||||
sta i+1
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((word) main::i#2<(word) $3e8) goto main::@2 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda i+1
|
||||
cmp #>$3e8
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<$3e8
|
||||
bcc b2
|
||||
!:
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [7] return
|
||||
rts
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (word) main::i#4 = (word) main::i#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#2 -- pbuz1=pbuc1_plus_vwuz2
|
||||
// [6] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#4 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda i
|
||||
clc
|
||||
adc #<screen
|
||||
@ -201,11 +200,11 @@ main: {
|
||||
lda i+1
|
||||
adc #>screen
|
||||
sta _1+1
|
||||
// [9] *((byte*~) main::$1) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
// [7] *((byte*~) main::$1) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (_1),y
|
||||
// [10] (word) main::i#1 ← (word) main::i#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
// [8] (word) main::i#1 ← (word) main::i#4 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc i
|
||||
@ -213,27 +212,40 @@ main: {
|
||||
bcc !+
|
||||
inc i+1
|
||||
!:
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (word) main::i#2 = (word) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [9] if((word) main::i#1<(word) $3e8) goto main::@2 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda i+1
|
||||
cmp #>$3e8
|
||||
bcc b2_from_b1
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<$3e8
|
||||
bcc b2_from_b1
|
||||
!:
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [10] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [6] if((word) main::i#2<(word) $3e8) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
|
||||
Statement [8] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#2 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) always clobbers reg byte a
|
||||
Statement [9] *((byte*~) main::$1) ← (byte) 'a' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [10] (word) main::i#1 ← (word) main::i#2 + (byte) $28 [ main::i#1 ] ( main:2 [ main::i#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ main::i#2 main::i#1 ] : zp ZP_WORD:2 ,
|
||||
Statement [6] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#4 [ main::i#4 main::$1 ] ( main:2 [ main::i#4 main::$1 ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte*~) main::$1) ← (byte) 'a' [ main::i#4 ] ( main:2 [ main::i#4 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [8] (word) main::i#1 ← (word) main::i#4 + (byte) $28 [ main::i#1 ] ( main:2 [ main::i#1 ] ) always clobbers reg byte a
|
||||
Statement [9] if((word) main::i#1<(word) $3e8) goto main::@2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ main::i#4 main::i#1 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_WORD:4 [ main::$1 ] : zp ZP_WORD:4 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 33: zp ZP_WORD:2 [ main::i#2 main::i#1 ] 22: zp ZP_WORD:4 [ main::$1 ]
|
||||
Uplift Scope [main] 27.5: zp ZP_WORD:2 [ main::i#4 main::i#1 ] 22: zp ZP_WORD:4 [ main::$1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 838 combination zp ZP_WORD:2 [ main::i#2 main::i#1 ] zp ZP_WORD:4 [ main::$1 ]
|
||||
Uplifting [] best 838 combination
|
||||
Uplifting [main] best 868 combination zp ZP_WORD:2 [ main::i#4 main::i#1 ] zp ZP_WORD:4 [ main::$1 ]
|
||||
Uplifting [] best 868 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -264,33 +276,21 @@ main: {
|
||||
.label screen = $400
|
||||
.label i = 2
|
||||
.label _1 = 4
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
// [5] phi (word) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vwuz1=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
b2_from_main:
|
||||
// [5] phi (word) main::i#4 = (byte) 0 [phi:main->main::@2#0] -- vwuz1=vbuc1
|
||||
lda #<0
|
||||
sta i
|
||||
lda #>0
|
||||
sta i+1
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [6] if((word) main::i#2<(word) $3e8) goto main::@2 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda i+1
|
||||
cmp #>$3e8
|
||||
bcc b2
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<$3e8
|
||||
bcc b2
|
||||
!:
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [7] return
|
||||
rts
|
||||
jmp b2
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
b2_from_b1:
|
||||
// [5] phi (word) main::i#4 = (word) main::i#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
jmp b2
|
||||
// main::@2
|
||||
b2:
|
||||
// [8] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#2 -- pbuz1=pbuc1_plus_vwuz2
|
||||
// [6] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#4 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda i
|
||||
clc
|
||||
adc #<screen
|
||||
@ -298,11 +298,11 @@ main: {
|
||||
lda i+1
|
||||
adc #>screen
|
||||
sta _1+1
|
||||
// [9] *((byte*~) main::$1) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
// [7] *((byte*~) main::$1) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (_1),y
|
||||
// [10] (word) main::i#1 ← (word) main::i#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
// [8] (word) main::i#1 ← (word) main::i#4 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc i
|
||||
@ -310,34 +310,53 @@ main: {
|
||||
bcc !+
|
||||
inc i+1
|
||||
!:
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
b1_from_b2:
|
||||
// [5] phi (word) main::i#2 = (word) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
// main::@1
|
||||
b1:
|
||||
// [9] if((word) main::i#1<(word) $3e8) goto main::@2 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda i+1
|
||||
cmp #>$3e8
|
||||
bcc b2_from_b1
|
||||
bne !+
|
||||
lda i
|
||||
cmp #<$3e8
|
||||
bcc b2_from_b1
|
||||
!:
|
||||
jmp breturn
|
||||
// main::@return
|
||||
breturn:
|
||||
// [10] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #>0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label b2_from_b1 with b2
|
||||
Replacing label b2_from_b1 with b2
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b2_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b2_from_main:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1_from_b2:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
@ -351,17 +370,17 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(word) main::i
|
||||
(word) main::i#1 i zp ZP_WORD:2 22.0
|
||||
(word) main::i#2 i zp ZP_WORD:2 11.0
|
||||
(word) main::i#1 i zp ZP_WORD:2 16.5
|
||||
(word) main::i#4 i zp ZP_WORD:2 11.0
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = (byte*) 1024
|
||||
|
||||
zp ZP_WORD:2 [ main::i#2 main::i#1 ]
|
||||
zp ZP_WORD:2 [ main::i#4 main::i#1 ]
|
||||
zp ZP_WORD:4 [ main::$1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 746
|
||||
Score: 716
|
||||
|
||||
// File Comments
|
||||
// Tests that array-indexing by a word variable is turned into pointer addition
|
||||
@ -382,15 +401,40 @@ main: {
|
||||
.label screen = $400
|
||||
.label i = 2
|
||||
.label _1 = 4
|
||||
// [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
// [5] phi (word) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vwuz1=vbuc1
|
||||
// [5] phi from main to main::@2 [phi:main->main::@2]
|
||||
// [5] phi (word) main::i#4 = (byte) 0 [phi:main->main::@2#0] -- vwuz1=vbuc1
|
||||
lda #<0
|
||||
sta i
|
||||
sta i+1
|
||||
// [5] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
// [5] phi (word) main::i#4 = (word) main::i#1 [phi:main::@1->main::@2#0] -- register_copy
|
||||
// main::@2
|
||||
b2:
|
||||
// screen[i] = 'a'
|
||||
// [6] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#4 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda i
|
||||
clc
|
||||
adc #<screen
|
||||
sta _1
|
||||
lda i+1
|
||||
adc #>screen
|
||||
sta _1+1
|
||||
// [7] *((byte*~) main::$1) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (_1),y
|
||||
// i+=40
|
||||
// [8] (word) main::i#1 ← (word) main::i#4 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc i
|
||||
sta i
|
||||
bcc !+
|
||||
inc i+1
|
||||
!:
|
||||
// main::@1
|
||||
b1:
|
||||
// for( word i=0;i<1000;i+=40)
|
||||
// [6] if((word) main::i#2<(word) $3e8) goto main::@2 -- vwuz1_lt_vwuc1_then_la1
|
||||
// [9] if((word) main::i#1<(word) $3e8) goto main::@2 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda i+1
|
||||
cmp #>$3e8
|
||||
bcc b2
|
||||
@ -401,35 +445,8 @@ main: {
|
||||
!:
|
||||
// main::@return
|
||||
// }
|
||||
// [7] return
|
||||
// [10] return
|
||||
rts
|
||||
// main::@2
|
||||
b2:
|
||||
// screen[i] = 'a'
|
||||
// [8] (byte*~) main::$1 ← (const byte*) main::screen#0 + (word) main::i#2 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda i
|
||||
clc
|
||||
adc #<screen
|
||||
sta _1
|
||||
lda i+1
|
||||
adc #>screen
|
||||
sta _1+1
|
||||
// [9] *((byte*~) main::$1) ← (byte) 'a' -- _deref_pbuz1=vbuc1
|
||||
lda #'a'
|
||||
ldy #0
|
||||
sta (_1),y
|
||||
// i+=40
|
||||
// [10] (word) main::i#1 ← (word) main::i#2 + (byte) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc i
|
||||
sta i
|
||||
bcc !+
|
||||
inc i+1
|
||||
!:
|
||||
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
||||
// [5] phi (word) main::i#2 = (word) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
}
|
||||
// File Data
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(word) main::i
|
||||
(word) main::i#1 i zp ZP_WORD:2 22.0
|
||||
(word) main::i#2 i zp ZP_WORD:2 11.0
|
||||
(word) main::i#1 i zp ZP_WORD:2 16.5
|
||||
(word) main::i#4 i zp ZP_WORD:2 11.0
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = (byte*) 1024
|
||||
|
||||
zp ZP_WORD:2 [ main::i#2 main::i#1 ]
|
||||
zp ZP_WORD:2 [ main::i#4 main::i#1 ]
|
||||
zp ZP_WORD:4 [ main::$1 ]
|
||||
|
@ -177,14 +177,6 @@ memset: {
|
||||
sta dst
|
||||
lda #>str
|
||||
sta dst+1
|
||||
b1:
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
b2:
|
||||
lda #c
|
||||
ldy #0
|
||||
@ -193,6 +185,12 @@ memset: {
|
||||
bne !+
|
||||
inc dst+1
|
||||
!:
|
||||
jmp b1
|
||||
lda dst+1
|
||||
cmp #>end
|
||||
bne b2
|
||||
lda dst
|
||||
cmp #<end
|
||||
bne b2
|
||||
rts
|
||||
}
|
||||
print_hextab: .text "0123456789abcdef"
|
||||
|
@ -139,15 +139,15 @@ print_cls::@return: scope:[print_cls] from print_cls
|
||||
to:@return
|
||||
memset: scope:[memset] from print_cls
|
||||
[64] phi()
|
||||
to:memset::@2
|
||||
memset::@2: scope:[memset] from memset memset::@1
|
||||
[65] (byte*) memset::dst#4 ← phi( memset::@1/(byte*) memset::dst#1 memset/(byte*)(const void*) memset::str#0 )
|
||||
[66] *((byte*) memset::dst#4) ← (const byte) memset::c#0
|
||||
[67] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#4
|
||||
to:memset::@1
|
||||
memset::@1: scope:[memset] from memset memset::@2
|
||||
[65] (byte*) memset::dst#2 ← phi( memset/(byte*)(const void*) memset::str#0 memset::@2/(byte*) memset::dst#1 )
|
||||
[66] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2
|
||||
memset::@1: scope:[memset] from memset::@2
|
||||
[68] if((byte*) memset::dst#1!=(const byte*) memset::end#0) goto memset::@2
|
||||
to:memset::@return
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
[67] return
|
||||
[69] return
|
||||
to:@return
|
||||
memset::@2: scope:[memset] from memset::@1
|
||||
[68] *((byte*) memset::dst#2) ← (const byte) memset::c#0
|
||||
[69] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
|
||||
to:memset::@1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user