1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-10-11 12:23:45 +00:00

Added boolean type variables & fragments. Lots of missing fragments. Inlining any booleans possible will improve performance. Closes #86

This commit is contained in:
jespergravgaard 2018-04-27 01:09:34 +02:00
parent e3da759057
commit ad54c264c4
35 changed files with 4290 additions and 696 deletions

View File

@ -303,6 +303,8 @@ public class AsmFragmentInstanceSpec {
return "vds";
} else if(SymbolType.STRING.equals(type)) {
return "pbu";
} else if(SymbolType.BOOLEAN.equals(type)) {
return "vbo";
} else if(type instanceof SymbolTypePointer) {
SymbolType elementType = ((SymbolTypePointer) type).getElementType();
if(SymbolType.isByte(elementType)) {
@ -330,7 +332,8 @@ public class AsmFragmentInstanceSpec {
*/
private String getRegisterName(Registers.Register register) {
if(
Registers.RegisterType.ZP_BYTE.equals(register.getType()) ||
Registers.RegisterType.ZP_BOOL.equals(register.getType()) ||
Registers.RegisterType.ZP_BYTE.equals(register.getType()) ||
Registers.RegisterType.ZP_WORD.equals(register.getType()) ||
Registers.RegisterType.ZP_DWORD.equals(register.getType())
) {

View File

@ -0,0 +1 @@
ora {z1}

View File

@ -0,0 +1 @@
lda {z1}

View File

@ -0,0 +1,5 @@
cmp #{c1}
beq !+
lda #1
!:
eor #1

View File

@ -0,0 +1,4 @@
cmp #{c1}
beq !+
lda #1
!:

View File

@ -0,0 +1,5 @@
cpx #{c1}
beq !+
lda #1
!:
eor #1

View File

@ -0,0 +1,4 @@
cpx #{c1}
beq !+
lda #1
!:

View File

@ -0,0 +1,5 @@
cpy #{c1}
beq !+
lda #1
!:
eor #1

View File

@ -0,0 +1,4 @@
cpy #{c1}
beq !+
lda #1
!:

View File

@ -0,0 +1,2 @@
cmp #0
bne {la1}

View File

@ -0,0 +1 @@
ldx {z1}

View File

@ -0,0 +1,2 @@
cpx #0
bne {la1}

View File

@ -0,0 +1 @@
ldy {z1}

View File

@ -0,0 +1,2 @@
cpy #0
bne {la1}

View File

@ -0,0 +1 @@
sta {z1}

View File

@ -53,6 +53,9 @@ public class Pass4RegisterUpliftPotentialInitialize extends Pass2Base {
potentials.add(Registers.getRegisterX());
potentials.add(Registers.getRegisterY());
}
if(registerType.equals(Registers.RegisterType.ZP_BOOL) && !varRefExtracted(equivalenceClass)) {
potentials.add(Registers.getRegisterA());
}
registerPotentials.setPotentialRegisters(equivalenceClass, potentials);
}
}

View File

@ -99,17 +99,26 @@ public class TestPrograms {
compileAndCompare("const-condition");
}
@Test
public void testBoolConst() throws IOException, URISyntaxException {
compileAndCompare("bool-const");
}
@Test
public void testBoolIfs() throws IOException, URISyntaxException {
compileAndCompare("bool-ifs");
}
@Test
public void testBoolVars() throws IOException, URISyntaxException {
compileAndCompare("bool-vars");
}
@Test
public void testBoolFunction() throws IOException, URISyntaxException {
compileAndCompare("bool-function");
}
@Test
public void testC64DtvBlitterMin() throws IOException, URISyntaxException {
compileAndCompare("c64dtv-blittermin");

View File

@ -0,0 +1,18 @@
// Test a function taking boolean parameter and returning boolean result
void main() {
byte* screen = $400;
for(byte i: 0..100) {
if( isSet(i, (i&1)==0)) {
screen[i] = '*';
} else {
screen[i] = ' ';
}
}
}
// Determine whether to set a char to '*.
// Returns true if i&8!=0 or b=true
boolean isSet(byte i, boolean b) {
return b || ((i&8)!=0);
}

View File

@ -0,0 +1,52 @@
// A test of boolean conditions using && || and !
void main() {
bool_and();
bool_or();
bool_not();
bool_complex();
}
void bool_and() {
const byte* screen = $400;
for( byte i : 0..20) {
if( (i<10) && ((i&1)==0) ) {
screen[i] = '*';
} else {
screen[i] = ' ';
}
}
}
void bool_or() {
const byte* screen = $428;
for( byte i : 0..20) {
if( (i<10) || ((i&1)==0) ) {
screen[i] = '*';
} else {
screen[i] = ' ';
}
}
}
void bool_not() {
const byte* screen = $450;
for( byte i : 0..20) {
if( !((i<10) || (i&1)==0)) {
screen[i] = '*';
} else {
screen[i] = ' ';
}
}
}
void bool_complex() {
const byte* screen = $478;
for( byte i : 0..20) {
if( ((i<10) && (i&1)==0) || !((i<10) || (i&1)==0) ) {
screen[i] = '*';
} else {
screen[i] = ' ';
}
}
}

View File

@ -10,7 +10,10 @@ void main() {
void bool_and() {
const byte* screen = $400;
for( byte i : 0..20) {
if( (i<10) && ((i&1)==0) ) {
boolean o1 = (i<10);
boolean o2 = ((i&1)==0);
boolean o3 = o1 && o2;
if(o3) {
screen[i] = '*';
} else {
screen[i] = ' ';
@ -21,7 +24,10 @@ void bool_and() {
void bool_or() {
const byte* screen = $428;
for( byte i : 0..20) {
if( (i<10) || ((i&1)==0) ) {
boolean o1 = (i<10);
boolean o2 = ((i&1)==0);
boolean o3 = o1 || o2;
if(o3) {
screen[i] = '*';
} else {
screen[i] = ' ';
@ -32,8 +38,10 @@ void bool_or() {
void bool_not() {
const byte* screen = $450;
for( byte i : 0..20) {
boolean o1 = (i&1)==0;
if( !((i<10) || ((i&1)==0)) ) {
boolean o1 = (i<10);
boolean o2 = (i&1)==0;
boolean o3 = !( o1 || o2);
if(o3) {
screen[i] = '*';
} else {
screen[i] = ' ';
@ -44,8 +52,12 @@ void bool_not() {
void bool_complex() {
const byte* screen = $478;
for( byte i : 0..20) {
boolean o1 = (i&1)==0;
if( ((i<10) && ((i&1)==0)) || !((i<10) || ((i&1)==0)) ) {
boolean o1 = (i<10);
boolean o2 = (i&1)==0;
boolean o3 = (o1 && o2);
boolean o4 = !(o1 || o2);
boolean o5 = o3 || o4;
if( o5 ) {
screen[i] = '*';
} else {
screen[i] = ' ';

View File

@ -0,0 +1,42 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
jsr main
main: {
.label screen = $400
ldx #0
b1:
txa
and #1
cmp #0
beq !+
lda #1
!:
eor #1
sta isSet.b
jsr isSet
cmp #0
bne b2
lda #' '
sta screen,x
b3:
inx
cpx #$65
bne b1
rts
b2:
lda #'*'
sta screen,x
jmp b3
}
isSet: {
.label b = 2
txa
and #8
cmp #0
beq !+
lda #1
!:
ora b
rts
}

View File

@ -0,0 +1,45 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main param-assignment [ ] ( )
to:@end
@end: scope:[] from @2
[3] phi() [ ] ( )
main: scope:[main] from @2
[4] phi() [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::i#1 ) [ main::i#2 ] ( main:2 [ main::i#2 ] )
[6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] )
[7] (boolean) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] )
[8] (byte) isSet::i#0 ← (byte) main::i#2 [ main::i#2 isSet::b#0 isSet::i#0 ] ( main:2 [ main::i#2 isSet::b#0 isSet::i#0 ] )
[9] call isSet param-assignment [ main::i#2 isSet::return#1 ] ( main:2 [ main::i#2 isSet::return#1 ] )
[10] (boolean) isSet::return#0 ← (boolean) isSet::return#1 [ main::i#2 isSet::return#0 ] ( main:2 [ main::i#2 isSet::return#0 ] )
to:main::@7
main::@7: scope:[main] from main::@1
[11] (boolean~) main::$2 ← (boolean) isSet::return#0 [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] )
[12] if((boolean~) main::$2) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@4
main::@4: scope:[main] from main::@7
[13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@3
main::@3: scope:[main] from main::@2 main::@4
[14] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] )
[15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] )
to:main::@return
main::@return: scope:[main] from main::@3
[16] return [ ] ( main:2 [ ] )
to:@return
main::@2: scope:[main] from main::@7
[17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@3
isSet: scope:[isSet] from main::@1
[18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 [ isSet::b#0 isSet::$0 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$0 ] )
[19] (boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] )
[20] (boolean) isSet::return#1 ← (boolean) isSet::b#0 || (boolean~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] )
to:isSet::@return
isSet::@return: scope:[isSet] from isSet
[21] return [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] )
to:@return

View File

@ -0,0 +1,854 @@
PARSING src/test/java/dk/camelot64/kickc/test/kc/bool-function.kc
// Test a function taking boolean parameter and returning boolean result
void main() {
byte* screen = $400;
for(byte i: 0..100) {
if( isSet(i, (i&1)==0)) {
screen[i] = '*';
} else {
screen[i] = ' ';
}
}
}
// Determine whether to set a char to '*.
// Returns true if i&8!=0 or b=true
boolean isSet(byte i, boolean b) {
return b || ((i&8)!=0);
}
SYMBOLS
(label) @1
(label) @2
(label) @begin
(label) @end
(boolean()) isSet((byte) isSet::i , (boolean) isSet::b)
(byte~) isSet::$0
(boolean~) isSet::$1
(boolean~) isSet::$2
(label) isSet::@1
(label) isSet::@return
(boolean) isSet::b
(byte) isSet::i
(boolean) isSet::return
(void()) main()
(byte~) main::$0
(boolean~) main::$1
(boolean~) main::$2
(boolean~) main::$3
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@return
(byte) main::i
(byte*) main::screen
Promoting word/signed word/dword/signed dword to byte* in main::screen ← ((byte*)) 1024
INITIAL CONTROL FLOW GRAPH
@begin: scope:[] from
to:@1
main: scope:[main] from
(byte*) main::screen ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte) main::i ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@3
(byte~) main::$0 ← (byte) main::i & (byte/signed byte/word/signed word/dword/signed dword) 1
(boolean~) main::$1 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0
(boolean~) main::$2 ← call isSet (byte) main::i (boolean~) main::$1
if((boolean~) main::$2) goto main::@2
to:main::@4
main::@2: scope:[main] from main::@1 main::@5
*((byte*) main::screen + (byte) main::i) ← (byte) '*'
to:main::@3
main::@4: scope:[main] from main::@1
*((byte*) main::screen + (byte) main::i) ← (byte) ' '
to:main::@3
main::@3: scope:[main] from main::@2 main::@4
(byte) main::i ← ++ (byte) main::i
(boolean~) main::$3 ← (byte) main::i != (byte/signed byte/word/signed word/dword/signed dword) 101
if((boolean~) main::$3) goto main::@1
to:main::@6
main::@5: scope:[main] from
to:main::@2
main::@6: scope:[main] from main::@3
to:main::@return
main::@return: scope:[main] from main::@6
return
to:@return
@1: scope:[] from @begin
to:@2
isSet: scope:[isSet] from
(byte~) isSet::$0 ← (byte) isSet::i & (byte/signed byte/word/signed word/dword/signed dword) 8
(boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0
(boolean~) isSet::$2 ← (boolean) isSet::b || (boolean~) isSet::$1
(boolean) isSet::return ← (boolean~) isSet::$2
to:isSet::@return
isSet::@return: scope:[isSet] from isSet isSet::@1
(boolean) isSet::return ← (boolean) isSet::return
return (boolean) isSet::return
to:@return
isSet::@1: scope:[isSet] from
to:isSet::@return
@2: scope:[] from @1
call main
to:@end
@end: scope:[] from @2
Removing empty block main::@5
Removing empty block main::@6
Removing empty block @1
Removing empty block isSet::@1
PROCEDURE MODIFY VARIABLE ANALYSIS
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
@begin: scope:[] from
to:@2
main: scope:[main] from @2
(byte*) main::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@3
(byte*) main::screen#4 ← phi( main/(byte*) main::screen#0 main::@3/(byte*) main::screen#5 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
(boolean~) main::$1 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) isSet::i#0 ← (byte) main::i#2
(boolean) isSet::b#0 ← (boolean~) main::$1
call isSet param-assignment
(boolean) isSet::return#0 ← (boolean) isSet::return#2
to:main::@7
main::@7: scope:[main] from main::@1
(byte) main::i#6 ← phi( main::@1/(byte) main::i#2 )
(byte*) main::screen#3 ← phi( main::@1/(byte*) main::screen#4 )
(boolean) isSet::return#3 ← phi( main::@1/(boolean) isSet::return#0 )
(boolean~) main::$2 ← (boolean) isSet::return#3
if((boolean~) main::$2) goto main::@2
to:main::@4
main::@2: scope:[main] from main::@7
(byte) main::i#3 ← phi( main::@7/(byte) main::i#6 )
(byte*) main::screen#1 ← phi( main::@7/(byte*) main::screen#3 )
*((byte*) main::screen#1 + (byte) main::i#3) ← (byte) '*'
to:main::@3
main::@4: scope:[main] from main::@7
(byte) main::i#4 ← phi( main::@7/(byte) main::i#6 )
(byte*) main::screen#2 ← phi( main::@7/(byte*) main::screen#3 )
*((byte*) main::screen#2 + (byte) main::i#4) ← (byte) ' '
to:main::@3
main::@3: scope:[main] from main::@2 main::@4
(byte*) main::screen#5 ← phi( main::@2/(byte*) main::screen#1 main::@4/(byte*) main::screen#2 )
(byte) main::i#5 ← phi( main::@2/(byte) main::i#3 main::@4/(byte) main::i#4 )
(byte) main::i#1 ← ++ (byte) main::i#5
(boolean~) main::$3 ← (byte) main::i#1 != (byte/signed byte/word/signed word/dword/signed dword) 101
if((boolean~) main::$3) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@3
return
to:@return
isSet: scope:[isSet] from main::@1
(boolean) isSet::b#1 ← phi( main::@1/(boolean) isSet::b#0 )
(byte) isSet::i#1 ← phi( main::@1/(byte) isSet::i#0 )
(byte~) isSet::$0 ← (byte) isSet::i#1 & (byte/signed byte/word/signed word/dword/signed dword) 8
(boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0
(boolean~) isSet::$2 ← (boolean) isSet::b#1 || (boolean~) isSet::$1
(boolean) isSet::return#1 ← (boolean~) isSet::$2
to:isSet::@return
isSet::@return: scope:[isSet] from isSet
(boolean) isSet::return#4 ← phi( isSet/(boolean) isSet::return#1 )
(boolean) isSet::return#2 ← (boolean) isSet::return#4
return
to:@return
@2: scope:[] from @begin
call main param-assignment
to:@3
@3: scope:[] from @2
to:@end
@end: scope:[] from @3
SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(boolean()) isSet((byte) isSet::i , (boolean) isSet::b)
(byte~) isSet::$0
(boolean~) isSet::$1
(boolean~) isSet::$2
(label) isSet::@return
(boolean) isSet::b
(boolean) isSet::b#0
(boolean) isSet::b#1
(byte) isSet::i
(byte) isSet::i#0
(byte) isSet::i#1
(boolean) isSet::return
(boolean) isSet::return#0
(boolean) isSet::return#1
(boolean) isSet::return#2
(boolean) isSet::return#3
(boolean) isSet::return#4
(void()) main()
(byte~) main::$0
(boolean~) main::$1
(boolean~) main::$2
(boolean~) main::$3
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@7
(label) main::@return
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte) main::i#3
(byte) main::i#4
(byte) main::i#5
(byte) main::i#6
(byte*) main::screen
(byte*) main::screen#0
(byte*) main::screen#1
(byte*) main::screen#2
(byte*) main::screen#3
(byte*) main::screen#4
(byte*) main::screen#5
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) @3
Succesful SSA optimization Pass2CullEmptyBlocks
Not aliassing across scopes: isSet::i#0 main::i#2
Not aliassing across scopes: isSet::return#0 isSet::return#2
Not aliassing across scopes: main::$2 isSet::return#3
Not aliassing across scopes: isSet::i#1 isSet::i#0
Not aliassing across scopes: isSet::b#1 isSet::b#0
Alias (boolean) isSet::b#0 = (boolean~) main::$1
Alias (boolean) isSet::return#0 = (boolean) isSet::return#3
Alias (byte*) main::screen#1 = (byte*) main::screen#3 (byte*) main::screen#4 (byte*) main::screen#2
Alias (byte) main::i#2 = (byte) main::i#6 (byte) main::i#3 (byte) main::i#4
Alias (boolean) isSet::return#1 = (boolean~) isSet::$2 (boolean) isSet::return#4 (boolean) isSet::return#2
Succesful SSA optimization Pass2AliasElimination
Not aliassing across scopes: isSet::i#0 main::i#2
Not aliassing across scopes: isSet::return#0 isSet::return#1
Not aliassing across scopes: main::$2 isSet::return#0
Not aliassing across scopes: isSet::i#1 isSet::i#0
Not aliassing across scopes: isSet::b#1 isSet::b#0
Alias (byte) main::i#2 = (byte) main::i#5
Alias (byte*) main::screen#1 = (byte*) main::screen#5
Succesful SSA optimization Pass2AliasElimination
Not aliassing across scopes: isSet::i#0 main::i#2
Not aliassing across scopes: isSet::return#0 isSet::return#1
Not aliassing across scopes: main::$2 isSet::return#0
Not aliassing across scopes: isSet::i#1 isSet::i#0
Not aliassing across scopes: isSet::b#1 isSet::b#0
Self Phi Eliminated (byte*) main::screen#1
Succesful SSA optimization Pass2SelfPhiElimination
Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0
Redundant Phi (byte) isSet::i#1 (byte) isSet::i#0
Redundant Phi (boolean) isSet::b#1 (boolean) isSet::b#0
Succesful SSA optimization Pass2RedundantPhiElimination
Simple Condition (boolean~) main::$3 if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1
Succesful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::screen#0 = ((byte*))1024
Constant (const byte) main::i#0 = 0
Succesful SSA optimization Pass2ConstantIdentification
Not aliassing across scopes: isSet::i#0 main::i#2
Not aliassing across scopes: isSet::return#0 isSet::return#1
Not aliassing across scopes: main::$2 isSet::return#0
OPTIMIZING CONTROL FLOW GRAPH
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @2 @end main main::@1 main::@7 main::@4 main::@3 main::@return main::@2 isSet isSet::@return
Added new block during phi lifting main::@8(between main::@3 and main::@1)
Block Sequence Planned @begin @2 @end main main::@1 main::@7 main::@4 main::@3 main::@return main::@8 main::@2 isSet isSet::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Calls in [main] to isSet:9
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Created 1 initial phi equivalence classes
Coalesced [17] main::i#7 ← main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) main::@8
Block Sequence Planned @begin @2 @end main main::@1 main::@7 main::@4 main::@3 main::@return main::@2 isSet isSet::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main param-assignment [ ] ( )
to:@end
@end: scope:[] from @2
[3] phi() [ ] ( )
main: scope:[main] from @2
[4] phi() [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::i#1 ) [ main::i#2 ] ( main:2 [ main::i#2 ] )
[6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] )
[7] (boolean) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] )
[8] (byte) isSet::i#0 ← (byte) main::i#2 [ main::i#2 isSet::b#0 isSet::i#0 ] ( main:2 [ main::i#2 isSet::b#0 isSet::i#0 ] )
[9] call isSet param-assignment [ main::i#2 isSet::return#1 ] ( main:2 [ main::i#2 isSet::return#1 ] )
[10] (boolean) isSet::return#0 ← (boolean) isSet::return#1 [ main::i#2 isSet::return#0 ] ( main:2 [ main::i#2 isSet::return#0 ] )
to:main::@7
main::@7: scope:[main] from main::@1
[11] (boolean~) main::$2 ← (boolean) isSet::return#0 [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] )
[12] if((boolean~) main::$2) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@4
main::@4: scope:[main] from main::@7
[13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@3
main::@3: scope:[main] from main::@2 main::@4
[14] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] )
[15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] )
to:main::@return
main::@return: scope:[main] from main::@3
[16] return [ ] ( main:2 [ ] )
to:@return
main::@2: scope:[main] from main::@7
[17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@3
isSet: scope:[isSet] from main::@1
[18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 [ isSet::b#0 isSet::$0 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$0 ] )
[19] (boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] )
[20] (boolean) isSet::return#1 ← (boolean) isSet::b#0 || (boolean~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] )
to:isSet::@return
isSet::@return: scope:[isSet] from isSet
[21] return [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] )
to:@return
DOMINATORS
@begin dominated by @begin
@2 dominated by @2 @begin
@end dominated by @2 @begin @end
main dominated by @2 @begin main
main::@1 dominated by @2 @begin main::@1 main
main::@7 dominated by @2 main::@7 @begin main::@1 main
main::@4 dominated by @2 main::@7 @begin main::@1 main main::@4
main::@3 dominated by @2 main::@7 @begin main::@1 main main::@3
main::@return dominated by main::@return @2 main::@7 @begin main::@1 main main::@3
main::@2 dominated by @2 main::@7 @begin main::@1 main::@2 main
isSet dominated by @2 @begin isSet main::@1 main
isSet::@return dominated by @2 @begin isSet main::@1 isSet::@return main
NATURAL LOOPS
Found back edge: Loop head: main::@1 tails: main::@3 blocks: null
Populated: Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2 main::@4 main::@7 main::@1
Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2 main::@4 main::@7 main::@1
NATURAL LOOPS WITH DEPTH
Found 0 loops in scope []
Found 1 loops in scope [main]
Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2 main::@4 main::@7 main::@1
Found 0 loops in scope [isSet]
Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2 main::@4 main::@7 main::@1 depth: 1
VARIABLE REGISTER WEIGHTS
(boolean()) isSet((byte) isSet::i , (boolean) isSet::b)
(byte~) isSet::$0 4.0
(boolean~) isSet::$1 4.0
(boolean) isSet::b
(boolean) isSet::b#0 3.25
(byte) isSet::i
(byte) isSet::i#0 13.0
(boolean) isSet::return
(boolean) isSet::return#0 22.0
(boolean) isSet::return#1 4.333333333333333
(void()) main()
(byte~) main::$0 22.0
(boolean~) main::$2 22.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 6.6
(byte*) main::screen
Initial phi equivalence classes
[ main::i#2 main::i#1 ]
Added variable main::$0 to zero page equivalence class [ main::$0 ]
Added variable isSet::b#0 to zero page equivalence class [ isSet::b#0 ]
Added variable isSet::i#0 to zero page equivalence class [ isSet::i#0 ]
Added variable isSet::return#0 to zero page equivalence class [ isSet::return#0 ]
Added variable main::$2 to zero page equivalence class [ main::$2 ]
Added variable isSet::$0 to zero page equivalence class [ isSet::$0 ]
Added variable isSet::$1 to zero page equivalence class [ isSet::$1 ]
Added variable isSet::return#1 to zero page equivalence class [ isSet::return#1 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::$0 ]
[ isSet::b#0 ]
[ isSet::i#0 ]
[ isSet::return#0 ]
[ main::$2 ]
[ isSet::$0 ]
[ isSet::$1 ]
[ isSet::return#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::$0 ]
Allocated zp ZP_BOOL:4 [ isSet::b#0 ]
Allocated zp ZP_BYTE:5 [ isSet::i#0 ]
Allocated zp ZP_BOOL:6 [ isSet::return#0 ]
Allocated zp ZP_BOOL:7 [ main::$2 ]
Allocated zp ZP_BYTE:8 [ isSet::$0 ]
Allocated zp ZP_BOOL:9 [ isSet::$1 ]
Allocated zp ZP_BOOL:10 [ isSet::return#1 ]
INITIAL ASM
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @2 to main [phi:@2->main]
main_from_b2:
jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
.label screen = $400
.label _0 = 3
.label _2 = 7
.label i = 2
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta i
jmp b1
//SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
b1_from_b3:
//SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@3->main::@1#0] -- register_copy
jmp b1
//SEG14 main::@1
b1:
//SEG15 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) -- vbuz1=vbuz2_band_vbuc1
lda #1
and i
sta _0
//SEG16 [7] (boolean) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) -- vboz1=vbuz2_eq_vbuc1
lda _0
cmp #0
beq !+
lda #1
!:
eor #1
sta isSet.b
//SEG17 [8] (byte) isSet::i#0 ← (byte) main::i#2 [ main::i#2 isSet::b#0 isSet::i#0 ] ( main:2 [ main::i#2 isSet::b#0 isSet::i#0 ] ) -- vbuz1=vbuz2
lda i
sta isSet.i
//SEG18 [9] call isSet param-assignment [ main::i#2 isSet::return#1 ] ( main:2 [ main::i#2 isSet::return#1 ] )
jsr isSet
//SEG19 [10] (boolean) isSet::return#0 ← (boolean) isSet::return#1 [ main::i#2 isSet::return#0 ] ( main:2 [ main::i#2 isSet::return#0 ] ) -- vboz1=vboz2
lda isSet.return_1
sta isSet.return
jmp b7
//SEG20 main::@7
b7:
//SEG21 [11] (boolean~) main::$2 ← (boolean) isSet::return#0 [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] ) -- vboz1=vboz2
lda isSet.return
sta _2
//SEG22 [12] if((boolean~) main::$2) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- vboz1_then_la1
lda _2
cmp #0
bne b2
jmp b4
//SEG23 main::@4
b4:
//SEG24 [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- pbuc1_derefidx_vbuz1=vbuc2
ldy i
lda #' '
sta screen,y
jmp b3
//SEG25 main::@3
b3:
//SEG26 [14] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1=_inc_vbuz1
inc i
//SEG27 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1_neq_vbuc1_then_la1
lda i
cmp #$65
bne b1_from_b3
jmp breturn
//SEG28 main::@return
breturn:
//SEG29 [16] return [ ] ( main:2 [ ] )
rts
//SEG30 main::@2
b2:
//SEG31 [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- pbuc1_derefidx_vbuz1=vbuc2
ldy i
lda #'*'
sta screen,y
jmp b3
}
//SEG32 isSet
isSet: {
.label _0 = 8
.label _1 = 9
.label i = 5
.label b = 4
.label return = 6
.label return_1 = $a
//SEG33 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 [ isSet::b#0 isSet::$0 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$0 ] ) -- vbuz1=vbuz2_band_vbuc1
lda #8
and i
sta _0
//SEG34 [19] (boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) -- vboz1=vbuz2_neq_vbuc1
lda _0
cmp #0
beq !+
lda #1
!:
sta _1
//SEG35 [20] (boolean) isSet::return#1 ← (boolean) isSet::b#0 || (boolean~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) -- vboz1=vboz2_or_vboz3
lda b
ora _1
sta return_1
jmp breturn
//SEG36 isSet::@return
breturn:
//SEG37 [21] return [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] )
rts
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) 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 [7] (boolean) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 [ isSet::b#0 isSet::$0 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BOOL:4 [ isSet::b#0 ]
Statement [19] (boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a
Statement [20] (boolean) isSet::return#1 ← (boolean) isSet::b#0 || (boolean~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a
Statement [7] (boolean) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) always clobbers reg byte a
Statement [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 [ isSet::b#0 isSet::$0 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$0 ] ) always clobbers reg byte a
Statement [19] (boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) always clobbers reg byte a
Statement [20] (boolean) isSet::return#1 ← (boolean) isSet::b#0 || (boolean~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) 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::$0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BOOL:4 [ isSet::b#0 ] : zp ZP_BOOL:4 ,
Potential registers zp ZP_BYTE:5 [ isSet::i#0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BOOL:6 [ isSet::return#0 ] : zp ZP_BOOL:6 , reg byte a ,
Potential registers zp ZP_BOOL:7 [ main::$2 ] : zp ZP_BOOL:7 , reg byte a ,
Potential registers zp ZP_BYTE:8 [ isSet::$0 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BOOL:9 [ isSet::$1 ] : zp ZP_BOOL:9 , reg byte a ,
Potential registers zp ZP_BOOL:10 [ isSet::return#1 ] : zp ZP_BOOL:10 , reg byte a ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 23.1: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:3 [ main::$0 ] 22: zp ZP_BOOL:7 [ main::$2 ]
Uplift Scope [isSet] 22: zp ZP_BOOL:6 [ isSet::return#0 ] 13: zp ZP_BYTE:5 [ isSet::i#0 ] 4.33: zp ZP_BOOL:10 [ isSet::return#1 ] 4: zp ZP_BYTE:8 [ isSet::$0 ] 4: zp ZP_BOOL:9 [ isSet::$1 ] 3.25: zp ZP_BOOL:4 [ isSet::b#0 ]
Uplift Scope []
Uplifting [main] best 871 combination reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$0 ] reg byte a [ main::$2 ]
Uplifting [isSet] best 735 combination reg byte a [ isSet::return#0 ] reg byte x [ isSet::i#0 ] reg byte a [ isSet::return#1 ] reg byte a [ isSet::$0 ] reg byte a [ isSet::$1 ] zp ZP_BOOL:4 [ isSet::b#0 ]
Limited combination testing to 100 combinations of 128 possible.
Uplifting [] best 735 combination
Allocated (was zp ZP_BOOL:4) zp ZP_BOOL:2 [ isSet::b#0 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @2 to main [phi:@2->main]
main_from_b2:
jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
jmp bend
//SEG8 @end
bend:
//SEG9 main
main: {
.label screen = $400
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
jmp b1
//SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
b1_from_b3:
//SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@3->main::@1#0] -- register_copy
jmp b1
//SEG14 main::@1
b1:
//SEG15 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) -- vbuaa=vbuxx_band_vbuc1
txa
and #1
//SEG16 [7] (boolean) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) -- vboz1=vbuaa_eq_vbuc1
cmp #0
beq !+
lda #1
!:
eor #1
sta isSet.b
//SEG17 [8] (byte) isSet::i#0 ← (byte) main::i#2 [ main::i#2 isSet::b#0 isSet::i#0 ] ( main:2 [ main::i#2 isSet::b#0 isSet::i#0 ] )
// (byte) isSet::i#0 = (byte) main::i#2 // register copy reg byte x
//SEG18 [9] call isSet param-assignment [ main::i#2 isSet::return#1 ] ( main:2 [ main::i#2 isSet::return#1 ] )
jsr isSet
//SEG19 [10] (boolean) isSet::return#0 ← (boolean) isSet::return#1 [ main::i#2 isSet::return#0 ] ( main:2 [ main::i#2 isSet::return#0 ] )
// (boolean) isSet::return#0 = (boolean) isSet::return#1 // register copy reg byte a
jmp b7
//SEG20 main::@7
b7:
//SEG21 [11] (boolean~) main::$2 ← (boolean) isSet::return#0 [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] )
// (boolean~) main::$2 = (boolean) isSet::return#0 // register copy reg byte a
//SEG22 [12] if((boolean~) main::$2) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- vboaa_then_la1
cmp #0
bne b2
jmp b4
//SEG23 main::@4
b4:
//SEG24 [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- pbuc1_derefidx_vbuxx=vbuc2
lda #' '
sta screen,x
jmp b3
//SEG25 main::@3
b3:
//SEG26 [14] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx=_inc_vbuxx
inx
//SEG27 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx_neq_vbuc1_then_la1
cpx #$65
bne b1_from_b3
jmp breturn
//SEG28 main::@return
breturn:
//SEG29 [16] return [ ] ( main:2 [ ] )
rts
//SEG30 main::@2
b2:
//SEG31 [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- pbuc1_derefidx_vbuxx=vbuc2
lda #'*'
sta screen,x
jmp b3
}
//SEG32 isSet
isSet: {
.label b = 2
//SEG33 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 [ isSet::b#0 isSet::$0 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$0 ] ) -- vbuaa=vbuxx_band_vbuc1
txa
and #8
//SEG34 [19] (boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) -- vboaa=vbuaa_neq_vbuc1
cmp #0
beq !+
lda #1
!:
//SEG35 [20] (boolean) isSet::return#1 ← (boolean) isSet::b#0 || (boolean~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) -- vboaa=vboz1_or_vboaa
ora b
jmp breturn
//SEG36 isSet::@return
breturn:
//SEG37 [21] return [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] )
rts
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b7
Removing instruction jmp b4
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b3 with b1
Removing instruction bbegin:
Removing instruction b2_from_bbegin:
Removing instruction main_from_b2:
Removing instruction bend_from_b2:
Removing instruction b1_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b2:
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b7:
Removing instruction b4:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(boolean()) isSet((byte) isSet::i , (boolean) isSet::b)
(byte~) isSet::$0 reg byte a 4.0
(boolean~) isSet::$1 reg byte a 4.0
(label) isSet::@return
(boolean) isSet::b
(boolean) isSet::b#0 b zp ZP_BOOL:2 3.25
(byte) isSet::i
(byte) isSet::i#0 reg byte x 13.0
(boolean) isSet::return
(boolean) isSet::return#0 reg byte a 22.0
(boolean) isSet::return#1 reg byte a 4.333333333333333
(void()) main()
(byte~) main::$0 reg byte a 22.0
(boolean~) main::$2 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@7
(label) main::@return
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 6.6
(byte*) main::screen
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1024
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::$0 ]
zp ZP_BOOL:2 [ isSet::b#0 ]
reg byte x [ isSet::i#0 ]
reg byte a [ isSet::return#0 ]
reg byte a [ main::$2 ]
reg byte a [ isSet::$0 ]
reg byte a [ isSet::$1 ]
reg byte a [ isSet::return#1 ]
FINAL ASSEMBLER
Score: 546
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
//SEG2 @begin
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG4 @2
//SEG5 [2] call main param-assignment [ ] ( )
//SEG6 [4] phi from @2 to main [phi:@2->main]
jsr main
//SEG7 [3] phi from @2 to @end [phi:@2->@end]
//SEG8 @end
//SEG9 main
main: {
.label screen = $400
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
//SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1]
//SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@3->main::@1#0] -- register_copy
//SEG14 main::@1
b1:
//SEG15 [6] (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) -- vbuaa=vbuxx_band_vbuc1
txa
and #1
//SEG16 [7] (boolean) isSet::b#0 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ main::i#2 isSet::b#0 ] ( main:2 [ main::i#2 isSet::b#0 ] ) -- vboz1=vbuaa_eq_vbuc1
cmp #0
beq !+
lda #1
!:
eor #1
sta isSet.b
//SEG17 [8] (byte) isSet::i#0 ← (byte) main::i#2 [ main::i#2 isSet::b#0 isSet::i#0 ] ( main:2 [ main::i#2 isSet::b#0 isSet::i#0 ] )
// (byte) isSet::i#0 = (byte) main::i#2 // register copy reg byte x
//SEG18 [9] call isSet param-assignment [ main::i#2 isSet::return#1 ] ( main:2 [ main::i#2 isSet::return#1 ] )
jsr isSet
//SEG19 [10] (boolean) isSet::return#0 ← (boolean) isSet::return#1 [ main::i#2 isSet::return#0 ] ( main:2 [ main::i#2 isSet::return#0 ] )
// (boolean) isSet::return#0 = (boolean) isSet::return#1 // register copy reg byte a
//SEG20 main::@7
//SEG21 [11] (boolean~) main::$2 ← (boolean) isSet::return#0 [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] )
// (boolean~) main::$2 = (boolean) isSet::return#0 // register copy reg byte a
//SEG22 [12] if((boolean~) main::$2) goto main::@2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- vboaa_then_la1
cmp #0
bne b2
//SEG23 main::@4
//SEG24 [13] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) ' ' [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- pbuc1_derefidx_vbuxx=vbuc2
lda #' '
sta screen,x
//SEG25 main::@3
b3:
//SEG26 [14] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx=_inc_vbuxx
inx
//SEG27 [15] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 101) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx_neq_vbuc1_then_la1
cpx #$65
bne b1
//SEG28 main::@return
//SEG29 [16] return [ ] ( main:2 [ ] )
rts
//SEG30 main::@2
b2:
//SEG31 [17] *((const byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' [ main::i#2 ] ( main:2 [ main::i#2 ] ) -- pbuc1_derefidx_vbuxx=vbuc2
lda #'*'
sta screen,x
jmp b3
}
//SEG32 isSet
isSet: {
.label b = 2
//SEG33 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 [ isSet::b#0 isSet::$0 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$0 ] ) -- vbuaa=vbuxx_band_vbuc1
txa
and #8
//SEG34 [19] (boolean~) isSet::$1 ← (byte~) isSet::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 [ isSet::b#0 isSet::$1 ] ( main:2::isSet:9 [ main::i#2 isSet::b#0 isSet::$1 ] ) -- vboaa=vbuaa_neq_vbuc1
cmp #0
beq !+
lda #1
!:
//SEG35 [20] (boolean) isSet::return#1 ← (boolean) isSet::b#0 || (boolean~) isSet::$1 [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] ) -- vboaa=vboz1_or_vboaa
ora b
//SEG36 isSet::@return
//SEG37 [21] return [ isSet::return#1 ] ( main:2::isSet:9 [ main::i#2 isSet::return#1 ] )
rts
}

View File

@ -0,0 +1,38 @@
(label) @2
(label) @begin
(label) @end
(boolean()) isSet((byte) isSet::i , (boolean) isSet::b)
(byte~) isSet::$0 reg byte a 4.0
(boolean~) isSet::$1 reg byte a 4.0
(label) isSet::@return
(boolean) isSet::b
(boolean) isSet::b#0 b zp ZP_BOOL:2 3.25
(byte) isSet::i
(byte) isSet::i#0 reg byte x 13.0
(boolean) isSet::return
(boolean) isSet::return#0 reg byte a 22.0
(boolean) isSet::return#1 reg byte a 4.333333333333333
(void()) main()
(byte~) main::$0 reg byte a 22.0
(boolean~) main::$2 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@7
(label) main::@return
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 6.6
(byte*) main::screen
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1024
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::$0 ]
zp ZP_BOOL:2 [ isSet::b#0 ]
reg byte x [ isSet::i#0 ]
reg byte a [ isSet::return#0 ]
reg byte a [ main::$2 ]
reg byte a [ isSet::$0 ]
reg byte a [ isSet::$1 ]
reg byte a [ isSet::return#1 ]

View File

@ -0,0 +1,113 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
jsr main
main: {
jsr bool_and
jsr bool_or
jsr bool_not
jsr bool_complex
rts
}
bool_complex: {
.label screen = $478
ldy #0
b1:
tya
and #1
tax
tya
and #1
cpy #$a
bcc b8
b7:
cpy #$a
bcc b4
cmp #0
beq b4
b2:
lda #'*'
sta screen,y
b3:
iny
cpy #$15
bne b1
rts
b4:
lda #' '
sta screen,y
jmp b3
b8:
cpx #0
beq b2
jmp b7
}
bool_not: {
.label screen = $450
ldx #0
b1:
txa
and #1
cpx #$a
bcc b4
cmp #0
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
b1:
txa
and #1
cpx #$a
bcc b2
cmp #0
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
b1:
txa
and #1
cpx #$a
bcc b7
b4:
lda #' '
sta screen,x
b3:
inx
cpx #$15
bne b1
rts
b7:
cmp #0
beq b2
jmp b4
b2:
lda #'*'
sta screen,x
jmp b3
}

View File

@ -0,0 +1,131 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@5
@5: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main param-assignment [ ] ( )
to:@end
@end: scope:[] from @5
[3] phi() [ ] ( )
main: scope:[main] from @5
[4] phi() [ ] ( main:2 [ ] )
[5] call bool_and param-assignment [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main
[6] phi() [ ] ( main:2 [ ] )
[7] call bool_or param-assignment [ ] ( main:2 [ ] )
to:main::@2
main::@2: scope:[main] from main::@1
[8] phi() [ ] ( main:2 [ ] )
[9] call bool_not param-assignment [ ] ( main:2 [ ] )
to:main::@3
main::@3: scope:[main] from main::@2
[10] phi() [ ] ( main:2 [ ] )
[11] call bool_complex param-assignment [ ] ( main:2 [ ] )
to:main::@return
main::@return: scope:[main] from main::@3
[12] return [ ] ( main:2 [ ] )
to:@return
bool_complex: scope:[bool_complex] from main::@3
[13] phi() [ ] ( main:2::bool_complex:11 [ ] )
to:bool_complex::@1
bool_complex::@1: scope:[bool_complex] from bool_complex bool_complex::@3
[14] (byte) bool_complex::i#2 ← phi( bool_complex/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_complex::@3/(byte) bool_complex::i#1 ) [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
[15] (byte~) bool_complex::$1 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_complex::i#2 bool_complex::$1 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$1 ] )
[16] (byte~) bool_complex::$5 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_complex::i#2 bool_complex::$1 bool_complex::$5 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$1 bool_complex::$5 ] )
[17] if((byte) bool_complex::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_complex::@8 [ bool_complex::i#2 bool_complex::$1 bool_complex::$5 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$1 bool_complex::$5 ] )
to:bool_complex::@7
bool_complex::@7: scope:[bool_complex] from bool_complex::@1 bool_complex::@8
[18] if((byte) bool_complex::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_complex::@4 [ bool_complex::i#2 bool_complex::$5 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$5 ] )
to:bool_complex::@9
bool_complex::@9: scope:[bool_complex] from bool_complex::@7
[19] if((byte~) bool_complex::$5==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_complex::@4 [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
to:bool_complex::@2
bool_complex::@2: scope:[bool_complex] from bool_complex::@8 bool_complex::@9
[20] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) '*' [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
to:bool_complex::@3
bool_complex::@3: scope:[bool_complex] from bool_complex::@2 bool_complex::@4
[21] (byte) bool_complex::i#1 ← ++ (byte) bool_complex::i#2 [ bool_complex::i#1 ] ( main:2::bool_complex:11 [ bool_complex::i#1 ] )
[22] if((byte) bool_complex::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_complex::@1 [ bool_complex::i#1 ] ( main:2::bool_complex:11 [ bool_complex::i#1 ] )
to:bool_complex::@return
bool_complex::@return: scope:[bool_complex] from bool_complex::@3
[23] return [ ] ( main:2::bool_complex:11 [ ] )
to:@return
bool_complex::@4: scope:[bool_complex] from bool_complex::@7 bool_complex::@9
[24] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) ' ' [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
to:bool_complex::@3
bool_complex::@8: scope:[bool_complex] from bool_complex::@1
[25] if((byte~) bool_complex::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_complex::@2 [ bool_complex::i#2 bool_complex::$5 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$5 ] )
to:bool_complex::@7
bool_not: scope:[bool_not] from main::@2
[26] phi() [ ] ( main:2::bool_not:9 [ ] )
to:bool_not::@1
bool_not::@1: scope:[bool_not] from bool_not bool_not::@3
[27] (byte) bool_not::i#2 ← phi( bool_not/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_not::@3/(byte) bool_not::i#1 ) [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
[28] (byte~) bool_not::$1 ← (byte) bool_not::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_not::i#2 bool_not::$1 ] ( main:2::bool_not:9 [ bool_not::i#2 bool_not::$1 ] )
[29] if((byte) bool_not::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_not::@4 [ bool_not::i#2 bool_not::$1 ] ( main:2::bool_not:9 [ bool_not::i#2 bool_not::$1 ] )
to:bool_not::@7
bool_not::@7: scope:[bool_not] from bool_not::@1
[30] if((byte~) bool_not::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_not::@4 [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
to:bool_not::@2
bool_not::@2: scope:[bool_not] from bool_not::@7
[31] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) '*' [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
to:bool_not::@3
bool_not::@3: scope:[bool_not] from bool_not::@2 bool_not::@4
[32] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#2 [ bool_not::i#1 ] ( main:2::bool_not:9 [ bool_not::i#1 ] )
[33] if((byte) bool_not::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_not::@1 [ bool_not::i#1 ] ( main:2::bool_not:9 [ bool_not::i#1 ] )
to:bool_not::@return
bool_not::@return: scope:[bool_not] from bool_not::@3
[34] return [ ] ( main:2::bool_not:9 [ ] )
to:@return
bool_not::@4: scope:[bool_not] from bool_not::@1 bool_not::@7
[35] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) ' ' [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
to:bool_not::@3
bool_or: scope:[bool_or] from main::@1
[36] phi() [ ] ( main:2::bool_or:7 [ ] )
to:bool_or::@1
bool_or::@1: scope:[bool_or] from bool_or bool_or::@3
[37] (byte) bool_or::i#2 ← phi( bool_or/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_or::@3/(byte) bool_or::i#1 ) [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
[38] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_or::i#2 bool_or::$1 ] ( main:2::bool_or:7 [ bool_or::i#2 bool_or::$1 ] )
[39] if((byte) bool_or::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_or::@2 [ bool_or::i#2 bool_or::$1 ] ( main:2::bool_or:7 [ bool_or::i#2 bool_or::$1 ] )
to:bool_or::@7
bool_or::@7: scope:[bool_or] from bool_or::@1
[40] if((byte~) bool_or::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_or::@2 [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
to:bool_or::@4
bool_or::@4: scope:[bool_or] from bool_or::@7
[41] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) ' ' [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
to:bool_or::@3
bool_or::@3: scope:[bool_or] from bool_or::@2 bool_or::@4
[42] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#2 [ bool_or::i#1 ] ( main:2::bool_or:7 [ bool_or::i#1 ] )
[43] if((byte) bool_or::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_or::@1 [ bool_or::i#1 ] ( main:2::bool_or:7 [ bool_or::i#1 ] )
to:bool_or::@return
bool_or::@return: scope:[bool_or] from bool_or::@3
[44] return [ ] ( main:2::bool_or:7 [ ] )
to:@return
bool_or::@2: scope:[bool_or] from bool_or::@1 bool_or::@7
[45] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) '*' [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
to:bool_or::@3
bool_and: scope:[bool_and] from main
[46] phi() [ ] ( main:2::bool_and:5 [ ] )
to:bool_and::@1
bool_and::@1: scope:[bool_and] from bool_and bool_and::@3
[47] (byte) bool_and::i#2 ← phi( bool_and/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_and::@3/(byte) bool_and::i#1 ) [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
[48] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_and::i#2 bool_and::$1 ] ( main:2::bool_and:5 [ bool_and::i#2 bool_and::$1 ] )
[49] if((byte) bool_and::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_and::@7 [ bool_and::i#2 bool_and::$1 ] ( main:2::bool_and:5 [ bool_and::i#2 bool_and::$1 ] )
to:bool_and::@4
bool_and::@4: scope:[bool_and] from bool_and::@1 bool_and::@7
[50] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) ' ' [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
to:bool_and::@3
bool_and::@3: scope:[bool_and] from bool_and::@2 bool_and::@4
[51] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#2 [ bool_and::i#1 ] ( main:2::bool_and:5 [ bool_and::i#1 ] )
[52] if((byte) bool_and::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_and::@1 [ bool_and::i#1 ] ( main:2::bool_and:5 [ bool_and::i#1 ] )
to:bool_and::@return
bool_and::@return: scope:[bool_and] from bool_and::@3
[53] return [ ] ( main:2::bool_and:5 [ ] )
to:@return
bool_and::@7: scope:[bool_and] from bool_and::@1
[54] if((byte~) bool_and::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_and::@2 [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
to:bool_and::@4
bool_and::@2: scope:[bool_and] from bool_and::@7
[55] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) '*' [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
to:bool_and::@3

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
(label) @5
(label) @begin
(label) @end
(void()) bool_and()
(byte~) bool_and::$1 reg byte a 11.0
(label) bool_and::@1
(label) bool_and::@2
(label) bool_and::@3
(label) bool_and::@4
(label) bool_and::@7
(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::screen
(const byte*) bool_and::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1024
(void()) bool_complex()
(byte~) bool_complex::$1 reg byte x 7.333333333333333
(byte~) bool_complex::$5 reg byte a 5.5
(label) bool_complex::@1
(label) bool_complex::@2
(label) bool_complex::@3
(label) bool_complex::@4
(label) bool_complex::@7
(label) bool_complex::@8
(label) bool_complex::@9
(label) bool_complex::@return
(byte) bool_complex::i
(byte) bool_complex::i#1 reg byte y 16.5
(byte) bool_complex::i#2 reg byte y 9.777777777777779
(byte*) bool_complex::screen
(const byte*) bool_complex::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1144
(void()) bool_not()
(byte~) bool_not::$1 reg byte a 11.0
(label) bool_not::@1
(label) bool_not::@2
(label) bool_not::@3
(label) bool_not::@4
(label) bool_not::@7
(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::screen
(const byte*) bool_not::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1104
(void()) bool_or()
(byte~) bool_or::$1 reg byte a 11.0
(label) bool_or::@1
(label) bool_or::@2
(label) bool_or::@3
(label) bool_or::@4
(label) bool_or::@7
(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::screen
(const byte*) bool_or::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1064
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
reg byte y [ 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_complex::$1 ]
reg byte a [ bool_complex::$5 ]
reg byte a [ bool_not::$1 ]
reg byte a [ bool_or::$1 ]
reg byte a [ bool_and::$1 ]

View File

@ -11,35 +11,49 @@ main: {
}
bool_complex: {
.label screen = $478
ldy #0
.label o1 = 2
.label o2 = 3
ldx #0
b1:
tya
cpx #$a
lda #0
rol
eor #1
sta o1
txa
and #1
tax
tya
and #1
cpy #$a
bcc b8
b7:
cpy #$a
bcc b4
cmp #0
beq b4
beq !+
lda #1
!:
eor #1
sta o2
lda o1
cmp #0
bne b8
b7:
lda o1
cmp #0
bne b4
lda o2
cmp #0
bne b4
b2:
lda #'*'
sta screen,y
sta screen,x
b3:
iny
cpy #$15
inx
cpx #$15
bne b1
rts
b4:
lda #' '
sta screen,y
sta screen,x
jmp b3
b8:
cpx #0
beq b2
lda o2
cmp #0
bne b2
jmp b7
}
bool_not: {

View File

@ -31,101 +31,102 @@ bool_complex: scope:[bool_complex] from main::@3
to:bool_complex::@1
bool_complex::@1: scope:[bool_complex] from bool_complex bool_complex::@3
[14] (byte) bool_complex::i#2 ← phi( bool_complex/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_complex::@3/(byte) bool_complex::i#1 ) [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
[15] (byte~) bool_complex::$3 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_complex::i#2 bool_complex::$3 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$3 ] )
[16] (byte~) bool_complex::$7 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_complex::i#2 bool_complex::$3 bool_complex::$7 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$3 bool_complex::$7 ] )
[17] if((byte) bool_complex::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_complex::@8 [ bool_complex::i#2 bool_complex::$3 bool_complex::$7 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$3 bool_complex::$7 ] )
[15] (boolean) bool_complex::o1#0 ← (byte) bool_complex::i#2 < (byte/signed byte/word/signed word/dword/signed dword) 10 [ bool_complex::i#2 bool_complex::o1#0 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::o1#0 ] )
[16] (byte~) bool_complex::$1 ← (byte) bool_complex::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::$1 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::$1 ] )
[17] (boolean) bool_complex::o2#0 ← (byte~) bool_complex::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::o2#0 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::o2#0 ] )
[18] if((boolean) bool_complex::o1#0) goto bool_complex::@8 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::o2#0 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::o2#0 ] )
to:bool_complex::@7
bool_complex::@7: scope:[bool_complex] from bool_complex::@1 bool_complex::@8
[18] if((byte) bool_complex::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_complex::@4 [ bool_complex::i#2 bool_complex::$7 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$7 ] )
[19] if((boolean) bool_complex::o1#0) goto bool_complex::@4 [ bool_complex::i#2 bool_complex::o2#0 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::o2#0 ] )
to:bool_complex::@9
bool_complex::@9: scope:[bool_complex] from bool_complex::@7
[19] if((byte~) bool_complex::$7==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_complex::@4 [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
[20] if((boolean) bool_complex::o2#0) goto bool_complex::@4 [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
to:bool_complex::@2
bool_complex::@2: scope:[bool_complex] from bool_complex::@8 bool_complex::@9
[20] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) '*' [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
[21] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) '*' [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
to:bool_complex::@3
bool_complex::@3: scope:[bool_complex] from bool_complex::@2 bool_complex::@4
[21] (byte) bool_complex::i#1 ← ++ (byte) bool_complex::i#2 [ bool_complex::i#1 ] ( main:2::bool_complex:11 [ bool_complex::i#1 ] )
[22] if((byte) bool_complex::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_complex::@1 [ bool_complex::i#1 ] ( main:2::bool_complex:11 [ bool_complex::i#1 ] )
[22] (byte) bool_complex::i#1 ← ++ (byte) bool_complex::i#2 [ bool_complex::i#1 ] ( main:2::bool_complex:11 [ bool_complex::i#1 ] )
[23] if((byte) bool_complex::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_complex::@1 [ bool_complex::i#1 ] ( main:2::bool_complex:11 [ bool_complex::i#1 ] )
to:bool_complex::@return
bool_complex::@return: scope:[bool_complex] from bool_complex::@3
[23] return [ ] ( main:2::bool_complex:11 [ ] )
[24] return [ ] ( main:2::bool_complex:11 [ ] )
to:@return
bool_complex::@4: scope:[bool_complex] from bool_complex::@7 bool_complex::@9
[24] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) ' ' [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
[25] *((const byte*) bool_complex::screen#0 + (byte) bool_complex::i#2) ← (byte) ' ' [ bool_complex::i#2 ] ( main:2::bool_complex:11 [ bool_complex::i#2 ] )
to:bool_complex::@3
bool_complex::@8: scope:[bool_complex] from bool_complex::@1
[25] if((byte~) bool_complex::$3==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_complex::@2 [ bool_complex::i#2 bool_complex::$7 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::$7 ] )
[26] if((boolean) bool_complex::o2#0) goto bool_complex::@2 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::o2#0 ] ( main:2::bool_complex:11 [ bool_complex::i#2 bool_complex::o1#0 bool_complex::o2#0 ] )
to:bool_complex::@7
bool_not: scope:[bool_not] from main::@2
[26] phi() [ ] ( main:2::bool_not:9 [ ] )
[27] phi() [ ] ( main:2::bool_not:9 [ ] )
to:bool_not::@1
bool_not::@1: scope:[bool_not] from bool_not bool_not::@3
[27] (byte) bool_not::i#2 ← phi( bool_not/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_not::@3/(byte) bool_not::i#1 ) [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
[28] (byte~) bool_not::$3 ← (byte) bool_not::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_not::i#2 bool_not::$3 ] ( main:2::bool_not:9 [ bool_not::i#2 bool_not::$3 ] )
[29] if((byte) bool_not::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_not::@4 [ bool_not::i#2 bool_not::$3 ] ( main:2::bool_not:9 [ bool_not::i#2 bool_not::$3 ] )
[28] (byte) bool_not::i#2 ← phi( bool_not/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_not::@3/(byte) bool_not::i#1 ) [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
[29] (byte~) bool_not::$1 ← (byte) bool_not::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_not::i#2 bool_not::$1 ] ( main:2::bool_not:9 [ bool_not::i#2 bool_not::$1 ] )
[30] if((byte) bool_not::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_not::@4 [ bool_not::i#2 bool_not::$1 ] ( main:2::bool_not:9 [ bool_not::i#2 bool_not::$1 ] )
to:bool_not::@7
bool_not::@7: scope:[bool_not] from bool_not::@1
[30] if((byte~) bool_not::$3==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_not::@4 [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
[31] if((byte~) bool_not::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_not::@4 [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
to:bool_not::@2
bool_not::@2: scope:[bool_not] from bool_not::@7
[31] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) '*' [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
[32] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) '*' [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
to:bool_not::@3
bool_not::@3: scope:[bool_not] from bool_not::@2 bool_not::@4
[32] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#2 [ bool_not::i#1 ] ( main:2::bool_not:9 [ bool_not::i#1 ] )
[33] if((byte) bool_not::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_not::@1 [ bool_not::i#1 ] ( main:2::bool_not:9 [ bool_not::i#1 ] )
[33] (byte) bool_not::i#1 ← ++ (byte) bool_not::i#2 [ bool_not::i#1 ] ( main:2::bool_not:9 [ bool_not::i#1 ] )
[34] if((byte) bool_not::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_not::@1 [ bool_not::i#1 ] ( main:2::bool_not:9 [ bool_not::i#1 ] )
to:bool_not::@return
bool_not::@return: scope:[bool_not] from bool_not::@3
[34] return [ ] ( main:2::bool_not:9 [ ] )
[35] return [ ] ( main:2::bool_not:9 [ ] )
to:@return
bool_not::@4: scope:[bool_not] from bool_not::@1 bool_not::@7
[35] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) ' ' [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
[36] *((const byte*) bool_not::screen#0 + (byte) bool_not::i#2) ← (byte) ' ' [ bool_not::i#2 ] ( main:2::bool_not:9 [ bool_not::i#2 ] )
to:bool_not::@3
bool_or: scope:[bool_or] from main::@1
[36] phi() [ ] ( main:2::bool_or:7 [ ] )
[37] phi() [ ] ( main:2::bool_or:7 [ ] )
to:bool_or::@1
bool_or::@1: scope:[bool_or] from bool_or bool_or::@3
[37] (byte) bool_or::i#2 ← phi( bool_or/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_or::@3/(byte) bool_or::i#1 ) [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
[38] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_or::i#2 bool_or::$1 ] ( main:2::bool_or:7 [ bool_or::i#2 bool_or::$1 ] )
[39] if((byte) bool_or::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_or::@2 [ bool_or::i#2 bool_or::$1 ] ( main:2::bool_or:7 [ bool_or::i#2 bool_or::$1 ] )
[38] (byte) bool_or::i#2 ← phi( bool_or/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_or::@3/(byte) bool_or::i#1 ) [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
[39] (byte~) bool_or::$1 ← (byte) bool_or::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_or::i#2 bool_or::$1 ] ( main:2::bool_or:7 [ bool_or::i#2 bool_or::$1 ] )
[40] if((byte) bool_or::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_or::@2 [ bool_or::i#2 bool_or::$1 ] ( main:2::bool_or:7 [ bool_or::i#2 bool_or::$1 ] )
to:bool_or::@7
bool_or::@7: scope:[bool_or] from bool_or::@1
[40] if((byte~) bool_or::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_or::@2 [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
[41] if((byte~) bool_or::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_or::@2 [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
to:bool_or::@4
bool_or::@4: scope:[bool_or] from bool_or::@7
[41] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) ' ' [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
[42] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) ' ' [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
to:bool_or::@3
bool_or::@3: scope:[bool_or] from bool_or::@2 bool_or::@4
[42] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#2 [ bool_or::i#1 ] ( main:2::bool_or:7 [ bool_or::i#1 ] )
[43] if((byte) bool_or::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_or::@1 [ bool_or::i#1 ] ( main:2::bool_or:7 [ bool_or::i#1 ] )
[43] (byte) bool_or::i#1 ← ++ (byte) bool_or::i#2 [ bool_or::i#1 ] ( main:2::bool_or:7 [ bool_or::i#1 ] )
[44] if((byte) bool_or::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_or::@1 [ bool_or::i#1 ] ( main:2::bool_or:7 [ bool_or::i#1 ] )
to:bool_or::@return
bool_or::@return: scope:[bool_or] from bool_or::@3
[44] return [ ] ( main:2::bool_or:7 [ ] )
[45] return [ ] ( main:2::bool_or:7 [ ] )
to:@return
bool_or::@2: scope:[bool_or] from bool_or::@1 bool_or::@7
[45] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) '*' [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
[46] *((const byte*) bool_or::screen#0 + (byte) bool_or::i#2) ← (byte) '*' [ bool_or::i#2 ] ( main:2::bool_or:7 [ bool_or::i#2 ] )
to:bool_or::@3
bool_and: scope:[bool_and] from main
[46] phi() [ ] ( main:2::bool_and:5 [ ] )
[47] phi() [ ] ( main:2::bool_and:5 [ ] )
to:bool_and::@1
bool_and::@1: scope:[bool_and] from bool_and bool_and::@3
[47] (byte) bool_and::i#2 ← phi( bool_and/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_and::@3/(byte) bool_and::i#1 ) [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
[48] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_and::i#2 bool_and::$1 ] ( main:2::bool_and:5 [ bool_and::i#2 bool_and::$1 ] )
[49] if((byte) bool_and::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_and::@7 [ bool_and::i#2 bool_and::$1 ] ( main:2::bool_and:5 [ bool_and::i#2 bool_and::$1 ] )
[48] (byte) bool_and::i#2 ← phi( bool_and/(byte/signed byte/word/signed word/dword/signed dword) 0 bool_and::@3/(byte) bool_and::i#1 ) [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
[49] (byte~) bool_and::$1 ← (byte) bool_and::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 [ bool_and::i#2 bool_and::$1 ] ( main:2::bool_and:5 [ bool_and::i#2 bool_and::$1 ] )
[50] if((byte) bool_and::i#2<(byte/signed byte/word/signed word/dword/signed dword) 10) goto bool_and::@7 [ bool_and::i#2 bool_and::$1 ] ( main:2::bool_and:5 [ bool_and::i#2 bool_and::$1 ] )
to:bool_and::@4
bool_and::@4: scope:[bool_and] from bool_and::@1 bool_and::@7
[50] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) ' ' [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
[51] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) ' ' [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
to:bool_and::@3
bool_and::@3: scope:[bool_and] from bool_and::@2 bool_and::@4
[51] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#2 [ bool_and::i#1 ] ( main:2::bool_and:5 [ bool_and::i#1 ] )
[52] if((byte) bool_and::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_and::@1 [ bool_and::i#1 ] ( main:2::bool_and:5 [ bool_and::i#1 ] )
[52] (byte) bool_and::i#1 ← ++ (byte) bool_and::i#2 [ bool_and::i#1 ] ( main:2::bool_and:5 [ bool_and::i#1 ] )
[53] if((byte) bool_and::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 21) goto bool_and::@1 [ bool_and::i#1 ] ( main:2::bool_and:5 [ bool_and::i#1 ] )
to:bool_and::@return
bool_and::@return: scope:[bool_and] from bool_and::@3
[53] return [ ] ( main:2::bool_and:5 [ ] )
[54] return [ ] ( main:2::bool_and:5 [ ] )
to:@return
bool_and::@7: scope:[bool_and] from bool_and::@1
[54] if((byte~) bool_and::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_and::@2 [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
[55] if((byte~) bool_and::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto bool_and::@2 [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
to:bool_and::@4
bool_and::@2: scope:[bool_and] from bool_and::@7
[55] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) '*' [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
[56] *((const byte*) bool_and::screen#0 + (byte) bool_and::i#2) ← (byte) '*' [ bool_and::i#2 ] ( main:2::bool_and:5 [ bool_and::i#2 ] )
to:bool_and::@3

File diff suppressed because it is too large Load Diff

View File

@ -12,11 +12,13 @@
(byte) bool_and::i
(byte) bool_and::i#1 reg byte x 16.5
(byte) bool_and::i#2 reg byte x 11.0
(boolean) bool_and::o1
(boolean) bool_and::o2
(boolean) bool_and::o3
(byte*) bool_and::screen
(const byte*) bool_and::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1024
(void()) bool_complex()
(byte~) bool_complex::$3 reg byte x 7.333333333333333
(byte~) bool_complex::$7 reg byte a 5.5
(byte~) bool_complex::$1 reg byte a 22.0
(label) bool_complex::@1
(label) bool_complex::@2
(label) bool_complex::@3
@ -26,12 +28,19 @@
(label) bool_complex::@9
(label) bool_complex::@return
(byte) bool_complex::i
(byte) bool_complex::i#1 reg byte y 16.5
(byte) bool_complex::i#2 reg byte y 9.777777777777779
(byte) bool_complex::i#1 reg byte x 16.5
(byte) bool_complex::i#2 reg byte x 6.6
(boolean) bool_complex::o1
(boolean) bool_complex::o1#0 o1 zp ZP_BOOL:2 6.6000000000000005
(boolean) bool_complex::o2
(boolean) bool_complex::o2#0 o2 zp ZP_BOOL:3 8.25
(boolean) bool_complex::o3
(boolean) bool_complex::o4
(boolean) bool_complex::o5
(byte*) bool_complex::screen
(const byte*) bool_complex::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1144
(void()) bool_not()
(byte~) bool_not::$3 reg byte a 11.0
(byte~) bool_not::$1 reg byte a 11.0
(label) bool_not::@1
(label) bool_not::@2
(label) bool_not::@3
@ -41,6 +50,9 @@
(byte) bool_not::i
(byte) bool_not::i#1 reg byte x 16.5
(byte) bool_not::i#2 reg byte x 11.0
(boolean) bool_not::o1
(boolean) bool_not::o2
(boolean) bool_not::o3
(byte*) bool_not::screen
(const byte*) bool_not::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1104
(void()) bool_or()
@ -54,6 +66,9 @@
(byte) bool_or::i
(byte) bool_or::i#1 reg byte x 16.5
(byte) bool_or::i#2 reg byte x 11.0
(boolean) bool_or::o1
(boolean) bool_or::o2
(boolean) bool_or::o3
(byte*) bool_or::screen
(const byte*) bool_or::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) 1064
(void()) main()
@ -62,12 +77,13 @@
(label) main::@3
(label) main::@return
reg byte y [ bool_complex::i#2 bool_complex::i#1 ]
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_complex::$3 ]
reg byte a [ bool_complex::$7 ]
reg byte a [ bool_not::$3 ]
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 ]