|
|
@ -5,13 +5,14 @@ void main() {
|
|
|
|
for( register(X) byte x: 0..100 ) {
|
|
|
|
for( register(X) byte x: 0..100 ) {
|
|
|
|
for( byte y: 0..100 ) {
|
|
|
|
for( byte y: 0..100 ) {
|
|
|
|
for( byte a: 0..100 ) {
|
|
|
|
for( byte a: 0..100 ) {
|
|
|
|
print(y, a+x);
|
|
|
|
register(A) byte val1 = a+x;
|
|
|
|
|
|
|
|
print(y, val1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void print(byte idx, register(y) byte val) {
|
|
|
|
void print(byte idx, byte val) {
|
|
|
|
byte* SCREEN = $0400;
|
|
|
|
byte* SCREEN = $0400;
|
|
|
|
SCREEN[idx] = val;
|
|
|
|
SCREEN[idx] = val;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -25,7 +26,8 @@ main::@2:
|
|
|
|
(byte) main::a ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
|
|
|
(byte) main::a ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
|
|
|
main::@3:
|
|
|
|
main::@3:
|
|
|
|
(byte/word~) main::$0 ← (byte) main::a + (byte) main::x
|
|
|
|
(byte/word~) main::$0 ← (byte) main::a + (byte) main::x
|
|
|
|
(void~) main::$1 ← call print (byte) main::y (byte/word~) main::$0
|
|
|
|
(byte) main::val1 ← (byte/word~) main::$0
|
|
|
|
|
|
|
|
(void~) main::$1 ← call print (byte) main::y (byte) main::val1
|
|
|
|
(byte) main::a ← ++ (byte) main::a
|
|
|
|
(byte) main::a ← ++ (byte) main::a
|
|
|
|
(boolean~) main::$2 ← (byte) main::a != (byte/signed byte/word/signed word/dword/signed dword) 101
|
|
|
|
(boolean~) main::$2 ← (byte) main::a != (byte/signed byte/word/signed word/dword/signed dword) 101
|
|
|
|
if((boolean~) main::$2) goto main::@3
|
|
|
|
if((boolean~) main::$2) goto main::@3
|
|
|
@ -58,6 +60,7 @@ SYMBOLS
|
|
|
|
(label) main::@3
|
|
|
|
(label) main::@3
|
|
|
|
(label) main::@return
|
|
|
|
(label) main::@return
|
|
|
|
(byte) main::a
|
|
|
|
(byte) main::a
|
|
|
|
|
|
|
|
(byte) main::val1 !reg byte a
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::y
|
|
|
|
(byte) main::y
|
|
|
|
(void()) print((byte) print::idx , (byte) print::val)
|
|
|
|
(void()) print((byte) print::idx , (byte) print::val)
|
|
|
@ -81,7 +84,8 @@ main::@2: scope:[main] from main::@1 main::@4
|
|
|
|
to:main::@3
|
|
|
|
to:main::@3
|
|
|
|
main::@3: scope:[main] from main::@2 main::@3
|
|
|
|
main::@3: scope:[main] from main::@2 main::@3
|
|
|
|
(byte/word~) main::$0 ← (byte) main::a + (byte) main::x
|
|
|
|
(byte/word~) main::$0 ← (byte) main::a + (byte) main::x
|
|
|
|
(void~) main::$1 ← call print (byte) main::y (byte/word~) main::$0
|
|
|
|
(byte) main::val1 ← (byte/word~) main::$0
|
|
|
|
|
|
|
|
(void~) main::$1 ← call print (byte) main::y (byte) main::val1
|
|
|
|
(byte) main::a ← ++ (byte) main::a
|
|
|
|
(byte) main::a ← ++ (byte) main::a
|
|
|
|
(boolean~) main::$2 ← (byte) main::a != (byte/signed byte/word/signed word/dword/signed dword) 101
|
|
|
|
(boolean~) main::$2 ← (byte) main::a != (byte/signed byte/word/signed word/dword/signed dword) 101
|
|
|
|
if((boolean~) main::$2) goto main::@3
|
|
|
|
if((boolean~) main::$2) goto main::@3
|
|
|
@ -144,8 +148,9 @@ main::@3: scope:[main] from main::@2 main::@7
|
|
|
|
(byte) main::x#2 ← phi( main::@2/(byte) main::x#4 main::@7/(byte) main::x#5 )
|
|
|
|
(byte) main::x#2 ← phi( main::@2/(byte) main::x#4 main::@7/(byte) main::x#5 )
|
|
|
|
(byte) main::a#2 ← phi( main::@2/(byte) main::a#0 main::@7/(byte) main::a#1 )
|
|
|
|
(byte) main::a#2 ← phi( main::@2/(byte) main::a#0 main::@7/(byte) main::a#1 )
|
|
|
|
(byte/word~) main::$0 ← (byte) main::a#2 + (byte) main::x#2
|
|
|
|
(byte/word~) main::$0 ← (byte) main::a#2 + (byte) main::x#2
|
|
|
|
|
|
|
|
(byte) main::val1#0 ← (byte/word~) main::$0
|
|
|
|
(byte) print::idx#0 ← (byte) main::y#2
|
|
|
|
(byte) print::idx#0 ← (byte) main::y#2
|
|
|
|
(byte) print::val#0 ← (byte/word~) main::$0
|
|
|
|
(byte) print::val#0 ← (byte) main::val1#0
|
|
|
|
call print param-assignment
|
|
|
|
call print param-assignment
|
|
|
|
to:main::@7
|
|
|
|
to:main::@7
|
|
|
|
main::@7: scope:[main] from main::@3
|
|
|
|
main::@7: scope:[main] from main::@3
|
|
|
@ -210,6 +215,8 @@ SYMBOL TABLE SSA
|
|
|
|
(byte) main::a#1
|
|
|
|
(byte) main::a#1
|
|
|
|
(byte) main::a#2
|
|
|
|
(byte) main::a#2
|
|
|
|
(byte) main::a#3
|
|
|
|
(byte) main::a#3
|
|
|
|
|
|
|
|
(byte) main::val1 !reg byte a
|
|
|
|
|
|
|
|
(byte) main::val1#0 !reg byte a
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::x#0
|
|
|
|
(byte) main::x#0
|
|
|
|
(byte) main::x#1
|
|
|
|
(byte) main::x#1
|
|
|
@ -241,14 +248,16 @@ OPTIMIZING CONTROL FLOW GRAPH
|
|
|
|
Culled Empty Block (label) @3
|
|
|
|
Culled Empty Block (label) @3
|
|
|
|
Succesful SSA optimization Pass2CullEmptyBlocks
|
|
|
|
Succesful SSA optimization Pass2CullEmptyBlocks
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#2
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#2
|
|
|
|
|
|
|
|
Not aliassing across scopes: print::val#0 main::val1#0
|
|
|
|
Not aliassing across scopes: print::val#1 print::val#0
|
|
|
|
Not aliassing across scopes: print::val#1 print::val#0
|
|
|
|
Not aliassing across scopes: print::idx#1 print::idx#0
|
|
|
|
Not aliassing across scopes: print::idx#1 print::idx#0
|
|
|
|
Alias (byte) print::val#0 = (byte/word~) main::$0
|
|
|
|
Alias (byte) main::val1#0 = (byte/word~) main::$0
|
|
|
|
Alias (byte) main::a#2 = (byte) main::a#3
|
|
|
|
Alias (byte) main::a#2 = (byte) main::a#3
|
|
|
|
Alias (byte) main::x#2 = (byte) main::x#5 (byte) main::x#6 (byte) main::x#3
|
|
|
|
Alias (byte) main::x#2 = (byte) main::x#5 (byte) main::x#6 (byte) main::x#3
|
|
|
|
Alias (byte) main::y#2 = (byte) main::y#5 (byte) main::y#3
|
|
|
|
Alias (byte) main::y#2 = (byte) main::y#5 (byte) main::y#3
|
|
|
|
Succesful SSA optimization Pass2AliasElimination
|
|
|
|
Succesful SSA optimization Pass2AliasElimination
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#2
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#2
|
|
|
|
|
|
|
|
Not aliassing across scopes: print::val#0 main::val1#0
|
|
|
|
Not aliassing across scopes: print::val#1 print::val#0
|
|
|
|
Not aliassing across scopes: print::val#1 print::val#0
|
|
|
|
Not aliassing across scopes: print::idx#1 print::idx#0
|
|
|
|
Not aliassing across scopes: print::idx#1 print::idx#0
|
|
|
|
Self Phi Eliminated (byte) main::x#2
|
|
|
|
Self Phi Eliminated (byte) main::x#2
|
|
|
@ -269,11 +278,13 @@ Constant (const byte) main::a#0 = 0
|
|
|
|
Constant (const byte*) print::SCREEN#0 = ((byte*))1024
|
|
|
|
Constant (const byte*) print::SCREEN#0 = ((byte*))1024
|
|
|
|
Succesful SSA optimization Pass2ConstantIdentification
|
|
|
|
Succesful SSA optimization Pass2ConstantIdentification
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#4
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#4
|
|
|
|
|
|
|
|
Not aliassing across scopes: print::val#0 main::val1#0
|
|
|
|
Self Phi Eliminated (byte) main::x#4
|
|
|
|
Self Phi Eliminated (byte) main::x#4
|
|
|
|
Succesful SSA optimization Pass2SelfPhiElimination
|
|
|
|
Succesful SSA optimization Pass2SelfPhiElimination
|
|
|
|
Redundant Phi (byte) main::x#4 (byte) main::x#7
|
|
|
|
Redundant Phi (byte) main::x#4 (byte) main::x#7
|
|
|
|
Succesful SSA optimization Pass2RedundantPhiElimination
|
|
|
|
Succesful SSA optimization Pass2RedundantPhiElimination
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#4
|
|
|
|
Not aliassing across scopes: print::idx#0 main::y#4
|
|
|
|
|
|
|
|
Not aliassing across scopes: print::val#0 main::val1#0
|
|
|
|
OPTIMIZING CONTROL FLOW GRAPH
|
|
|
|
OPTIMIZING CONTROL FLOW GRAPH
|
|
|
|
Inlining constant with var siblings (const byte) main::x#0
|
|
|
|
Inlining constant with var siblings (const byte) main::x#0
|
|
|
|
Inlining constant with var siblings (const byte) main::x#0
|
|
|
|
Inlining constant with var siblings (const byte) main::x#0
|
|
|
@ -296,7 +307,7 @@ Adding NOP phi() at start of @end
|
|
|
|
Adding NOP phi() at start of main
|
|
|
|
Adding NOP phi() at start of main
|
|
|
|
CALL GRAPH
|
|
|
|
CALL GRAPH
|
|
|
|
Calls in [] to main:2
|
|
|
|
Calls in [] to main:2
|
|
|
|
Calls in [main] to print:10
|
|
|
|
Calls in [main] to print:11
|
|
|
|
|
|
|
|
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
@ -305,10 +316,11 @@ Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
|
|
|
|
Propagating live ranges...
|
|
|
|
Created 3 initial phi equivalence classes
|
|
|
|
Created 3 initial phi equivalence classes
|
|
|
|
Coalesced [18] main::x#8 ← main::x#1
|
|
|
|
Coalesced [19] main::x#8 ← main::x#1
|
|
|
|
Coalesced [19] main::y#6 ← main::y#1
|
|
|
|
Coalesced [20] main::y#6 ← main::y#1
|
|
|
|
Coalesced [20] main::a#4 ← main::a#1
|
|
|
|
Coalesced [21] main::a#4 ← main::a#1
|
|
|
|
Coalesced down to 3 phi equivalence classes
|
|
|
|
Coalesced down to 3 phi equivalence classes
|
|
|
|
Culled Empty Block (label) main::@8
|
|
|
|
Culled Empty Block (label) main::@8
|
|
|
|
Culled Empty Block (label) main::@9
|
|
|
|
Culled Empty Block (label) main::@9
|
|
|
@ -324,6 +336,7 @@ Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
Propagating live ranges...
|
|
|
|
|
|
|
|
Propagating live ranges...
|
|
|
|
|
|
|
|
|
|
|
|
FINAL CONTROL FLOW GRAPH
|
|
|
|
FINAL CONTROL FLOW GRAPH
|
|
|
|
@begin: scope:[] from
|
|
|
|
@begin: scope:[] from
|
|
|
@ -346,30 +359,31 @@ main::@2: scope:[main] from main::@1 main::@4
|
|
|
|
to:main::@3
|
|
|
|
to:main::@3
|
|
|
|
main::@3: scope:[main] from main::@2 main::@7
|
|
|
|
main::@3: scope:[main] from main::@2 main::@7
|
|
|
|
[7] (byte) main::a#2 ← phi( main::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@7/(byte) main::a#1 ) [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
[7] (byte) main::a#2 ← phi( main::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@7/(byte) main::a#1 ) [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
[8] (byte) print::val#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 ] )
|
|
|
|
[8] (byte) main::val1#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] )
|
|
|
|
[9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] )
|
|
|
|
[9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] )
|
|
|
|
[10] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
[10] (byte) print::val#0 ← (byte) main::val1#0 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] )
|
|
|
|
|
|
|
|
[11] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
to:main::@7
|
|
|
|
to:main::@7
|
|
|
|
main::@7: scope:[main] from main::@3
|
|
|
|
main::@7: scope:[main] from main::@3
|
|
|
|
[11] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] )
|
|
|
|
[12] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] )
|
|
|
|
[12] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] )
|
|
|
|
[13] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] )
|
|
|
|
to:main::@4
|
|
|
|
to:main::@4
|
|
|
|
main::@4: scope:[main] from main::@7
|
|
|
|
main::@4: scope:[main] from main::@7
|
|
|
|
[13] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] )
|
|
|
|
[14] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] )
|
|
|
|
[14] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] )
|
|
|
|
[15] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] )
|
|
|
|
to:main::@5
|
|
|
|
to:main::@5
|
|
|
|
main::@5: scope:[main] from main::@4
|
|
|
|
main::@5: scope:[main] from main::@4
|
|
|
|
[15] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] )
|
|
|
|
[16] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] )
|
|
|
|
[16] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] )
|
|
|
|
[17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] )
|
|
|
|
to:main::@return
|
|
|
|
to:main::@return
|
|
|
|
main::@return: scope:[main] from main::@5
|
|
|
|
main::@return: scope:[main] from main::@5
|
|
|
|
[17] return [ ] ( main:2 [ ] )
|
|
|
|
[18] return [ ] ( main:2 [ ] )
|
|
|
|
to:@return
|
|
|
|
to:@return
|
|
|
|
print: scope:[print] from main::@3
|
|
|
|
print: scope:[print] from main::@3
|
|
|
|
[18] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
[19] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
to:print::@return
|
|
|
|
to:print::@return
|
|
|
|
print::@return: scope:[print] from print
|
|
|
|
print::@return: scope:[print] from print
|
|
|
|
[19] return [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
[20] return [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
to:@return
|
|
|
|
to:@return
|
|
|
|
|
|
|
|
|
|
|
|
DOMINATORS
|
|
|
|
DOMINATORS
|
|
|
@ -414,37 +428,42 @@ VARIABLE REGISTER WEIGHTS
|
|
|
|
(void()) main()
|
|
|
|
(void()) main()
|
|
|
|
(byte) main::a
|
|
|
|
(byte) main::a
|
|
|
|
(byte) main::a#1 1501.5
|
|
|
|
(byte) main::a#1 1501.5
|
|
|
|
(byte) main::a#2 750.75
|
|
|
|
(byte) main::a#2 600.5999999999999
|
|
|
|
|
|
|
|
(byte) main::val1 !reg byte a
|
|
|
|
|
|
|
|
(byte) main::val1#0 !reg byte a 1001.0
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::x#1 16.5
|
|
|
|
(byte) main::x#1 16.5
|
|
|
|
(byte) main::x#7 102.29999999999998
|
|
|
|
(byte) main::x#7 93.0
|
|
|
|
(byte) main::y
|
|
|
|
(byte) main::y
|
|
|
|
(byte) main::y#1 151.5
|
|
|
|
(byte) main::y#1 151.5
|
|
|
|
(byte) main::y#4 171.85714285714283
|
|
|
|
(byte) main::y#4 150.375
|
|
|
|
(void()) print((byte) print::idx , (byte) print::val)
|
|
|
|
(void()) print((byte) print::idx , (byte) print::val)
|
|
|
|
(byte*) print::SCREEN
|
|
|
|
(byte*) print::SCREEN
|
|
|
|
(byte) print::idx
|
|
|
|
(byte) print::idx
|
|
|
|
(byte) print::idx#0 1003.0
|
|
|
|
(byte) print::idx#0 501.5
|
|
|
|
(byte) print::val
|
|
|
|
(byte) print::val
|
|
|
|
(byte) print::val#0 501.5
|
|
|
|
(byte) print::val#0 1003.0
|
|
|
|
|
|
|
|
|
|
|
|
Initial phi equivalence classes
|
|
|
|
Initial phi equivalence classes
|
|
|
|
[ main::x#7 main::x#1 ]
|
|
|
|
[ main::x#7 main::x#1 ]
|
|
|
|
[ main::y#4 main::y#1 ]
|
|
|
|
[ main::y#4 main::y#1 ]
|
|
|
|
[ main::a#2 main::a#1 ]
|
|
|
|
[ main::a#2 main::a#1 ]
|
|
|
|
Added variable print::val#0 to zero page equivalence class [ print::val#0 ]
|
|
|
|
Added variable main::val1#0 to zero page equivalence class [ main::val1#0 ]
|
|
|
|
Added variable print::idx#0 to zero page equivalence class [ print::idx#0 ]
|
|
|
|
Added variable print::idx#0 to zero page equivalence class [ print::idx#0 ]
|
|
|
|
|
|
|
|
Added variable print::val#0 to zero page equivalence class [ print::val#0 ]
|
|
|
|
Complete equivalence classes
|
|
|
|
Complete equivalence classes
|
|
|
|
[ main::x#7 main::x#1 ]
|
|
|
|
[ main::x#7 main::x#1 ]
|
|
|
|
[ main::y#4 main::y#1 ]
|
|
|
|
[ main::y#4 main::y#1 ]
|
|
|
|
[ main::a#2 main::a#1 ]
|
|
|
|
[ main::a#2 main::a#1 ]
|
|
|
|
[ print::val#0 ]
|
|
|
|
[ main::val1#0 ]
|
|
|
|
[ print::idx#0 ]
|
|
|
|
[ print::idx#0 ]
|
|
|
|
|
|
|
|
[ print::val#0 ]
|
|
|
|
Allocated zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Allocated zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Allocated zp ZP_BYTE:3 [ main::y#4 main::y#1 ]
|
|
|
|
Allocated zp ZP_BYTE:3 [ main::y#4 main::y#1 ]
|
|
|
|
Allocated zp ZP_BYTE:4 [ main::a#2 main::a#1 ]
|
|
|
|
Allocated zp ZP_BYTE:4 [ main::a#2 main::a#1 ]
|
|
|
|
Allocated zp ZP_BYTE:5 [ print::val#0 ]
|
|
|
|
Allocated zp ZP_BYTE:5 [ main::val1#0 ]
|
|
|
|
Allocated zp ZP_BYTE:6 [ print::idx#0 ]
|
|
|
|
Allocated zp ZP_BYTE:6 [ print::idx#0 ]
|
|
|
|
|
|
|
|
Allocated zp ZP_BYTE:7 [ print::val#0 ]
|
|
|
|
|
|
|
|
|
|
|
|
INITIAL ASM
|
|
|
|
INITIAL ASM
|
|
|
|
//SEG0 Basic Upstart
|
|
|
|
//SEG0 Basic Upstart
|
|
|
@ -470,6 +489,7 @@ bend_from_b2:
|
|
|
|
bend:
|
|
|
|
bend:
|
|
|
|
//SEG9 main
|
|
|
|
//SEG9 main
|
|
|
|
main: {
|
|
|
|
main: {
|
|
|
|
|
|
|
|
.label val1 = 5
|
|
|
|
.label a = 4
|
|
|
|
.label a = 4
|
|
|
|
.label y = 3
|
|
|
|
.label y = 3
|
|
|
|
.label x = 2
|
|
|
|
.label x = 2
|
|
|
@ -509,62 +529,65 @@ main: {
|
|
|
|
jmp b3
|
|
|
|
jmp b3
|
|
|
|
//SEG24 main::@3
|
|
|
|
//SEG24 main::@3
|
|
|
|
b3:
|
|
|
|
b3:
|
|
|
|
//SEG25 [8] (byte) print::val#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 ] ) -- vbuz1=vbuz2_plus_vbuz3
|
|
|
|
//SEG25 [8] (byte) main::val1#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ) -- vbuz1=vbuz2_plus_vbuz3
|
|
|
|
lda a
|
|
|
|
lda a
|
|
|
|
clc
|
|
|
|
clc
|
|
|
|
adc x
|
|
|
|
adc x
|
|
|
|
sta print.val
|
|
|
|
sta val1
|
|
|
|
//SEG26 [9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] ) -- vbuz1=vbuz2
|
|
|
|
//SEG26 [9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] ) -- vbuz1=vbuz2
|
|
|
|
lda y
|
|
|
|
lda y
|
|
|
|
sta print.idx
|
|
|
|
sta print.idx
|
|
|
|
//SEG27 [10] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
//SEG27 [10] (byte) print::val#0 ← (byte) main::val1#0 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] ) -- vbuz1=vbuz2
|
|
|
|
|
|
|
|
lda val1
|
|
|
|
|
|
|
|
sta print.val
|
|
|
|
|
|
|
|
//SEG28 [11] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
jsr print
|
|
|
|
jsr print
|
|
|
|
jmp b7
|
|
|
|
jmp b7
|
|
|
|
//SEG28 main::@7
|
|
|
|
//SEG29 main::@7
|
|
|
|
b7:
|
|
|
|
b7:
|
|
|
|
//SEG29 [11] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
//SEG30 [12] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
inc a
|
|
|
|
inc a
|
|
|
|
//SEG30 [12] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
//SEG31 [13] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
lda a
|
|
|
|
lda a
|
|
|
|
cmp #$65
|
|
|
|
cmp #$65
|
|
|
|
bne b3_from_b7
|
|
|
|
bne b3_from_b7
|
|
|
|
jmp b4
|
|
|
|
jmp b4
|
|
|
|
//SEG31 main::@4
|
|
|
|
//SEG32 main::@4
|
|
|
|
b4:
|
|
|
|
b4:
|
|
|
|
//SEG32 [13] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
//SEG33 [14] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
inc y
|
|
|
|
inc y
|
|
|
|
//SEG33 [14] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
//SEG34 [15] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
lda y
|
|
|
|
lda y
|
|
|
|
cmp #$65
|
|
|
|
cmp #$65
|
|
|
|
bne b2_from_b4
|
|
|
|
bne b2_from_b4
|
|
|
|
jmp b5
|
|
|
|
jmp b5
|
|
|
|
//SEG34 main::@5
|
|
|
|
//SEG35 main::@5
|
|
|
|
b5:
|
|
|
|
b5:
|
|
|
|
//SEG35 [15] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
//SEG36 [16] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
inc x
|
|
|
|
inc x
|
|
|
|
//SEG36 [16] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
//SEG37 [17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
lda x
|
|
|
|
lda x
|
|
|
|
cmp #$65
|
|
|
|
cmp #$65
|
|
|
|
bne b1_from_b5
|
|
|
|
bne b1_from_b5
|
|
|
|
jmp breturn
|
|
|
|
jmp breturn
|
|
|
|
//SEG37 main::@return
|
|
|
|
//SEG38 main::@return
|
|
|
|
breturn:
|
|
|
|
breturn:
|
|
|
|
//SEG38 [17] return [ ] ( main:2 [ ] )
|
|
|
|
//SEG39 [18] return [ ] ( main:2 [ ] )
|
|
|
|
rts
|
|
|
|
rts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//SEG39 print
|
|
|
|
//SEG40 print
|
|
|
|
print: {
|
|
|
|
print: {
|
|
|
|
.const SCREEN = $400
|
|
|
|
.const SCREEN = $400
|
|
|
|
.label idx = 6
|
|
|
|
.label idx = 6
|
|
|
|
.label val = 5
|
|
|
|
.label val = 7
|
|
|
|
//SEG40 [18] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] ) -- pbuc1_derefidx_vbuz1=vbuz2
|
|
|
|
//SEG41 [19] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] ) -- pbuc1_derefidx_vbuz1=vbuz2
|
|
|
|
lda val
|
|
|
|
lda val
|
|
|
|
ldy idx
|
|
|
|
ldy idx
|
|
|
|
sta SCREEN,y
|
|
|
|
sta SCREEN,y
|
|
|
|
jmp breturn
|
|
|
|
jmp breturn
|
|
|
|
//SEG41 print::@return
|
|
|
|
//SEG42 print::@return
|
|
|
|
breturn:
|
|
|
|
breturn:
|
|
|
|
//SEG42 [19] return [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
//SEG43 [20] return [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
rts
|
|
|
|
rts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -572,21 +595,25 @@ REGISTER UPLIFT POTENTIAL REGISTERS
|
|
|
|
Potential registers zp ZP_BYTE:2 [ main::x#7 main::x#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:2 [ main::x#7 main::x#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:3 [ main::y#4 main::y#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:3 [ main::y#4 main::y#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:4 [ main::a#2 main::a#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:4 [ main::a#2 main::a#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:5 [ print::val#0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:5 [ main::val1#0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:6 [ print::idx#0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
Potential registers zp ZP_BYTE:6 [ print::idx#0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
|
|
|
|
Potential registers zp ZP_BYTE:7 [ print::val#0 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
|
|
|
|
|
|
|
|
REGISTER UPLIFT SCOPES
|
|
|
|
REGISTER UPLIFT SCOPES
|
|
|
|
Uplift Scope [main] 2,252.25: zp ZP_BYTE:4 [ main::a#2 main::a#1 ] 323.36: zp ZP_BYTE:3 [ main::y#4 main::y#1 ] 118.8: zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Uplift Scope [main] 2,102.1: zp ZP_BYTE:4 [ main::a#2 main::a#1 ] 1,001: zp ZP_BYTE:5 [ main::val1#0 ] 301.88: zp ZP_BYTE:3 [ main::y#4 main::y#1 ] 109.5: zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Uplift Scope [print] 1,003: zp ZP_BYTE:6 [ print::idx#0 ] 501.5: zp ZP_BYTE:5 [ print::val#0 ]
|
|
|
|
Uplift Scope [print] 1,003: zp ZP_BYTE:7 [ print::val#0 ] 501.5: zp ZP_BYTE:6 [ print::idx#0 ]
|
|
|
|
Uplift Scope []
|
|
|
|
Uplift Scope []
|
|
|
|
|
|
|
|
|
|
|
|
Uplifting [main] best 45453 combination reg byte x [ main::a#2 main::a#1 ] zp ZP_BYTE:3 [ main::y#4 main::y#1 ] zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Uplifting [main] best 47453 combination reg byte x [ main::a#2 main::a#1 ] reg byte y [ main::val1#0 ] zp ZP_BYTE:3 [ main::y#4 main::y#1 ] zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Uplifting [print] best 39447 combination reg byte y [ print::idx#0 ] reg byte a [ print::val#0 ]
|
|
|
|
Uplifting [print] best 44452 combination reg byte y [ print::val#0 ] zp ZP_BYTE:6 [ print::idx#0 ]
|
|
|
|
Uplifting [] best 39447 combination
|
|
|
|
Uplifting [] best 44452 combination
|
|
|
|
|
|
|
|
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ print::idx#0 ]
|
|
|
|
|
|
|
|
Uplifting [print] best 44452 combination zp ZP_BYTE:6 [ print::idx#0 ]
|
|
|
|
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::y#4 main::y#1 ]
|
|
|
|
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ main::y#4 main::y#1 ]
|
|
|
|
Uplifting [main] best 35547 combination reg byte y [ main::y#4 main::y#1 ]
|
|
|
|
Uplifting [main] best 44452 combination zp ZP_BYTE:3 [ main::y#4 main::y#1 ]
|
|
|
|
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Uplifting [main] best 35547 combination zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
Uplifting [main] best 44452 combination zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
|
|
|
|
Coalescing zero page register [ zp ZP_BYTE:3 [ main::y#4 main::y#1 ] ] with [ zp ZP_BYTE:6 [ print::idx#0 ] ]
|
|
|
|
|
|
|
|
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
|
|
|
//SEG0 Basic Upstart
|
|
|
|
//SEG0 Basic Upstart
|
|
|
@ -612,6 +639,7 @@ bend_from_b2:
|
|
|
|
bend:
|
|
|
|
bend:
|
|
|
|
//SEG9 main
|
|
|
|
//SEG9 main
|
|
|
|
main: {
|
|
|
|
main: {
|
|
|
|
|
|
|
|
.label y = 3
|
|
|
|
.label x = 2
|
|
|
|
.label x = 2
|
|
|
|
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
|
|
|
|
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
|
|
|
|
b1_from_main:
|
|
|
|
b1_from_main:
|
|
|
@ -627,8 +655,9 @@ main: {
|
|
|
|
b1:
|
|
|
|
b1:
|
|
|
|
//SEG15 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
|
|
|
//SEG15 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
|
|
|
b2_from_b1:
|
|
|
|
b2_from_b1:
|
|
|
|
//SEG16 [6] phi (byte) main::y#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuyy=vbuc1
|
|
|
|
//SEG16 [6] phi (byte) main::y#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1
|
|
|
|
ldy #0
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
sta y
|
|
|
|
jmp b2
|
|
|
|
jmp b2
|
|
|
|
//SEG17 [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
|
|
|
|
//SEG17 [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
|
|
|
|
b2_from_b4:
|
|
|
|
b2_from_b4:
|
|
|
@ -647,54 +676,61 @@ main: {
|
|
|
|
jmp b3
|
|
|
|
jmp b3
|
|
|
|
//SEG24 main::@3
|
|
|
|
//SEG24 main::@3
|
|
|
|
b3:
|
|
|
|
b3:
|
|
|
|
//SEG25 [8] (byte) print::val#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 ] ) -- vbuaa=vbuxx_plus_vbuz1
|
|
|
|
//SEG25 [8] (byte) main::val1#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ) -- vbuyy=vbuxx_plus_vbuz1
|
|
|
|
txa
|
|
|
|
txa
|
|
|
|
clc
|
|
|
|
clc
|
|
|
|
adc x
|
|
|
|
adc x
|
|
|
|
//SEG26 [9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] )
|
|
|
|
tay
|
|
|
|
// (byte) print::idx#0 = (byte) main::y#4 // register copy reg byte y
|
|
|
|
//SEG26 [9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] )
|
|
|
|
//SEG27 [10] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
// (byte) print::idx#0 = (byte) main::y#4 // register copy zp ZP_BYTE:3
|
|
|
|
|
|
|
|
//SEG27 [10] (byte) print::val#0 ← (byte) main::val1#0 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] )
|
|
|
|
|
|
|
|
// (byte) print::val#0 = (byte) main::val1#0 // register copy reg byte y
|
|
|
|
|
|
|
|
//SEG28 [11] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
jsr print
|
|
|
|
jsr print
|
|
|
|
jmp b7
|
|
|
|
jmp b7
|
|
|
|
//SEG28 main::@7
|
|
|
|
//SEG29 main::@7
|
|
|
|
b7:
|
|
|
|
b7:
|
|
|
|
//SEG29 [11] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx=_inc_vbuxx
|
|
|
|
//SEG30 [12] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx=_inc_vbuxx
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
//SEG30 [12] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx_neq_vbuc1_then_la1
|
|
|
|
//SEG31 [13] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx_neq_vbuc1_then_la1
|
|
|
|
cpx #$65
|
|
|
|
cpx #$65
|
|
|
|
bne b3_from_b7
|
|
|
|
bne b3_from_b7
|
|
|
|
jmp b4
|
|
|
|
jmp b4
|
|
|
|
//SEG31 main::@4
|
|
|
|
//SEG32 main::@4
|
|
|
|
b4:
|
|
|
|
b4:
|
|
|
|
//SEG32 [13] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuyy=_inc_vbuyy
|
|
|
|
//SEG33 [14] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
iny
|
|
|
|
inc y
|
|
|
|
//SEG33 [14] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuyy_neq_vbuc1_then_la1
|
|
|
|
//SEG34 [15] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
cpy #$65
|
|
|
|
lda y
|
|
|
|
|
|
|
|
cmp #$65
|
|
|
|
bne b2_from_b4
|
|
|
|
bne b2_from_b4
|
|
|
|
jmp b5
|
|
|
|
jmp b5
|
|
|
|
//SEG34 main::@5
|
|
|
|
//SEG35 main::@5
|
|
|
|
b5:
|
|
|
|
b5:
|
|
|
|
//SEG35 [15] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
//SEG36 [16] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
inc x
|
|
|
|
inc x
|
|
|
|
//SEG36 [16] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
//SEG37 [17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
lda x
|
|
|
|
lda x
|
|
|
|
cmp #$65
|
|
|
|
cmp #$65
|
|
|
|
bne b1_from_b5
|
|
|
|
bne b1_from_b5
|
|
|
|
jmp breturn
|
|
|
|
jmp breturn
|
|
|
|
//SEG37 main::@return
|
|
|
|
//SEG38 main::@return
|
|
|
|
breturn:
|
|
|
|
breturn:
|
|
|
|
//SEG38 [17] return [ ] ( main:2 [ ] )
|
|
|
|
//SEG39 [18] return [ ] ( main:2 [ ] )
|
|
|
|
rts
|
|
|
|
rts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//SEG39 print
|
|
|
|
//SEG40 print
|
|
|
|
print: {
|
|
|
|
print: {
|
|
|
|
.const SCREEN = $400
|
|
|
|
.const SCREEN = $400
|
|
|
|
//SEG40 [18] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] ) -- pbuc1_derefidx_vbuyy=vbuaa
|
|
|
|
.label idx = 3
|
|
|
|
|
|
|
|
//SEG41 [19] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] ) -- pbuc1_derefidx_vbuz1=vbuyy
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
|
|
|
ldy idx
|
|
|
|
sta SCREEN,y
|
|
|
|
sta SCREEN,y
|
|
|
|
jmp breturn
|
|
|
|
jmp breturn
|
|
|
|
//SEG41 print::@return
|
|
|
|
//SEG42 print::@return
|
|
|
|
breturn:
|
|
|
|
breturn:
|
|
|
|
//SEG42 [19] return [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
//SEG43 [20] return [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
rts
|
|
|
|
rts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -751,31 +787,33 @@ FINAL SYMBOL TABLE
|
|
|
|
(label) main::@return
|
|
|
|
(label) main::@return
|
|
|
|
(byte) main::a
|
|
|
|
(byte) main::a
|
|
|
|
(byte) main::a#1 reg byte x 1501.5
|
|
|
|
(byte) main::a#1 reg byte x 1501.5
|
|
|
|
(byte) main::a#2 reg byte x 750.75
|
|
|
|
(byte) main::a#2 reg byte x 600.5999999999999
|
|
|
|
|
|
|
|
(byte) main::val1 !reg byte a
|
|
|
|
|
|
|
|
(byte) main::val1#0 !reg byte a reg byte y 1001.0
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::x
|
|
|
|
(byte) main::x#1 x zp ZP_BYTE:2 16.5
|
|
|
|
(byte) main::x#1 x zp ZP_BYTE:2 16.5
|
|
|
|
(byte) main::x#7 x zp ZP_BYTE:2 102.29999999999998
|
|
|
|
(byte) main::x#7 x zp ZP_BYTE:2 93.0
|
|
|
|
(byte) main::y
|
|
|
|
(byte) main::y
|
|
|
|
(byte) main::y#1 reg byte y 151.5
|
|
|
|
(byte) main::y#1 y zp ZP_BYTE:3 151.5
|
|
|
|
(byte) main::y#4 reg byte y 171.85714285714283
|
|
|
|
(byte) main::y#4 y zp ZP_BYTE:3 150.375
|
|
|
|
(void()) print((byte) print::idx , (byte) print::val)
|
|
|
|
(void()) print((byte) print::idx , (byte) print::val)
|
|
|
|
(label) print::@return
|
|
|
|
(label) print::@return
|
|
|
|
(byte*) print::SCREEN
|
|
|
|
(byte*) print::SCREEN
|
|
|
|
(const byte*) print::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
|
|
|
|
(const byte*) print::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
|
|
|
|
(byte) print::idx
|
|
|
|
(byte) print::idx
|
|
|
|
(byte) print::idx#0 reg byte y 1003.0
|
|
|
|
(byte) print::idx#0 idx zp ZP_BYTE:3 501.5
|
|
|
|
(byte) print::val
|
|
|
|
(byte) print::val
|
|
|
|
(byte) print::val#0 reg byte a 501.5
|
|
|
|
(byte) print::val#0 reg byte y 1003.0
|
|
|
|
|
|
|
|
|
|
|
|
zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
zp ZP_BYTE:2 [ main::x#7 main::x#1 ]
|
|
|
|
reg byte y [ main::y#4 main::y#1 ]
|
|
|
|
zp ZP_BYTE:3 [ main::y#4 main::y#1 print::idx#0 ]
|
|
|
|
reg byte x [ main::a#2 main::a#1 ]
|
|
|
|
reg byte x [ main::a#2 main::a#1 ]
|
|
|
|
reg byte a [ print::val#0 ]
|
|
|
|
reg byte y [ main::val1#0 ]
|
|
|
|
reg byte y [ print::idx#0 ]
|
|
|
|
reg byte y [ print::val#0 ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FINAL ASSEMBLER
|
|
|
|
FINAL ASSEMBLER
|
|
|
|
Score: 22548
|
|
|
|
Score: 25453
|
|
|
|
|
|
|
|
|
|
|
|
//SEG0 Basic Upstart
|
|
|
|
//SEG0 Basic Upstart
|
|
|
|
.pc = $801 "Basic"
|
|
|
|
.pc = $801 "Basic"
|
|
|
@ -792,6 +830,7 @@ Score: 22548
|
|
|
|
//SEG8 @end
|
|
|
|
//SEG8 @end
|
|
|
|
//SEG9 main
|
|
|
|
//SEG9 main
|
|
|
|
main: {
|
|
|
|
main: {
|
|
|
|
|
|
|
|
.label y = 3
|
|
|
|
.label x = 2
|
|
|
|
.label x = 2
|
|
|
|
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
|
|
|
|
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
|
|
|
|
//SEG11 [5] phi (byte) main::x#7 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
|
|
|
//SEG11 [5] phi (byte) main::x#7 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
|
|
@ -802,8 +841,9 @@ main: {
|
|
|
|
//SEG14 main::@1
|
|
|
|
//SEG14 main::@1
|
|
|
|
b1:
|
|
|
|
b1:
|
|
|
|
//SEG15 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
|
|
|
//SEG15 [6] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
|
|
|
//SEG16 [6] phi (byte) main::y#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuyy=vbuc1
|
|
|
|
//SEG16 [6] phi (byte) main::y#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@1->main::@2#0] -- vbuz1=vbuc1
|
|
|
|
ldy #0
|
|
|
|
lda #0
|
|
|
|
|
|
|
|
sta y
|
|
|
|
//SEG17 [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
|
|
|
|
//SEG17 [6] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
|
|
|
|
//SEG18 [6] phi (byte) main::y#4 = (byte) main::y#1 [phi:main::@4->main::@2#0] -- register_copy
|
|
|
|
//SEG18 [6] phi (byte) main::y#4 = (byte) main::y#1 [phi:main::@4->main::@2#0] -- register_copy
|
|
|
|
//SEG19 main::@2
|
|
|
|
//SEG19 main::@2
|
|
|
@ -815,44 +855,51 @@ main: {
|
|
|
|
//SEG23 [7] phi (byte) main::a#2 = (byte) main::a#1 [phi:main::@7->main::@3#0] -- register_copy
|
|
|
|
//SEG23 [7] phi (byte) main::a#2 = (byte) main::a#1 [phi:main::@7->main::@3#0] -- register_copy
|
|
|
|
//SEG24 main::@3
|
|
|
|
//SEG24 main::@3
|
|
|
|
b3:
|
|
|
|
b3:
|
|
|
|
//SEG25 [8] (byte) print::val#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 ] ) -- vbuaa=vbuxx_plus_vbuz1
|
|
|
|
//SEG25 [8] (byte) main::val1#0 ← (byte) main::a#2 + (byte) main::x#7 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 ] ) -- vbuyy=vbuxx_plus_vbuz1
|
|
|
|
txa
|
|
|
|
txa
|
|
|
|
clc
|
|
|
|
clc
|
|
|
|
adc x
|
|
|
|
adc x
|
|
|
|
//SEG26 [9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::val#0 print::idx#0 ] )
|
|
|
|
tay
|
|
|
|
// (byte) print::idx#0 = (byte) main::y#4 // register copy reg byte y
|
|
|
|
//SEG26 [9] (byte) print::idx#0 ← (byte) main::y#4 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 main::val1#0 print::idx#0 ] )
|
|
|
|
//SEG27 [10] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
// (byte) print::idx#0 = (byte) main::y#4 // register copy zp ZP_BYTE:3
|
|
|
|
|
|
|
|
//SEG27 [10] (byte) print::val#0 ← (byte) main::val1#0 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] ( main:2 [ main::x#7 main::y#4 main::a#2 print::idx#0 print::val#0 ] )
|
|
|
|
|
|
|
|
// (byte) print::val#0 = (byte) main::val1#0 // register copy reg byte y
|
|
|
|
|
|
|
|
//SEG28 [11] call print param-assignment [ main::x#7 main::y#4 main::a#2 ] ( main:2 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
jsr print
|
|
|
|
jsr print
|
|
|
|
//SEG28 main::@7
|
|
|
|
//SEG29 main::@7
|
|
|
|
//SEG29 [11] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx=_inc_vbuxx
|
|
|
|
//SEG30 [12] (byte) main::a#1 ← ++ (byte) main::a#2 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx=_inc_vbuxx
|
|
|
|
inx
|
|
|
|
inx
|
|
|
|
//SEG30 [12] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx_neq_vbuc1_then_la1
|
|
|
|
//SEG31 [13] if((byte) main::a#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@3 [ main::x#7 main::y#4 main::a#1 ] ( main:2 [ main::x#7 main::y#4 main::a#1 ] ) -- vbuxx_neq_vbuc1_then_la1
|
|
|
|
cpx #$65
|
|
|
|
cpx #$65
|
|
|
|
bne b3
|
|
|
|
bne b3
|
|
|
|
//SEG31 main::@4
|
|
|
|
//SEG32 main::@4
|
|
|
|
//SEG32 [13] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuyy=_inc_vbuyy
|
|
|
|
//SEG33 [14] (byte) main::y#1 ← ++ (byte) main::y#4 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
iny
|
|
|
|
inc y
|
|
|
|
//SEG33 [14] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuyy_neq_vbuc1_then_la1
|
|
|
|
//SEG34 [15] if((byte) main::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@2 [ main::x#7 main::y#1 ] ( main:2 [ main::x#7 main::y#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
cpy #$65
|
|
|
|
lda y
|
|
|
|
|
|
|
|
cmp #$65
|
|
|
|
bne b2
|
|
|
|
bne b2
|
|
|
|
//SEG34 main::@5
|
|
|
|
//SEG35 main::@5
|
|
|
|
//SEG35 [15] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
//SEG36 [16] (byte) main::x#1 ← ++ (byte) main::x#7 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1
|
|
|
|
inc x
|
|
|
|
inc x
|
|
|
|
//SEG36 [16] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
//SEG37 [17] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
|
|
|
lda x
|
|
|
|
lda x
|
|
|
|
cmp #$65
|
|
|
|
cmp #$65
|
|
|
|
bne b1
|
|
|
|
bne b1
|
|
|
|
//SEG37 main::@return
|
|
|
|
//SEG38 main::@return
|
|
|
|
//SEG38 [17] return [ ] ( main:2 [ ] )
|
|
|
|
//SEG39 [18] return [ ] ( main:2 [ ] )
|
|
|
|
rts
|
|
|
|
rts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//SEG39 print
|
|
|
|
//SEG40 print
|
|
|
|
print: {
|
|
|
|
print: {
|
|
|
|
.const SCREEN = $400
|
|
|
|
.const SCREEN = $400
|
|
|
|
//SEG40 [18] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] ) -- pbuc1_derefidx_vbuyy=vbuaa
|
|
|
|
.label idx = 3
|
|
|
|
|
|
|
|
//SEG41 [19] *((const byte*) print::SCREEN#0 + (byte) print::idx#0) ← (byte) print::val#0 [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] ) -- pbuc1_derefidx_vbuz1=vbuyy
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
|
|
|
ldy idx
|
|
|
|
sta SCREEN,y
|
|
|
|
sta SCREEN,y
|
|
|
|
//SEG41 print::@return
|
|
|
|
//SEG42 print::@return
|
|
|
|
//SEG42 [19] return [ ] ( main:2::print:10 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
//SEG43 [20] return [ ] ( main:2::print:11 [ main::x#7 main::y#4 main::a#2 ] )
|
|
|
|
rts
|
|
|
|
rts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|