mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-17 10:30:43 +00:00
Implemented de-inlining of ptr[w] with word-size indexes.
This commit is contained in:
parent
957fe13e4e
commit
7db4308b94
4
src/main/fragment/_deref_pwuc1=_deref_pwuc2.asm
Normal file
4
src/main/fragment/_deref_pwuc1=_deref_pwuc2.asm
Normal file
@ -0,0 +1,4 @@
|
||||
lda {c2}
|
||||
sta {c1}
|
||||
lda {c2}+1
|
||||
sta {c1}+1
|
@ -1,16 +0,0 @@
|
||||
lda #<{c1}
|
||||
clc
|
||||
adc {z1}
|
||||
sta !a1+ +1
|
||||
lda #>{c1}
|
||||
adc {z1}+1
|
||||
sta !a1+ +2
|
||||
lda #<{c2}
|
||||
clc
|
||||
adc {z1}
|
||||
sta !a2+ +1
|
||||
lda #>{c2}
|
||||
adc {z1}+1
|
||||
sta !a2+ +2
|
||||
!a2: lda {c2}
|
||||
!a1: sta {c1}
|
@ -1,16 +0,0 @@
|
||||
lda #<{c1}
|
||||
clc
|
||||
adc {z1}
|
||||
sta !a1+ +1
|
||||
lda #>{c1}
|
||||
adc {z1}+1
|
||||
sta !a1+ +2
|
||||
lda #<{c2}
|
||||
clc
|
||||
adc {z2}
|
||||
sta !a2+ +1
|
||||
lda #>{c2}
|
||||
adc {z2}+1
|
||||
sta !a2+ +2
|
||||
!a2: lda {c2}
|
||||
!a1: sta {c1}
|
@ -1,10 +0,0 @@
|
||||
sta !v+ +1
|
||||
lda #<{c1}
|
||||
clc
|
||||
adc {z1}
|
||||
sta !a+ +1
|
||||
lda #>{c1}
|
||||
adc {z1}+1
|
||||
sta !a+ +2
|
||||
!v: lda #0
|
||||
!a: sta {c1}
|
@ -1,9 +0,0 @@
|
||||
lda #<{c1}
|
||||
clc
|
||||
adc {z1}
|
||||
sta !+ +1
|
||||
lda #>{c1}
|
||||
adc {z1}+1
|
||||
sta !+ +2
|
||||
lda #{c2}
|
||||
!: sta {c1}
|
@ -256,6 +256,7 @@ public class Compiler {
|
||||
optimizations.add(new Pass2MultiplyToShiftRewriting(program));
|
||||
optimizations.add(new Pass2SizeOfSimplification(program));
|
||||
optimizations.add(new Pass2InlineDerefIdx(program));
|
||||
optimizations.add(new Pass2DeInlineWordDerefIdx(program));
|
||||
pass2Execute(optimizations);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
package dk.camelot64.kickc.passes;
|
||||
|
||||
import dk.camelot64.kickc.model.Comment;
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
import dk.camelot64.kickc.model.iterator.ProgramValueIterator;
|
||||
import dk.camelot64.kickc.model.operators.Operators;
|
||||
import dk.camelot64.kickc.model.statements.StatementAssignment;
|
||||
import dk.camelot64.kickc.model.symbols.Scope;
|
||||
import dk.camelot64.kickc.model.symbols.VariableIntermediate;
|
||||
import dk.camelot64.kickc.model.types.SymbolType;
|
||||
import dk.camelot64.kickc.model.types.SymbolTypeInference;
|
||||
import dk.camelot64.kickc.model.values.PointerDereferenceIndexed;
|
||||
import dk.camelot64.kickc.model.values.PointerDereferenceSimple;
|
||||
import dk.camelot64.kickc.model.values.RValue;
|
||||
import sun.tools.jstat.Operator;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/** Fnds derefidx with word indices - and de-inlines them (converting to + and normal deref). */
|
||||
public class Pass2DeInlineWordDerefIdx extends Pass2SsaOptimization {
|
||||
|
||||
public Pass2DeInlineWordDerefIdx(Program program) {
|
||||
super(program);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean step() {
|
||||
AtomicBoolean optimized = new AtomicBoolean(false);
|
||||
ProgramValueIterator.execute(getGraph(), (programValue, currentStmt, stmtIt, currentBlock) -> {
|
||||
if(programValue.get() instanceof PointerDereferenceIndexed) {
|
||||
PointerDereferenceIndexed dereferenceIndexed = (PointerDereferenceIndexed) programValue.get();
|
||||
RValue indexValue = dereferenceIndexed.getIndex();
|
||||
SymbolType indexType = SymbolTypeInference.inferType(getScope(), indexValue);
|
||||
if(indexType.getSizeBytes()>1) {
|
||||
// Index is multiple bytes - de-inline it
|
||||
getLog().append("De-inlining pointer[w] to *(pointer+w) "+currentStmt.toString(getProgram(), false));
|
||||
Scope currentScope = getScope().getScope(currentBlock.getScope());
|
||||
VariableIntermediate tmpVar = currentScope.addVariableIntermediate();
|
||||
SymbolType pointerType = SymbolTypeInference.inferType(getScope(), dereferenceIndexed.getPointer(), Operators.PLUS, indexValue);
|
||||
tmpVar.setType(pointerType);
|
||||
stmtIt.previous();
|
||||
stmtIt.add(new StatementAssignment(tmpVar.getRef(), dereferenceIndexed.getPointer(), Operators.PLUS, indexValue, currentStmt.getSource(), Comment.NO_COMMENTS));
|
||||
stmtIt.next();
|
||||
programValue.set(new PointerDereferenceSimple(tmpVar.getRef()));
|
||||
optimized.set(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
return optimized.get();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -112,6 +112,11 @@ public class TestPrograms {
|
||||
compileAndCompare("word-pointer-iteration-0");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWordArray2() throws IOException, URISyntaxException {
|
||||
compileAndCompare("word-array-2");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWordArray1() throws IOException, URISyntaxException {
|
||||
compileAndCompare("word-array-1");
|
||||
|
13
src/test/kc/word-array-2.kc
Normal file
13
src/test/kc/word-array-2.kc
Normal file
@ -0,0 +1,13 @@
|
||||
// Tests a word-array with 128+ elements
|
||||
|
||||
word[256] words;
|
||||
|
||||
void main() {
|
||||
for(byte i: 0..0xff) {
|
||||
words[(word)i] = ((word)i)*0x100+i;
|
||||
}
|
||||
|
||||
const word* SCREEN = $0400;
|
||||
SCREEN[0] = words[(word)255];
|
||||
|
||||
}
|
@ -10,28 +10,31 @@ main: {
|
||||
.const y1 = $18
|
||||
.const xd = x1-x0
|
||||
.const yd = y1-y0
|
||||
.label x = 4
|
||||
.label idx = 2
|
||||
.label y = 4
|
||||
.label y = 5
|
||||
.label _16 = 6
|
||||
lda #y0
|
||||
sta y
|
||||
ldx #yd/2
|
||||
ldy #x0
|
||||
lda #x0
|
||||
sta x
|
||||
lda #x0+y0*$28
|
||||
sta idx
|
||||
lda #0
|
||||
sta idx+1
|
||||
b1:
|
||||
lda #<screen
|
||||
lda idx
|
||||
clc
|
||||
adc idx
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc idx+1
|
||||
sta !++2
|
||||
adc #<screen
|
||||
sta _16
|
||||
lda idx+1
|
||||
adc #>screen
|
||||
sta _16+1
|
||||
lda #STAR
|
||||
!:
|
||||
sta screen
|
||||
iny
|
||||
ldy #0
|
||||
sta (_16),y
|
||||
inc x
|
||||
inc idx
|
||||
bne !+
|
||||
inc idx+1
|
||||
@ -52,7 +55,8 @@ main: {
|
||||
txa
|
||||
axs #xd
|
||||
b2:
|
||||
cpy #x1+1
|
||||
lda x
|
||||
cmp #x1+1
|
||||
bcc b1
|
||||
rts
|
||||
}
|
||||
|
@ -15,23 +15,24 @@ main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 )
|
||||
[5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 )
|
||||
[5] (word) main::idx#3 ← phi( main/(const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 main::@2/(word) main::idx#5 )
|
||||
[6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0
|
||||
[7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[8] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
|
||||
[10] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2
|
||||
[6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3
|
||||
[7] *((byte*) main::$16) ← (const byte) main::STAR#0
|
||||
[8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
|
||||
[11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1
|
||||
[11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[12] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
|
||||
[12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1 main::@3
|
||||
[14] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
|
||||
[14] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
|
||||
[14] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 )
|
||||
[15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
|
||||
[15] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
|
||||
[15] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
|
||||
[15] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 )
|
||||
[16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[16] return
|
||||
[17] return
|
||||
to:@return
|
||||
|
@ -204,6 +204,8 @@ Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const byte) main::e#0 = main::yd#0/2
|
||||
Constant (const word) main::idx#0 = main::x0#0+main::$4
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
De-inlining pointer[w] to *(pointer+w) *((const byte[main::$0]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0
|
||||
Successful SSA optimization Pass2DeInlineWordDerefIdx
|
||||
Inlining constant with var siblings (const byte) main::e#0
|
||||
Inlining constant with var siblings (const word) main::idx#0
|
||||
Constant inlined main::idx#0 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
@ -222,16 +224,16 @@ CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 7 initial phi equivalence classes
|
||||
Coalesced [14] main::idx#8 ← main::idx#2
|
||||
Coalesced [15] main::e#8 ← main::e#2
|
||||
Coalesced [16] main::y#7 ← main::y#1
|
||||
Coalesced [20] main::idx#6 ← main::idx#5
|
||||
Coalesced [21] main::x#5 ← main::x#1
|
||||
Coalesced [22] main::e#6 ← main::e#5
|
||||
Coalesced [23] main::y#5 ← main::y#4
|
||||
Coalesced [24] main::idx#7 ← main::idx#1
|
||||
Coalesced [25] main::e#7 ← main::e#1
|
||||
Coalesced (already) [26] main::y#6 ← main::y#2
|
||||
Coalesced [15] main::idx#8 ← main::idx#2
|
||||
Coalesced [16] main::e#8 ← main::e#2
|
||||
Coalesced [17] main::y#7 ← main::y#1
|
||||
Coalesced [21] main::idx#6 ← main::idx#5
|
||||
Coalesced [22] main::x#5 ← main::x#1
|
||||
Coalesced [23] main::e#6 ← main::e#5
|
||||
Coalesced [24] main::y#5 ← main::y#4
|
||||
Coalesced [25] main::idx#7 ← main::idx#1
|
||||
Coalesced [26] main::e#7 ← main::e#1
|
||||
Coalesced (already) [27] main::y#6 ← main::y#2
|
||||
Coalesced down to 4 phi equivalence classes
|
||||
Culled Empty Block (label) main::@5
|
||||
Culled Empty Block (label) main::@6
|
||||
@ -258,51 +260,53 @@ main::@1: scope:[main] from main main::@2
|
||||
[5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 )
|
||||
[5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 )
|
||||
[5] (word) main::idx#3 ← phi( main/(const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 main::@2/(word) main::idx#5 )
|
||||
[6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0
|
||||
[7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[8] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
|
||||
[10] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2
|
||||
[6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3
|
||||
[7] *((byte*) main::$16) ← (const byte) main::STAR#0
|
||||
[8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0
|
||||
[11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@1
|
||||
[11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[12] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
|
||||
[12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1 main::@3
|
||||
[14] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
|
||||
[14] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
|
||||
[14] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 )
|
||||
[15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
|
||||
[15] (byte) main::y#4 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#1 )
|
||||
[15] (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 )
|
||||
[15] (word) main::idx#5 ← phi( main::@1/(word) main::idx#1 main::@3/(word) main::idx#2 )
|
||||
[16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[16] return
|
||||
[17] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(void()) main()
|
||||
(byte*) main::$16 22.0
|
||||
(byte) main::STAR
|
||||
(byte) main::e
|
||||
(byte) main::e#1 11.0
|
||||
(byte) main::e#2 22.0
|
||||
(byte) main::e#3 5.5
|
||||
(byte) main::e#3 4.4
|
||||
(byte) main::e#5 16.5
|
||||
(word) main::idx
|
||||
(word) main::idx#1 8.25
|
||||
(word) main::idx#2 11.0
|
||||
(word) main::idx#3 11.0
|
||||
(word) main::idx#3 8.25
|
||||
(word) main::idx#5 16.5
|
||||
(byte[$28*$19]) main::screen
|
||||
(byte) main::x
|
||||
(byte) main::x#1 3.666666666666667
|
||||
(byte) main::x#2 11.0
|
||||
(byte) main::x#2 7.333333333333333
|
||||
(byte) main::x0
|
||||
(byte) main::x1
|
||||
(byte) main::xd
|
||||
(byte) main::y
|
||||
(byte) main::y#1 7.333333333333333
|
||||
(byte) main::y#2 5.5
|
||||
(byte) main::y#2 4.714285714285714
|
||||
(byte) main::y#4 16.5
|
||||
(byte) main::y0
|
||||
(byte) main::y1
|
||||
@ -313,15 +317,18 @@ Initial phi equivalence classes
|
||||
[ main::x#2 main::x#1 ]
|
||||
[ main::e#3 main::e#5 main::e#1 main::e#2 ]
|
||||
[ main::y#2 main::y#4 main::y#1 ]
|
||||
Added variable main::$16 to zero page equivalence class [ main::$16 ]
|
||||
Complete equivalence classes
|
||||
[ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ]
|
||||
[ main::x#2 main::x#1 ]
|
||||
[ main::e#3 main::e#5 main::e#1 main::e#2 ]
|
||||
[ main::y#2 main::y#4 main::y#1 ]
|
||||
[ main::$16 ]
|
||||
Allocated zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ]
|
||||
Allocated zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Allocated zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ]
|
||||
Allocated zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Allocated zp ZP_WORD:7 [ main::$16 ]
|
||||
|
||||
INITIAL ASM
|
||||
//SEG0 File Comments
|
||||
@ -360,6 +367,7 @@ main: {
|
||||
.label idx = 2
|
||||
.label e = 5
|
||||
.label y = 6
|
||||
.label _16 = 7
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
@ -386,38 +394,39 @@ main: {
|
||||
jmp b1
|
||||
//SEG21 main::@1
|
||||
b1:
|
||||
//SEG22 [6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0 -- pbuc1_derefidx_vwuz1=vbuc2
|
||||
lda #<screen
|
||||
//SEG22 [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda idx
|
||||
clc
|
||||
adc idx
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc idx+1
|
||||
sta !++2
|
||||
adc #<screen
|
||||
sta _16
|
||||
lda idx+1
|
||||
adc #>screen
|
||||
sta _16+1
|
||||
//SEG23 [7] *((byte*) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
|
||||
lda #STAR
|
||||
!:
|
||||
sta screen
|
||||
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
ldy #0
|
||||
sta (_16),y
|
||||
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
//SEG24 [8] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
|
||||
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
|
||||
inc idx
|
||||
bne !+
|
||||
inc idx+1
|
||||
!:
|
||||
//SEG25 [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuz1=vbuz1_plus_vbuc1
|
||||
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuz1=vbuz1_plus_vbuc1
|
||||
lax e
|
||||
axs #-[yd]
|
||||
stx e
|
||||
//SEG26 [10] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuz1_then_la1
|
||||
//SEG27 [11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuz1_then_la1
|
||||
lda #xd
|
||||
cmp e
|
||||
bcs b2_from_b1
|
||||
jmp b3
|
||||
//SEG27 main::@3
|
||||
//SEG28 main::@3
|
||||
b3:
|
||||
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG29 [12] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc idx
|
||||
@ -425,56 +434,69 @@ main: {
|
||||
bcc !+
|
||||
inc idx+1
|
||||
!:
|
||||
//SEG30 [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuz1=vbuz1_minus_vbuc1
|
||||
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuz1=vbuz1_minus_vbuc1
|
||||
lax e
|
||||
axs #xd
|
||||
stx e
|
||||
//SEG31 [14] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
|
||||
//SEG32 [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
|
||||
b2_from_b1:
|
||||
b2_from_b3:
|
||||
//SEG32 [14] phi (byte) main::y#4 = (byte) main::y#2 [phi:main::@1/main::@3->main::@2#0] -- register_copy
|
||||
//SEG33 [14] phi (byte) main::e#5 = (byte) main::e#1 [phi:main::@1/main::@3->main::@2#1] -- register_copy
|
||||
//SEG34 [14] phi (word) main::idx#5 = (word) main::idx#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
|
||||
//SEG33 [15] phi (byte) main::y#4 = (byte) main::y#2 [phi:main::@1/main::@3->main::@2#0] -- register_copy
|
||||
//SEG34 [15] phi (byte) main::e#5 = (byte) main::e#1 [phi:main::@1/main::@3->main::@2#1] -- register_copy
|
||||
//SEG35 [15] phi (word) main::idx#5 = (word) main::idx#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
|
||||
jmp b2
|
||||
//SEG35 main::@2
|
||||
//SEG36 main::@2
|
||||
b2:
|
||||
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
|
||||
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda x
|
||||
cmp #x1+1
|
||||
bcc b1_from_b2
|
||||
jmp breturn
|
||||
//SEG37 main::@return
|
||||
//SEG38 main::@return
|
||||
breturn:
|
||||
//SEG38 [16] return
|
||||
//SEG39 [17] return
|
||||
rts
|
||||
}
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a
|
||||
Statement [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Statement [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a
|
||||
Statement [12] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
|
||||
Statement [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a
|
||||
Statement [6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a
|
||||
Statement [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a
|
||||
Statement [12] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
|
||||
Statement [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte*) main::$16) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x
|
||||
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Removing always clobbered register reg byte x as potential for zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
|
||||
Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
|
||||
Statement [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 main::$16 ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte*) main::$16) ← (const byte) main::STAR#0 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::idx#3 main::x#2 main::e#3 main::y#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ( main:2 [ main::y#2 main::x#1 main::idx#1 main::e#1 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ( main:2 [ main::x#1 main::e#1 main::y#1 main::idx#2 ] ) always clobbers reg byte a
|
||||
Statement [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ( main:2 [ main::idx#5 main::x#1 main::e#5 main::y#4 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] : zp ZP_BYTE:5 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] : zp ZP_BYTE:6 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 ,
|
||||
Potential registers zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] : zp ZP_BYTE:5 , reg byte x ,
|
||||
Potential registers zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] : zp ZP_BYTE:6 ,
|
||||
Potential registers zp ZP_WORD:7 [ main::$16 ] : zp ZP_WORD:7 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 55: zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] 46.75: zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] 29.33: zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] 14.67: zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Uplift Scope [main] 53.9: zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] 44: zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] 28.55: zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] 22: zp ZP_WORD:7 [ main::$16 ] 11: zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 1183 combination reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ] zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] reg byte y [ main::x#2 main::x#1 ]
|
||||
Uplifting [] best 1183 combination
|
||||
Uplifting [main] best 1293 combination reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ] zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] zp ZP_WORD:7 [ main::$16 ] zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Uplifting [] best 1293 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Uplifting [main] best 1183 combination zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:4 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Uplifting [main] best 1293 combination zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Uplifting [main] best 1293 combination zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Allocated (was zp ZP_WORD:7) zp ZP_WORD:6 [ main::$16 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
//SEG0 File Comments
|
||||
@ -509,8 +531,10 @@ main: {
|
||||
.const y1 = $18
|
||||
.const xd = x1-x0
|
||||
.const yd = y1-y0
|
||||
.label x = 4
|
||||
.label idx = 2
|
||||
.label y = 4
|
||||
.label y = 5
|
||||
.label _16 = 6
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
@ -518,8 +542,9 @@ main: {
|
||||
sta y
|
||||
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
ldx #yd/2
|
||||
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuyy=vbuc1
|
||||
ldy #x0
|
||||
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
|
||||
lda #x0
|
||||
sta x
|
||||
//SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1
|
||||
lda #x0+y0*$28
|
||||
sta idx
|
||||
@ -535,37 +560,38 @@ main: {
|
||||
jmp b1
|
||||
//SEG21 main::@1
|
||||
b1:
|
||||
//SEG22 [6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0 -- pbuc1_derefidx_vwuz1=vbuc2
|
||||
lda #<screen
|
||||
//SEG22 [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda idx
|
||||
clc
|
||||
adc idx
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc idx+1
|
||||
sta !++2
|
||||
adc #<screen
|
||||
sta _16
|
||||
lda idx+1
|
||||
adc #>screen
|
||||
sta _16+1
|
||||
//SEG23 [7] *((byte*) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
|
||||
lda #STAR
|
||||
!:
|
||||
sta screen
|
||||
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuyy=vbuyy_plus_1
|
||||
iny
|
||||
//SEG24 [8] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
|
||||
ldy #0
|
||||
sta (_16),y
|
||||
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
|
||||
inc idx
|
||||
bne !+
|
||||
inc idx+1
|
||||
!:
|
||||
//SEG25 [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuxx=vbuxx_plus_vbuc1
|
||||
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuxx=vbuxx_plus_vbuc1
|
||||
txa
|
||||
axs #-[yd]
|
||||
//SEG26 [10] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
|
||||
//SEG27 [11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
|
||||
cpx #xd
|
||||
bcc b2_from_b1
|
||||
beq b2_from_b1
|
||||
jmp b3
|
||||
//SEG27 main::@3
|
||||
//SEG28 main::@3
|
||||
b3:
|
||||
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG29 [12] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc idx
|
||||
@ -573,25 +599,26 @@ main: {
|
||||
bcc !+
|
||||
inc idx+1
|
||||
!:
|
||||
//SEG30 [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuxx=vbuxx_minus_vbuc1
|
||||
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuxx=vbuxx_minus_vbuc1
|
||||
txa
|
||||
axs #xd
|
||||
//SEG31 [14] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
|
||||
//SEG32 [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
|
||||
b2_from_b1:
|
||||
b2_from_b3:
|
||||
//SEG32 [14] phi (byte) main::y#4 = (byte) main::y#2 [phi:main::@1/main::@3->main::@2#0] -- register_copy
|
||||
//SEG33 [14] phi (byte) main::e#5 = (byte) main::e#1 [phi:main::@1/main::@3->main::@2#1] -- register_copy
|
||||
//SEG34 [14] phi (word) main::idx#5 = (word) main::idx#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
|
||||
//SEG33 [15] phi (byte) main::y#4 = (byte) main::y#2 [phi:main::@1/main::@3->main::@2#0] -- register_copy
|
||||
//SEG34 [15] phi (byte) main::e#5 = (byte) main::e#1 [phi:main::@1/main::@3->main::@2#1] -- register_copy
|
||||
//SEG35 [15] phi (word) main::idx#5 = (word) main::idx#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
|
||||
jmp b2
|
||||
//SEG35 main::@2
|
||||
//SEG36 main::@2
|
||||
b2:
|
||||
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuyy_lt_vbuc1_then_la1
|
||||
cpy #x1+1
|
||||
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda x
|
||||
cmp #x1+1
|
||||
bcc b1_from_b2
|
||||
jmp breturn
|
||||
//SEG37 main::@return
|
||||
//SEG38 main::@return
|
||||
breturn:
|
||||
//SEG38 [16] return
|
||||
//SEG39 [17] return
|
||||
rts
|
||||
}
|
||||
|
||||
@ -632,6 +659,7 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) main()
|
||||
(byte*) main::$16 $16 zp ZP_WORD:6 22.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@3
|
||||
@ -641,18 +669,18 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::e
|
||||
(byte) main::e#1 reg byte x 11.0
|
||||
(byte) main::e#2 reg byte x 22.0
|
||||
(byte) main::e#3 reg byte x 5.5
|
||||
(byte) main::e#3 reg byte x 4.4
|
||||
(byte) main::e#5 reg byte x 16.5
|
||||
(word) main::idx
|
||||
(word) main::idx#1 idx zp ZP_WORD:2 8.25
|
||||
(word) main::idx#2 idx zp ZP_WORD:2 11.0
|
||||
(word) main::idx#3 idx zp ZP_WORD:2 11.0
|
||||
(word) main::idx#3 idx zp ZP_WORD:2 8.25
|
||||
(word) main::idx#5 idx zp ZP_WORD:2 16.5
|
||||
(byte[$28*$19]) main::screen
|
||||
(const byte[$28*$19]) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
|
||||
(byte) main::x
|
||||
(byte) main::x#1 reg byte y 3.666666666666667
|
||||
(byte) main::x#2 reg byte y 11.0
|
||||
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
|
||||
(byte) main::x#2 x zp ZP_BYTE:4 7.333333333333333
|
||||
(byte) main::x0
|
||||
(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
(byte) main::x1
|
||||
@ -660,9 +688,9 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::xd
|
||||
(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0
|
||||
(byte) main::y
|
||||
(byte) main::y#1 y zp ZP_BYTE:4 7.333333333333333
|
||||
(byte) main::y#2 y zp ZP_BYTE:4 5.5
|
||||
(byte) main::y#4 y zp ZP_BYTE:4 16.5
|
||||
(byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333
|
||||
(byte) main::y#2 y zp ZP_BYTE:5 4.714285714285714
|
||||
(byte) main::y#4 y zp ZP_BYTE:5 16.5
|
||||
(byte) main::y0
|
||||
(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
(byte) main::y1
|
||||
@ -671,13 +699,14 @@ FINAL SYMBOL TABLE
|
||||
(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0
|
||||
|
||||
zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ]
|
||||
reg byte y [ main::x#2 main::x#1 ]
|
||||
zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ]
|
||||
zp ZP_BYTE:4 [ main::y#2 main::y#4 main::y#1 ]
|
||||
zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]
|
||||
zp ZP_WORD:6 [ main::$16 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 1021
|
||||
Score: 1131
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -702,16 +731,19 @@ main: {
|
||||
.const y1 = $18
|
||||
.const xd = x1-x0
|
||||
.const yd = y1-y0
|
||||
.label x = 4
|
||||
.label idx = 2
|
||||
.label y = 4
|
||||
.label y = 5
|
||||
.label _16 = 6
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
//SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
||||
lda #y0
|
||||
sta y
|
||||
//SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1
|
||||
ldx #yd/2
|
||||
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuyy=vbuc1
|
||||
ldy #x0
|
||||
//SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1
|
||||
lda #x0
|
||||
sta x
|
||||
//SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1
|
||||
lda #x0+y0*$28
|
||||
sta idx
|
||||
@ -724,35 +756,36 @@ main: {
|
||||
//SEG20 [5] phi (word) main::idx#3 = (word) main::idx#5 [phi:main::@2->main::@1#3] -- register_copy
|
||||
//SEG21 main::@1
|
||||
b1:
|
||||
//SEG22 [6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0 -- pbuc1_derefidx_vwuz1=vbuc2
|
||||
lda #<screen
|
||||
//SEG22 [6] (byte*) main::$16 ← (const byte[$28*$19]) main::screen#0 + (word) main::idx#3 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda idx
|
||||
clc
|
||||
adc idx
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc idx+1
|
||||
sta !++2
|
||||
adc #<screen
|
||||
sta _16
|
||||
lda idx+1
|
||||
adc #>screen
|
||||
sta _16+1
|
||||
//SEG23 [7] *((byte*) main::$16) ← (const byte) main::STAR#0 -- _deref_pbuz1=vbuc1
|
||||
lda #STAR
|
||||
!:
|
||||
sta screen
|
||||
//SEG23 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuyy=vbuyy_plus_1
|
||||
iny
|
||||
//SEG24 [8] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
|
||||
ldy #0
|
||||
sta (_16),y
|
||||
//SEG24 [8] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
//SEG25 [9] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_plus_1
|
||||
inc idx
|
||||
bne !+
|
||||
inc idx+1
|
||||
!:
|
||||
//SEG25 [9] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuxx=vbuxx_plus_vbuc1
|
||||
//SEG26 [10] (byte) main::e#1 ← (byte) main::e#3 + (const byte) main::yd#0 -- vbuxx=vbuxx_plus_vbuc1
|
||||
txa
|
||||
axs #-[yd]
|
||||
//SEG26 [10] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
|
||||
//SEG27 [11] if((const byte) main::xd#0>=(byte) main::e#1) goto main::@2 -- vbuc1_ge_vbuxx_then_la1
|
||||
cpx #xd
|
||||
bcc b2
|
||||
beq b2
|
||||
//SEG27 main::@3
|
||||
//SEG28 [11] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
//SEG28 main::@3
|
||||
//SEG29 [12] (byte) main::y#1 ← (byte) main::y#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG29 [12] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
//SEG30 [13] (word) main::idx#2 ← (word) main::idx#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc idx
|
||||
@ -760,20 +793,21 @@ main: {
|
||||
bcc !+
|
||||
inc idx+1
|
||||
!:
|
||||
//SEG30 [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuxx=vbuxx_minus_vbuc1
|
||||
//SEG31 [14] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 -- vbuxx=vbuxx_minus_vbuc1
|
||||
txa
|
||||
axs #xd
|
||||
//SEG31 [14] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
|
||||
//SEG32 [14] phi (byte) main::y#4 = (byte) main::y#2 [phi:main::@1/main::@3->main::@2#0] -- register_copy
|
||||
//SEG33 [14] phi (byte) main::e#5 = (byte) main::e#1 [phi:main::@1/main::@3->main::@2#1] -- register_copy
|
||||
//SEG34 [14] phi (word) main::idx#5 = (word) main::idx#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
|
||||
//SEG35 main::@2
|
||||
//SEG32 [15] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
|
||||
//SEG33 [15] phi (byte) main::y#4 = (byte) main::y#2 [phi:main::@1/main::@3->main::@2#0] -- register_copy
|
||||
//SEG34 [15] phi (byte) main::e#5 = (byte) main::e#1 [phi:main::@1/main::@3->main::@2#1] -- register_copy
|
||||
//SEG35 [15] phi (word) main::idx#5 = (word) main::idx#1 [phi:main::@1/main::@3->main::@2#2] -- register_copy
|
||||
//SEG36 main::@2
|
||||
b2:
|
||||
//SEG36 [15] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuyy_lt_vbuc1_then_la1
|
||||
cpy #x1+1
|
||||
//SEG37 [16] if((byte) main::x#1<(const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda x
|
||||
cmp #x1+1
|
||||
bcc b1
|
||||
//SEG37 main::@return
|
||||
//SEG38 [16] return
|
||||
//SEG38 main::@return
|
||||
//SEG39 [17] return
|
||||
rts
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) main()
|
||||
(byte*) main::$16 $16 zp ZP_WORD:6 22.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@3
|
||||
@ -11,18 +12,18 @@
|
||||
(byte) main::e
|
||||
(byte) main::e#1 reg byte x 11.0
|
||||
(byte) main::e#2 reg byte x 22.0
|
||||
(byte) main::e#3 reg byte x 5.5
|
||||
(byte) main::e#3 reg byte x 4.4
|
||||
(byte) main::e#5 reg byte x 16.5
|
||||
(word) main::idx
|
||||
(word) main::idx#1 idx zp ZP_WORD:2 8.25
|
||||
(word) main::idx#2 idx zp ZP_WORD:2 11.0
|
||||
(word) main::idx#3 idx zp ZP_WORD:2 11.0
|
||||
(word) main::idx#3 idx zp ZP_WORD:2 8.25
|
||||
(word) main::idx#5 idx zp ZP_WORD:2 16.5
|
||||
(byte[$28*$19]) main::screen
|
||||
(const byte[$28*$19]) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
|
||||
(byte) main::x
|
||||
(byte) main::x#1 reg byte y 3.666666666666667
|
||||
(byte) main::x#2 reg byte y 11.0
|
||||
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
|
||||
(byte) main::x#2 x zp ZP_BYTE:4 7.333333333333333
|
||||
(byte) main::x0
|
||||
(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
(byte) main::x1
|
||||
@ -30,9 +31,9 @@
|
||||
(byte) main::xd
|
||||
(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0
|
||||
(byte) main::y
|
||||
(byte) main::y#1 y zp ZP_BYTE:4 7.333333333333333
|
||||
(byte) main::y#2 y zp ZP_BYTE:4 5.5
|
||||
(byte) main::y#4 y zp ZP_BYTE:4 16.5
|
||||
(byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333
|
||||
(byte) main::y#2 y zp ZP_BYTE:5 4.714285714285714
|
||||
(byte) main::y#4 y zp ZP_BYTE:5 16.5
|
||||
(byte) main::y0
|
||||
(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
(byte) main::y1
|
||||
@ -41,6 +42,7 @@
|
||||
(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0
|
||||
|
||||
zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ]
|
||||
reg byte y [ main::x#2 main::x#1 ]
|
||||
zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ]
|
||||
zp ZP_BYTE:4 [ main::y#2 main::y#4 main::y#1 ]
|
||||
zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]
|
||||
zp ZP_WORD:6 [ main::$16 ]
|
||||
|
@ -182,6 +182,7 @@ makecharset: {
|
||||
.label ii = $a
|
||||
.label i = 9
|
||||
.label c = 8
|
||||
.label _22 = 2
|
||||
lda #<CHARSET
|
||||
sta font
|
||||
lda #>CHARSET
|
||||
@ -270,19 +271,16 @@ makecharset: {
|
||||
bcc !+
|
||||
inc _19+1
|
||||
!:
|
||||
tya
|
||||
sta !v++1
|
||||
lda #<CHARSET+1*8
|
||||
clc
|
||||
adc _19
|
||||
sta !a++1
|
||||
lda #>CHARSET+1*8
|
||||
adc _19+1
|
||||
sta !a++2
|
||||
!v:
|
||||
lda #0
|
||||
!a:
|
||||
sta CHARSET+1*8
|
||||
lda _22
|
||||
adc #<CHARSET+1*8
|
||||
sta _22
|
||||
lda _22+1
|
||||
adc #>CHARSET+1*8
|
||||
sta _22+1
|
||||
tya
|
||||
ldy #0
|
||||
sta (_22),y
|
||||
inc i
|
||||
lda i
|
||||
cmp #8
|
||||
|
@ -150,36 +150,37 @@ makecharset::@8: scope:[makecharset] from makecharset::@6
|
||||
[77] (word~) makecharset::$17 ← ((word)) (byte) makecharset::c#7
|
||||
[78] (word~) makecharset::$18 ← (word~) makecharset::$17 << (byte/signed byte/word/signed word/dword/signed dword) 3
|
||||
[79] (word~) makecharset::$19 ← (word~) makecharset::$18 + (byte) makecharset::i#6
|
||||
[80] *((const byte*) CHARSET#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 8 + (word~) makecharset::$19) ← (byte) makecharset::b#3
|
||||
[81] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#6
|
||||
[82] if((byte) makecharset::i#1<(byte/signed byte/word/signed word/dword/signed dword) 8) goto makecharset::@4
|
||||
[80] (byte*) makecharset::$22 ← (const byte*) CHARSET#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 8 + (word~) makecharset::$19
|
||||
[81] *((byte*) makecharset::$22) ← (byte) makecharset::b#3
|
||||
[82] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#6
|
||||
[83] if((byte) makecharset::i#1<(byte/signed byte/word/signed word/dword/signed dword) 8) goto makecharset::@4
|
||||
to:makecharset::@9
|
||||
makecharset::@9: scope:[makecharset] from makecharset::@8
|
||||
[83] (byte) makecharset::c#1 ← ++ (byte) makecharset::c#7
|
||||
[84] if((byte) makecharset::c#1<(byte/signed byte/word/signed word/dword/signed dword) $40) goto makecharset::@3
|
||||
[84] (byte) makecharset::c#1 ← ++ (byte) makecharset::c#7
|
||||
[85] if((byte) makecharset::c#1<(byte/signed byte/word/signed word/dword/signed dword) $40) goto makecharset::@3
|
||||
to:makecharset::@return
|
||||
makecharset::@return: scope:[makecharset] from makecharset::@9
|
||||
[85] return
|
||||
[86] return
|
||||
to:@return
|
||||
sid_rnd_init: scope:[sid_rnd_init] from main::@7
|
||||
[86] *((const word*) SID_VOICE3_FREQ#0) ← (word/dword/signed dword) $ffff
|
||||
[87] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
[87] *((const word*) SID_VOICE3_FREQ#0) ← (word/dword/signed dword) $ffff
|
||||
[88] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
to:sid_rnd_init::@return
|
||||
sid_rnd_init::@return: scope:[sid_rnd_init] from sid_rnd_init
|
||||
[88] return
|
||||
[89] return
|
||||
to:@return
|
||||
fillscreen: scope:[fillscreen] from main main::@4 main::@5 main::@6
|
||||
[89] (byte*) fillscreen::screen#6 ← phi( main/(const byte*) BUFFER#0 main::@5/(const byte*) SCREEN2#0 main::@6/(const byte*) COLS#0 main::@4/(const byte*) SCREEN1#0 )
|
||||
[89] (byte) fillscreen::fill#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@6/(const byte) YELLOW#0 main::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 )
|
||||
[90] (byte*) fillscreen::screen#6 ← phi( main/(const byte*) BUFFER#0 main::@5/(const byte*) SCREEN2#0 main::@6/(const byte*) COLS#0 main::@4/(const byte*) SCREEN1#0 )
|
||||
[90] (byte) fillscreen::fill#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@6/(const byte) YELLOW#0 main::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 )
|
||||
to:fillscreen::@1
|
||||
fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@1
|
||||
[90] (word) fillscreen::i#2 ← phi( fillscreen/(byte/signed byte/word/signed word/dword/signed dword) 0 fillscreen::@1/(word) fillscreen::i#1 )
|
||||
[90] (byte*) fillscreen::screen#5 ← phi( fillscreen/(byte*) fillscreen::screen#6 fillscreen::@1/(byte*) fillscreen::screen#4 )
|
||||
[91] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5
|
||||
[92] (byte*) fillscreen::screen#4 ← ++ (byte*) fillscreen::screen#5
|
||||
[93] (word) fillscreen::i#1 ← ++ (word) fillscreen::i#2
|
||||
[94] if((word) fillscreen::i#1!=(word/signed word/dword/signed dword) $3e8) goto fillscreen::@1
|
||||
[91] (word) fillscreen::i#2 ← phi( fillscreen/(byte/signed byte/word/signed word/dword/signed dword) 0 fillscreen::@1/(word) fillscreen::i#1 )
|
||||
[91] (byte*) fillscreen::screen#5 ← phi( fillscreen/(byte*) fillscreen::screen#6 fillscreen::@1/(byte*) fillscreen::screen#4 )
|
||||
[92] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5
|
||||
[93] (byte*) fillscreen::screen#4 ← ++ (byte*) fillscreen::screen#5
|
||||
[94] (word) fillscreen::i#1 ← ++ (word) fillscreen::i#2
|
||||
[95] if((word) fillscreen::i#1!=(word/signed word/dword/signed dword) $3e8) goto fillscreen::@1
|
||||
to:fillscreen::@return
|
||||
fillscreen::@return: scope:[fillscreen] from fillscreen::@1
|
||||
[95] return
|
||||
[96] return
|
||||
to:@return
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -118,6 +118,7 @@
|
||||
(word~) makecharset::$17 $17 zp ZP_WORD:2 202.0
|
||||
(word~) makecharset::$18 $18 zp ZP_WORD:2 202.0
|
||||
(word~) makecharset::$19 $19 zp ZP_WORD:2 202.0
|
||||
(byte*) makecharset::$22 $22 zp ZP_WORD:2 202.0
|
||||
(label) makecharset::@1
|
||||
(label) makecharset::@2
|
||||
(label) makecharset::@3
|
||||
@ -131,18 +132,18 @@
|
||||
(byte) makecharset::b
|
||||
(byte) makecharset::b#1 reg byte y 2002.0
|
||||
(byte) makecharset::b#2 reg byte y 429.0
|
||||
(byte) makecharset::b#3 reg byte y 517.3333333333334
|
||||
(byte) makecharset::b#3 reg byte y 443.42857142857144
|
||||
(byte) makecharset::bc
|
||||
(byte) makecharset::bc#1 reg byte x 2002.0
|
||||
(byte) makecharset::bc#2 reg byte x 400.4
|
||||
(byte) makecharset::bc#3 reg byte x 2103.0
|
||||
(byte) makecharset::bc#5 reg byte x 202.0
|
||||
(byte) makecharset::bc#6 reg byte x 344.8888888888889
|
||||
(byte) makecharset::bc#6 reg byte x 310.4
|
||||
(byte[8]) makecharset::bittab
|
||||
(const byte[8]) makecharset::bittab#0 bittab = { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) $10, (byte/signed byte/word/signed word/dword/signed dword) $20, (byte/signed byte/word/signed word/dword/signed dword) $40, (byte/word/signed word/dword/signed dword) $80 }
|
||||
(byte) makecharset::c
|
||||
(byte) makecharset::c#1 c zp ZP_BYTE:8 16.5
|
||||
(byte) makecharset::c#7 c zp ZP_BYTE:8 59.15789473684211
|
||||
(byte) makecharset::c#7 c zp ZP_BYTE:8 56.19999999999999
|
||||
(byte*) makecharset::charset
|
||||
(byte*) makecharset::font
|
||||
(byte*) makecharset::font#1 font zp ZP_WORD:2 16.5
|
||||
@ -152,7 +153,7 @@
|
||||
(byte*) makecharset::font1#2 font1 zp ZP_WORD:2 16.5
|
||||
(byte) makecharset::i
|
||||
(byte) makecharset::i#1 i zp ZP_BYTE:9 151.5
|
||||
(byte) makecharset::i#6 i zp ZP_BYTE:9 81.5
|
||||
(byte) makecharset::i#6 i zp ZP_BYTE:9 76.70588235294117
|
||||
(byte) makecharset::ii
|
||||
(byte) makecharset::ii#1 ii zp ZP_BYTE:10 1501.5
|
||||
(byte) makecharset::ii#2 ii zp ZP_BYTE:10 333.6666666666667
|
||||
@ -164,7 +165,7 @@
|
||||
(void()) sid_rnd_init()
|
||||
(label) sid_rnd_init::@return
|
||||
|
||||
zp ZP_WORD:2 [ fire::screen#0 fire::screen#5 fire::screen#3 fire::screen#1 makecharset::font#2 makecharset::font#1 makecharset::font1#2 makecharset::font1#1 fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 makecharset::$17 makecharset::$18 makecharset::$19 ]
|
||||
zp ZP_WORD:2 [ fire::screen#0 fire::screen#5 fire::screen#3 fire::screen#1 makecharset::font#2 makecharset::font#1 makecharset::font1#2 makecharset::font1#1 fillscreen::screen#5 fillscreen::screen#6 fillscreen::screen#4 makecharset::$17 makecharset::$18 makecharset::$19 makecharset::$22 ]
|
||||
zp ZP_WORD:4 [ fire::buffer#4 fire::buffer#2 fire::buffer#7 fire::buffer#3 fillscreen::i#2 fillscreen::i#1 ]
|
||||
zp ZP_WORD:6 [ fire::screen#4 fire::screen#10 fire::screen#2 ]
|
||||
reg byte a [ fire::c#2 fire::c#0 fire::c#1 ]
|
||||
|
@ -247,6 +247,7 @@ makecharset: {
|
||||
.label s = 5
|
||||
.label i = 4
|
||||
.label c = 2
|
||||
.label _16 = $e
|
||||
jsr sid_rnd_init
|
||||
jsr print_cls
|
||||
lda #<print_line_cursor
|
||||
@ -297,19 +298,16 @@ makecharset: {
|
||||
bcc !+
|
||||
inc _9+1
|
||||
!:
|
||||
tya
|
||||
sta !v++1
|
||||
lda #<CHARSET
|
||||
clc
|
||||
adc _9
|
||||
sta !a++1
|
||||
lda #>CHARSET
|
||||
adc _9+1
|
||||
sta !a++2
|
||||
!v:
|
||||
lda #0
|
||||
!a:
|
||||
sta CHARSET
|
||||
lda _16
|
||||
adc #<CHARSET
|
||||
sta _16
|
||||
lda _16+1
|
||||
adc #>CHARSET
|
||||
sta _16+1
|
||||
tya
|
||||
ldy #0
|
||||
sta (_16),y
|
||||
inc i
|
||||
lda i
|
||||
cmp #8
|
||||
@ -330,9 +328,7 @@ makecharset: {
|
||||
bne !+
|
||||
lda c
|
||||
cmp #<$100
|
||||
bcs !b1+
|
||||
jmp b1
|
||||
!b1:
|
||||
bcc b1
|
||||
!:
|
||||
rts
|
||||
bittab: .byte 1, 2, 4, 8, $10, $20, $40, $80
|
||||
|
@ -234,55 +234,56 @@ makecharset::@4: scope:[makecharset] from makecharset::@11 makecharset::@5
|
||||
makecharset::@6: scope:[makecharset] from makecharset::@4
|
||||
[116] (word~) makecharset::$8 ← (word) makecharset::c#2 << (byte/signed byte/word/signed word/dword/signed dword) 3
|
||||
[117] (word~) makecharset::$9 ← (word~) makecharset::$8 + (byte) makecharset::i#7
|
||||
[118] *((const byte*) CHARSET#0 + (word~) makecharset::$9) ← (byte) makecharset::b#3
|
||||
[119] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#7
|
||||
[120] if((byte) makecharset::i#1<(byte/signed byte/word/signed word/dword/signed dword) 8) goto makecharset::@2
|
||||
[118] (byte*) makecharset::$16 ← (const byte*) CHARSET#0 + (word~) makecharset::$9
|
||||
[119] *((byte*) makecharset::$16) ← (byte) makecharset::b#3
|
||||
[120] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#7
|
||||
[121] if((byte) makecharset::i#1<(byte/signed byte/word/signed word/dword/signed dword) 8) goto makecharset::@2
|
||||
to:makecharset::@7
|
||||
makecharset::@7: scope:[makecharset] from makecharset::@6
|
||||
[121] (byte/word~) makecharset::$11 ← (word) makecharset::c#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
|
||||
[122] if((byte/word~) makecharset::$11!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto makecharset::@9
|
||||
[122] (byte/word~) makecharset::$11 ← (word) makecharset::c#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
|
||||
[123] if((byte/word~) makecharset::$11!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto makecharset::@9
|
||||
to:makecharset::@8
|
||||
makecharset::@8: scope:[makecharset] from makecharset::@7
|
||||
[123] phi()
|
||||
[124] call print_char
|
||||
[124] phi()
|
||||
[125] call print_char
|
||||
to:makecharset::@9
|
||||
makecharset::@9: scope:[makecharset] from makecharset::@7 makecharset::@8
|
||||
[125] (byte*) print_char_cursor#18 ← phi( makecharset::@8/(byte*) print_char_cursor#1 makecharset::@7/(byte*) print_char_cursor#44 )
|
||||
[126] (word) makecharset::c#1 ← ++ (word) makecharset::c#2
|
||||
[127] if((word) makecharset::c#1<(word/signed word/dword/signed dword) $100) goto makecharset::@1
|
||||
[126] (byte*) print_char_cursor#18 ← phi( makecharset::@8/(byte*) print_char_cursor#1 makecharset::@7/(byte*) print_char_cursor#44 )
|
||||
[127] (word) makecharset::c#1 ← ++ (word) makecharset::c#2
|
||||
[128] if((word) makecharset::c#1<(word/signed word/dword/signed dword) $100) goto makecharset::@1
|
||||
to:makecharset::@return
|
||||
makecharset::@return: scope:[makecharset] from makecharset::@9
|
||||
[128] return
|
||||
[129] return
|
||||
to:@return
|
||||
print_char: scope:[print_char] from makecharset::@8
|
||||
[129] *((byte*) print_char_cursor#44) ← (const byte) print_char::ch#0
|
||||
[130] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#44
|
||||
[130] *((byte*) print_char_cursor#44) ← (const byte) print_char::ch#0
|
||||
[131] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#44
|
||||
to:print_char::@return
|
||||
print_char::@return: scope:[print_char] from print_char
|
||||
[131] return
|
||||
[132] return
|
||||
to:@return
|
||||
sid_rnd: scope:[sid_rnd] from makecharset::@3
|
||||
[132] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0)
|
||||
[133] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0)
|
||||
to:sid_rnd::@return
|
||||
sid_rnd::@return: scope:[sid_rnd] from sid_rnd
|
||||
[133] return
|
||||
[134] return
|
||||
to:@return
|
||||
print_cls: scope:[print_cls] from makecharset::@10
|
||||
[134] phi()
|
||||
[135] phi()
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
|
||||
[135] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) print_line_cursor#0 print_cls::@1/(byte*) print_cls::sc#1 )
|
||||
[136] *((byte*) print_cls::sc#2) ← (byte) ' '
|
||||
[137] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
|
||||
[138] if((byte*) print_cls::sc#1!=(const byte*) print_line_cursor#0+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
|
||||
[136] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) print_line_cursor#0 print_cls::@1/(byte*) print_cls::sc#1 )
|
||||
[137] *((byte*) print_cls::sc#2) ← (byte) ' '
|
||||
[138] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
|
||||
[139] if((byte*) print_cls::sc#1!=(const byte*) print_line_cursor#0+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
|
||||
to:print_cls::@return
|
||||
print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
[139] return
|
||||
[140] return
|
||||
to:@return
|
||||
sid_rnd_init: scope:[sid_rnd_init] from makecharset
|
||||
[140] *((const word*) SID_VOICE3_FREQ#0) ← (word/dword/signed dword) $ffff
|
||||
[141] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
[141] *((const word*) SID_VOICE3_FREQ#0) ← (word/dword/signed dword) $ffff
|
||||
[142] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
to:sid_rnd_init::@return
|
||||
sid_rnd_init::@return: scope:[sid_rnd_init] from sid_rnd_init
|
||||
[142] return
|
||||
[143] return
|
||||
to:@return
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -164,6 +164,7 @@
|
||||
(byte*) main::toD0181_screen
|
||||
(void()) makecharset((byte*) makecharset::charset)
|
||||
(byte/word~) makecharset::$11 reg byte a 22.0
|
||||
(byte*) makecharset::$16 $16 zp ZP_WORD:14 202.0
|
||||
(byte~) makecharset::$2 reg byte a 22.0
|
||||
(byte~) makecharset::$3 reg byte a 2002.0
|
||||
(byte~) makecharset::$4 $4 zp ZP_BYTE:6 2002.0
|
||||
@ -184,21 +185,21 @@
|
||||
(byte) makecharset::b
|
||||
(byte) makecharset::b#1 reg byte y 2002.0
|
||||
(byte) makecharset::b#2 reg byte y 500.5
|
||||
(byte) makecharset::b#3 reg byte y 620.8
|
||||
(byte) makecharset::b#3 reg byte y 517.3333333333334
|
||||
(byte[8]) makecharset::bittab
|
||||
(const byte[8]) makecharset::bittab#0 bittab = { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) $10, (byte/signed byte/word/signed word/dword/signed dword) $20, (byte/signed byte/word/signed word/dword/signed dword) $40, (byte/word/signed word/dword/signed dword) $80 }
|
||||
(word) makecharset::c
|
||||
(word) makecharset::c#1 c zp ZP_WORD:2 16.5
|
||||
(word) makecharset::c#2 c zp ZP_WORD:2 6.041666666666666
|
||||
(word) makecharset::c#2 c zp ZP_WORD:2 5.800000000000001
|
||||
(byte*) makecharset::charset
|
||||
(byte) makecharset::i
|
||||
(byte) makecharset::i#1 i zp ZP_BYTE:4 151.5
|
||||
(byte) makecharset::i#7 i zp ZP_BYTE:4 21.642857142857142
|
||||
(byte) makecharset::i#7 i zp ZP_BYTE:4 20.2
|
||||
(byte) makecharset::ii
|
||||
(byte) makecharset::ii#1 reg byte x 1501.5
|
||||
(byte) makecharset::ii#2 reg byte x 375.375
|
||||
(byte) makecharset::s
|
||||
(byte) makecharset::s#0 s zp ZP_BYTE:5 59.529411764705884
|
||||
(byte) makecharset::s#0 s zp ZP_BYTE:5 56.22222222222223
|
||||
(void()) print_char((byte) print_char::ch)
|
||||
(label) print_char::@return
|
||||
(byte) print_char::ch
|
||||
@ -206,7 +207,7 @@
|
||||
(byte*) print_char_cursor
|
||||
(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:11 4.333333333333333
|
||||
(byte*) print_char_cursor#18 print_char_cursor zp ZP_WORD:11 11.0
|
||||
(byte*) print_char_cursor#44 print_char_cursor zp ZP_WORD:11 1.1304347826086956
|
||||
(byte*) print_char_cursor#44 print_char_cursor zp ZP_WORD:11 1.0833333333333333
|
||||
(void()) print_cls()
|
||||
(label) print_cls::@1
|
||||
(label) print_cls::@return
|
||||
@ -269,6 +270,6 @@ reg byte a [ doplasma::val#50 ]
|
||||
reg byte a [ makecharset::$2 ]
|
||||
reg byte a [ sid_rnd::return#2 ]
|
||||
reg byte a [ makecharset::$3 ]
|
||||
zp ZP_WORD:14 [ makecharset::$8 makecharset::$9 ]
|
||||
zp ZP_WORD:14 [ makecharset::$8 makecharset::$9 makecharset::$16 ]
|
||||
reg byte a [ makecharset::$11 ]
|
||||
reg byte a [ sid_rnd::return#0 ]
|
||||
|
@ -183,6 +183,7 @@ makecharset: {
|
||||
.label s = 5
|
||||
.label i = 4
|
||||
.label c = 2
|
||||
.label _16 = $d
|
||||
jsr sid_rnd_init
|
||||
jsr print_cls
|
||||
lda #<print_line_cursor
|
||||
@ -233,19 +234,16 @@ makecharset: {
|
||||
bcc !+
|
||||
inc _9+1
|
||||
!:
|
||||
tya
|
||||
sta !v++1
|
||||
lda #<CHARSET
|
||||
clc
|
||||
adc _9
|
||||
sta !a++1
|
||||
lda #>CHARSET
|
||||
adc _9+1
|
||||
sta !a++2
|
||||
!v:
|
||||
lda #0
|
||||
!a:
|
||||
sta CHARSET
|
||||
lda _16
|
||||
adc #<CHARSET
|
||||
sta _16
|
||||
lda _16+1
|
||||
adc #>CHARSET
|
||||
sta _16+1
|
||||
tya
|
||||
ldy #0
|
||||
sta (_16),y
|
||||
inc i
|
||||
lda i
|
||||
cmp #8
|
||||
@ -266,9 +264,7 @@ makecharset: {
|
||||
bne !+
|
||||
lda c
|
||||
cmp #<$100
|
||||
bcs !b1+
|
||||
jmp b1
|
||||
!b1:
|
||||
bcc b1
|
||||
!:
|
||||
rts
|
||||
bittab: .byte 1, 2, 4, 8, $10, $20, $40, $80
|
||||
|
@ -149,55 +149,56 @@ makecharset::@4: scope:[makecharset] from makecharset::@11 makecharset::@5
|
||||
makecharset::@6: scope:[makecharset] from makecharset::@4
|
||||
[73] (word~) makecharset::$8 ← (word) makecharset::c#2 << (byte/signed byte/word/signed word/dword/signed dword) 3
|
||||
[74] (word~) makecharset::$9 ← (word~) makecharset::$8 + (byte) makecharset::i#7
|
||||
[75] *((const byte*) CHARSET#0 + (word~) makecharset::$9) ← (byte) makecharset::b#3
|
||||
[76] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#7
|
||||
[77] if((byte) makecharset::i#1<(byte/signed byte/word/signed word/dword/signed dword) 8) goto makecharset::@2
|
||||
[75] (byte*) makecharset::$16 ← (const byte*) CHARSET#0 + (word~) makecharset::$9
|
||||
[76] *((byte*) makecharset::$16) ← (byte) makecharset::b#3
|
||||
[77] (byte) makecharset::i#1 ← ++ (byte) makecharset::i#7
|
||||
[78] if((byte) makecharset::i#1<(byte/signed byte/word/signed word/dword/signed dword) 8) goto makecharset::@2
|
||||
to:makecharset::@7
|
||||
makecharset::@7: scope:[makecharset] from makecharset::@6
|
||||
[78] (byte/word~) makecharset::$11 ← (word) makecharset::c#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
|
||||
[79] if((byte/word~) makecharset::$11!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto makecharset::@9
|
||||
[79] (byte/word~) makecharset::$11 ← (word) makecharset::c#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
|
||||
[80] if((byte/word~) makecharset::$11!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto makecharset::@9
|
||||
to:makecharset::@8
|
||||
makecharset::@8: scope:[makecharset] from makecharset::@7
|
||||
[80] phi()
|
||||
[81] call print_char
|
||||
[81] phi()
|
||||
[82] call print_char
|
||||
to:makecharset::@9
|
||||
makecharset::@9: scope:[makecharset] from makecharset::@7 makecharset::@8
|
||||
[82] (byte*) print_char_cursor#18 ← phi( makecharset::@8/(byte*) print_char_cursor#1 makecharset::@7/(byte*) print_char_cursor#46 )
|
||||
[83] (word) makecharset::c#1 ← ++ (word) makecharset::c#2
|
||||
[84] if((word) makecharset::c#1<(word/signed word/dword/signed dword) $100) goto makecharset::@1
|
||||
[83] (byte*) print_char_cursor#18 ← phi( makecharset::@8/(byte*) print_char_cursor#1 makecharset::@7/(byte*) print_char_cursor#46 )
|
||||
[84] (word) makecharset::c#1 ← ++ (word) makecharset::c#2
|
||||
[85] if((word) makecharset::c#1<(word/signed word/dword/signed dword) $100) goto makecharset::@1
|
||||
to:makecharset::@return
|
||||
makecharset::@return: scope:[makecharset] from makecharset::@9
|
||||
[85] return
|
||||
[86] return
|
||||
to:@return
|
||||
print_char: scope:[print_char] from makecharset::@8
|
||||
[86] *((byte*) print_char_cursor#46) ← (const byte) print_char::ch#0
|
||||
[87] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#46
|
||||
[87] *((byte*) print_char_cursor#46) ← (const byte) print_char::ch#0
|
||||
[88] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#46
|
||||
to:print_char::@return
|
||||
print_char::@return: scope:[print_char] from print_char
|
||||
[88] return
|
||||
[89] return
|
||||
to:@return
|
||||
sid_rnd: scope:[sid_rnd] from makecharset::@3
|
||||
[89] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0)
|
||||
[90] (byte) sid_rnd::return#0 ← *((const byte*) SID_VOICE3_OSC#0)
|
||||
to:sid_rnd::@return
|
||||
sid_rnd::@return: scope:[sid_rnd] from sid_rnd
|
||||
[90] return
|
||||
[91] return
|
||||
to:@return
|
||||
print_cls: scope:[print_cls] from makecharset::@10
|
||||
[91] phi()
|
||||
[92] phi()
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
|
||||
[92] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) print_line_cursor#0 print_cls::@1/(byte*) print_cls::sc#1 )
|
||||
[93] *((byte*) print_cls::sc#2) ← (byte) ' '
|
||||
[94] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
|
||||
[95] if((byte*) print_cls::sc#1!=(const byte*) print_line_cursor#0+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
|
||||
[93] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) print_line_cursor#0 print_cls::@1/(byte*) print_cls::sc#1 )
|
||||
[94] *((byte*) print_cls::sc#2) ← (byte) ' '
|
||||
[95] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
|
||||
[96] if((byte*) print_cls::sc#1!=(const byte*) print_line_cursor#0+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
|
||||
to:print_cls::@return
|
||||
print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
[96] return
|
||||
[97] return
|
||||
to:@return
|
||||
sid_rnd_init: scope:[sid_rnd_init] from makecharset
|
||||
[97] *((const word*) SID_VOICE3_FREQ#0) ← (word/dword/signed dword) $ffff
|
||||
[98] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
[98] *((const word*) SID_VOICE3_FREQ#0) ← (word/dword/signed dword) $ffff
|
||||
[99] *((const byte*) SID_VOICE3_CONTROL#0) ← (const byte) SID_CONTROL_NOISE#0
|
||||
to:sid_rnd_init::@return
|
||||
sid_rnd_init::@return: scope:[sid_rnd_init] from sid_rnd_init
|
||||
[99] return
|
||||
[100] return
|
||||
to:@return
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -134,6 +134,7 @@
|
||||
(byte*) main::toD0182_screen
|
||||
(void()) makecharset((byte*) makecharset::charset)
|
||||
(byte/word~) makecharset::$11 reg byte a 22.0
|
||||
(byte*) makecharset::$16 $16 zp ZP_WORD:13 202.0
|
||||
(byte~) makecharset::$2 reg byte a 22.0
|
||||
(byte~) makecharset::$3 reg byte a 2002.0
|
||||
(byte~) makecharset::$4 $4 zp ZP_BYTE:6 2002.0
|
||||
@ -154,21 +155,21 @@
|
||||
(byte) makecharset::b
|
||||
(byte) makecharset::b#1 reg byte y 2002.0
|
||||
(byte) makecharset::b#2 reg byte y 500.5
|
||||
(byte) makecharset::b#3 reg byte y 620.8
|
||||
(byte) makecharset::b#3 reg byte y 517.3333333333334
|
||||
(byte[8]) makecharset::bittab
|
||||
(const byte[8]) makecharset::bittab#0 bittab = { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) $10, (byte/signed byte/word/signed word/dword/signed dword) $20, (byte/signed byte/word/signed word/dword/signed dword) $40, (byte/word/signed word/dword/signed dword) $80 }
|
||||
(word) makecharset::c
|
||||
(word) makecharset::c#1 c zp ZP_WORD:2 16.5
|
||||
(word) makecharset::c#2 c zp ZP_WORD:2 6.041666666666666
|
||||
(word) makecharset::c#2 c zp ZP_WORD:2 5.800000000000001
|
||||
(byte*) makecharset::charset
|
||||
(byte) makecharset::i
|
||||
(byte) makecharset::i#1 i zp ZP_BYTE:4 151.5
|
||||
(byte) makecharset::i#7 i zp ZP_BYTE:4 21.642857142857142
|
||||
(byte) makecharset::i#7 i zp ZP_BYTE:4 20.2
|
||||
(byte) makecharset::ii
|
||||
(byte) makecharset::ii#1 reg byte x 1501.5
|
||||
(byte) makecharset::ii#2 reg byte x 375.375
|
||||
(byte) makecharset::s
|
||||
(byte) makecharset::s#0 s zp ZP_BYTE:5 59.529411764705884
|
||||
(byte) makecharset::s#0 s zp ZP_BYTE:5 56.22222222222223
|
||||
(void()) print_char((byte) print_char::ch)
|
||||
(label) print_char::@return
|
||||
(byte) print_char::ch
|
||||
@ -176,7 +177,7 @@
|
||||
(byte*) print_char_cursor
|
||||
(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:11 4.333333333333333
|
||||
(byte*) print_char_cursor#18 print_char_cursor zp ZP_WORD:11 11.0
|
||||
(byte*) print_char_cursor#46 print_char_cursor zp ZP_WORD:11 1.1304347826086956
|
||||
(byte*) print_char_cursor#46 print_char_cursor zp ZP_WORD:11 1.0833333333333333
|
||||
(void()) print_cls()
|
||||
(label) print_cls::@1
|
||||
(label) print_cls::@return
|
||||
@ -213,6 +214,6 @@ reg byte a [ doplasma::$4 ]
|
||||
reg byte a [ makecharset::$2 ]
|
||||
reg byte a [ sid_rnd::return#2 ]
|
||||
reg byte a [ makecharset::$3 ]
|
||||
zp ZP_WORD:13 [ makecharset::$8 makecharset::$9 ]
|
||||
zp ZP_WORD:13 [ makecharset::$8 makecharset::$9 makecharset::$16 ]
|
||||
reg byte a [ makecharset::$11 ]
|
||||
reg byte a [ sid_rnd::return#0 ]
|
||||
|
@ -227,17 +227,23 @@ if() condition always true - replacing block destination [26] if(true) goto tabl
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Eliminating unused variable - keeping the phi block (byte) irq_idx#3
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
De-inlining pointer[w] to *(pointer+w) *((const byte*) SCREEN#0+-(const byte) VIC_SIZE#0 + (word/signed word/dword/signed dword~) table_driven_irq::$6) ← (byte) table_driven_irq::val#0
|
||||
Successful SSA optimization Pass2DeInlineWordDerefIdx
|
||||
Culled Empty Block (label) @4
|
||||
Culled Empty Block (label) table_driven_irq::@4
|
||||
Culled Empty Block (label) table_driven_irq::@8
|
||||
Successful SSA optimization Pass2CullEmptyBlocks
|
||||
Alias (word/signed word/dword/signed dword~) table_driven_irq::$6 = (word/signed word/dword/signed dword~) table_driven_irq::$5
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Consolidated array index constant in assignment *(SCREEN#0+-VIC_SIZE#0+$3f8 + table_driven_irq::$6)
|
||||
Consolidated constant in assignment table_driven_irq::$7
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Inferred type updated to byte in [17] (word/signed word/dword/signed dword~) table_driven_irq::$6 ← (byte) table_driven_irq::idx#0
|
||||
Converting *(pointer+n) to pointer[n] *((byte*) table_driven_irq::$7) ← (byte) table_driven_irq::val#0 -- *(SCREEN#0+-VIC_SIZE#0+$3f8 + table_driven_irq::$6)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Alias (byte) table_driven_irq::idx#0 = (byte~) table_driven_irq::$6
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Eliminating unused variable (byte*) table_driven_irq::$7 and assignment [17] (byte*) table_driven_irq::$7 ← (const byte*) SCREEN#0+-(const byte) VIC_SIZE#0+(word/signed word/dword/signed dword) $3f8 + (byte) table_driven_irq::idx#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined table_driven_irq::$1 = (const byte) VIC_SIZE#0+(byte/signed byte/word/signed word/dword/signed dword) 8
|
||||
Constant inlined main::$0 = &interrupt(KERNEL_MIN)(void()) table_driven_irq()
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
|
@ -61,6 +61,14 @@ draw_block: {
|
||||
.label x1 = 9
|
||||
.label z = 4
|
||||
.label z_1 = 9
|
||||
.label _11 = 4
|
||||
.label _12 = 4
|
||||
.label _13 = 4
|
||||
.label _14 = 4
|
||||
.label _15 = 4
|
||||
.label _16 = 4
|
||||
.label _17 = 4
|
||||
.label _18 = 9
|
||||
asl
|
||||
asl
|
||||
sta tileno
|
||||
@ -81,89 +89,80 @@ draw_block: {
|
||||
adc z+1
|
||||
sta z_1+1
|
||||
ldy tileno
|
||||
lda tileset,y
|
||||
sta !v++1
|
||||
lda #<screen
|
||||
ldx tileset,y
|
||||
lda z_1
|
||||
clc
|
||||
adc z_1
|
||||
sta !a++1
|
||||
lda #>screen
|
||||
adc z_1+1
|
||||
sta !a++2
|
||||
!v:
|
||||
lda #0
|
||||
!a:
|
||||
sta screen
|
||||
lda #<colors
|
||||
adc #<screen
|
||||
sta _11
|
||||
lda z_1+1
|
||||
adc #>screen
|
||||
sta _11+1
|
||||
txa
|
||||
ldy #0
|
||||
sta (_11),y
|
||||
lda z_1
|
||||
clc
|
||||
adc z_1
|
||||
sta !++1
|
||||
lda #>colors
|
||||
adc z_1+1
|
||||
sta !++2
|
||||
adc #<colors
|
||||
sta _12
|
||||
lda z_1+1
|
||||
adc #>colors
|
||||
sta _12+1
|
||||
lda #YELLOW
|
||||
!:
|
||||
sta colors
|
||||
lda #<screen+1
|
||||
sta (_12),y
|
||||
lda z_1
|
||||
clc
|
||||
adc z_1
|
||||
sta !++1
|
||||
lda #>screen+1
|
||||
adc z_1+1
|
||||
sta !++2
|
||||
adc #<screen+1
|
||||
sta _13
|
||||
lda z_1+1
|
||||
adc #>screen+1
|
||||
sta _13+1
|
||||
lda #1
|
||||
!:
|
||||
sta screen+1
|
||||
lda #<colors+1
|
||||
sta (_13),y
|
||||
lda z_1
|
||||
clc
|
||||
adc z_1
|
||||
sta !++1
|
||||
lda #>colors+1
|
||||
adc z_1+1
|
||||
sta !++2
|
||||
adc #<colors+1
|
||||
sta _14
|
||||
lda z_1+1
|
||||
adc #>colors+1
|
||||
sta _14+1
|
||||
lda #YELLOW
|
||||
!:
|
||||
sta colors+1
|
||||
lda #<screen+$28
|
||||
sta (_14),y
|
||||
lda z_1
|
||||
clc
|
||||
adc z_1
|
||||
sta !++1
|
||||
lda #>screen+$28
|
||||
adc z_1+1
|
||||
sta !++2
|
||||
adc #<screen+$28
|
||||
sta _15
|
||||
lda z_1+1
|
||||
adc #>screen+$28
|
||||
sta _15+1
|
||||
lda #2
|
||||
!:
|
||||
sta screen+$28
|
||||
lda #<colors+$28
|
||||
sta (_15),y
|
||||
lda z_1
|
||||
clc
|
||||
adc z_1
|
||||
sta !++1
|
||||
lda #>colors+$28
|
||||
adc z_1+1
|
||||
sta !++2
|
||||
adc #<colors+$28
|
||||
sta _16
|
||||
lda z_1+1
|
||||
adc #>colors+$28
|
||||
sta _16+1
|
||||
lda #YELLOW
|
||||
!:
|
||||
sta colors+$28
|
||||
lda #<screen+$29
|
||||
sta (_16),y
|
||||
lda z_1
|
||||
clc
|
||||
adc z_1
|
||||
sta !++1
|
||||
lda #>screen+$29
|
||||
adc z_1+1
|
||||
sta !++2
|
||||
adc #<screen+$29
|
||||
sta _17
|
||||
lda z_1+1
|
||||
adc #>screen+$29
|
||||
sta _17+1
|
||||
lda #3
|
||||
!:
|
||||
sta screen+$29
|
||||
lda #<colors+$29
|
||||
sta (_17),y
|
||||
clc
|
||||
adc z_1
|
||||
sta !++1
|
||||
lda #>colors+$29
|
||||
adc z_1+1
|
||||
sta !++2
|
||||
lda _18
|
||||
adc #<colors+$29
|
||||
sta _18
|
||||
lda _18+1
|
||||
adc #>colors+$29
|
||||
sta _18+1
|
||||
lda #YELLOW
|
||||
!:
|
||||
sta colors+$29
|
||||
sta (_18),y
|
||||
rts
|
||||
}
|
||||
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
|
||||
|
@ -47,91 +47,99 @@ draw_block::@1: scope:[draw_block] from draw_block
|
||||
[26] (word) draw_block::z#0 ← (word) mul8u::return#2
|
||||
[27] (word) draw_block::z#1 ← (word) draw_block::z#0 + (word) draw_block::x1#0
|
||||
[28] (byte) draw_block::drawtile#0 ← *((const byte*) tileset#0 + (byte) draw_block::tileno#1)
|
||||
[29] *((const byte*) screen#0 + (word) draw_block::z#1) ← (byte) draw_block::drawtile#0
|
||||
[30] *((const byte*) colors#0 + (word) draw_block::z#1) ← (const byte) YELLOW#0
|
||||
[31] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (word) draw_block::z#1) ← (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[32] *((const byte*) colors#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (word) draw_block::z#1) ← (const byte) YELLOW#0
|
||||
[33] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) draw_block::z#1) ← (byte/signed byte/word/signed word/dword/signed dword) 2
|
||||
[34] *((const byte*) colors#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) draw_block::z#1) ← (const byte) YELLOW#0
|
||||
[35] *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $29 + (word) draw_block::z#1) ← (byte/signed byte/word/signed word/dword/signed dword) 3
|
||||
[36] *((const byte*) colors#0+(byte/signed byte/word/signed word/dword/signed dword) $29 + (word) draw_block::z#1) ← (const byte) YELLOW#0
|
||||
[29] (byte*) draw_block::$11 ← (const byte*) screen#0 + (word) draw_block::z#1
|
||||
[30] *((byte*) draw_block::$11) ← (byte) draw_block::drawtile#0
|
||||
[31] (byte*) draw_block::$12 ← (const byte*) colors#0 + (word) draw_block::z#1
|
||||
[32] *((byte*) draw_block::$12) ← (const byte) YELLOW#0
|
||||
[33] (byte*) draw_block::$13 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (word) draw_block::z#1
|
||||
[34] *((byte*) draw_block::$13) ← (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[35] (byte*) draw_block::$14 ← (const byte*) colors#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (word) draw_block::z#1
|
||||
[36] *((byte*) draw_block::$14) ← (const byte) YELLOW#0
|
||||
[37] (byte*) draw_block::$15 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) draw_block::z#1
|
||||
[38] *((byte*) draw_block::$15) ← (byte/signed byte/word/signed word/dword/signed dword) 2
|
||||
[39] (byte*) draw_block::$16 ← (const byte*) colors#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) draw_block::z#1
|
||||
[40] *((byte*) draw_block::$16) ← (const byte) YELLOW#0
|
||||
[41] (byte*) draw_block::$17 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $29 + (word) draw_block::z#1
|
||||
[42] *((byte*) draw_block::$17) ← (byte/signed byte/word/signed word/dword/signed dword) 3
|
||||
[43] (byte*) draw_block::$18 ← (const byte*) colors#0+(byte/signed byte/word/signed word/dword/signed dword) $29 + (word) draw_block::z#1
|
||||
[44] *((byte*) draw_block::$18) ← (const byte) YELLOW#0
|
||||
to:draw_block::@return
|
||||
draw_block::@return: scope:[draw_block] from draw_block::@1
|
||||
[37] return
|
||||
[45] return
|
||||
to:@return
|
||||
mul8u: scope:[mul8u] from draw_block
|
||||
[38] phi()
|
||||
[46] phi()
|
||||
to:mul8u::@1
|
||||
mul8u::@1: scope:[mul8u] from mul8u mul8u::@3
|
||||
[39] (word) mul8u::mb#2 ← phi( mul8u/((word))(const byte) mul8u::b#0 mul8u::@3/(word) mul8u::mb#1 )
|
||||
[39] (word) mul8u::res#2 ← phi( mul8u/(byte/signed byte/word/signed word/dword/signed dword) 0 mul8u::@3/(word) mul8u::res#6 )
|
||||
[39] (byte) mul8u::a#2 ← phi( mul8u/(byte) mul8u::a#1 mul8u::@3/(byte) mul8u::a#0 )
|
||||
[40] if((byte) mul8u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@2
|
||||
[47] (word) mul8u::mb#2 ← phi( mul8u/((word))(const byte) mul8u::b#0 mul8u::@3/(word) mul8u::mb#1 )
|
||||
[47] (word) mul8u::res#2 ← phi( mul8u/(byte/signed byte/word/signed word/dword/signed dword) 0 mul8u::@3/(word) mul8u::res#6 )
|
||||
[47] (byte) mul8u::a#2 ← phi( mul8u/(byte) mul8u::a#1 mul8u::@3/(byte) mul8u::a#0 )
|
||||
[48] if((byte) mul8u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@2
|
||||
to:mul8u::@return
|
||||
mul8u::@return: scope:[mul8u] from mul8u::@1
|
||||
[41] return
|
||||
[49] return
|
||||
to:@return
|
||||
mul8u::@2: scope:[mul8u] from mul8u::@1
|
||||
[42] (byte~) mul8u::$1 ← (byte) mul8u::a#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[43] if((byte~) mul8u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@3
|
||||
[50] (byte~) mul8u::$1 ← (byte) mul8u::a#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[51] if((byte~) mul8u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@3
|
||||
to:mul8u::@4
|
||||
mul8u::@4: scope:[mul8u] from mul8u::@2
|
||||
[44] (word) mul8u::res#1 ← (word) mul8u::res#2 + (word) mul8u::mb#2
|
||||
[52] (word) mul8u::res#1 ← (word) mul8u::res#2 + (word) mul8u::mb#2
|
||||
to:mul8u::@3
|
||||
mul8u::@3: scope:[mul8u] from mul8u::@2 mul8u::@4
|
||||
[45] (word) mul8u::res#6 ← phi( mul8u::@2/(word) mul8u::res#2 mul8u::@4/(word) mul8u::res#1 )
|
||||
[46] (byte) mul8u::a#0 ← (byte) mul8u::a#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[47] (word) mul8u::mb#1 ← (word) mul8u::mb#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[53] (word) mul8u::res#6 ← phi( mul8u::@2/(word) mul8u::res#2 mul8u::@4/(word) mul8u::res#1 )
|
||||
[54] (byte) mul8u::a#0 ← (byte) mul8u::a#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[55] (word) mul8u::mb#1 ← (word) mul8u::mb#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
to:mul8u::@1
|
||||
init: scope:[init] from main
|
||||
[48] phi()
|
||||
[49] call init_sprites
|
||||
[56] phi()
|
||||
[57] call init_sprites
|
||||
to:init::@2
|
||||
init::@2: scope:[init] from init
|
||||
[50] phi()
|
||||
[51] call fill
|
||||
[58] phi()
|
||||
[59] call fill
|
||||
to:init::@3
|
||||
init::@3: scope:[init] from init::@2
|
||||
[52] phi()
|
||||
[53] call fill
|
||||
[60] phi()
|
||||
[61] call fill
|
||||
to:init::toD0181
|
||||
init::toD0181: scope:[init] from init::@3
|
||||
[54] phi()
|
||||
[62] phi()
|
||||
to:init::@1
|
||||
init::@1: scope:[init] from init::toD0181
|
||||
[55] *((const byte*) D018#0) ← (const byte) init::toD0181_return#0
|
||||
[63] *((const byte*) D018#0) ← (const byte) init::toD0181_return#0
|
||||
asm { lda#$5b sta$d011 }
|
||||
[57] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0
|
||||
[58] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0
|
||||
[59] *((const byte*) BGCOL2#0) ← (const byte) RED#0
|
||||
[60] *((const byte*) BGCOL3#0) ← (const byte) BLUE#0
|
||||
[61] *((const byte*) BGCOL4#0) ← (const byte) GREEN#0
|
||||
[65] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0
|
||||
[66] *((const byte*) BGCOL1#0) ← (const byte) BLACK#0
|
||||
[67] *((const byte*) BGCOL2#0) ← (const byte) RED#0
|
||||
[68] *((const byte*) BGCOL3#0) ← (const byte) BLUE#0
|
||||
[69] *((const byte*) BGCOL4#0) ← (const byte) GREEN#0
|
||||
to:init::@return
|
||||
init::@return: scope:[init] from init::@1
|
||||
[62] return
|
||||
[70] return
|
||||
to:@return
|
||||
fill: scope:[fill] from init::@2 init::@3
|
||||
[63] (byte) fill::val#3 ← phi( init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@3/(const byte) BLACK#0 )
|
||||
[63] (byte*) fill::addr#0 ← phi( init::@2/(const byte*) screen#0 init::@3/(const byte*) colors#0 )
|
||||
[64] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (word/signed word/dword/signed dword) $3e8
|
||||
[71] (byte) fill::val#3 ← phi( init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@3/(const byte) BLACK#0 )
|
||||
[71] (byte*) fill::addr#0 ← phi( init::@2/(const byte*) screen#0 init::@3/(const byte*) colors#0 )
|
||||
[72] (byte*) fill::end#0 ← (byte*) fill::addr#0 + (word/signed word/dword/signed dword) $3e8
|
||||
to:fill::@1
|
||||
fill::@1: scope:[fill] from fill fill::@1
|
||||
[65] (byte*) fill::addr#2 ← phi( fill/(byte*) fill::addr#0 fill::@1/(byte*) fill::addr#1 )
|
||||
[66] *((byte*) fill::addr#2) ← (byte) fill::val#3
|
||||
[67] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2
|
||||
[68] if((byte*) fill::addr#1!=(byte*) fill::end#0) goto fill::@1
|
||||
[73] (byte*) fill::addr#2 ← phi( fill/(byte*) fill::addr#0 fill::@1/(byte*) fill::addr#1 )
|
||||
[74] *((byte*) fill::addr#2) ← (byte) fill::val#3
|
||||
[75] (byte*) fill::addr#1 ← ++ (byte*) fill::addr#2
|
||||
[76] if((byte*) fill::addr#1!=(byte*) fill::end#0) goto fill::@1
|
||||
to:fill::@return
|
||||
fill::@return: scope:[fill] from fill::@1
|
||||
[69] return
|
||||
[77] return
|
||||
to:@return
|
||||
init_sprites: scope:[init_sprites] from init
|
||||
[70] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[71] *((const byte*) SPRITES_EXPAND_X#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
[72] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
[73] *((const byte*) SPRITES_XMSB#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
[74] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0
|
||||
[75] *((const byte*) SPRITES_MC#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
[78] *((const byte*) SPRITES_ENABLE#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[79] *((const byte*) SPRITES_EXPAND_X#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
[80] *((const byte*) SPRITES_EXPAND_Y#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
[81] *((const byte*) SPRITES_XMSB#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
[82] *((const byte*) SPRITES_COLS#0) ← (const byte) WHITE#0
|
||||
[83] *((const byte*) SPRITES_MC#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
to:init_sprites::@return
|
||||
init_sprites::@return: scope:[init_sprites] from init_sprites
|
||||
[76] return
|
||||
[84] return
|
||||
to:@return
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -43,11 +43,19 @@
|
||||
(const byte*) colors#0 colors = ((byte*))(word/dword/signed dword) $d800
|
||||
(void()) draw_block((byte) draw_block::tileno , (byte) draw_block::x , (byte) draw_block::y , (byte) draw_block::color)
|
||||
(byte~) draw_block::$1 reg byte a 4.0
|
||||
(byte*) draw_block::$11 $11 zp ZP_WORD:4 4.0
|
||||
(byte*) draw_block::$12 $12 zp ZP_WORD:4 4.0
|
||||
(byte*) draw_block::$13 $13 zp ZP_WORD:4 4.0
|
||||
(byte*) draw_block::$14 $14 zp ZP_WORD:4 4.0
|
||||
(byte*) draw_block::$15 $15 zp ZP_WORD:4 4.0
|
||||
(byte*) draw_block::$16 $16 zp ZP_WORD:4 4.0
|
||||
(byte*) draw_block::$17 $17 zp ZP_WORD:4 4.0
|
||||
(byte*) draw_block::$18 $18 zp ZP_WORD:9 4.0
|
||||
(label) draw_block::@1
|
||||
(label) draw_block::@return
|
||||
(byte) draw_block::color
|
||||
(byte) draw_block::drawtile
|
||||
(byte) draw_block::drawtile#0 reg byte a 4.0
|
||||
(byte) draw_block::drawtile#0 reg byte x 2.0
|
||||
(byte) draw_block::tileno
|
||||
(byte) draw_block::tileno#0 reg byte a 34.33333333333333
|
||||
(byte) draw_block::tileno#1 tileno zp ZP_BYTE:8 0.4444444444444444
|
||||
@ -60,7 +68,7 @@
|
||||
(byte) draw_block::y#1 reg byte a 4.0
|
||||
(word) draw_block::z
|
||||
(word) draw_block::z#0 z zp ZP_WORD:4 4.0
|
||||
(word) draw_block::z#1 z#1 zp ZP_WORD:9 2.0000000000000004
|
||||
(word) draw_block::z#1 z#1 zp ZP_WORD:9 1.125
|
||||
(void()) fill((byte*) fill::start , (word) fill::size , (byte) fill::val)
|
||||
(label) fill::@1
|
||||
(label) fill::@return
|
||||
@ -143,7 +151,7 @@
|
||||
zp ZP_BYTE:2 [ main::x#4 main::x#1 ]
|
||||
zp ZP_BYTE:3 [ main::y#2 main::y#1 ]
|
||||
reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
|
||||
zp ZP_WORD:4 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 draw_block::z#0 fill::addr#2 fill::addr#0 fill::addr#1 ]
|
||||
zp ZP_WORD:4 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 draw_block::z#0 fill::addr#2 fill::addr#0 fill::addr#1 draw_block::$11 draw_block::$12 draw_block::$13 draw_block::$14 draw_block::$15 draw_block::$16 draw_block::$17 ]
|
||||
zp ZP_WORD:6 [ mul8u::mb#2 mul8u::mb#1 fill::end#0 ]
|
||||
reg byte x [ fill::val#3 ]
|
||||
reg byte a [ main::z#0 ]
|
||||
@ -153,7 +161,7 @@ reg byte y [ draw_block::x#0 ]
|
||||
reg byte x [ draw_block::y#0 ]
|
||||
zp ZP_BYTE:8 [ draw_block::tileno#1 ]
|
||||
reg byte a [ draw_block::$1 ]
|
||||
zp ZP_WORD:9 [ draw_block::x1#0 draw_block::z#1 ]
|
||||
zp ZP_WORD:9 [ draw_block::x1#0 draw_block::z#1 draw_block::$18 ]
|
||||
reg byte a [ draw_block::y#1 ]
|
||||
reg byte a [ draw_block::drawtile#0 ]
|
||||
reg byte x [ draw_block::drawtile#0 ]
|
||||
reg byte a [ mul8u::$1 ]
|
||||
|
@ -14,6 +14,8 @@ scrollup3: {
|
||||
.label l2_1 = 4
|
||||
.label line = 2
|
||||
.label l2_2 = 4
|
||||
.label _4 = 7
|
||||
.label _5 = 9
|
||||
.label l2_4 = 4
|
||||
lda #0
|
||||
sta l2
|
||||
@ -25,24 +27,23 @@ scrollup3: {
|
||||
sta l2_4+1
|
||||
ldx #0
|
||||
b2:
|
||||
lda #<screen
|
||||
lda l2_2
|
||||
clc
|
||||
adc l2_2
|
||||
sta !a1++1
|
||||
lda #>screen
|
||||
adc l2_2+1
|
||||
sta !a1++2
|
||||
lda #<screen+$28
|
||||
adc #<screen+$28
|
||||
sta _4
|
||||
lda l2_2+1
|
||||
adc #>screen+$28
|
||||
sta _4+1
|
||||
lda l2_2
|
||||
clc
|
||||
adc l2_2
|
||||
sta !a2++1
|
||||
lda #>screen+$28
|
||||
adc l2_2+1
|
||||
sta !a2++2
|
||||
!a2:
|
||||
lda screen+$28
|
||||
!a1:
|
||||
sta screen
|
||||
adc #<screen
|
||||
sta _5
|
||||
lda l2_2+1
|
||||
adc #>screen
|
||||
sta _5+1
|
||||
ldy #0
|
||||
lda (_4),y
|
||||
sta (_5),y
|
||||
inc l2_1
|
||||
bne !+
|
||||
inc l2_1+1
|
||||
@ -108,6 +109,8 @@ scrollup1: {
|
||||
.label _0 = 4
|
||||
.label _2 = 7
|
||||
.label line = 2
|
||||
.label _6 = 7
|
||||
.label _7 = 4
|
||||
lda #0
|
||||
sta line
|
||||
sta line+1
|
||||
@ -128,24 +131,23 @@ scrollup1: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _2+1
|
||||
lda #<screen
|
||||
clc
|
||||
adc _0
|
||||
sta !a1++1
|
||||
lda #>screen
|
||||
adc _0+1
|
||||
sta !a1++2
|
||||
lda #<screen+$28
|
||||
lda _6
|
||||
adc #<screen+$28
|
||||
sta _6
|
||||
lda _6+1
|
||||
adc #>screen+$28
|
||||
sta _6+1
|
||||
clc
|
||||
adc _2
|
||||
sta !a2++1
|
||||
lda #>screen+$28
|
||||
adc _2+1
|
||||
sta !a2++2
|
||||
!a2:
|
||||
lda screen+$28
|
||||
!a1:
|
||||
sta screen
|
||||
lda _7
|
||||
adc #<screen
|
||||
sta _7
|
||||
lda _7+1
|
||||
adc #>screen
|
||||
sta _7+1
|
||||
ldy #0
|
||||
lda (_6),y
|
||||
sta (_7),y
|
||||
inx
|
||||
cpx #$28
|
||||
bcc b2
|
||||
|
@ -32,61 +32,65 @@ scrollup3::@1: scope:[scrollup3] from scrollup3 scrollup3::@3
|
||||
scrollup3::@2: scope:[scrollup3] from scrollup3::@1 scrollup3::@2
|
||||
[14] (byte) scrollup3::c#2 ← phi( scrollup3::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup3::@2/(byte) scrollup3::c#1 )
|
||||
[14] (word) scrollup3::l2#2 ← phi( scrollup3::@1/(word~) scrollup3::l2#4 scrollup3::@2/(word) scrollup3::l2#1 )
|
||||
[15] *((const byte*) screen#0 + (word) scrollup3::l2#2) ← *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2)
|
||||
[16] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
|
||||
[17] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2
|
||||
[18] if((byte) scrollup3::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup3::@2
|
||||
[15] (byte*) scrollup3::$4 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word) scrollup3::l2#2
|
||||
[16] (byte*) scrollup3::$5 ← (const byte*) screen#0 + (word) scrollup3::l2#2
|
||||
[17] *((byte*) scrollup3::$5) ← *((byte*) scrollup3::$4)
|
||||
[18] (word) scrollup3::l2#1 ← ++ (word) scrollup3::l2#2
|
||||
[19] (byte) scrollup3::c#1 ← ++ (byte) scrollup3::c#2
|
||||
[20] if((byte) scrollup3::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup3::@2
|
||||
to:scrollup3::@3
|
||||
scrollup3::@3: scope:[scrollup3] from scrollup3::@2
|
||||
[19] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[20] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1
|
||||
[21] (word) scrollup3::line#1 ← (word) scrollup3::l2#0 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[22] if((word) scrollup3::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup3::@1
|
||||
to:scrollup3::@return
|
||||
scrollup3::@return: scope:[scrollup3] from scrollup3::@3
|
||||
[21] return
|
||||
[23] return
|
||||
to:@return
|
||||
scrollup2: scope:[scrollup2] from main::@1
|
||||
[22] phi()
|
||||
[24] phi()
|
||||
to:scrollup2::@1
|
||||
scrollup2::@1: scope:[scrollup2] from scrollup2 scrollup2::@3
|
||||
[23] (byte) scrollup2::l#4 ← phi( scrollup2/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup2::@3/(byte) scrollup2::l#1 )
|
||||
[23] (byte*) scrollup2::line1#3 ← phi( scrollup2/(const byte*) screen#0 scrollup2::@3/(byte*) scrollup2::line1#1 )
|
||||
[23] (byte*) scrollup2::line2#3 ← phi( scrollup2/(const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 scrollup2::@3/(byte*) scrollup2::line2#1 )
|
||||
[25] (byte) scrollup2::l#4 ← phi( scrollup2/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup2::@3/(byte) scrollup2::l#1 )
|
||||
[25] (byte*) scrollup2::line1#3 ← phi( scrollup2/(const byte*) screen#0 scrollup2::@3/(byte*) scrollup2::line1#1 )
|
||||
[25] (byte*) scrollup2::line2#3 ← phi( scrollup2/(const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 scrollup2::@3/(byte*) scrollup2::line2#1 )
|
||||
to:scrollup2::@2
|
||||
scrollup2::@2: scope:[scrollup2] from scrollup2::@1 scrollup2::@2
|
||||
[24] (byte) scrollup2::c#2 ← phi( scrollup2::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup2::@2/(byte) scrollup2::c#1 )
|
||||
[24] (byte*) scrollup2::line1#2 ← phi( scrollup2::@1/(byte*) scrollup2::line1#3 scrollup2::@2/(byte*) scrollup2::line1#1 )
|
||||
[24] (byte*) scrollup2::line2#2 ← phi( scrollup2::@1/(byte*) scrollup2::line2#3 scrollup2::@2/(byte*) scrollup2::line2#1 )
|
||||
[25] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2)
|
||||
[26] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2
|
||||
[27] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2
|
||||
[28] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2
|
||||
[29] if((byte) scrollup2::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup2::@2
|
||||
[26] (byte) scrollup2::c#2 ← phi( scrollup2::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup2::@2/(byte) scrollup2::c#1 )
|
||||
[26] (byte*) scrollup2::line1#2 ← phi( scrollup2::@1/(byte*) scrollup2::line1#3 scrollup2::@2/(byte*) scrollup2::line1#1 )
|
||||
[26] (byte*) scrollup2::line2#2 ← phi( scrollup2::@1/(byte*) scrollup2::line2#3 scrollup2::@2/(byte*) scrollup2::line2#1 )
|
||||
[27] *((byte*) scrollup2::line1#2) ← *((byte*) scrollup2::line2#2)
|
||||
[28] (byte*) scrollup2::line1#1 ← ++ (byte*) scrollup2::line1#2
|
||||
[29] (byte*) scrollup2::line2#1 ← ++ (byte*) scrollup2::line2#2
|
||||
[30] (byte) scrollup2::c#1 ← ++ (byte) scrollup2::c#2
|
||||
[31] if((byte) scrollup2::c#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup2::@2
|
||||
to:scrollup2::@3
|
||||
scrollup2::@3: scope:[scrollup2] from scrollup2::@2
|
||||
[30] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4
|
||||
[31] if((byte) scrollup2::l#1!=(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup2::@1
|
||||
[32] (byte) scrollup2::l#1 ← ++ (byte) scrollup2::l#4
|
||||
[33] if((byte) scrollup2::l#1!=(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup2::@1
|
||||
to:scrollup2::@return
|
||||
scrollup2::@return: scope:[scrollup2] from scrollup2::@3
|
||||
[32] return
|
||||
[34] return
|
||||
to:@return
|
||||
scrollup1: scope:[scrollup1] from main
|
||||
[33] phi()
|
||||
[35] phi()
|
||||
to:scrollup1::@1
|
||||
scrollup1::@1: scope:[scrollup1] from scrollup1 scrollup1::@3
|
||||
[34] (word) scrollup1::line#4 ← phi( scrollup1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup1::@3/(word) scrollup1::line#1 )
|
||||
[36] (word) scrollup1::line#4 ← phi( scrollup1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup1::@3/(word) scrollup1::line#1 )
|
||||
to:scrollup1::@2
|
||||
scrollup1::@2: scope:[scrollup1] from scrollup1::@1 scrollup1::@2
|
||||
[35] (byte) scrollup1::c#2 ← phi( scrollup1::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup1::@2/(byte) scrollup1::c#1 )
|
||||
[36] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
|
||||
[37] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
|
||||
[38] *((const byte*) screen#0 + (word~) scrollup1::$0) ← *((const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2)
|
||||
[39] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2
|
||||
[40] if((byte) scrollup1::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup1::@2
|
||||
[37] (byte) scrollup1::c#2 ← phi( scrollup1::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 scrollup1::@2/(byte) scrollup1::c#1 )
|
||||
[38] (word~) scrollup1::$0 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
|
||||
[39] (word~) scrollup1::$2 ← (word) scrollup1::line#4 + (byte) scrollup1::c#2
|
||||
[40] (byte*) scrollup1::$6 ← (const byte*) screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) scrollup1::$2
|
||||
[41] (byte*) scrollup1::$7 ← (const byte*) screen#0 + (word~) scrollup1::$0
|
||||
[42] *((byte*) scrollup1::$7) ← *((byte*) scrollup1::$6)
|
||||
[43] (byte) scrollup1::c#1 ← ++ (byte) scrollup1::c#2
|
||||
[44] if((byte) scrollup1::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto scrollup1::@2
|
||||
to:scrollup1::@3
|
||||
scrollup1::@3: scope:[scrollup1] from scrollup1::@2
|
||||
[41] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[42] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1
|
||||
[45] (word) scrollup1::line#1 ← (word) scrollup1::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[46] if((word) scrollup1::line#1<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto scrollup1::@1
|
||||
to:scrollup1::@return
|
||||
scrollup1::@return: scope:[scrollup1] from scrollup1::@3
|
||||
[43] return
|
||||
[47] return
|
||||
to:@return
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,18 +8,20 @@
|
||||
(byte*) screen
|
||||
(const byte*) screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
|
||||
(void()) scrollup1()
|
||||
(word~) scrollup1::$0 $0 zp ZP_WORD:4 101.0
|
||||
(word~) scrollup1::$0 $0 zp ZP_WORD:4 67.33333333333333
|
||||
(word~) scrollup1::$2 $2 zp ZP_WORD:7 202.0
|
||||
(byte*) scrollup1::$6 $6 zp ZP_WORD:7 101.0
|
||||
(byte*) scrollup1::$7 $7 zp ZP_WORD:4 202.0
|
||||
(label) scrollup1::@1
|
||||
(label) scrollup1::@2
|
||||
(label) scrollup1::@3
|
||||
(label) scrollup1::@return
|
||||
(byte) scrollup1::c
|
||||
(byte) scrollup1::c#1 reg byte x 151.5
|
||||
(byte) scrollup1::c#2 reg byte x 101.0
|
||||
(byte) scrollup1::c#2 reg byte x 67.33333333333333
|
||||
(word) scrollup1::line
|
||||
(word) scrollup1::line#1 line zp ZP_WORD:2 16.5
|
||||
(word) scrollup1::line#4 line zp ZP_WORD:2 32.0
|
||||
(word) scrollup1::line#4 line zp ZP_WORD:2 24.888888888888886
|
||||
(void()) scrollup2()
|
||||
(label) scrollup2::@1
|
||||
(label) scrollup2::@2
|
||||
@ -40,25 +42,28 @@
|
||||
(byte*) scrollup2::line2#2 line2 zp ZP_WORD:2 104.66666666666666
|
||||
(byte*) scrollup2::line2#3 line2 zp ZP_WORD:2 22.0
|
||||
(void()) scrollup3()
|
||||
(byte*) scrollup3::$4 $4 zp ZP_WORD:7 101.0
|
||||
(byte*) scrollup3::$5 $5 zp ZP_WORD:9 202.0
|
||||
(label) scrollup3::@1
|
||||
(label) scrollup3::@2
|
||||
(label) scrollup3::@3
|
||||
(label) scrollup3::@return
|
||||
(byte) scrollup3::c
|
||||
(byte) scrollup3::c#1 reg byte x 151.5
|
||||
(byte) scrollup3::c#2 reg byte x 67.33333333333333
|
||||
(byte) scrollup3::c#2 reg byte x 40.4
|
||||
(word) scrollup3::l2
|
||||
(word) scrollup3::l2#0 l2 zp ZP_WORD:2 4.714285714285714
|
||||
(word) scrollup3::l2#0 l2 zp ZP_WORD:2 3.666666666666667
|
||||
(word) scrollup3::l2#1 l2#1 zp ZP_WORD:4 67.33333333333333
|
||||
(word) scrollup3::l2#2 l2#2 zp ZP_WORD:4 207.5
|
||||
(word) scrollup3::l2#2 l2#2 zp ZP_WORD:4 103.75
|
||||
(word~) scrollup3::l2#4 l2#4 zp ZP_WORD:4 22.0
|
||||
(word) scrollup3::line
|
||||
(word) scrollup3::line#1 line zp ZP_WORD:2 16.5
|
||||
|
||||
zp ZP_WORD:2 [ scrollup3::l2#0 scrollup3::line#1 scrollup2::line2#2 scrollup2::line2#3 scrollup2::line2#1 scrollup1::line#4 scrollup1::line#1 ]
|
||||
zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 scrollup1::$0 ]
|
||||
zp ZP_WORD:4 [ scrollup3::l2#2 scrollup3::l2#4 scrollup3::l2#1 scrollup2::line1#2 scrollup2::line1#3 scrollup2::line1#1 scrollup1::$0 scrollup1::$7 ]
|
||||
reg byte x [ scrollup3::c#2 scrollup3::c#1 ]
|
||||
zp ZP_BYTE:6 [ scrollup2::l#4 scrollup2::l#1 ]
|
||||
reg byte x [ scrollup2::c#2 scrollup2::c#1 ]
|
||||
reg byte x [ scrollup1::c#2 scrollup1::c#1 ]
|
||||
zp ZP_WORD:7 [ scrollup1::$2 ]
|
||||
zp ZP_WORD:7 [ scrollup3::$4 scrollup1::$2 scrollup1::$6 ]
|
||||
zp ZP_WORD:9 [ scrollup3::$5 ]
|
||||
|
@ -7,6 +7,9 @@ main: {
|
||||
.label _2 = 6
|
||||
.label _6 = 4
|
||||
.label line = 2
|
||||
.label _8 = 6
|
||||
.label _9 = 4
|
||||
.label _10 = 4
|
||||
lda #0
|
||||
sta line
|
||||
sta line+1
|
||||
@ -27,24 +30,23 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _2+1
|
||||
lda #<screen
|
||||
clc
|
||||
adc _0
|
||||
sta !a1++1
|
||||
lda #>screen
|
||||
adc _0+1
|
||||
sta !a1++2
|
||||
lda #<screen+$28
|
||||
lda _8
|
||||
adc #<screen+$28
|
||||
sta _8
|
||||
lda _8+1
|
||||
adc #>screen+$28
|
||||
sta _8+1
|
||||
clc
|
||||
adc _2
|
||||
sta !a2++1
|
||||
lda #>screen+$28
|
||||
adc _2+1
|
||||
sta !a2++2
|
||||
!a2:
|
||||
lda screen+$28
|
||||
!a1:
|
||||
sta screen
|
||||
lda _9
|
||||
adc #<screen
|
||||
sta _9
|
||||
lda _9+1
|
||||
adc #>screen
|
||||
sta _9+1
|
||||
ldy #0
|
||||
lda (_8),y
|
||||
sta (_9),y
|
||||
inx
|
||||
cpx #$28
|
||||
bcc b2
|
||||
@ -73,16 +75,16 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _6+1
|
||||
lda #<screen
|
||||
clc
|
||||
adc _6
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc _6+1
|
||||
sta !++2
|
||||
lda _10
|
||||
adc #<screen
|
||||
sta _10
|
||||
lda _10+1
|
||||
adc #>screen
|
||||
sta _10+1
|
||||
lda #' '
|
||||
!:
|
||||
sta screen
|
||||
ldy #0
|
||||
sta (_10),y
|
||||
inx
|
||||
cpx #$28
|
||||
bcc b4
|
||||
|
@ -17,21 +17,24 @@ main::@2: scope:[main] from main::@1 main::@2
|
||||
[6] (byte) main::c#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::c#1 )
|
||||
[7] (word~) main::$0 ← (word) main::line#6 + (byte) main::c#2
|
||||
[8] (word~) main::$2 ← (word) main::line#6 + (byte) main::c#2
|
||||
[9] *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2)
|
||||
[10] (byte) main::c#1 ← ++ (byte) main::c#2
|
||||
[11] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2
|
||||
[9] (byte*) main::$8 ← (const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2
|
||||
[10] (byte*) main::$9 ← (const byte*) main::screen#0 + (word~) main::$0
|
||||
[11] *((byte*) main::$9) ← *((byte*) main::$8)
|
||||
[12] (byte) main::c#1 ← ++ (byte) main::c#2
|
||||
[13] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@2
|
||||
[12] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[13] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1
|
||||
[14] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[15] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@4
|
||||
[14] (byte) main::c1#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::c1#1 )
|
||||
[15] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2
|
||||
[16] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' '
|
||||
[17] (byte) main::c1#1 ← ++ (byte) main::c1#2
|
||||
[18] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4
|
||||
[16] (byte) main::c1#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::c1#1 )
|
||||
[17] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2
|
||||
[18] (byte*) main::$10 ← (const byte*) main::screen#0 + (word~) main::$6
|
||||
[19] *((byte*) main::$10) ← (byte) ' '
|
||||
[20] (byte) main::c1#1 ← ++ (byte) main::c1#2
|
||||
[21] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@4
|
||||
[19] return
|
||||
[22] return
|
||||
to:@return
|
||||
|
@ -120,6 +120,10 @@ Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Inferred type updated to word in [4] (word/signed dword/dword~) main::$2 ← (word~) main::$1
|
||||
Eliminating unused constant (const word) main::line#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
De-inlining pointer[w] to *(pointer+w) *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2)
|
||||
De-inlining pointer[w] to *(pointer+w) *((const byte*) main::screen#0 + (word~) main::$0) ← *((byte*) main::$8)
|
||||
De-inlining pointer[w] to *(pointer+w) *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' '
|
||||
Successful SSA optimization Pass2DeInlineWordDerefIdx
|
||||
Culled Empty Block (label) main::@4
|
||||
Successful SSA optimization Pass2CullEmptyBlocks
|
||||
Alias (word~) main::$2 = (word~) main::$1
|
||||
@ -143,9 +147,9 @@ CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 3 initial phi equivalence classes
|
||||
Coalesced [20] main::c1#3 ← main::c1#1
|
||||
Coalesced [21] main::line#8 ← main::line#2
|
||||
Coalesced [22] main::c#3 ← main::c#1
|
||||
Coalesced [23] main::c1#3 ← main::c1#1
|
||||
Coalesced [24] main::line#8 ← main::line#2
|
||||
Coalesced [25] main::c#3 ← main::c#1
|
||||
Coalesced down to 3 phi equivalence classes
|
||||
Culled Empty Block (label) main::@9
|
||||
Culled Empty Block (label) main::@7
|
||||
@ -176,40 +180,46 @@ main::@2: scope:[main] from main::@1 main::@2
|
||||
[6] (byte) main::c#2 ← phi( main::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::c#1 )
|
||||
[7] (word~) main::$0 ← (word) main::line#6 + (byte) main::c#2
|
||||
[8] (word~) main::$2 ← (word) main::line#6 + (byte) main::c#2
|
||||
[9] *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2)
|
||||
[10] (byte) main::c#1 ← ++ (byte) main::c#2
|
||||
[11] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2
|
||||
[9] (byte*) main::$8 ← (const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2
|
||||
[10] (byte*) main::$9 ← (const byte*) main::screen#0 + (word~) main::$0
|
||||
[11] *((byte*) main::$9) ← *((byte*) main::$8)
|
||||
[12] (byte) main::c#1 ← ++ (byte) main::c#2
|
||||
[13] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2
|
||||
to:main::@3
|
||||
main::@3: scope:[main] from main::@2
|
||||
[12] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[13] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1
|
||||
[14] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28
|
||||
[15] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@3 main::@4
|
||||
[14] (byte) main::c1#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::c1#1 )
|
||||
[15] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2
|
||||
[16] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' '
|
||||
[17] (byte) main::c1#1 ← ++ (byte) main::c1#2
|
||||
[18] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4
|
||||
[16] (byte) main::c1#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::c1#1 )
|
||||
[17] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2
|
||||
[18] (byte*) main::$10 ← (const byte*) main::screen#0 + (word~) main::$6
|
||||
[19] *((byte*) main::$10) ← (byte) ' '
|
||||
[20] (byte) main::c1#1 ← ++ (byte) main::c1#2
|
||||
[21] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@4
|
||||
[19] return
|
||||
[22] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(void()) main()
|
||||
(word~) main::$0 101.0
|
||||
(word~) main::$0 67.33333333333333
|
||||
(byte*) main::$10 22.0
|
||||
(word~) main::$2 202.0
|
||||
(word~) main::$6 22.0
|
||||
(byte*) main::$8 101.0
|
||||
(byte*) main::$9 202.0
|
||||
(byte) main::c
|
||||
(byte) main::c#1 151.5
|
||||
(byte) main::c#2 101.0
|
||||
(byte) main::c#2 67.33333333333333
|
||||
(byte) main::c1
|
||||
(byte) main::c1#1 16.5
|
||||
(byte) main::c1#2 11.0
|
||||
(byte) main::c1#2 8.25
|
||||
(word) main::line
|
||||
(word) main::line#2 6.285714285714286
|
||||
(word) main::line#6 32.0
|
||||
(word) main::line#2 5.5
|
||||
(word) main::line#6 24.888888888888886
|
||||
(byte*) main::screen
|
||||
|
||||
Initial phi equivalence classes
|
||||
@ -218,20 +228,29 @@ Initial phi equivalence classes
|
||||
[ main::c1#2 main::c1#1 ]
|
||||
Added variable main::$0 to zero page equivalence class [ main::$0 ]
|
||||
Added variable main::$2 to zero page equivalence class [ main::$2 ]
|
||||
Added variable main::$8 to zero page equivalence class [ main::$8 ]
|
||||
Added variable main::$9 to zero page equivalence class [ main::$9 ]
|
||||
Added variable main::$6 to zero page equivalence class [ main::$6 ]
|
||||
Added variable main::$10 to zero page equivalence class [ main::$10 ]
|
||||
Complete equivalence classes
|
||||
[ main::line#6 main::line#2 ]
|
||||
[ main::c#2 main::c#1 ]
|
||||
[ main::c1#2 main::c1#1 ]
|
||||
[ main::$0 ]
|
||||
[ main::$2 ]
|
||||
[ main::$8 ]
|
||||
[ main::$9 ]
|
||||
[ main::$6 ]
|
||||
[ main::$10 ]
|
||||
Allocated zp ZP_WORD:2 [ main::line#6 main::line#2 ]
|
||||
Allocated zp ZP_BYTE:4 [ main::c#2 main::c#1 ]
|
||||
Allocated zp ZP_BYTE:5 [ main::c1#2 main::c1#1 ]
|
||||
Allocated zp ZP_WORD:6 [ main::$0 ]
|
||||
Allocated zp ZP_WORD:8 [ main::$2 ]
|
||||
Allocated zp ZP_WORD:10 [ main::$6 ]
|
||||
Allocated zp ZP_WORD:10 [ main::$8 ]
|
||||
Allocated zp ZP_WORD:12 [ main::$9 ]
|
||||
Allocated zp ZP_WORD:14 [ main::$6 ]
|
||||
Allocated zp ZP_WORD:16 [ main::$10 ]
|
||||
|
||||
INITIAL ASM
|
||||
//SEG0 File Comments
|
||||
@ -261,10 +280,13 @@ main: {
|
||||
.label screen = $400
|
||||
.label _0 = 6
|
||||
.label _2 = 8
|
||||
.label _6 = $a
|
||||
.label _6 = $e
|
||||
.label c = 4
|
||||
.label line = 2
|
||||
.label c1 = 5
|
||||
.label _8 = $a
|
||||
.label _9 = $c
|
||||
.label _10 = $10
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
//SEG12 [5] phi (word) main::line#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vwuz1=vbuc1
|
||||
@ -307,35 +329,37 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _2+1
|
||||
//SEG23 [9] *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2) -- pbuc1_derefidx_vwuz1=pbuc2_derefidx_vwuz2
|
||||
lda #<screen
|
||||
//SEG23 [9] (byte*) main::$8 ← (const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda _2
|
||||
clc
|
||||
adc _0
|
||||
sta !a1++1
|
||||
lda #>screen
|
||||
adc _0+1
|
||||
sta !a1++2
|
||||
lda #<screen+$28
|
||||
adc #<screen+$28
|
||||
sta _8
|
||||
lda _2+1
|
||||
adc #>screen+$28
|
||||
sta _8+1
|
||||
//SEG24 [10] (byte*) main::$9 ← (const byte*) main::screen#0 + (word~) main::$0 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda _0
|
||||
clc
|
||||
adc _2
|
||||
sta !a2++1
|
||||
lda #>screen+$28
|
||||
adc _2+1
|
||||
sta !a2++2
|
||||
!a2:
|
||||
lda screen+$28
|
||||
!a1:
|
||||
sta screen
|
||||
//SEG24 [10] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuz1=_inc_vbuz1
|
||||
adc #<screen
|
||||
sta _9
|
||||
lda _0+1
|
||||
adc #>screen
|
||||
sta _9+1
|
||||
//SEG25 [11] *((byte*) main::$9) ← *((byte*) main::$8) -- _deref_pbuz1=_deref_pbuz2
|
||||
ldy #0
|
||||
lda (_8),y
|
||||
ldy #0
|
||||
sta (_9),y
|
||||
//SEG26 [12] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuz1=_inc_vbuz1
|
||||
inc c
|
||||
//SEG25 [11] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
//SEG27 [13] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda c
|
||||
cmp #$28
|
||||
bcc b2_from_b2
|
||||
jmp b3
|
||||
//SEG26 main::@3
|
||||
//SEG28 main::@3
|
||||
b3:
|
||||
//SEG27 [12] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
//SEG29 [14] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc line
|
||||
@ -343,7 +367,7 @@ main: {
|
||||
bcc !+
|
||||
inc line+1
|
||||
!:
|
||||
//SEG28 [13] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 -- vwuz1_lt_vwuc1_then_la1
|
||||
//SEG30 [15] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda line+1
|
||||
cmp #>$28*$18
|
||||
bcc b1_from_b3
|
||||
@ -352,20 +376,20 @@ main: {
|
||||
cmp #<$28*$18
|
||||
bcc b1_from_b3
|
||||
!:
|
||||
//SEG29 [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
//SEG31 [16] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
b4_from_b3:
|
||||
//SEG30 [14] phi (byte) main::c1#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuz1=vbuc1
|
||||
//SEG32 [16] phi (byte) main::c1#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta c1
|
||||
jmp b4
|
||||
// Cleare the bottom line
|
||||
//SEG31 [14] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
//SEG33 [16] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
b4_from_b4:
|
||||
//SEG32 [14] phi (byte) main::c1#2 = (byte) main::c1#1 [phi:main::@4->main::@4#0] -- register_copy
|
||||
//SEG34 [16] phi (byte) main::c1#2 = (byte) main::c1#1 [phi:main::@4->main::@4#0] -- register_copy
|
||||
jmp b4
|
||||
//SEG33 main::@4
|
||||
//SEG35 main::@4
|
||||
b4:
|
||||
//SEG34 [15] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 -- vwuz1=vwuz2_plus_vbuz3
|
||||
//SEG36 [17] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 -- vwuz1=vwuz2_plus_vbuz3
|
||||
lda c1
|
||||
clc
|
||||
adc line
|
||||
@ -373,27 +397,28 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _6+1
|
||||
//SEG35 [16] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' -- pbuc1_derefidx_vwuz1=vbuc2
|
||||
lda #<screen
|
||||
//SEG37 [18] (byte*) main::$10 ← (const byte*) main::screen#0 + (word~) main::$6 -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda _6
|
||||
clc
|
||||
adc _6
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc _6+1
|
||||
sta !++2
|
||||
adc #<screen
|
||||
sta _10
|
||||
lda _6+1
|
||||
adc #>screen
|
||||
sta _10+1
|
||||
//SEG38 [19] *((byte*) main::$10) ← (byte) ' ' -- _deref_pbuz1=vbuc1
|
||||
lda #' '
|
||||
!:
|
||||
sta screen
|
||||
//SEG36 [17] (byte) main::c1#1 ← ++ (byte) main::c1#2 -- vbuz1=_inc_vbuz1
|
||||
ldy #0
|
||||
sta (_10),y
|
||||
//SEG39 [20] (byte) main::c1#1 ← ++ (byte) main::c1#2 -- vbuz1=_inc_vbuz1
|
||||
inc c1
|
||||
//SEG37 [18] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4 -- vbuz1_lt_vbuc1_then_la1
|
||||
//SEG40 [21] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4 -- vbuz1_lt_vbuc1_then_la1
|
||||
lda c1
|
||||
cmp #$28
|
||||
bcc b4_from_b4
|
||||
jmp breturn
|
||||
//SEG38 main::@return
|
||||
//SEG41 main::@return
|
||||
breturn:
|
||||
//SEG39 [19] return
|
||||
//SEG42 [22] return
|
||||
rts
|
||||
}
|
||||
|
||||
@ -401,35 +426,49 @@ REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [7] (word~) main::$0 ← (word) main::line#6 + (byte) main::c#2 [ main::line#6 main::c#2 main::$0 ] ( main:2 [ main::line#6 main::c#2 main::$0 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::c#2 main::c#1 ]
|
||||
Statement [8] (word~) main::$2 ← (word) main::line#6 + (byte) main::c#2 [ main::line#6 main::c#2 main::$0 main::$2 ] ( main:2 [ main::line#6 main::c#2 main::$0 main::$2 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2) [ main::line#6 main::c#2 ] ( main:2 [ main::line#6 main::c#2 ] ) always clobbers reg byte a
|
||||
Statement [12] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [13] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [15] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 [ main::line#2 main::c1#2 main::$6 ] ( main:2 [ main::line#2 main::c1#2 main::$6 ] ) always clobbers reg byte a
|
||||
Statement [9] (byte*) main::$8 ← (const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2 [ main::line#6 main::c#2 main::$0 main::$8 ] ( main:2 [ main::line#6 main::c#2 main::$0 main::$8 ] ) always clobbers reg byte a
|
||||
Statement [10] (byte*) main::$9 ← (const byte*) main::screen#0 + (word~) main::$0 [ main::line#6 main::c#2 main::$8 main::$9 ] ( main:2 [ main::line#6 main::c#2 main::$8 main::$9 ] ) always clobbers reg byte a
|
||||
Statement [11] *((byte*) main::$9) ← *((byte*) main::$8) [ main::line#6 main::c#2 ] ( main:2 [ main::line#6 main::c#2 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ main::c#2 main::c#1 ]
|
||||
Statement [14] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [15] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [17] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 [ main::line#2 main::c1#2 main::$6 ] ( main:2 [ main::line#2 main::c1#2 main::$6 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::c1#2 main::c1#1 ]
|
||||
Statement [16] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' [ main::line#2 main::c1#2 ] ( main:2 [ main::line#2 main::c1#2 ] ) always clobbers reg byte a
|
||||
Statement [18] (byte*) main::$10 ← (const byte*) main::screen#0 + (word~) main::$6 [ main::line#2 main::c1#2 main::$10 ] ( main:2 [ main::line#2 main::c1#2 main::$10 ] ) always clobbers reg byte a
|
||||
Statement [19] *((byte*) main::$10) ← (byte) ' ' [ main::line#2 main::c1#2 ] ( main:2 [ main::line#2 main::c1#2 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ main::c1#2 main::c1#1 ]
|
||||
Statement [7] (word~) main::$0 ← (word) main::line#6 + (byte) main::c#2 [ main::line#6 main::c#2 main::$0 ] ( main:2 [ main::line#6 main::c#2 main::$0 ] ) always clobbers reg byte a
|
||||
Statement [8] (word~) main::$2 ← (word) main::line#6 + (byte) main::c#2 [ main::line#6 main::c#2 main::$0 main::$2 ] ( main:2 [ main::line#6 main::c#2 main::$0 main::$2 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2) [ main::line#6 main::c#2 ] ( main:2 [ main::line#6 main::c#2 ] ) always clobbers reg byte a
|
||||
Statement [12] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [13] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [15] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 [ main::line#2 main::c1#2 main::$6 ] ( main:2 [ main::line#2 main::c1#2 main::$6 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' [ main::line#2 main::c1#2 ] ( main:2 [ main::line#2 main::c1#2 ] ) always clobbers reg byte a
|
||||
Statement [9] (byte*) main::$8 ← (const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2 [ main::line#6 main::c#2 main::$0 main::$8 ] ( main:2 [ main::line#6 main::c#2 main::$0 main::$8 ] ) always clobbers reg byte a
|
||||
Statement [10] (byte*) main::$9 ← (const byte*) main::screen#0 + (word~) main::$0 [ main::line#6 main::c#2 main::$8 main::$9 ] ( main:2 [ main::line#6 main::c#2 main::$8 main::$9 ] ) always clobbers reg byte a
|
||||
Statement [11] *((byte*) main::$9) ← *((byte*) main::$8) [ main::line#6 main::c#2 ] ( main:2 [ main::line#6 main::c#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [14] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [15] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 [ main::line#2 ] ( main:2 [ main::line#2 ] ) always clobbers reg byte a
|
||||
Statement [17] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 [ main::line#2 main::c1#2 main::$6 ] ( main:2 [ main::line#2 main::c1#2 main::$6 ] ) always clobbers reg byte a
|
||||
Statement [18] (byte*) main::$10 ← (const byte*) main::screen#0 + (word~) main::$6 [ main::line#2 main::c1#2 main::$10 ] ( main:2 [ main::line#2 main::c1#2 main::$10 ] ) always clobbers reg byte a
|
||||
Statement [19] *((byte*) main::$10) ← (byte) ' ' [ main::line#2 main::c1#2 ] ( main:2 [ main::line#2 main::c1#2 ] ) always clobbers reg byte a reg byte y
|
||||
Potential registers zp ZP_WORD:2 [ main::line#6 main::line#2 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::c#2 main::c#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:5 [ main::c1#2 main::c1#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:4 [ main::c#2 main::c#1 ] : zp ZP_BYTE:4 , reg byte x ,
|
||||
Potential registers zp ZP_BYTE:5 [ main::c1#2 main::c1#1 ] : zp ZP_BYTE:5 , reg byte x ,
|
||||
Potential registers zp ZP_WORD:6 [ main::$0 ] : zp ZP_WORD:6 ,
|
||||
Potential registers zp ZP_WORD:8 [ main::$2 ] : zp ZP_WORD:8 ,
|
||||
Potential registers zp ZP_WORD:10 [ main::$6 ] : zp ZP_WORD:10 ,
|
||||
Potential registers zp ZP_WORD:10 [ main::$8 ] : zp ZP_WORD:10 ,
|
||||
Potential registers zp ZP_WORD:12 [ main::$9 ] : zp ZP_WORD:12 ,
|
||||
Potential registers zp ZP_WORD:14 [ main::$6 ] : zp ZP_WORD:14 ,
|
||||
Potential registers zp ZP_WORD:16 [ main::$10 ] : zp ZP_WORD:16 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 252.5: zp ZP_BYTE:4 [ main::c#2 main::c#1 ] 202: zp ZP_WORD:8 [ main::$2 ] 101: zp ZP_WORD:6 [ main::$0 ] 38.29: zp ZP_WORD:2 [ main::line#6 main::line#2 ] 27.5: zp ZP_BYTE:5 [ main::c1#2 main::c1#1 ] 22: zp ZP_WORD:10 [ main::$6 ]
|
||||
Uplift Scope [main] 218.83: zp ZP_BYTE:4 [ main::c#2 main::c#1 ] 202: zp ZP_WORD:8 [ main::$2 ] 202: zp ZP_WORD:12 [ main::$9 ] 101: zp ZP_WORD:10 [ main::$8 ] 67.33: zp ZP_WORD:6 [ main::$0 ] 30.39: zp ZP_WORD:2 [ main::line#6 main::line#2 ] 24.75: zp ZP_BYTE:5 [ main::c1#2 main::c1#1 ] 22: zp ZP_WORD:14 [ main::$6 ] 22: zp ZP_WORD:16 [ main::$10 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 11293 combination reg byte x [ main::c#2 main::c#1 ] zp ZP_WORD:8 [ main::$2 ] zp ZP_WORD:6 [ main::$0 ] zp ZP_WORD:2 [ main::line#6 main::line#2 ] reg byte x [ main::c1#2 main::c1#1 ] zp ZP_WORD:10 [ main::$6 ]
|
||||
Uplifting [] best 11293 combination
|
||||
Coalescing zero page register [ zp ZP_WORD:6 [ main::$0 ] ] with [ zp ZP_WORD:10 [ main::$6 ] ]
|
||||
Allocated (was zp ZP_WORD:6) zp ZP_WORD:4 [ main::$0 main::$6 ]
|
||||
Allocated (was zp ZP_WORD:8) zp ZP_WORD:6 [ main::$2 ]
|
||||
Uplifting [main] best 11663 combination reg byte x [ main::c#2 main::c#1 ] zp ZP_WORD:8 [ main::$2 ] zp ZP_WORD:12 [ main::$9 ] zp ZP_WORD:10 [ main::$8 ] zp ZP_WORD:6 [ main::$0 ] zp ZP_WORD:2 [ main::line#6 main::line#2 ] reg byte x [ main::c1#2 main::c1#1 ] zp ZP_WORD:14 [ main::$6 ] zp ZP_WORD:16 [ main::$10 ]
|
||||
Uplifting [] best 11663 combination
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:6 [ main::$0 ] ] with [ zp ZP_WORD:12 [ main::$9 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:8 [ main::$2 ] ] with [ zp ZP_WORD:10 [ main::$8 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:14 [ main::$6 ] ] with [ zp ZP_WORD:16 [ main::$10 ] ] - score: 1
|
||||
Coalescing zero page register [ zp ZP_WORD:6 [ main::$0 main::$9 ] ] with [ zp ZP_WORD:14 [ main::$6 main::$10 ] ]
|
||||
Allocated (was zp ZP_WORD:6) zp ZP_WORD:4 [ main::$0 main::$9 main::$6 main::$10 ]
|
||||
Allocated (was zp ZP_WORD:8) zp ZP_WORD:6 [ main::$2 main::$8 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
//SEG0 File Comments
|
||||
@ -461,6 +500,9 @@ main: {
|
||||
.label _2 = 6
|
||||
.label _6 = 4
|
||||
.label line = 2
|
||||
.label _8 = 6
|
||||
.label _9 = 4
|
||||
.label _10 = 4
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
//SEG12 [5] phi (word) main::line#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vwuz1=vbuc1
|
||||
@ -502,34 +544,36 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _2+1
|
||||
//SEG23 [9] *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2) -- pbuc1_derefidx_vwuz1=pbuc2_derefidx_vwuz2
|
||||
lda #<screen
|
||||
//SEG23 [9] (byte*) main::$8 ← (const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz1
|
||||
clc
|
||||
adc _0
|
||||
sta !a1++1
|
||||
lda #>screen
|
||||
adc _0+1
|
||||
sta !a1++2
|
||||
lda #<screen+$28
|
||||
lda _8
|
||||
adc #<screen+$28
|
||||
sta _8
|
||||
lda _8+1
|
||||
adc #>screen+$28
|
||||
sta _8+1
|
||||
//SEG24 [10] (byte*) main::$9 ← (const byte*) main::screen#0 + (word~) main::$0 -- pbuz1=pbuc1_plus_vwuz1
|
||||
clc
|
||||
adc _2
|
||||
sta !a2++1
|
||||
lda #>screen+$28
|
||||
adc _2+1
|
||||
sta !a2++2
|
||||
!a2:
|
||||
lda screen+$28
|
||||
!a1:
|
||||
sta screen
|
||||
//SEG24 [10] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
|
||||
lda _9
|
||||
adc #<screen
|
||||
sta _9
|
||||
lda _9+1
|
||||
adc #>screen
|
||||
sta _9+1
|
||||
//SEG25 [11] *((byte*) main::$9) ← *((byte*) main::$8) -- _deref_pbuz1=_deref_pbuz2
|
||||
ldy #0
|
||||
lda (_8),y
|
||||
ldy #0
|
||||
sta (_9),y
|
||||
//SEG26 [12] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
//SEG25 [11] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
//SEG27 [13] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$28
|
||||
bcc b2_from_b2
|
||||
jmp b3
|
||||
//SEG26 main::@3
|
||||
//SEG28 main::@3
|
||||
b3:
|
||||
//SEG27 [12] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
//SEG29 [14] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc line
|
||||
@ -537,7 +581,7 @@ main: {
|
||||
bcc !+
|
||||
inc line+1
|
||||
!:
|
||||
//SEG28 [13] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 -- vwuz1_lt_vwuc1_then_la1
|
||||
//SEG30 [15] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda line+1
|
||||
cmp #>$28*$18
|
||||
bcc b1_from_b3
|
||||
@ -546,19 +590,19 @@ main: {
|
||||
cmp #<$28*$18
|
||||
bcc b1_from_b3
|
||||
!:
|
||||
//SEG29 [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
//SEG31 [16] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
b4_from_b3:
|
||||
//SEG30 [14] phi (byte) main::c1#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
|
||||
//SEG32 [16] phi (byte) main::c1#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
jmp b4
|
||||
// Cleare the bottom line
|
||||
//SEG31 [14] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
//SEG33 [16] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
b4_from_b4:
|
||||
//SEG32 [14] phi (byte) main::c1#2 = (byte) main::c1#1 [phi:main::@4->main::@4#0] -- register_copy
|
||||
//SEG34 [16] phi (byte) main::c1#2 = (byte) main::c1#1 [phi:main::@4->main::@4#0] -- register_copy
|
||||
jmp b4
|
||||
//SEG33 main::@4
|
||||
//SEG35 main::@4
|
||||
b4:
|
||||
//SEG34 [15] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 -- vwuz1=vwuz2_plus_vbuxx
|
||||
//SEG36 [17] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 -- vwuz1=vwuz2_plus_vbuxx
|
||||
txa
|
||||
clc
|
||||
adc line
|
||||
@ -566,26 +610,27 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _6+1
|
||||
//SEG35 [16] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' -- pbuc1_derefidx_vwuz1=vbuc2
|
||||
lda #<screen
|
||||
//SEG37 [18] (byte*) main::$10 ← (const byte*) main::screen#0 + (word~) main::$6 -- pbuz1=pbuc1_plus_vwuz1
|
||||
clc
|
||||
adc _6
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc _6+1
|
||||
sta !++2
|
||||
lda _10
|
||||
adc #<screen
|
||||
sta _10
|
||||
lda _10+1
|
||||
adc #>screen
|
||||
sta _10+1
|
||||
//SEG38 [19] *((byte*) main::$10) ← (byte) ' ' -- _deref_pbuz1=vbuc1
|
||||
lda #' '
|
||||
!:
|
||||
sta screen
|
||||
//SEG36 [17] (byte) main::c1#1 ← ++ (byte) main::c1#2 -- vbuxx=_inc_vbuxx
|
||||
ldy #0
|
||||
sta (_10),y
|
||||
//SEG39 [20] (byte) main::c1#1 ← ++ (byte) main::c1#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
//SEG37 [18] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4 -- vbuxx_lt_vbuc1_then_la1
|
||||
//SEG40 [21] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$28
|
||||
bcc b4_from_b4
|
||||
jmp breturn
|
||||
//SEG38 main::@return
|
||||
//SEG41 main::@return
|
||||
breturn:
|
||||
//SEG39 [19] return
|
||||
//SEG42 [22] return
|
||||
rts
|
||||
}
|
||||
|
||||
@ -599,6 +644,7 @@ Removing instruction jmp b4
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #0
|
||||
Removing instruction ldy #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label b2_from_b2 with b2
|
||||
Replacing label b1_from_b3 with b1
|
||||
@ -634,9 +680,12 @@ FINAL SYMBOL TABLE
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) main()
|
||||
(word~) main::$0 $0 zp ZP_WORD:4 101.0
|
||||
(word~) main::$0 $0 zp ZP_WORD:4 67.33333333333333
|
||||
(byte*) main::$10 $10 zp ZP_WORD:4 22.0
|
||||
(word~) main::$2 $2 zp ZP_WORD:6 202.0
|
||||
(word~) main::$6 $6 zp ZP_WORD:4 22.0
|
||||
(byte*) main::$8 $8 zp ZP_WORD:6 101.0
|
||||
(byte*) main::$9 $9 zp ZP_WORD:4 202.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@3
|
||||
@ -644,25 +693,25 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@return
|
||||
(byte) main::c
|
||||
(byte) main::c#1 reg byte x 151.5
|
||||
(byte) main::c#2 reg byte x 101.0
|
||||
(byte) main::c#2 reg byte x 67.33333333333333
|
||||
(byte) main::c1
|
||||
(byte) main::c1#1 reg byte x 16.5
|
||||
(byte) main::c1#2 reg byte x 11.0
|
||||
(byte) main::c1#2 reg byte x 8.25
|
||||
(word) main::line
|
||||
(word) main::line#2 line zp ZP_WORD:2 6.285714285714286
|
||||
(word) main::line#6 line zp ZP_WORD:2 32.0
|
||||
(word) main::line#2 line zp ZP_WORD:2 5.5
|
||||
(word) main::line#6 line zp ZP_WORD:2 24.888888888888886
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
|
||||
|
||||
zp ZP_WORD:2 [ main::line#6 main::line#2 ]
|
||||
reg byte x [ main::c#2 main::c#1 ]
|
||||
reg byte x [ main::c1#2 main::c1#1 ]
|
||||
zp ZP_WORD:4 [ main::$0 main::$6 ]
|
||||
zp ZP_WORD:6 [ main::$2 ]
|
||||
zp ZP_WORD:4 [ main::$0 main::$9 main::$6 main::$10 ]
|
||||
zp ZP_WORD:6 [ main::$2 main::$8 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 10211
|
||||
Score: 10381
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -684,6 +733,9 @@ main: {
|
||||
.label _2 = 6
|
||||
.label _6 = 4
|
||||
.label line = 2
|
||||
.label _8 = 6
|
||||
.label _9 = 4
|
||||
.label _10 = 4
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
//SEG12 [5] phi (word) main::line#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vwuz1=vbuc1
|
||||
lda #0
|
||||
@ -716,32 +768,33 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _2+1
|
||||
//SEG23 [9] *((const byte*) main::screen#0 + (word~) main::$0) ← *((const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2) -- pbuc1_derefidx_vwuz1=pbuc2_derefidx_vwuz2
|
||||
lda #<screen
|
||||
//SEG23 [9] (byte*) main::$8 ← (const byte*) main::screen#0+(byte/signed byte/word/signed word/dword/signed dword) $28 + (word~) main::$2 -- pbuz1=pbuc1_plus_vwuz1
|
||||
clc
|
||||
adc _0
|
||||
sta !a1++1
|
||||
lda #>screen
|
||||
adc _0+1
|
||||
sta !a1++2
|
||||
lda #<screen+$28
|
||||
lda _8
|
||||
adc #<screen+$28
|
||||
sta _8
|
||||
lda _8+1
|
||||
adc #>screen+$28
|
||||
sta _8+1
|
||||
//SEG24 [10] (byte*) main::$9 ← (const byte*) main::screen#0 + (word~) main::$0 -- pbuz1=pbuc1_plus_vwuz1
|
||||
clc
|
||||
adc _2
|
||||
sta !a2++1
|
||||
lda #>screen+$28
|
||||
adc _2+1
|
||||
sta !a2++2
|
||||
!a2:
|
||||
lda screen+$28
|
||||
!a1:
|
||||
sta screen
|
||||
//SEG24 [10] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
|
||||
lda _9
|
||||
adc #<screen
|
||||
sta _9
|
||||
lda _9+1
|
||||
adc #>screen
|
||||
sta _9+1
|
||||
//SEG25 [11] *((byte*) main::$9) ← *((byte*) main::$8) -- _deref_pbuz1=_deref_pbuz2
|
||||
ldy #0
|
||||
lda (_8),y
|
||||
sta (_9),y
|
||||
//SEG26 [12] (byte) main::c#1 ← ++ (byte) main::c#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
//SEG25 [11] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
//SEG27 [13] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$28
|
||||
bcc b2
|
||||
//SEG26 main::@3
|
||||
//SEG27 [12] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
//SEG28 main::@3
|
||||
//SEG29 [14] (word) main::line#2 ← (word) main::line#6 + (byte/signed byte/word/signed word/dword/signed dword) $28 -- vwuz1=vwuz1_plus_vbuc1
|
||||
lda #$28
|
||||
clc
|
||||
adc line
|
||||
@ -749,7 +802,7 @@ main: {
|
||||
bcc !+
|
||||
inc line+1
|
||||
!:
|
||||
//SEG28 [13] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 -- vwuz1_lt_vwuc1_then_la1
|
||||
//SEG30 [15] if((word) main::line#2<(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $18) goto main::@1 -- vwuz1_lt_vwuc1_then_la1
|
||||
lda line+1
|
||||
cmp #>$28*$18
|
||||
bcc b1
|
||||
@ -758,15 +811,15 @@ main: {
|
||||
cmp #<$28*$18
|
||||
bcc b1
|
||||
!:
|
||||
//SEG29 [14] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
//SEG30 [14] phi (byte) main::c1#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
|
||||
//SEG31 [16] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
//SEG32 [16] phi (byte) main::c1#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main::@3->main::@4#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// Cleare the bottom line
|
||||
//SEG31 [14] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
//SEG32 [14] phi (byte) main::c1#2 = (byte) main::c1#1 [phi:main::@4->main::@4#0] -- register_copy
|
||||
//SEG33 main::@4
|
||||
//SEG33 [16] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
//SEG34 [16] phi (byte) main::c1#2 = (byte) main::c1#1 [phi:main::@4->main::@4#0] -- register_copy
|
||||
//SEG35 main::@4
|
||||
b4:
|
||||
//SEG34 [15] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 -- vwuz1=vwuz2_plus_vbuxx
|
||||
//SEG36 [17] (word~) main::$6 ← (word) main::line#2 + (byte) main::c1#2 -- vwuz1=vwuz2_plus_vbuxx
|
||||
txa
|
||||
clc
|
||||
adc line
|
||||
@ -774,24 +827,25 @@ main: {
|
||||
lda #0
|
||||
adc line+1
|
||||
sta _6+1
|
||||
//SEG35 [16] *((const byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' -- pbuc1_derefidx_vwuz1=vbuc2
|
||||
lda #<screen
|
||||
//SEG37 [18] (byte*) main::$10 ← (const byte*) main::screen#0 + (word~) main::$6 -- pbuz1=pbuc1_plus_vwuz1
|
||||
clc
|
||||
adc _6
|
||||
sta !++1
|
||||
lda #>screen
|
||||
adc _6+1
|
||||
sta !++2
|
||||
lda _10
|
||||
adc #<screen
|
||||
sta _10
|
||||
lda _10+1
|
||||
adc #>screen
|
||||
sta _10+1
|
||||
//SEG38 [19] *((byte*) main::$10) ← (byte) ' ' -- _deref_pbuz1=vbuc1
|
||||
lda #' '
|
||||
!:
|
||||
sta screen
|
||||
//SEG36 [17] (byte) main::c1#1 ← ++ (byte) main::c1#2 -- vbuxx=_inc_vbuxx
|
||||
ldy #0
|
||||
sta (_10),y
|
||||
//SEG39 [20] (byte) main::c1#1 ← ++ (byte) main::c1#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
//SEG37 [18] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4 -- vbuxx_lt_vbuc1_then_la1
|
||||
//SEG40 [21] if((byte) main::c1#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@4 -- vbuxx_lt_vbuc1_then_la1
|
||||
cpx #$28
|
||||
bcc b4
|
||||
//SEG38 main::@return
|
||||
//SEG39 [19] return
|
||||
//SEG41 main::@return
|
||||
//SEG42 [22] return
|
||||
rts
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,12 @@
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(void()) main()
|
||||
(word~) main::$0 $0 zp ZP_WORD:4 101.0
|
||||
(word~) main::$0 $0 zp ZP_WORD:4 67.33333333333333
|
||||
(byte*) main::$10 $10 zp ZP_WORD:4 22.0
|
||||
(word~) main::$2 $2 zp ZP_WORD:6 202.0
|
||||
(word~) main::$6 $6 zp ZP_WORD:4 22.0
|
||||
(byte*) main::$8 $8 zp ZP_WORD:6 101.0
|
||||
(byte*) main::$9 $9 zp ZP_WORD:4 202.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@3
|
||||
@ -12,18 +15,18 @@
|
||||
(label) main::@return
|
||||
(byte) main::c
|
||||
(byte) main::c#1 reg byte x 151.5
|
||||
(byte) main::c#2 reg byte x 101.0
|
||||
(byte) main::c#2 reg byte x 67.33333333333333
|
||||
(byte) main::c1
|
||||
(byte) main::c1#1 reg byte x 16.5
|
||||
(byte) main::c1#2 reg byte x 11.0
|
||||
(byte) main::c1#2 reg byte x 8.25
|
||||
(word) main::line
|
||||
(word) main::line#2 line zp ZP_WORD:2 6.285714285714286
|
||||
(word) main::line#6 line zp ZP_WORD:2 32.0
|
||||
(word) main::line#2 line zp ZP_WORD:2 5.5
|
||||
(word) main::line#6 line zp ZP_WORD:2 24.888888888888886
|
||||
(byte*) main::screen
|
||||
(const byte*) main::screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400
|
||||
|
||||
zp ZP_WORD:2 [ main::line#6 main::line#2 ]
|
||||
reg byte x [ main::c#2 main::c#1 ]
|
||||
reg byte x [ main::c1#2 main::c1#1 ]
|
||||
zp ZP_WORD:4 [ main::$0 main::$6 ]
|
||||
zp ZP_WORD:6 [ main::$2 ]
|
||||
zp ZP_WORD:4 [ main::$0 main::$9 main::$6 main::$10 ]
|
||||
zp ZP_WORD:6 [ main::$2 main::$8 ]
|
||||
|
64
src/test/ref/word-array-2.asm
Normal file
64
src/test/ref/word-array-2.asm
Normal file
@ -0,0 +1,64 @@
|
||||
// Tests a word-array with 128+ elements
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.const SIZEOF_WORD = 2
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = 2
|
||||
.label _2 = 4
|
||||
.label _3 = 4
|
||||
.label _4 = 4
|
||||
.label _6 = 2
|
||||
.label _9 = 2
|
||||
ldx #0
|
||||
b1:
|
||||
txa
|
||||
sta _1
|
||||
lda #0
|
||||
sta _1+1
|
||||
txa
|
||||
sta _2
|
||||
lda #0
|
||||
sta _2+1
|
||||
ldy #8
|
||||
cpy #0
|
||||
beq !e+
|
||||
!:
|
||||
asl _3
|
||||
rol _3+1
|
||||
dey
|
||||
bne !-
|
||||
!e:
|
||||
txa
|
||||
clc
|
||||
adc _4
|
||||
sta _4
|
||||
bcc !+
|
||||
inc _4+1
|
||||
!:
|
||||
asl _6
|
||||
rol _6+1
|
||||
clc
|
||||
lda _9
|
||||
adc #<words
|
||||
sta _9
|
||||
lda _9+1
|
||||
adc #>words
|
||||
sta _9+1
|
||||
ldy #0
|
||||
lda _4
|
||||
sta (_9),y
|
||||
iny
|
||||
lda _4+1
|
||||
sta (_9),y
|
||||
inx
|
||||
cpx #0
|
||||
bne b1
|
||||
lda words+$ff*SIZEOF_WORD
|
||||
sta SCREEN
|
||||
lda words+$ff*SIZEOF_WORD+1
|
||||
sta SCREEN+1
|
||||
rts
|
||||
}
|
||||
words: .fill 2*$100, 0
|
30
src/test/ref/word-array-2.cfg
Normal file
30
src/test/ref/word-array-2.cfg
Normal file
@ -0,0 +1,30 @@
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call main
|
||||
to:@end
|
||||
@end: scope:[] from @1
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@1
|
||||
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 )
|
||||
[6] (word~) main::$1 ← ((word)) (byte) main::i#2
|
||||
[7] (word~) main::$2 ← ((word)) (byte) main::i#2
|
||||
[8] (word~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8
|
||||
[9] (word~) main::$4 ← (word~) main::$3 + (byte) main::i#2
|
||||
[10] (word) main::$6 ← (word~) main::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[11] (word*) main::$9 ← (const word[$100]) words#0 + (word) main::$6
|
||||
[12] *((word*) main::$9) ← (word~) main::$4
|
||||
[13] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[14] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1
|
||||
[15] *((const word*) main::SCREEN#0) ← *((const word[$100]) words#0+((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[16] return
|
||||
to:@return
|
615
src/test/ref/word-array-2.log
Normal file
615
src/test/ref/word-array-2.log
Normal file
@ -0,0 +1,615 @@
|
||||
Fixing pointer array-indexing *((word[$100]) words + (word~) main::$1)
|
||||
Fixing pointer array-indexing *((word[$100]) words + (byte/word/signed word/dword/signed dword~) main::$0)
|
||||
Fixing pointer array-indexing *((word*) main::SCREEN + (byte/signed byte/word/signed word/dword/signed dword) 0)
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(word[$100]) words#0 ← { fill( $100, 0) }
|
||||
to:@1
|
||||
main: scope:[main] from @1
|
||||
(byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@1
|
||||
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
|
||||
(word~) main::$1 ← ((word)) (byte) main::i#2
|
||||
(word~) main::$2 ← ((word)) (byte) main::i#2
|
||||
(word/signed dword/dword~) main::$3 ← (word~) main::$2 * (word/signed word/dword/signed dword) $100
|
||||
(word/signed dword/dword~) main::$4 ← (word/signed dword/dword~) main::$3 + (byte) main::i#2
|
||||
(word) main::$6 ← (word~) main::$1 * (const byte) SIZEOF_WORD
|
||||
*((word[$100]) words#0 + (word) main::$6) ← (word/signed dword/dword~) main::$4
|
||||
(byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$ff)
|
||||
(bool~) main::$5 ← (byte) main::i#1 != rangelast(0,$ff)
|
||||
if((bool~) main::$5) goto main::@1
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1
|
||||
(word*) main::SCREEN#0 ← ((word*)) (word/signed word/dword/signed dword) $400
|
||||
(byte/word/signed word/dword/signed dword~) main::$0 ← ((word)) (byte/word/signed word/dword/signed dword) $ff
|
||||
(byte/word/signed word/dword/signed dword) main::$7 ← (byte/word/signed word/dword/signed dword~) main::$0 * (const byte) SIZEOF_WORD
|
||||
(byte/signed byte/word/signed word/dword/signed dword) main::$8 ← (byte/signed byte/word/signed word/dword/signed dword) 0 * (const byte) SIZEOF_WORD
|
||||
*((word*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$8) ← *((word[$100]) words#0 + (byte/word/signed word/dword/signed dword) main::$7)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
return
|
||||
to:@return
|
||||
@1: scope:[] from @begin
|
||||
call main
|
||||
to:@2
|
||||
@2: scope:[] from @1
|
||||
to:@end
|
||||
@end: scope:[] from @2
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
|
||||
(void()) main()
|
||||
(byte/word/signed word/dword/signed dword~) main::$0
|
||||
(word~) main::$1
|
||||
(word~) main::$2
|
||||
(word/signed dword/dword~) main::$3
|
||||
(word/signed dword/dword~) main::$4
|
||||
(bool~) main::$5
|
||||
(word) main::$6
|
||||
(byte/word/signed word/dword/signed dword) main::$7
|
||||
(byte/signed byte/word/signed word/dword/signed dword) main::$8
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(word*) main::SCREEN
|
||||
(word*) main::SCREEN#0
|
||||
(byte) main::i
|
||||
(byte) main::i#0
|
||||
(byte) main::i#1
|
||||
(byte) main::i#2
|
||||
(word[$100]) words
|
||||
(word[$100]) words#0
|
||||
|
||||
Culled Empty Block (label) @2
|
||||
Successful SSA optimization Pass2CullEmptyBlocks
|
||||
Simple Condition (bool~) main::$5 [11] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Constant (const word[$100]) words#0 = { fill( $100, 0) }
|
||||
Constant (const byte) main::i#0 = 0
|
||||
Constant (const word*) main::SCREEN#0 = ((word*))$400
|
||||
Constant (const byte/word/signed word/dword/signed dword) main::$0 = ((word))$ff
|
||||
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$8 = 0*SIZEOF_WORD
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const word/signed word/dword/signed dword) main::$7 = main::$0*SIZEOF_WORD
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Consolidated array index constant in *(words#0+main::$7)
|
||||
Consolidated array index constant in *(main::SCREEN#0+main::$8)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
|
||||
Resolved ranged comparison value if(main::i#1!=rangelast(0,$ff)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 0
|
||||
Rewriting multiplication to use shift (word/signed dword/dword~) main::$3 ← (word~) main::$2 * (word/signed word/dword/signed dword) $100
|
||||
Rewriting multiplication to use shift (word) main::$6 ← (word~) main::$1 * (const byte) SIZEOF_WORD
|
||||
Successful SSA optimization Pass2MultiplyToShiftRewriting
|
||||
De-inlining pointer[w] to *(pointer+w) *((const word[$100]) words#0 + (word) main::$6) ← (word/signed dword/dword~) main::$4
|
||||
Successful SSA optimization Pass2DeInlineWordDerefIdx
|
||||
Inferred type updated to word in [3] (word/signed dword/dword~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8
|
||||
Inferred type updated to word in [4] (word/signed dword/dword~) main::$4 ← (word~) main::$3 + (byte) main::i#2
|
||||
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
|
||||
Constant inlined main::$7 = ((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD
|
||||
Constant inlined main::$0 = ((word))(byte/word/signed word/dword/signed dword) $ff
|
||||
Constant inlined main::$8 = (byte/signed byte/word/signed word/dword/signed dword) 0*(const byte) SIZEOF_WORD
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Simplifying constant multiply by zero 0*SIZEOF_WORD
|
||||
Simplifying constant plus zero main::SCREEN#0+0
|
||||
Added new block during phi lifting main::@3(between main::@1 and main::@1)
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 1 initial phi equivalence classes
|
||||
Coalesced [17] main::i#3 ← main::i#1
|
||||
Coalesced down to 1 phi equivalence classes
|
||||
Culled Empty Block (label) main::@3
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
Adding NOP phi() at start of main
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call main
|
||||
to:@end
|
||||
@end: scope:[] from @1
|
||||
[3] phi()
|
||||
main: scope:[main] from @1
|
||||
[4] phi()
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@1
|
||||
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 )
|
||||
[6] (word~) main::$1 ← ((word)) (byte) main::i#2
|
||||
[7] (word~) main::$2 ← ((word)) (byte) main::i#2
|
||||
[8] (word~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8
|
||||
[9] (word~) main::$4 ← (word~) main::$3 + (byte) main::i#2
|
||||
[10] (word) main::$6 ← (word~) main::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1
|
||||
[11] (word*) main::$9 ← (const word[$100]) words#0 + (word) main::$6
|
||||
[12] *((word*) main::$9) ← (word~) main::$4
|
||||
[13] (byte) main::i#1 ← ++ (byte) main::i#2
|
||||
[14] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1
|
||||
[15] *((const word*) main::SCREEN#0) ← *((const word[$100]) words#0+((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
[16] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(void()) main()
|
||||
(word~) main::$1 5.5
|
||||
(word~) main::$2 22.0
|
||||
(word~) main::$3 22.0
|
||||
(word~) main::$4 7.333333333333333
|
||||
(word) main::$6 22.0
|
||||
(word*) main::$9 22.0
|
||||
(word*) main::SCREEN
|
||||
(byte) main::i
|
||||
(byte) main::i#1 16.5
|
||||
(byte) main::i#2 6.875
|
||||
(word[$100]) words
|
||||
|
||||
Initial phi equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
Added variable main::$1 to zero page equivalence class [ main::$1 ]
|
||||
Added variable main::$2 to zero page equivalence class [ main::$2 ]
|
||||
Added variable main::$3 to zero page equivalence class [ main::$3 ]
|
||||
Added variable main::$4 to zero page equivalence class [ main::$4 ]
|
||||
Added variable main::$6 to zero page equivalence class [ main::$6 ]
|
||||
Added variable main::$9 to zero page equivalence class [ main::$9 ]
|
||||
Complete equivalence classes
|
||||
[ main::i#2 main::i#1 ]
|
||||
[ main::$1 ]
|
||||
[ main::$2 ]
|
||||
[ main::$3 ]
|
||||
[ main::$4 ]
|
||||
[ main::$6 ]
|
||||
[ main::$9 ]
|
||||
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Allocated zp ZP_WORD:3 [ main::$1 ]
|
||||
Allocated zp ZP_WORD:5 [ main::$2 ]
|
||||
Allocated zp ZP_WORD:7 [ main::$3 ]
|
||||
Allocated zp ZP_WORD:9 [ main::$4 ]
|
||||
Allocated zp ZP_WORD:11 [ main::$6 ]
|
||||
Allocated zp ZP_WORD:13 [ main::$9 ]
|
||||
|
||||
INITIAL ASM
|
||||
//SEG0 File Comments
|
||||
// Tests a word-array with 128+ elements
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.const SIZEOF_WORD = 2
|
||||
//SEG3 @begin
|
||||
bbegin:
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
b1_from_bbegin:
|
||||
jmp b1
|
||||
//SEG5 @1
|
||||
b1:
|
||||
//SEG6 [2] call main
|
||||
//SEG7 [4] phi from @1 to main [phi:@1->main]
|
||||
main_from_b1:
|
||||
jsr main
|
||||
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
|
||||
bend_from_b1:
|
||||
jmp bend
|
||||
//SEG9 @end
|
||||
bend:
|
||||
//SEG10 main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = 3
|
||||
.label _2 = 5
|
||||
.label _3 = 7
|
||||
.label _4 = 9
|
||||
.label _6 = $b
|
||||
.label i = 2
|
||||
.label _9 = $d
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
//SEG12 [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
|
||||
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
|
||||
b1_from_b1:
|
||||
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
//SEG15 main::@1
|
||||
b1:
|
||||
//SEG16 [6] (word~) main::$1 ← ((word)) (byte) main::i#2 -- vwuz1=_word_vbuz2
|
||||
lda i
|
||||
sta _1
|
||||
lda #0
|
||||
sta _1+1
|
||||
//SEG17 [7] (word~) main::$2 ← ((word)) (byte) main::i#2 -- vwuz1=_word_vbuz2
|
||||
lda i
|
||||
sta _2
|
||||
lda #0
|
||||
sta _2+1
|
||||
//SEG18 [8] (word~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8 -- vwuz1=vwuz2_rol_vbuc1
|
||||
ldy #8
|
||||
lda _2
|
||||
sta _3
|
||||
lda _2+1
|
||||
sta _3+1
|
||||
cpy #0
|
||||
beq !e+
|
||||
!:
|
||||
asl _3
|
||||
rol _3+1
|
||||
dey
|
||||
bne !-
|
||||
!e:
|
||||
//SEG19 [9] (word~) main::$4 ← (word~) main::$3 + (byte) main::i#2 -- vwuz1=vwuz2_plus_vbuz3
|
||||
lda i
|
||||
clc
|
||||
adc _3
|
||||
sta _4
|
||||
lda #0
|
||||
adc _3+1
|
||||
sta _4+1
|
||||
//SEG20 [10] (word) main::$6 ← (word~) main::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz2_rol_1
|
||||
lda _1
|
||||
asl
|
||||
sta _6
|
||||
lda _1+1
|
||||
rol
|
||||
sta _6+1
|
||||
//SEG21 [11] (word*) main::$9 ← (const word[$100]) words#0 + (word) main::$6 -- pwuz1=pwuc1_plus_vwuz2
|
||||
lda _6
|
||||
clc
|
||||
adc #<words
|
||||
sta _9
|
||||
lda _6+1
|
||||
adc #>words
|
||||
sta _9+1
|
||||
//SEG22 [12] *((word*) main::$9) ← (word~) main::$4 -- _deref_pwuz1=vwuz2
|
||||
ldy #0
|
||||
lda _4
|
||||
sta (_9),y
|
||||
iny
|
||||
lda _4+1
|
||||
sta (_9),y
|
||||
//SEG23 [13] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
|
||||
inc i
|
||||
//SEG24 [14] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 -- vbuz1_neq_0_then_la1
|
||||
lda i
|
||||
cmp #0
|
||||
bne b1_from_b1
|
||||
jmp b2
|
||||
//SEG25 main::@2
|
||||
b2:
|
||||
//SEG26 [15] *((const word*) main::SCREEN#0) ← *((const word[$100]) words#0+((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD) -- _deref_pwuc1=_deref_pwuc2
|
||||
lda words+$ff*SIZEOF_WORD
|
||||
sta SCREEN
|
||||
lda words+$ff*SIZEOF_WORD+1
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
//SEG27 main::@return
|
||||
breturn:
|
||||
//SEG28 [16] return
|
||||
rts
|
||||
}
|
||||
words: .fill 2*$100, 0
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [6] (word~) main::$1 ← ((word)) (byte) main::i#2 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Statement [7] (word~) main::$2 ← ((word)) (byte) main::i#2 [ main::i#2 main::$1 main::$2 ] ( main:2 [ main::i#2 main::$1 main::$2 ] ) always clobbers reg byte a
|
||||
Statement [8] (word~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8 [ main::i#2 main::$1 main::$3 ] ( main:2 [ main::i#2 main::$1 main::$3 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
|
||||
Statement [9] (word~) main::$4 ← (word~) main::$3 + (byte) main::i#2 [ main::i#2 main::$1 main::$4 ] ( main:2 [ main::i#2 main::$1 main::$4 ] ) always clobbers reg byte a
|
||||
Statement [10] (word) main::$6 ← (word~) main::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$4 main::$6 ] ( main:2 [ main::i#2 main::$4 main::$6 ] ) always clobbers reg byte a
|
||||
Statement [11] (word*) main::$9 ← (const word[$100]) words#0 + (word) main::$6 [ main::i#2 main::$4 main::$9 ] ( main:2 [ main::i#2 main::$4 main::$9 ] ) always clobbers reg byte a
|
||||
Statement [12] *((word*) main::$9) ← (word~) main::$4 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [15] *((const word*) main::SCREEN#0) ← *((const word[$100]) words#0+((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] (word~) main::$1 ← ((word)) (byte) main::i#2 [ main::i#2 main::$1 ] ( main:2 [ main::i#2 main::$1 ] ) always clobbers reg byte a
|
||||
Statement [7] (word~) main::$2 ← ((word)) (byte) main::i#2 [ main::i#2 main::$1 main::$2 ] ( main:2 [ main::i#2 main::$1 main::$2 ] ) always clobbers reg byte a
|
||||
Statement [8] (word~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8 [ main::i#2 main::$1 main::$3 ] ( main:2 [ main::i#2 main::$1 main::$3 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [9] (word~) main::$4 ← (word~) main::$3 + (byte) main::i#2 [ main::i#2 main::$1 main::$4 ] ( main:2 [ main::i#2 main::$1 main::$4 ] ) always clobbers reg byte a
|
||||
Statement [10] (word) main::$6 ← (word~) main::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$4 main::$6 ] ( main:2 [ main::i#2 main::$4 main::$6 ] ) always clobbers reg byte a
|
||||
Statement [11] (word*) main::$9 ← (const word[$100]) words#0 + (word) main::$6 [ main::i#2 main::$4 main::$9 ] ( main:2 [ main::i#2 main::$4 main::$9 ] ) always clobbers reg byte a
|
||||
Statement [12] *((word*) main::$9) ← (word~) main::$4 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [15] *((const word*) main::SCREEN#0) ← *((const word[$100]) words#0+((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x ,
|
||||
Potential registers zp ZP_WORD:3 [ main::$1 ] : zp ZP_WORD:3 ,
|
||||
Potential registers zp ZP_WORD:5 [ main::$2 ] : zp ZP_WORD:5 ,
|
||||
Potential registers zp ZP_WORD:7 [ main::$3 ] : zp ZP_WORD:7 ,
|
||||
Potential registers zp ZP_WORD:9 [ main::$4 ] : zp ZP_WORD:9 ,
|
||||
Potential registers zp ZP_WORD:11 [ main::$6 ] : zp ZP_WORD:11 ,
|
||||
Potential registers zp ZP_WORD:13 [ main::$9 ] : zp ZP_WORD:13 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 23.38: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_WORD:5 [ main::$2 ] 22: zp ZP_WORD:7 [ main::$3 ] 22: zp ZP_WORD:11 [ main::$6 ] 22: zp ZP_WORD:13 [ main::$9 ] 7.33: zp ZP_WORD:9 [ main::$4 ] 5.5: zp ZP_WORD:3 [ main::$1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 1482 combination reg byte x [ main::i#2 main::i#1 ] zp ZP_WORD:5 [ main::$2 ] zp ZP_WORD:7 [ main::$3 ] zp ZP_WORD:11 [ main::$6 ] zp ZP_WORD:13 [ main::$9 ] zp ZP_WORD:9 [ main::$4 ] zp ZP_WORD:3 [ main::$1 ]
|
||||
Uplifting [] best 1482 combination
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ main::$1 ] ] with [ zp ZP_WORD:11 [ main::$6 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ main::$2 ] ] with [ zp ZP_WORD:7 [ main::$3 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:3 [ main::$1 main::$6 ] ] with [ zp ZP_WORD:13 [ main::$9 ] ] - score: 1
|
||||
Coalescing zero page register with common assignment [ zp ZP_WORD:5 [ main::$2 main::$3 ] ] with [ zp ZP_WORD:9 [ main::$4 ] ] - score: 1
|
||||
Allocated (was zp ZP_WORD:3) zp ZP_WORD:2 [ main::$1 main::$6 main::$9 ]
|
||||
Allocated (was zp ZP_WORD:5) zp ZP_WORD:4 [ main::$2 main::$3 main::$4 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
//SEG0 File Comments
|
||||
// Tests a word-array with 128+ elements
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(bbegin)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.const SIZEOF_WORD = 2
|
||||
//SEG3 @begin
|
||||
bbegin:
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
b1_from_bbegin:
|
||||
jmp b1
|
||||
//SEG5 @1
|
||||
b1:
|
||||
//SEG6 [2] call main
|
||||
//SEG7 [4] phi from @1 to main [phi:@1->main]
|
||||
main_from_b1:
|
||||
jsr main
|
||||
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
|
||||
bend_from_b1:
|
||||
jmp bend
|
||||
//SEG9 @end
|
||||
bend:
|
||||
//SEG10 main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = 2
|
||||
.label _2 = 4
|
||||
.label _3 = 4
|
||||
.label _4 = 4
|
||||
.label _6 = 2
|
||||
.label _9 = 2
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
//SEG12 [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
|
||||
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
|
||||
b1_from_b1:
|
||||
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
|
||||
jmp b1
|
||||
//SEG15 main::@1
|
||||
b1:
|
||||
//SEG16 [6] (word~) main::$1 ← ((word)) (byte) main::i#2 -- vwuz1=_word_vbuxx
|
||||
txa
|
||||
sta _1
|
||||
lda #0
|
||||
sta _1+1
|
||||
//SEG17 [7] (word~) main::$2 ← ((word)) (byte) main::i#2 -- vwuz1=_word_vbuxx
|
||||
txa
|
||||
sta _2
|
||||
lda #0
|
||||
sta _2+1
|
||||
//SEG18 [8] (word~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8 -- vwuz1=vwuz1_rol_vbuc1
|
||||
ldy #8
|
||||
cpy #0
|
||||
beq !e+
|
||||
!:
|
||||
asl _3
|
||||
rol _3+1
|
||||
dey
|
||||
bne !-
|
||||
!e:
|
||||
//SEG19 [9] (word~) main::$4 ← (word~) main::$3 + (byte) main::i#2 -- vwuz1=vwuz1_plus_vbuxx
|
||||
txa
|
||||
clc
|
||||
adc _4
|
||||
sta _4
|
||||
bcc !+
|
||||
inc _4+1
|
||||
!:
|
||||
//SEG20 [10] (word) main::$6 ← (word~) main::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_rol_1
|
||||
asl _6
|
||||
rol _6+1
|
||||
//SEG21 [11] (word*) main::$9 ← (const word[$100]) words#0 + (word) main::$6 -- pwuz1=pwuc1_plus_vwuz1
|
||||
clc
|
||||
lda _9
|
||||
adc #<words
|
||||
sta _9
|
||||
lda _9+1
|
||||
adc #>words
|
||||
sta _9+1
|
||||
//SEG22 [12] *((word*) main::$9) ← (word~) main::$4 -- _deref_pwuz1=vwuz2
|
||||
ldy #0
|
||||
lda _4
|
||||
sta (_9),y
|
||||
iny
|
||||
lda _4+1
|
||||
sta (_9),y
|
||||
//SEG23 [13] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
//SEG24 [14] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 -- vbuxx_neq_0_then_la1
|
||||
cpx #0
|
||||
bne b1_from_b1
|
||||
jmp b2
|
||||
//SEG25 main::@2
|
||||
b2:
|
||||
//SEG26 [15] *((const word*) main::SCREEN#0) ← *((const word[$100]) words#0+((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD) -- _deref_pwuc1=_deref_pwuc2
|
||||
lda words+$ff*SIZEOF_WORD
|
||||
sta SCREEN
|
||||
lda words+$ff*SIZEOF_WORD+1
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
//SEG27 main::@return
|
||||
breturn:
|
||||
//SEG28 [16] return
|
||||
rts
|
||||
}
|
||||
words: .fill 2*$100, 0
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Replacing label b1_from_b1 with b1
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction b1:
|
||||
Removing instruction main_from_b1:
|
||||
Removing instruction bend_from_b1:
|
||||
Removing instruction b1_from_b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bend:
|
||||
Removing instruction b1_from_main:
|
||||
Removing instruction b2:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
|
||||
(void()) main()
|
||||
(word~) main::$1 $1 zp ZP_WORD:2 5.5
|
||||
(word~) main::$2 $2 zp ZP_WORD:4 22.0
|
||||
(word~) main::$3 $3 zp ZP_WORD:4 22.0
|
||||
(word~) main::$4 $4 zp ZP_WORD:4 7.333333333333333
|
||||
(word) main::$6 $6 zp ZP_WORD:2 22.0
|
||||
(word*) main::$9 $9 zp ZP_WORD:2 22.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(word*) main::SCREEN
|
||||
(const word*) main::SCREEN#0 SCREEN = ((word*))(word/signed word/dword/signed dword) $400
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 6.875
|
||||
(word[$100]) words
|
||||
(const word[$100]) words#0 words = { fill( $100, 0) }
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
zp ZP_WORD:2 [ main::$1 main::$6 main::$9 ]
|
||||
zp ZP_WORD:4 [ main::$2 main::$3 main::$4 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 1192
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests a word-array with 128+ elements
|
||||
//SEG1 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
//SEG2 Global Constants & labels
|
||||
.const SIZEOF_WORD = 2
|
||||
//SEG3 @begin
|
||||
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
//SEG5 @1
|
||||
//SEG6 [2] call main
|
||||
//SEG7 [4] phi from @1 to main [phi:@1->main]
|
||||
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
|
||||
//SEG9 @end
|
||||
//SEG10 main
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label _1 = 2
|
||||
.label _2 = 4
|
||||
.label _3 = 4
|
||||
.label _4 = 4
|
||||
.label _6 = 2
|
||||
.label _9 = 2
|
||||
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
//SEG12 [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
|
||||
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
|
||||
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
|
||||
//SEG15 main::@1
|
||||
b1:
|
||||
//SEG16 [6] (word~) main::$1 ← ((word)) (byte) main::i#2 -- vwuz1=_word_vbuxx
|
||||
txa
|
||||
sta _1
|
||||
lda #0
|
||||
sta _1+1
|
||||
//SEG17 [7] (word~) main::$2 ← ((word)) (byte) main::i#2 -- vwuz1=_word_vbuxx
|
||||
txa
|
||||
sta _2
|
||||
lda #0
|
||||
sta _2+1
|
||||
//SEG18 [8] (word~) main::$3 ← (word~) main::$2 << (byte/signed byte/word/signed word/dword/signed dword) 8 -- vwuz1=vwuz1_rol_vbuc1
|
||||
ldy #8
|
||||
cpy #0
|
||||
beq !e+
|
||||
!:
|
||||
asl _3
|
||||
rol _3+1
|
||||
dey
|
||||
bne !-
|
||||
!e:
|
||||
//SEG19 [9] (word~) main::$4 ← (word~) main::$3 + (byte) main::i#2 -- vwuz1=vwuz1_plus_vbuxx
|
||||
txa
|
||||
clc
|
||||
adc _4
|
||||
sta _4
|
||||
bcc !+
|
||||
inc _4+1
|
||||
!:
|
||||
//SEG20 [10] (word) main::$6 ← (word~) main::$1 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vwuz1=vwuz1_rol_1
|
||||
asl _6
|
||||
rol _6+1
|
||||
//SEG21 [11] (word*) main::$9 ← (const word[$100]) words#0 + (word) main::$6 -- pwuz1=pwuc1_plus_vwuz1
|
||||
clc
|
||||
lda _9
|
||||
adc #<words
|
||||
sta _9
|
||||
lda _9+1
|
||||
adc #>words
|
||||
sta _9+1
|
||||
//SEG22 [12] *((word*) main::$9) ← (word~) main::$4 -- _deref_pwuz1=vwuz2
|
||||
ldy #0
|
||||
lda _4
|
||||
sta (_9),y
|
||||
iny
|
||||
lda _4+1
|
||||
sta (_9),y
|
||||
//SEG23 [13] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
//SEG24 [14] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 -- vbuxx_neq_0_then_la1
|
||||
cpx #0
|
||||
bne b1
|
||||
//SEG25 main::@2
|
||||
//SEG26 [15] *((const word*) main::SCREEN#0) ← *((const word[$100]) words#0+((word))(byte/word/signed word/dword/signed dword) $ff*(const byte) SIZEOF_WORD) -- _deref_pwuc1=_deref_pwuc2
|
||||
lda words+$ff*SIZEOF_WORD
|
||||
sta SCREEN
|
||||
lda words+$ff*SIZEOF_WORD+1
|
||||
sta SCREEN+1
|
||||
//SEG27 main::@return
|
||||
//SEG28 [16] return
|
||||
rts
|
||||
}
|
||||
words: .fill 2*$100, 0
|
||||
|
25
src/test/ref/word-array-2.sym
Normal file
25
src/test/ref/word-array-2.sym
Normal file
@ -0,0 +1,25 @@
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
|
||||
(void()) main()
|
||||
(word~) main::$1 $1 zp ZP_WORD:2 5.5
|
||||
(word~) main::$2 $2 zp ZP_WORD:4 22.0
|
||||
(word~) main::$3 $3 zp ZP_WORD:4 22.0
|
||||
(word~) main::$4 $4 zp ZP_WORD:4 7.333333333333333
|
||||
(word) main::$6 $6 zp ZP_WORD:2 22.0
|
||||
(word*) main::$9 $9 zp ZP_WORD:2 22.0
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(word*) main::SCREEN
|
||||
(const word*) main::SCREEN#0 SCREEN = ((word*))(word/signed word/dword/signed dword) $400
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 16.5
|
||||
(byte) main::i#2 reg byte x 6.875
|
||||
(word[$100]) words
|
||||
(const word[$100]) words#0 words = { fill( $100, 0) }
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
zp ZP_WORD:2 [ main::$1 main::$6 main::$9 ]
|
||||
zp ZP_WORD:4 [ main::$2 main::$3 main::$4 ]
|
Loading…
x
Reference in New Issue
Block a user