1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-08 17:54:40 +00:00

Improved ZP register ASM naming further. (issue with allocation not choosing optimal registers in some cases - a few tests left failing)

This commit is contained in:
jespergravgaard 2017-08-21 08:27:34 +02:00
parent 029227652e
commit 64c690f925
31 changed files with 965 additions and 952 deletions

View File

@ -23,7 +23,9 @@ public class AsmFragment {
*/
private Map<String, Value> bindings;
/** The scope containing the fragment. Used when referenginv symbols defined in other scopes. */
/**
* The scope containing the fragment. Used when referenginv symbols defined in other scopes.
*/
private ScopeRef scope;
/**
@ -227,9 +229,7 @@ public class AsmFragment {
if (value instanceof VariableRef) {
value = program.getScope().getVariable((VariableRef) value);
}
if (value instanceof Variable) {
value = ((Variable) value).getAllocation();
} else if (value instanceof PointerDereferenceSimple) {
if (value instanceof PointerDereferenceSimple) {
PointerDereferenceSimple deref = (PointerDereferenceSimple) value;
return "_star_" + bind(deref.getPointer());
} else if (value instanceof PointerDereferenceIndexed) {
@ -237,14 +237,21 @@ public class AsmFragment {
return bind(deref.getPointer()) + "_staridx_" + bind(deref.getIndex());
}
// Find value if it is already bound
for (String name : bindings.keySet()) {
if (value.equals(bindings.get(name))) {
return name;
if (value instanceof Variable) {
Registers.Register register = ((Variable) value).getAllocation();
// Find value if it is already bound
for (String name : bindings.keySet()) {
Value bound = bindings.get(name);
if(bound instanceof Variable) {
Registers.Register boundRegister = ((Variable) bound).getAllocation();
if(boundRegister!=null && boundRegister.equals(register)) {
return name;
}
}
}
}
if (value instanceof Registers.Register) {
Registers.Register register = (Registers.Register) value;
// Create a new suitable name
if (Registers.RegisterType.ZP_BYTE.equals(register.getType())) {
String name = "zpby" + nextZpByteIdx++;
bindings.put(name, value);
@ -307,20 +314,16 @@ public class AsmFragment {
throw new RuntimeException("Binding '" + name + "' not found in fragment " + signature + ".asm");
}
String bound;
if (boundValue instanceof Registers.Register) {
Registers.Register register = (Registers.Register) boundValue;
if (register instanceof Registers.RegisterZp) {
Registers.RegisterZp zpReg = (Registers.RegisterZp) register;
if(zpReg.getName()!=null) {
Variable variable = zpReg.getVariable();
Scope varScope = variable.getScope();
if(!varScope.getRef().equals(scope) && varScope.getRef().getFullName().length()>0) {
bound = varScope.getFullName()+"."+zpReg.getName().replace('@', 'b').replace(':', '_').replace("#", "_");
} else {
bound = zpReg.getName().replace('@', 'b').replace(':', '_').replace("#", "_");
}
} else {
bound = String.format("$%x", zpReg.getZp());
if (boundValue instanceof Variable) {
Variable boundVar = (Variable) boundValue;
Registers.Register register = boundVar.getAllocation();
if (register != null && register instanceof Registers.RegisterZp) {
Scope varScope = boundVar.getScope();
String asmName = boundVar.getAsmName() == null ? boundVar.getLocalName() : boundVar.getAsmName();
if (!varScope.getRef().equals(scope) && varScope.getRef().getFullName().length() > 0) {
bound = varScope.getFullName() + "." + asmName.replace('@', 'b').replace(':', '_').replace("#", "_");
} else {
bound = asmName.replace('@', 'b').replace(':', '_').replace("#", "_");
}
} else {
throw new RuntimeException("Register Type not implemented " + register);

View File

@ -39,30 +39,14 @@ public class Registers {
/** The ZP address used for the byte. */
private int zp;
/** The name used as a label for the register in the ASM code. */
private String name;
/** The variable represented by the register. */
private Variable variable;
public RegisterZp(int zp, String name, Variable variable) {
public RegisterZp(int zp) {
this.zp = zp;
this.name = name;
this.variable = variable;
}
public int getZp() {
return zp;
}
public String getName() {
return name;
}
public Variable getVariable() {
return variable;
}
@Override
public boolean isZp() {
return true;
@ -70,7 +54,7 @@ public class Registers {
@Override
public String toString() {
return "zp "+getType().toString()+":"+zp+(name==null?"":(" "+name));
return "zp "+getType().toString()+":"+zp;
}
@Override
@ -82,20 +66,15 @@ public class Registers {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RegisterZp that = (RegisterZp) o;
if (zp != that.zp) return false;
return name != null ? name.equals(that.name) : that.name == null;
return zp == that.zp;
}
@Override
public int hashCode() {
int result = zp;
result = 31 * result + (name != null ? name.hashCode() : 0);
return result;
}
public void setName(String name) {
this.name = name;
return zp;
}
}
@ -103,8 +82,8 @@ public class Registers {
/** A zero page address used as a register for a single byte variable. */
public static class RegisterZpByte extends RegisterZp {
public RegisterZpByte(int zp, String name, Variable variable) {
super(zp, name, variable);
public RegisterZpByte(int zp) {
super(zp);
}
@Override
@ -118,8 +97,8 @@ public class Registers {
/** Two zero page addresses used as a register for a single word variable. */
public static class RegisterZpWord extends RegisterZp {
public RegisterZpWord(int zp, String name, Variable variable) {
super(zp, name, variable);
public RegisterZpWord(int zp) {
super(zp);
}
@Override
@ -132,8 +111,8 @@ public class Registers {
/** A zero page address used as a register for a boolean variable. */
public static class RegisterZpBool extends RegisterZp {
public RegisterZpBool(int zp, String name, Variable variable) {
super(zp, name, variable);
public RegisterZpBool(int zp) {
super(zp);
}
@Override
@ -147,8 +126,8 @@ public class Registers {
/** A zro page address pair used as a register containing a pointer to a byte. */
public static class RegisterZpPointerByte extends RegisterZp {
public RegisterZpPointerByte(int zp, String name, Variable variable) {
super(zp, name, variable);
public RegisterZpPointerByte(int zp) {
super(zp);
}
@Override

View File

@ -273,6 +273,10 @@ public abstract class Scope implements Symbol {
if (symbolClass == null || symbolClass.isInstance(symbol)) {
res.append(symbol.toString(program));
if (symbol instanceof Variable) {
String asmName = ((Variable) symbol).getAsmName();
if(asmName!=null) {
res.append(" "+asmName);
}
Registers.Register register = ((Variable) symbol).getAllocation();
if (register != null) {
res.append(" " + register);

View File

@ -21,6 +21,9 @@ public abstract class Variable implements Symbol {
/** If the variable is assigned to an ASM register, this contains the register. If null the variable has no allocation (yet). Constants are never assigned to registers. */
private Registers.Register allocation;
/** A short name used for the variable in ASM code. If possible variable names of ZP variables are shortened in ASM code. This is possible, when all versions of the var use the same register. */
private String asmName;
/** If the variable is a constant this is the constant value. If null the variable is not considered constant.*/
private Constant constant;
@ -82,6 +85,14 @@ public abstract class Variable implements Symbol {
this.allocation = allocation;
}
public String getAsmName() {
return asmName;
}
public void setAsmName(String asmName) {
this.asmName = asmName;
}
public Constant getConstant() {
return constant;
}
@ -96,29 +107,6 @@ public abstract class Variable implements Symbol {
@JsonIgnore
public abstract boolean isIntermediate();
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Variable variable = (Variable) o;
if (inferredType != variable.inferredType) return false;
if (name != null ? !name.equals(variable.name) : variable.name != null) return false;
if (scope != null ? !scope.equals(variable.scope) : variable.scope != null) return false;
if (type != null ? !type.equals(variable.type) : variable.type != null) return false;
if (allocation != null ? !allocation.equals(variable.allocation) : variable.allocation != null) return false;
return constant != null ? constant.equals(variable.constant) : variable.constant == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (scope != null ? scope.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (inferredType ? 1 : 0);
result = 31 * result + (allocation != null ? allocation.hashCode() : 0);
result = 31 * result + (constant != null ? constant.hashCode() : 0);
return result;
}
public Scope getScope() {
return scope;
@ -133,6 +121,37 @@ public abstract class Variable implements Symbol {
}
}
@JsonIgnore
public VariableRef getRef() {
return new VariableRef(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Variable variable = (Variable) o;
if (inferredType != variable.inferredType) return false;
if (name != null ? !name.equals(variable.name) : variable.name != null) return false;
if (scope != null ? !scope.equals(variable.scope) : variable.scope != null) return false;
if (type != null ? !type.equals(variable.type) : variable.type != null) return false;
if (allocation != null ? !allocation.equals(variable.allocation) : variable.allocation != null) return false;
if (asmName != null ? !asmName.equals(variable.asmName) : variable.asmName != null) return false;
return constant != null ? constant.equals(variable.constant) : variable.constant == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (scope != null ? scope.hashCode() : 0);
result = 31 * result + (type != null ? type.hashCode() : 0);
result = 31 * result + (inferredType ? 1 : 0);
result = 31 * result + (allocation != null ? allocation.hashCode() : 0);
result = 31 * result + (asmName != null ? asmName.hashCode() : 0);
result = 31 * result + (constant != null ? constant.hashCode() : 0);
return result;
}
@Override
public String toString() {
return toString(null);
@ -140,11 +159,13 @@ public abstract class Variable implements Symbol {
@Override
public String toString(Program program) {
return "(" + type.getTypeName() + (inferredType ? "~" : "") + ") " + getFullName();
String s = new StringBuilder()
.append("(")
.append(type.getTypeName())
.append(inferredType ? "~" : "")
.append(") ")
.append(getFullName()).toString();
return s;
}
@JsonIgnore
public VariableRef getRef() {
return new VariableRef(this);
}
}

View File

@ -56,7 +56,7 @@ public class Pass4CodeGeneration {
ControlFlowBlock defaultSuccessor = getGraph().getDefaultSuccessor(block);
if (defaultSuccessor != null) {
if (defaultSuccessor.hasPhiBlock()) {
genBlockPhiTransition(asm, block, defaultSuccessor);
genBlockPhiTransition(asm, block, defaultSuccessor, defaultSuccessor.getPhiBlock());
}
asm.addInstruction("JMP", AsmAddressingMode.ABS, defaultSuccessor.getLabel().getLocalName().replace('@', 'b').replace(':', '_'));
}
@ -79,10 +79,10 @@ public class Pass4CodeGeneration {
Registers.Register register = scopeVar.getAllocation();
if(register!=null && register.isZp()) {
Registers.RegisterZp registerZp = (Registers.RegisterZp) register;
String registerZpName = registerZp.getName();
if(registerZpName !=null && !added.contains(registerZpName)) {
asm.addLabelDecl(registerZpName, registerZp.getZp());
added.add(registerZpName);
String asmName = scopeVar.getAsmName();
if(asmName !=null && !added.contains(asmName)) {
asm.addLabelDecl(asmName, registerZp.getZp());
added.add(asmName);
}
}
}
@ -159,7 +159,7 @@ public class Pass4CodeGeneration {
if (genCallPhiEntry) {
ControlFlowBlock callSuccessor = getGraph().getCallSuccessor(block);
if (callSuccessor != null && callSuccessor.hasPhiBlock()) {
genBlockPhiTransition(asm, block, callSuccessor);
genBlockPhiTransition(asm, block, callSuccessor, call);
}
}
asm.addInstruction("jsr", AsmAddressingMode.ABS, call.getProcedure().getFullName());
@ -208,14 +208,14 @@ public class Pass4CodeGeneration {
});
for (ControlFlowBlock predecessor : predecessors) {
if (block.getLabel().equals(predecessor.getConditionalSuccessor())) {
genBlockPhiTransition(asm, predecessor, block);
genBlockPhiTransition(asm, predecessor, block, block.getPhiBlock());
asm.addInstruction("JMP", AsmAddressingMode.ABS, block.getLabel().getLocalName().replace('@', 'b').replace(':', '_'));
}
}
}
}
private void genBlockPhiTransition(AsmProgram asm, ControlFlowBlock fromBlock, ControlFlowBlock toBlock) {
private void genBlockPhiTransition(AsmProgram asm, ControlFlowBlock fromBlock, ControlFlowBlock toBlock, Statement scopeStatement) {
Statement toFirstStatement = toBlock.getStatements().get(0);
asm.startSegment(toFirstStatement.getIndex(), "[" + toFirstStatement.getIndex() + "]" + " phi from " + fromBlock.getLabel().getFullName() + " to " + toBlock.getLabel().getFullName());
asm.addLabel((toBlock.getLabel().getLocalName() + "_from_" + fromBlock.getLabel().getLocalName()).replace('@', 'b').replace(':', '_'));
@ -233,7 +233,7 @@ public class Pass4CodeGeneration {
});
for (StatementPhiBlock.PhiRValue phiRValue : phiRValues) {
if (phiRValue.getPredecessor().equals(fromBlock.getLabel())) {
genAsmMove(asm, phiVariable.getVariable(), phiRValue.getrValue(), phiBlock);
genAsmMove(asm, phiVariable.getVariable(), phiRValue.getrValue(), scopeStatement);
break;
}
}

View File

@ -2,9 +2,7 @@ package dk.camelot64.kickc.passes;
import dk.camelot64.kickc.icl.*;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.*;
/**
* Move register allocation from equivalence classes to RegisterAllocation.
@ -23,46 +21,52 @@ public class Pass4RegistersFinalize extends Pass2Base {
}
liveRangeEquivalenceClassSet.storeRegisterAllocation();
if (reallocateZp) {
shortenZpRegisterNames(liveRangeEquivalenceClassSet);
shortenZpRegisterNames();
}
}
/**
* Shorten register names for ZP registers if possible
*
* @param equivalenceClassSet
*/
private void shortenZpRegisterNames(LiveRangeEquivalenceClassSet equivalenceClassSet) {
private void shortenZpRegisterNames() {
Collection<Scope> allScopes = getProgram().getScope().getAllScopes(true);
allScopes.add(getProgram().getScope());
for (Scope scope : allScopes) {
Set<String> used = new LinkedHashSet<>();
// Find all names without "#"
// Create initial short names - and remember the ones without "#"
for (Variable variable : scope.getAllVariables(false)) {
if (variable.getAllocation() != null && variable.getAllocation().isZp()) {
Registers.RegisterZp regZp = (Registers.RegisterZp) variable.getAllocation();
String regZpName = regZp.getName();
if (!regZpName.contains("#")) {
used.add(regZpName);
}
variable.setAsmName(variable.getLocalName());
} else {
variable.setAsmName(null);
}
}
// For all names with "#" try to shorten
// Find short asm names for all variables if possible
Map<String, Registers.Register> shortNames = new LinkedHashMap<>();
for (Variable variable : scope.getAllVariables(false)) {
if (variable.getAllocation() != null && variable.getAllocation().isZp()) {
Registers.RegisterZp regZp = (Registers.RegisterZp) variable.getAllocation();
String regZpName = regZp.getName();
if (regZpName.contains("#")) {
regZpName = regZpName.substring(0, regZpName.indexOf("#"));
if (!used.contains(regZpName)) {
regZp.setName(regZpName);
used.add(regZpName);
Registers.Register allocation = variable.getAllocation();
if (allocation != null && allocation.isZp()) {
String asmName = variable.getAsmName();
if (asmName.contains("#")) {
String shortName = asmName.substring(0, variable.getAsmName().indexOf("#"));
if (shortNames.get(shortName) == null || shortNames.get(shortName).equals(allocation)) {
// Short name is usable!
variable.setAsmName(shortName);
shortNames.put(shortName, allocation);
continue;
}
}
if (shortNames.get(asmName) == null || shortNames.get(asmName).equals(allocation)) {
// Try the full name instead
variable.setAsmName(asmName);
shortNames.put(asmName, allocation);
continue;
} else {
// Be unhappy (if tyhis triggers in the future extend with ability to create new names by adding suffixes)
throw new RuntimeException("ASM name already used "+asmName);
}
}
}
}
}
@ -95,28 +99,27 @@ public class Pass4RegistersFinalize extends Pass2Base {
/**
* Create a new register for a specific variable type.
*
* @param varType The variable type to create a register for.
* @param variable The variable to create a register for.
* The register type created uses one or more zero page locations based on the variable type
* @return The new zeropage register
*/
private Registers.Register allocateNewRegisterZp(Variable variable) {
SymbolType varType = variable.getType();
String name = variable.getLocalName();
if (varType.equals(SymbolTypeBasic.BYTE)) {
return new Registers.RegisterZpByte(currentZp++, name, variable);
return new Registers.RegisterZpByte(currentZp++);
} else if (varType.equals(SymbolTypeBasic.WORD)) {
Registers.RegisterZpWord registerZpWord =
new Registers.RegisterZpWord(currentZp, name, variable);
new Registers.RegisterZpWord(currentZp);
currentZp = currentZp + 2;
return registerZpWord;
} else if (varType.equals(SymbolTypeBasic.BOOLEAN)) {
return new Registers.RegisterZpBool(currentZp++, name, variable);
return new Registers.RegisterZpBool(currentZp++);
} else if (varType.equals(SymbolTypeBasic.VOID)) {
// No need to setRegister register for VOID value
return null;
} else if (varType instanceof SymbolTypePointer) {
Registers.RegisterZpPointerByte registerZpPointerByte =
new Registers.RegisterZpPointerByte(currentZp, name, variable);
new Registers.RegisterZpPointerByte(currentZp);
currentZp = currentZp + 2;
return registerZpPointerByte;
} else {

View File

@ -1502,10 +1502,10 @@ Complete 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 ]
Allocated zp ZP_PTR_BYTE:2 cursor#3 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ]
Allocated zp ZP_BYTE:4 x#2 [ main::x#2 main::x#1 ]
Allocated zp ZP_BYTE:5 e#3 [ main::e#3 main::e#5 main::e#1 main::e#2 ]
Allocated zp ZP_BYTE:6 y#2 [ main::y#2 main::y#4 main::y#1 ]
Allocated zp ZP_PTR_BYTE:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#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 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -1611,12 +1611,12 @@ main: {
}
Statement [2] *((byte*) main::cursor#3) ← (byte) 81 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 x [ main::x#2 main::x#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 x [ main::x#2 main::x#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 e [ 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:5 e [ 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 y [ main::y#2 main::y#4 main::y#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 y [ main::y#2 main::y#4 main::y#1 ]
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 y 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 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 a as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
Statement [5] (byte) main::e#1 ← (byte) main::e#3 + (byte) 24 [ main::x#1 main::e#1 main::y#2 main::cursor#1 ] always clobbers reg byte a
Statement [8] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) 40 [ main::x#1 main::e#1 main::cursor#2 main::y#1 ] always clobbers reg byte a
Statement [9] (byte) main::e#2 ← (byte) main::e#1 - (byte) 39 [ main::x#1 main::cursor#2 main::e#2 main::y#1 ] always clobbers reg byte a
@ -1625,20 +1625,18 @@ Statement [5] (byte) main::e#1 ← (byte) main::e#3 + (byte) 24 [ main::x#1 main
Statement [8] (byte*) main::cursor#2 ← (byte*) main::cursor#1 + (byte) 40 [ main::x#1 main::e#1 main::cursor#2 main::y#1 ] always clobbers reg byte a
Statement [9] (byte) main::e#2 ← (byte) main::e#1 - (byte) 39 [ main::x#1 main::cursor#2 main::e#2 main::y#1 ] always clobbers reg byte a
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_PTR_BYTE:2 cursor [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] : zp ZP_PTR_BYTE:2 cursor ,
Potential registers zp ZP_BYTE:4 x [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 x , reg byte x ,
Potential registers zp ZP_BYTE:5 e [ main::e#3 main::e#5 main::e#1 main::e#2 ] : zp ZP_BYTE:5 e , reg byte x ,
Potential registers zp ZP_BYTE:6 y [ main::y#2 main::y#4 main::y#1 ] : zp ZP_BYTE:6 y , reg byte x ,
Potential registers zp ZP_PTR_BYTE:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] : zp ZP_PTR_BYTE:2 ,
Potential registers zp ZP_BYTE:4 [ main::x#2 main::x#1 ] : zp ZP_BYTE:4 , reg byte x ,
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 , reg byte x ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 55: zp ZP_BYTE:5 e [ main::e#3 main::e#5 main::e#1 main::e#2 ] 46.75: zp ZP_PTR_BYTE:2 cursor [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] 29.33: zp ZP_BYTE:6 y [ main::y#2 main::y#4 main::y#1 ] 14.67: zp ZP_BYTE:4 x [ main::x#2 main::x#1 ]
Uplift Scope [main] 55: zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] 46.75: zp ZP_PTR_BYTE:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#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 []
Uplifting [main] best 1315 combination reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ] zp ZP_PTR_BYTE:2 cursor [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] zp ZP_BYTE:6 y [ main::y#2 main::y#4 main::y#1 ] zp ZP_BYTE:4 x [ main::x#2 main::x#1 ]
Uplifting [main] best 1315 combination reg byte x [ main::e#3 main::e#5 main::e#1 main::e#2 ] zp ZP_PTR_BYTE:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
Uplifting [] best 1315 combination
Allocated (was zp ZP_PTR_BYTE:2 cursor) zp ZP_PTR_BYTE:2 cursor#3 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ]
Allocated (was zp ZP_BYTE:4 x) zp ZP_BYTE:4 x#2 [ main::x#2 main::x#1 ]
Allocated (was zp ZP_BYTE:6 y) zp ZP_BYTE:5 y#2 [ main::y#2 main::y#4 main::y#1 ]
Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b3
@ -2035,33 +2033,33 @@ FINAL SYMBOL TABLE
(label) main::@3
(label) main::@return
(byte*) main::cursor
(byte*) main::cursor#1 zp ZP_PTR_BYTE:2 cursor 8.25
(byte*) main::cursor#2 zp ZP_PTR_BYTE:2 cursor 11.0
(byte*) main::cursor#3 zp ZP_PTR_BYTE:2 cursor 11.0
(byte*) main::cursor#5 zp ZP_PTR_BYTE:2 cursor 16.5
(byte*) main::cursor#1 cursor zp ZP_PTR_BYTE:2 8.25
(byte*) main::cursor#2 cursor zp ZP_PTR_BYTE:2 11.0
(byte*) main::cursor#3 cursor zp ZP_PTR_BYTE:2 11.0
(byte*) main::cursor#5 cursor zp ZP_PTR_BYTE:2 16.5
(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#5 reg byte x 16.5
(byte) main::x
(byte) main::x#1 zp ZP_BYTE:4 x 3.666666666666667
(byte) main::x#2 zp ZP_BYTE:4 x 11.0
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
(byte) main::x#2 x zp ZP_BYTE:4 11.0
(byte) main::x0
(byte) main::x1
(byte) main::xd
(byte) main::y
(byte) main::y#1 zp ZP_BYTE:5 y 7.333333333333333
(byte) main::y#2 zp ZP_BYTE:5 y 5.5
(byte) main::y#4 zp ZP_BYTE:5 y 16.5
(byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333
(byte) main::y#2 y zp ZP_BYTE:5 5.5
(byte) main::y#4 y zp ZP_BYTE:5 16.5
(byte) main::y0
(byte) main::y1
(byte) main::yd
zp ZP_PTR_BYTE:2 cursor [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ]
zp ZP_BYTE:4 x [ main::x#2 main::x#1 ]
zp ZP_PTR_BYTE:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ]
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:5 y [ main::y#2 main::y#4 main::y#1 ]
zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]
FINAL CODE
//SEG0 Global ZP labels

View File

@ -8,30 +8,30 @@
(label) main::@3
(label) main::@return
(byte*) main::cursor
(byte*) main::cursor#1 zp ZP_PTR_BYTE:2 cursor 8.25
(byte*) main::cursor#2 zp ZP_PTR_BYTE:2 cursor 11.0
(byte*) main::cursor#3 zp ZP_PTR_BYTE:2 cursor 11.0
(byte*) main::cursor#5 zp ZP_PTR_BYTE:2 cursor 16.5
(byte*) main::cursor#1 cursor zp ZP_PTR_BYTE:2 8.25
(byte*) main::cursor#2 cursor zp ZP_PTR_BYTE:2 11.0
(byte*) main::cursor#3 cursor zp ZP_PTR_BYTE:2 11.0
(byte*) main::cursor#5 cursor zp ZP_PTR_BYTE:2 16.5
(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#5 reg byte x 16.5
(byte) main::x
(byte) main::x#1 zp ZP_BYTE:4 x 3.666666666666667
(byte) main::x#2 zp ZP_BYTE:4 x 11.0
(byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667
(byte) main::x#2 x zp ZP_BYTE:4 11.0
(byte) main::x0
(byte) main::x1
(byte) main::xd
(byte) main::y
(byte) main::y#1 zp ZP_BYTE:5 y 7.333333333333333
(byte) main::y#2 zp ZP_BYTE:5 y 5.5
(byte) main::y#4 zp ZP_BYTE:5 y 16.5
(byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333
(byte) main::y#2 y zp ZP_BYTE:5 5.5
(byte) main::y#4 y zp ZP_BYTE:5 16.5
(byte) main::y0
(byte) main::y1
(byte) main::yd
zp ZP_PTR_BYTE:2 cursor [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ]
zp ZP_BYTE:4 x [ main::x#2 main::x#1 ]
zp ZP_PTR_BYTE:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ]
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:5 y [ main::y#2 main::y#4 main::y#1 ]
zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ]

View File

@ -590,10 +590,10 @@ Complete equivalence classes
[ main::$1 ]
[ main::$3 ]
[ main::$4 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 $1 [ main::$1 ]
Allocated zp ZP_BYTE:4 $3 [ main::$3 ]
Allocated zp ZP_BYTE:5 $4 [ main::$4 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::$1 ]
Allocated zp ZP_BYTE:4 [ main::$3 ]
Allocated zp ZP_BYTE:5 [ main::$4 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -661,15 +661,15 @@ Statement [1] *((word) 4352) ← (byte) 0 [ ] always clobbers reg byte a
Statement [2] *((word) 4353) ← (byte) 1 [ ] always clobbers reg byte a
Statement [1] *((word) 4352) ← (byte) 0 [ ] always clobbers reg byte a
Statement [2] *((word) 4353) ← (byte) 1 [ ] always clobbers reg byte a
Equivalence Class zp ZP_BYTE:4 $3 [ main::$3 ] has ALU potential.
Equivalence Class zp ZP_BYTE:4 [ main::$3 ] has ALU potential.
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 $1 [ main::$1 ] : zp ZP_BYTE:3 $1 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 $3 [ main::$3 ] : zp ZP_BYTE:4 $3 , reg byte a , reg byte x , reg byte y , reg byte alu ,
Potential registers zp ZP_BYTE:5 $4 [ main::$4 ] : zp ZP_BYTE:5 $4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::$1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 [ main::$3 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y , reg byte alu ,
Potential registers zp ZP_BYTE:5 [ main::$4 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 27.5: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:4 $3 [ main::$3 ] 22: zp ZP_BYTE:5 $4 [ main::$4 ] 11: zp ZP_BYTE:3 $1 [ main::$1 ]
Uplift Scope [main] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 22: zp ZP_BYTE:4 [ main::$3 ] 22: zp ZP_BYTE:5 [ main::$4 ] 11: zp ZP_BYTE:3 [ main::$1 ]
Uplift Scope []
Uplifting [main] best 362 combination reg byte x [ main::i#2 main::i#1 ] reg byte alu [ main::$3 ] reg byte a [ main::$4 ] reg byte a [ main::$1 ]

View File

@ -54,9 +54,9 @@ plot: {
}
flip: {
.label c = 5
.label y = 4
.label r = 4
lda #$10
sta plot.y
sta r
ldy #$f
ldx #$0
b1:
@ -74,8 +74,8 @@ flip: {
lda c
bne b2
dey
dec plot.y
lda plot.y
dec r
lda r
bne b1
ldx #$0
b3:

View File

@ -4340,22 +4340,22 @@ Complete equivalence classes
[ plot::$3 ]
[ flip::$0 ]
[ flip::$4 ]
Allocated zp ZP_BYTE:2 c#2 [ main::c#2 main::c#1 ]
Allocated zp ZP_PTR_BYTE:3 line#2 [ plot::line#2 plot::line#1 ]
Allocated zp ZP_BYTE:5 y#2 [ plot::y#2 plot::y#1 ]
Allocated zp ZP_BYTE:6 i#2 [ plot::i#2 plot::i#3 plot::i#1 ]
Allocated zp ZP_BYTE:7 x#2 [ plot::x#2 plot::x#1 ]
Allocated zp ZP_BYTE:8 r#2 [ flip::r#2 flip::r#1 ]
Allocated zp ZP_BYTE:9 srcIdx#2 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
Allocated zp ZP_BYTE:10 dstIdx#3 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
Allocated zp ZP_BYTE:11 c#2 [ flip::c#2 flip::c#1 ]
Allocated zp ZP_BYTE:12 i#2 [ flip::i#2 flip::i#1 ]
Allocated zp ZP_BYTE:13 i#2 [ prepare::i#2 prepare::i#1 ]
Allocated zp ZP_BYTE:14 $1 [ main::$1 ]
Allocated zp ZP_BYTE:15 $3 [ main::$3 ]
Allocated zp ZP_BYTE:16 $3 [ plot::$3 ]
Allocated zp ZP_BYTE:17 $0 [ flip::$0 ]
Allocated zp ZP_BYTE:18 $4 [ flip::$4 ]
Allocated zp ZP_BYTE:2 [ main::c#2 main::c#1 ]
Allocated zp ZP_PTR_BYTE:3 [ plot::line#2 plot::line#1 ]
Allocated zp ZP_BYTE:5 [ plot::y#2 plot::y#1 ]
Allocated zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ]
Allocated zp ZP_BYTE:7 [ plot::x#2 plot::x#1 ]
Allocated zp ZP_BYTE:8 [ flip::r#2 flip::r#1 ]
Allocated zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
Allocated zp ZP_BYTE:10 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
Allocated zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ]
Allocated zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ]
Allocated zp ZP_BYTE:13 [ prepare::i#2 prepare::i#1 ]
Allocated zp ZP_BYTE:14 [ main::$1 ]
Allocated zp ZP_BYTE:15 [ main::$3 ]
Allocated zp ZP_BYTE:16 [ plot::$3 ]
Allocated zp ZP_BYTE:17 [ flip::$0 ]
Allocated zp ZP_BYTE:18 [ flip::$4 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -4658,48 +4658,48 @@ prepare: {
}
Statement [20] (byte*) plot::line#1 ← (byte*) plot::line#2 + (byte) 40 [ plot::i#1 plot::line#1 plot::y#2 ] always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 i [ plot::i#2 plot::i#3 plot::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 y [ plot::y#2 plot::y#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ plot::y#2 plot::y#1 ]
Statement [29] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) 16 [ flip::srcIdx#1 flip::dstIdx#1 flip::c#2 flip::r#2 ] always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 srcIdx [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 c [ flip::c#2 flip::c#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 r [ flip::r#2 flip::r#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ flip::r#2 flip::r#1 ]
Statement [20] (byte*) plot::line#1 ← (byte*) plot::line#2 + (byte) 40 [ plot::i#1 plot::line#1 plot::y#2 ] always clobbers reg byte a
Statement [29] (byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) 16 [ flip::srcIdx#1 flip::dstIdx#1 flip::c#2 flip::r#2 ] always clobbers reg byte a
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 c [ main::c#2 main::c#1 ] : zp ZP_BYTE:2 c , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_PTR_BYTE:3 line [ plot::line#2 plot::line#1 ] : zp ZP_PTR_BYTE:3 line ,
Potential registers zp ZP_BYTE:5 y [ plot::y#2 plot::y#1 ] : zp ZP_BYTE:5 y , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 i [ plot::i#2 plot::i#3 plot::i#1 ] : zp ZP_BYTE:6 i , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 x [ plot::x#2 plot::x#1 ] : zp ZP_BYTE:7 x , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:8 r [ flip::r#2 flip::r#1 ] : zp ZP_BYTE:8 r , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:9 srcIdx [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] : zp ZP_BYTE:9 srcIdx , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:10 dstIdx [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] : zp ZP_BYTE:10 dstIdx , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:11 c [ flip::c#2 flip::c#1 ] : zp ZP_BYTE:11 c , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:12 i [ flip::i#2 flip::i#1 ] : zp ZP_BYTE:12 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:13 i [ prepare::i#2 prepare::i#1 ] : zp ZP_BYTE:13 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:14 $1 [ main::$1 ] : zp ZP_BYTE:14 $1 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:15 $3 [ main::$3 ] : zp ZP_BYTE:15 $3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:16 $3 [ plot::$3 ] : zp ZP_BYTE:16 $3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:17 $0 [ flip::$0 ] : zp ZP_BYTE:17 $0 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:18 $4 [ flip::$4 ] : zp ZP_BYTE:18 $4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::c#2 main::c#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_PTR_BYTE:3 [ plot::line#2 plot::line#1 ] : zp ZP_PTR_BYTE:3 ,
Potential registers zp ZP_BYTE:5 [ plot::y#2 plot::y#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ] : zp ZP_BYTE:6 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ plot::x#2 plot::x#1 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:8 [ flip::r#2 flip::r#1 ] : zp ZP_BYTE:8 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] : zp ZP_BYTE:9 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:10 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] : zp ZP_BYTE:10 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ] : zp ZP_BYTE:11 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ] : zp ZP_BYTE:12 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:13 [ prepare::i#2 prepare::i#1 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:14 [ main::$1 ] : zp ZP_BYTE:14 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:15 [ main::$3 ] : zp ZP_BYTE:15 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:16 [ plot::$3 ] : zp ZP_BYTE:16 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:17 [ flip::$0 ] : zp ZP_BYTE:17 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:18 [ flip::$4 ] : zp ZP_BYTE:18 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [flip] 2,002: zp ZP_BYTE:17 $0 [ flip::$0 ] 1,901.9: zp ZP_BYTE:11 c [ flip::c#2 flip::c#1 ] 1,746.33: zp ZP_BYTE:10 dstIdx [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] 1,537.1: zp ZP_BYTE:9 srcIdx [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] 286.17: zp ZP_BYTE:12 i [ flip::i#2 flip::i#1 ] 202: zp ZP_BYTE:18 $4 [ flip::$4 ] 173.94: zp ZP_BYTE:8 r [ flip::r#2 flip::r#1 ]
Uplift Scope [plot] 2,252.25: zp ZP_BYTE:7 x [ plot::x#2 plot::x#1 ] 2,002: zp ZP_BYTE:16 $3 [ plot::$3 ] 1,587.17: zp ZP_BYTE:6 i [ plot::i#2 plot::i#3 plot::i#1 ] 239.19: zp ZP_PTR_BYTE:3 line [ plot::line#2 plot::line#1 ] 176.75: zp ZP_BYTE:5 y [ plot::y#2 plot::y#1 ]
Uplift Scope [main] 2,002: zp ZP_BYTE:14 $1 [ main::$1 ] 2,002: zp ZP_BYTE:15 $3 [ main::$3 ] 191.9: zp ZP_BYTE:2 c [ main::c#2 main::c#1 ]
Uplift Scope [prepare] 38.5: zp ZP_BYTE:13 i [ prepare::i#2 prepare::i#1 ]
Uplift Scope [flip] 2,002: zp ZP_BYTE:17 [ flip::$0 ] 1,901.9: zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ] 1,746.33: zp ZP_BYTE:10 [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] 1,537.1: zp ZP_BYTE:9 [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] 286.17: zp ZP_BYTE:12 [ flip::i#2 flip::i#1 ] 202: zp ZP_BYTE:18 [ flip::$4 ] 173.94: zp ZP_BYTE:8 [ flip::r#2 flip::r#1 ]
Uplift Scope [plot] 2,252.25: zp ZP_BYTE:7 [ plot::x#2 plot::x#1 ] 2,002: zp ZP_BYTE:16 [ plot::$3 ] 1,587.17: zp ZP_BYTE:6 [ plot::i#2 plot::i#3 plot::i#1 ] 239.19: zp ZP_PTR_BYTE:3 [ plot::line#2 plot::line#1 ] 176.75: zp ZP_BYTE:5 [ plot::y#2 plot::y#1 ]
Uplift Scope [main] 2,002: zp ZP_BYTE:14 [ main::$1 ] 2,002: zp ZP_BYTE:15 [ main::$3 ] 191.9: zp ZP_BYTE:2 [ main::c#2 main::c#1 ]
Uplift Scope [prepare] 38.5: zp ZP_BYTE:13 [ prepare::i#2 prepare::i#1 ]
Uplift Scope []
Uplifting [flip] best 180564 combination reg byte a [ flip::$0 ] zp ZP_BYTE:11 c [ flip::c#2 flip::c#1 ] reg byte y [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] reg byte x [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] reg byte x [ flip::i#2 flip::i#1 ] reg byte a [ flip::$4 ] zp ZP_BYTE:8 r [ flip::r#2 flip::r#1 ]
Uplifting [plot] best 150164 combination reg byte y [ plot::x#2 plot::x#1 ] reg byte a [ plot::$3 ] reg byte x [ plot::i#2 plot::i#3 plot::i#1 ] zp ZP_PTR_BYTE:3 line [ plot::line#2 plot::line#1 ] zp ZP_BYTE:5 y [ plot::y#2 plot::y#1 ]
Uplifting [flip] best 180564 combination reg byte a [ flip::$0 ] zp ZP_BYTE:11 [ flip::c#2 flip::c#1 ] reg byte y [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ] reg byte x [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ] reg byte x [ flip::i#2 flip::i#1 ] reg byte a [ flip::$4 ] zp ZP_BYTE:8 [ flip::r#2 flip::r#1 ]
Uplifting [plot] best 150164 combination reg byte y [ plot::x#2 plot::x#1 ] reg byte a [ plot::$3 ] reg byte x [ plot::i#2 plot::i#3 plot::i#1 ] zp ZP_PTR_BYTE:3 [ plot::line#2 plot::line#1 ] zp ZP_BYTE:5 [ plot::y#2 plot::y#1 ]
Uplifting [main] best 129564 combination reg byte a [ main::$1 ] reg byte a [ main::$3 ] reg byte x [ main::c#2 main::c#1 ]
Uplifting [prepare] best 129424 combination reg byte x [ prepare::i#2 prepare::i#1 ]
Uplifting [] best 129424 combination
Coalescing zero page register [ zp ZP_BYTE:5 y [ plot::y#2 plot::y#1 ] ] with [ zp ZP_BYTE:8 r [ flip::r#2 flip::r#1 ] ]
Allocated (was zp ZP_PTR_BYTE:3 line) zp ZP_PTR_BYTE:2 line#2 [ plot::line#2 plot::line#1 ]
Allocated (was zp ZP_BYTE:5 y) zp ZP_BYTE:4 y#2 [ plot::y#2 plot::y#1 flip::r#2 flip::r#1 ]
Allocated (was zp ZP_BYTE:11 c) zp ZP_BYTE:5 c#2 [ flip::c#2 flip::c#1 ]
Coalescing zero page register [ zp ZP_BYTE:5 [ plot::y#2 plot::y#1 ] ] with [ zp ZP_BYTE:8 [ flip::r#2 flip::r#1 ] ]
Allocated (was zp ZP_PTR_BYTE:3) zp ZP_PTR_BYTE:2 [ plot::line#2 plot::line#1 ]
Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:4 [ plot::y#2 plot::y#1 flip::r#2 flip::r#1 ]
Allocated (was zp ZP_BYTE:11) zp ZP_BYTE:5 [ flip::c#2 flip::c#1 ]
Removing instruction jmp bend
Removing instruction jmp b3
Removing instruction jmp b4
@ -4856,12 +4856,12 @@ plot: {
//SEG58 flip
flip: {
.label c = 5
.label y = 4
.label r = 4
//SEG59 [24] phi from flip to flip::@1
b1_from_flip:
//SEG60 [24] phi (byte) flip::r#2 = (byte) 16 -- zpby1=coby1
lda #$10
sta plot.y
sta r
//SEG61 [24] phi (byte) flip::dstIdx#5 = (byte) 15 -- yby=coby1
ldy #$f
//SEG62 [24] phi (byte) flip::srcIdx#3 = (byte) 0 -- xby=coby1
@ -4910,9 +4910,9 @@ flip: {
//SEG84 [32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ] -- yby=_dec_yby
dey
//SEG85 [33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1=_dec_zpby1
dec plot.y
dec r
//SEG86 [34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1_neq_0_then_la1
lda plot.y
lda r
bne b1_from_b4
//SEG87 [35] phi from flip::@4 to flip::@3
b3_from_b4:
@ -5113,12 +5113,12 @@ plot: {
//SEG58 flip
flip: {
.label c = 5
.label y = 4
.label r = 4
//SEG59 [24] phi from flip to flip::@1
b1_from_flip:
//SEG60 [24] phi (byte) flip::r#2 = (byte) 16 -- zpby1=coby1
lda #$10
sta plot.y
sta r
//SEG61 [24] phi (byte) flip::dstIdx#5 = (byte) 15 -- yby=coby1
ldy #$f
//SEG62 [24] phi (byte) flip::srcIdx#3 = (byte) 0 -- xby=coby1
@ -5164,9 +5164,9 @@ flip: {
//SEG84 [32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ] -- yby=_dec_yby
dey
//SEG85 [33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1=_dec_zpby1
dec plot.y
dec r
//SEG86 [34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1_neq_0_then_la1
lda plot.y
lda r
bne b1
//SEG87 [35] phi from flip::@4 to flip::@3
b3_from_b4:
@ -5355,11 +5355,11 @@ plot: {
//SEG58 flip
flip: {
.label c = 5
.label y = 4
.label r = 4
//SEG59 [24] phi from flip to flip::@1
//SEG60 [24] phi (byte) flip::r#2 = (byte) 16 -- zpby1=coby1
lda #$10
sta plot.y
sta r
//SEG61 [24] phi (byte) flip::dstIdx#5 = (byte) 15 -- yby=coby1
ldy #$f
//SEG62 [24] phi (byte) flip::srcIdx#3 = (byte) 0 -- xby=coby1
@ -5404,9 +5404,9 @@ flip: {
//SEG84 [32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ] -- yby=_dec_yby
dey
//SEG85 [33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1=_dec_zpby1
dec plot.y
dec r
//SEG86 [34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1_neq_0_then_la1
lda plot.y
lda r
bne b1
//SEG87 [35] phi from flip::@4 to flip::@3
//SEG88 [35] phi (byte) flip::i#2 = (byte) 0 -- xby=coby1
@ -5578,11 +5578,11 @@ plot: {
//SEG58 flip
flip: {
.label c = 5
.label y = 4
.label r = 4
//SEG59 [24] phi from flip to flip::@1
//SEG60 [24] phi (byte) flip::r#2 = (byte) 16 -- zpby1=coby1
lda #$10
sta plot.y
sta r
//SEG61 [24] phi (byte) flip::dstIdx#5 = (byte) 15 -- yby=coby1
ldy #$f
//SEG62 [24] phi (byte) flip::srcIdx#3 = (byte) 0 -- xby=coby1
@ -5625,9 +5625,9 @@ flip: {
//SEG84 [32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ] -- yby=_dec_yby
dey
//SEG85 [33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1=_dec_zpby1
dec plot.y
dec r
//SEG86 [34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1_neq_0_then_la1
lda plot.y
lda r
bne b1
//SEG87 [35] phi from flip::@4 to flip::@3
//SEG88 [35] phi (byte) flip::i#2 = (byte) 0 -- xby=coby1
@ -5791,11 +5791,11 @@ plot: {
//SEG58 flip
flip: {
.label c = 5
.label y = 4
.label r = 4
//SEG59 [24] phi from flip to flip::@1
//SEG60 [24] phi (byte) flip::r#2 = (byte) 16 -- zpby1=coby1
lda #$10
sta plot.y
sta r
//SEG61 [24] phi (byte) flip::dstIdx#5 = (byte) 15 -- yby=coby1
ldy #$f
//SEG62 [24] phi (byte) flip::srcIdx#3 = (byte) 0 -- xby=coby1
@ -5838,9 +5838,9 @@ flip: {
//SEG84 [32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ] -- yby=_dec_yby
dey
//SEG85 [33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1=_dec_zpby1
dec plot.y
dec r
//SEG86 [34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1_neq_0_then_la1
lda plot.y
lda r
bne b1
//SEG87 [35] phi from flip::@4 to flip::@3
//SEG88 [35] phi (byte) flip::i#2 = (byte) 0 -- xby=coby1
@ -6002,11 +6002,11 @@ plot: {
//SEG58 flip
flip: {
.label c = 5
.label y = 4
.label r = 4
//SEG59 [24] phi from flip to flip::@1
//SEG60 [24] phi (byte) flip::r#2 = (byte) 16 -- zpby1=coby1
lda #$10
sta plot.y
sta r
//SEG61 [24] phi (byte) flip::dstIdx#5 = (byte) 15 -- yby=coby1
ldy #$f
//SEG62 [24] phi (byte) flip::srcIdx#3 = (byte) 0 -- xby=coby1
@ -6049,9 +6049,9 @@ flip: {
//SEG84 [32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ] -- yby=_dec_yby
dey
//SEG85 [33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1=_dec_zpby1
dec plot.y
dec r
//SEG86 [34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1_neq_0_then_la1
lda plot.y
lda r
bne b1
//SEG87 [35] phi from flip::@4 to flip::@3
//SEG88 [35] phi (byte) flip::i#2 = (byte) 0 -- xby=coby1
@ -6111,8 +6111,8 @@ FINAL SYMBOL TABLE
(label) flip::@4
(label) flip::@return
(byte) flip::c
(byte) flip::c#1 zp ZP_BYTE:5 c 1501.5
(byte) flip::c#2 zp ZP_BYTE:5 c 400.4
(byte) flip::c#1 c zp ZP_BYTE:5 1501.5
(byte) flip::c#2 c zp ZP_BYTE:5 400.4
(byte) flip::dstIdx
(byte) flip::dstIdx#1 reg byte y 701.0
(byte) flip::dstIdx#2 reg byte y 67.33333333333333
@ -6122,8 +6122,8 @@ FINAL SYMBOL TABLE
(byte) flip::i#1 reg byte x 151.5
(byte) flip::i#2 reg byte x 134.66666666666666
(byte) flip::r
(byte) flip::r#1 zp ZP_BYTE:4 y 151.5
(byte) flip::r#2 zp ZP_BYTE:4 y 22.444444444444443
(byte) flip::r#1 r zp ZP_BYTE:4 151.5
(byte) flip::r#2 r zp ZP_BYTE:4 22.444444444444443
(byte) flip::srcIdx
(byte) flip::srcIdx#1 reg byte x 300.42857142857144
(byte) flip::srcIdx#2 reg byte x 1034.6666666666667
@ -6152,14 +6152,14 @@ FINAL SYMBOL TABLE
(byte) plot::i#2 reg byte x 1034.6666666666667
(byte) plot::i#3 reg byte x 202.0
(byte*) plot::line
(byte*) plot::line#1 zp ZP_PTR_BYTE:2 line 67.33333333333333
(byte*) plot::line#2 zp ZP_PTR_BYTE:2 line 171.85714285714283
(byte*) plot::line#1 line zp ZP_PTR_BYTE:2 67.33333333333333
(byte*) plot::line#2 line zp ZP_PTR_BYTE:2 171.85714285714283
(byte) plot::x
(byte) plot::x#1 reg byte y 1501.5
(byte) plot::x#2 reg byte y 750.75
(byte) plot::y
(byte) plot::y#1 zp ZP_BYTE:4 y 151.5
(byte) plot::y#2 zp ZP_BYTE:4 y 25.25
(byte) plot::y#1 y zp ZP_BYTE:4 151.5
(byte) plot::y#2 y zp ZP_BYTE:4 25.25
(void()) prepare()
(label) prepare::@1
(label) prepare::@return
@ -6168,13 +6168,13 @@ FINAL SYMBOL TABLE
(byte) prepare::i#2 reg byte x 22.0
reg byte x [ main::c#2 main::c#1 ]
zp ZP_PTR_BYTE:2 line [ plot::line#2 plot::line#1 ]
zp ZP_BYTE:4 y [ plot::y#2 plot::y#1 flip::r#2 flip::r#1 ]
zp ZP_PTR_BYTE:2 [ plot::line#2 plot::line#1 ]
zp ZP_BYTE:4 [ plot::y#2 plot::y#1 flip::r#2 flip::r#1 ]
reg byte x [ plot::i#2 plot::i#3 plot::i#1 ]
reg byte y [ plot::x#2 plot::x#1 ]
reg byte x [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
reg byte y [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
zp ZP_BYTE:5 c [ flip::c#2 flip::c#1 ]
zp ZP_BYTE:5 [ flip::c#2 flip::c#1 ]
reg byte x [ flip::i#2 flip::i#1 ]
reg byte x [ prepare::i#2 prepare::i#1 ]
reg byte a [ main::$1 ]
@ -6299,11 +6299,11 @@ plot: {
//SEG58 flip
flip: {
.label c = 5
.label y = 4
.label r = 4
//SEG59 [24] phi from flip to flip::@1
//SEG60 [24] phi (byte) flip::r#2 = (byte) 16 -- zpby1=coby1
lda #$10
sta plot.y
sta r
//SEG61 [24] phi (byte) flip::dstIdx#5 = (byte) 15 -- yby=coby1
ldy #$f
//SEG62 [24] phi (byte) flip::srcIdx#3 = (byte) 0 -- xby=coby1
@ -6346,9 +6346,9 @@ flip: {
//SEG84 [32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ] -- yby=_dec_yby
dey
//SEG85 [33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1=_dec_zpby1
dec plot.y
dec r
//SEG86 [34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ] -- zpby1_neq_0_then_la1
lda plot.y
lda r
bne b1
//SEG87 [35] phi from flip::@4 to flip::@3
//SEG88 [35] phi (byte) flip::i#2 = (byte) 0 -- xby=coby1

View File

@ -13,8 +13,8 @@
(label) flip::@4
(label) flip::@return
(byte) flip::c
(byte) flip::c#1 zp ZP_BYTE:5 c 1501.5
(byte) flip::c#2 zp ZP_BYTE:5 c 400.4
(byte) flip::c#1 c zp ZP_BYTE:5 1501.5
(byte) flip::c#2 c zp ZP_BYTE:5 400.4
(byte) flip::dstIdx
(byte) flip::dstIdx#1 reg byte y 701.0
(byte) flip::dstIdx#2 reg byte y 67.33333333333333
@ -24,8 +24,8 @@
(byte) flip::i#1 reg byte x 151.5
(byte) flip::i#2 reg byte x 134.66666666666666
(byte) flip::r
(byte) flip::r#1 zp ZP_BYTE:4 y 151.5
(byte) flip::r#2 zp ZP_BYTE:4 y 22.444444444444443
(byte) flip::r#1 r zp ZP_BYTE:4 151.5
(byte) flip::r#2 r zp ZP_BYTE:4 22.444444444444443
(byte) flip::srcIdx
(byte) flip::srcIdx#1 reg byte x 300.42857142857144
(byte) flip::srcIdx#2 reg byte x 1034.6666666666667
@ -54,14 +54,14 @@
(byte) plot::i#2 reg byte x 1034.6666666666667
(byte) plot::i#3 reg byte x 202.0
(byte*) plot::line
(byte*) plot::line#1 zp ZP_PTR_BYTE:2 line 67.33333333333333
(byte*) plot::line#2 zp ZP_PTR_BYTE:2 line 171.85714285714283
(byte*) plot::line#1 line zp ZP_PTR_BYTE:2 67.33333333333333
(byte*) plot::line#2 line zp ZP_PTR_BYTE:2 171.85714285714283
(byte) plot::x
(byte) plot::x#1 reg byte y 1501.5
(byte) plot::x#2 reg byte y 750.75
(byte) plot::y
(byte) plot::y#1 zp ZP_BYTE:4 y 151.5
(byte) plot::y#2 zp ZP_BYTE:4 y 25.25
(byte) plot::y#1 y zp ZP_BYTE:4 151.5
(byte) plot::y#2 y zp ZP_BYTE:4 25.25
(void()) prepare()
(label) prepare::@1
(label) prepare::@return
@ -70,13 +70,13 @@
(byte) prepare::i#2 reg byte x 22.0
reg byte x [ main::c#2 main::c#1 ]
zp ZP_PTR_BYTE:2 line [ plot::line#2 plot::line#1 ]
zp ZP_BYTE:4 y [ plot::y#2 plot::y#1 flip::r#2 flip::r#1 ]
zp ZP_PTR_BYTE:2 [ plot::line#2 plot::line#1 ]
zp ZP_BYTE:4 [ plot::y#2 plot::y#1 flip::r#2 flip::r#1 ]
reg byte x [ plot::i#2 plot::i#3 plot::i#1 ]
reg byte y [ plot::x#2 plot::x#1 ]
reg byte x [ flip::srcIdx#2 flip::srcIdx#3 flip::srcIdx#1 ]
reg byte y [ flip::dstIdx#3 flip::dstIdx#5 flip::dstIdx#2 flip::dstIdx#1 ]
zp ZP_BYTE:5 c [ flip::c#2 flip::c#1 ]
zp ZP_BYTE:5 [ flip::c#2 flip::c#1 ]
reg byte x [ flip::i#2 flip::i#1 ]
reg byte x [ prepare::i#2 prepare::i#1 ]
reg byte a [ main::$1 ]

View File

@ -468,7 +468,7 @@ Initial phi equivalence classes
[ main::i#2 main::i#1 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -514,10 +514,10 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 38.5: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Uplift Scope []
Uplifting [main] best 290 combination reg byte x [ main::i#2 main::i#1 ]

View File

@ -753,8 +753,8 @@ Initial phi equivalence classes
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::j#2 main::j#1 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 j#2 [ main::j#2 main::j#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -822,11 +822,11 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 j [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 j , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 38.5: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] 38.5: zp ZP_BYTE:3 j [ main::j#2 main::j#1 ]
Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 38.5: zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
Uplift Scope []
Uplifting [main] best 505 combination reg byte x [ main::i#2 main::i#1 ] reg byte x [ main::j#2 main::j#1 ]

View File

@ -596,7 +596,7 @@ Initial phi equivalence classes
[ main::i#2 main::i#1 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -648,10 +648,10 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 31.17: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Uplift Scope [main] 31.17: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Uplift Scope []
Uplifting [main] best 335 combination reg byte x [ main::i#2 main::i#1 ]

View File

@ -440,8 +440,8 @@ Initial phi equivalence classes
Complete equivalence classes
[ i#2 i#1 ]
[ s#2 s#4 s#1 ]
Allocated zp ZP_BYTE:2 i#2 [ i#2 i#1 ]
Allocated zp ZP_BYTE:3 s#2 [ s#2 s#4 s#1 ]
Allocated zp ZP_BYTE:2 [ i#2 i#1 ]
Allocated zp ZP_BYTE:3 [ s#2 s#4 s#1 ]
INITIAL ASM
//SEG0 Global ZP labels
.label i = 2
@ -497,11 +497,11 @@ b2:
bend:
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ i#2 i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 s [ s#2 s#4 s#1 ] : zp ZP_BYTE:3 s , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ i#2 i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ s#2 s#4 s#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 49.5: zp ZP_BYTE:3 s [ s#2 s#4 s#1 ] 27.5: zp ZP_BYTE:2 i [ i#2 i#1 ]
Uplift Scope [] 49.5: zp ZP_BYTE:3 [ s#2 s#4 s#1 ] 27.5: zp ZP_BYTE:2 [ i#2 i#1 ]
Uplifting [] best 435 combination reg byte a [ s#2 s#4 s#1 ] reg byte x [ i#2 i#1 ]
Removing instruction jmp b1

View File

@ -781,8 +781,8 @@ Initial phi equivalence classes
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ nest::j#2 nest::j#1 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 j#2 [ nest::j#2 nest::j#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ nest::j#2 nest::j#1 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -854,12 +854,12 @@ nest: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 j [ nest::j#2 nest::j#1 ] : zp ZP_BYTE:3 j , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ nest::j#2 nest::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [nest] 303: zp ZP_BYTE:3 j [ nest::j#2 nest::j#1 ]
Uplift Scope [main] 19.64: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Uplift Scope [nest] 303: zp ZP_BYTE:3 [ nest::j#2 nest::j#1 ]
Uplift Scope [main] 19.64: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Uplift Scope []
Uplifting [nest] best 2536 combination reg byte x [ nest::j#2 nest::j#1 ]

View File

@ -2040,12 +2040,12 @@ Complete equivalence classes
[ nest1::j#2 nest1::j#1 ]
[ nest2::i#2 nest2::i#1 ]
[ nest2::j#2 nest2::j#1 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 j#2 [ main::j#2 main::j#1 ]
Allocated zp ZP_BYTE:4 i#2 [ nest1::i#2 nest1::i#1 ]
Allocated zp ZP_BYTE:5 j#2 [ nest1::j#2 nest1::j#1 ]
Allocated zp ZP_BYTE:6 i#2 [ nest2::i#2 nest2::i#1 ]
Allocated zp ZP_BYTE:7 j#2 [ nest2::j#2 nest2::j#1 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
Allocated zp ZP_BYTE:4 [ nest1::i#2 nest1::i#1 ]
Allocated zp ZP_BYTE:5 [ nest1::j#2 nest1::j#1 ]
Allocated zp ZP_BYTE:6 [ nest2::i#2 nest2::i#1 ]
Allocated zp ZP_BYTE:7 [ nest2::j#2 nest2::j#1 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -2211,26 +2211,23 @@ nest2: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 j [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 j , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 i [ nest1::i#2 nest1::i#1 ] : zp ZP_BYTE:4 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:5 j [ nest1::j#2 nest1::j#1 ] : zp ZP_BYTE:5 j , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 i [ nest2::i#2 nest2::i#1 ] : zp ZP_BYTE:6 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 j [ nest2::j#2 nest2::j#1 ] : zp ZP_BYTE:7 j , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::j#2 main::j#1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 [ nest1::i#2 nest1::i#1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:5 [ nest1::j#2 nest1::j#1 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 [ nest2::i#2 nest2::i#1 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ nest2::j#2 nest2::j#1 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [nest2] 3,000,003: zp ZP_BYTE:7 j [ nest2::j#2 nest2::j#1 ] 190,001.9: zp ZP_BYTE:6 i [ nest2::i#2 nest2::i#1 ]
Uplift Scope [nest1] 17,001.7: zp ZP_BYTE:5 j [ nest1::j#2 nest1::j#1 ] 1,655.5: zp ZP_BYTE:4 i [ nest1::i#2 nest1::i#1 ]
Uplift Scope [main] 162.72: zp ZP_BYTE:3 j [ main::j#2 main::j#1 ] 17.55: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Uplift Scope [nest2] 3,000,003: zp ZP_BYTE:7 [ nest2::j#2 nest2::j#1 ] 190,001.9: zp ZP_BYTE:6 [ nest2::i#2 nest2::i#1 ]
Uplift Scope [nest1] 17,001.7: zp ZP_BYTE:5 [ nest1::j#2 nest1::j#1 ] 1,655.5: zp ZP_BYTE:4 [ nest1::i#2 nest1::i#1 ]
Uplift Scope [main] 162.72: zp ZP_BYTE:3 [ main::j#2 main::j#1 ] 17.55: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Uplift Scope []
Uplifting [nest2] best 23646452 combination reg byte y [ nest2::j#2 nest2::j#1 ] reg byte x [ nest2::i#2 nest2::i#1 ]
Uplifting [nest1] best 23566452 combination reg byte a [ nest1::j#2 nest1::j#1 ] zp ZP_BYTE:4 i [ nest1::i#2 nest1::i#1 ]
Uplifting [main] best 23566452 combination zp ZP_BYTE:3 j [ main::j#2 main::j#1 ] zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Uplifting [nest1] best 23566452 combination reg byte a [ nest1::j#2 nest1::j#1 ] zp ZP_BYTE:4 [ nest1::i#2 nest1::i#1 ]
Uplifting [main] best 23566452 combination zp ZP_BYTE:3 [ main::j#2 main::j#1 ] zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Uplifting [] best 23566452 combination
Allocated (was zp ZP_BYTE:2 i) zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated (was zp ZP_BYTE:3 j) zp ZP_BYTE:3 j#2 [ main::j#2 main::j#1 ]
Allocated (was zp ZP_BYTE:4 i) zp ZP_BYTE:4 i#2 [ nest1::i#2 nest1::i#1 ]
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
@ -2808,11 +2805,11 @@ FINAL SYMBOL TABLE
(label) main::@5
(label) main::@return
(byte) main::i
(byte) main::i#1 zp ZP_BYTE:2 i 16.5
(byte) main::i#2 zp ZP_BYTE:2 i 1.0476190476190477
(byte) main::i#1 i zp ZP_BYTE:2 16.5
(byte) main::i#2 i zp ZP_BYTE:2 1.0476190476190477
(byte) main::j
(byte) main::j#1 zp ZP_BYTE:3 j 151.5
(byte) main::j#2 zp ZP_BYTE:3 j 11.222222222222221
(byte) main::j#1 j zp ZP_BYTE:3 151.5
(byte) main::j#2 j zp ZP_BYTE:3 11.222222222222221
(void()) nest1()
(label) nest1::@1
(label) nest1::@2
@ -2820,8 +2817,8 @@ FINAL SYMBOL TABLE
(label) nest1::@5
(label) nest1::@return
(byte) nest1::i
(byte) nest1::i#1 zp ZP_BYTE:4 i 1501.5
(byte) nest1::i#2 zp ZP_BYTE:4 i 154.0
(byte) nest1::i#1 i zp ZP_BYTE:4 1501.5
(byte) nest1::i#2 i zp ZP_BYTE:4 154.0
(byte) nest1::j
(byte) nest1::j#1 reg byte a 15001.5
(byte) nest1::j#2 reg byte a 2000.2
@ -2837,9 +2834,9 @@ FINAL SYMBOL TABLE
(byte) nest2::j#1 reg byte y 1500001.5
(byte) nest2::j#2 reg byte y 1500001.5
zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
zp ZP_BYTE:3 j [ main::j#2 main::j#1 ]
zp ZP_BYTE:4 i [ nest1::i#2 nest1::i#1 ]
zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
zp ZP_BYTE:4 [ nest1::i#2 nest1::i#1 ]
reg byte a [ nest1::j#2 nest1::j#1 ]
reg byte x [ nest2::i#2 nest2::i#1 ]
reg byte y [ nest2::j#2 nest2::j#1 ]

View File

@ -8,11 +8,11 @@
(label) main::@5
(label) main::@return
(byte) main::i
(byte) main::i#1 zp ZP_BYTE:2 i 16.5
(byte) main::i#2 zp ZP_BYTE:2 i 1.0476190476190477
(byte) main::i#1 i zp ZP_BYTE:2 16.5
(byte) main::i#2 i zp ZP_BYTE:2 1.0476190476190477
(byte) main::j
(byte) main::j#1 zp ZP_BYTE:3 j 151.5
(byte) main::j#2 zp ZP_BYTE:3 j 11.222222222222221
(byte) main::j#1 j zp ZP_BYTE:3 151.5
(byte) main::j#2 j zp ZP_BYTE:3 11.222222222222221
(void()) nest1()
(label) nest1::@1
(label) nest1::@2
@ -20,8 +20,8 @@
(label) nest1::@5
(label) nest1::@return
(byte) nest1::i
(byte) nest1::i#1 zp ZP_BYTE:4 i 1501.5
(byte) nest1::i#2 zp ZP_BYTE:4 i 154.0
(byte) nest1::i#1 i zp ZP_BYTE:4 1501.5
(byte) nest1::i#2 i zp ZP_BYTE:4 154.0
(byte) nest1::j
(byte) nest1::j#1 reg byte a 15001.5
(byte) nest1::j#2 reg byte a 2000.2
@ -37,9 +37,9 @@
(byte) nest2::j#1 reg byte y 1500001.5
(byte) nest2::j#2 reg byte y 1500001.5
zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
zp ZP_BYTE:3 j [ main::j#2 main::j#1 ]
zp ZP_BYTE:4 i [ nest1::i#2 nest1::i#1 ]
zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
zp ZP_BYTE:3 [ main::j#2 main::j#1 ]
zp ZP_BYTE:4 [ nest1::i#2 nest1::i#1 ]
reg byte a [ nest1::j#2 nest1::j#1 ]
reg byte x [ nest2::i#2 nest2::i#1 ]
reg byte y [ nest2::j#2 nest2::j#1 ]

View File

@ -614,8 +614,8 @@ Initial phi equivalence classes
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::s#3 main::s#1 main::s#2 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 s#3 [ main::s#3 main::s#1 main::s#2 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::s#3 main::s#1 main::s#2 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -679,11 +679,11 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 s [ main::s#3 main::s#1 main::s#2 ] : zp ZP_BYTE:3 s , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::s#3 main::s#1 main::s#2 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 55: zp ZP_BYTE:3 s [ main::s#3 main::s#1 main::s#2 ] 44: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Uplift Scope [main] 55: zp ZP_BYTE:3 [ main::s#3 main::s#1 main::s#2 ] 44: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Uplift Scope []
Uplifting [main] best 380 combination reg byte y [ main::s#3 main::s#1 main::s#2 ] reg byte x [ main::i#2 main::i#1 ]

View File

@ -332,8 +332,8 @@ Added variable $1 to zero page equivalence class [ $1 ]
Complete equivalence classes
[ i#2 i#1 ]
[ $1 ]
Allocated zp ZP_BYTE:2 i#2 [ i#2 i#1 ]
Allocated zp ZP_BYTE:3 $1 [ $1 ]
Allocated zp ZP_BYTE:2 [ i#2 i#1 ]
Allocated zp ZP_BYTE:3 [ $1 ]
INITIAL ASM
//SEG0 Global ZP labels
.label $1 = 3
@ -372,14 +372,14 @@ b1:
bend:
Statement [1] (byte~) $1 ← (byte) i#2 + (byte) 4 [ i#2 $1 ] always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 i [ i#2 i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ i#2 i#1 ]
Statement [1] (byte~) $1 ← (byte) i#2 + (byte) 4 [ i#2 $1 ] always clobbers reg byte a
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ i#2 i#1 ] : zp ZP_BYTE:2 i , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 $1 [ $1 ] : zp ZP_BYTE:3 $1 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ i#2 i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ $1 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 31.17: zp ZP_BYTE:2 i [ i#2 i#1 ] 22: zp ZP_BYTE:3 $1 [ $1 ]
Uplift Scope [] 31.17: zp ZP_BYTE:2 [ i#2 i#1 ] 22: zp ZP_BYTE:3 [ $1 ]
Uplifting [] best 285 combination reg byte x [ i#2 i#1 ] reg byte a [ $1 ]
Removing instruction jmp b1

View File

@ -31,9 +31,9 @@ lvaluevar: {
rvaluevar: {
.label screen = 2
lda #<$400
sta lvaluevar.screen
sta screen
lda #>$400
sta lvaluevar.screen+$1
sta screen+$1
ldx #$2
b1:
cpx #$a
@ -41,10 +41,10 @@ rvaluevar: {
rts
b2:
ldy #$0
lda (lvaluevar.screen),y
inc lvaluevar.screen
lda (screen),y
inc screen
bne !+
inc lvaluevar.screen+$1
inc screen+$1
!:
inx
jmp b1

View File

@ -2002,16 +2002,16 @@ Complete equivalence classes
[ rvalue::b#0 ]
[ rvalue::b#1 ]
[ rvalue::b#2 ]
Allocated zp ZP_BYTE:2 i#2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Allocated zp ZP_PTR_BYTE:3 screen#2 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Allocated zp ZP_BYTE:5 i#2 [ rvaluevar::i#2 rvaluevar::i#1 ]
Allocated zp ZP_PTR_BYTE:6 screen#2 [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Allocated zp ZP_BYTE:8 i#2 [ rvalue::i#2 rvalue::i#1 ]
Allocated zp ZP_BYTE:9 i#2 [ lvalue::i#2 lvalue::i#1 ]
Allocated zp ZP_BYTE:10 b#0 [ rvaluevar::b#0 ]
Allocated zp ZP_BYTE:11 b#0 [ rvalue::b#0 ]
Allocated zp ZP_BYTE:12 b#1 [ rvalue::b#1 ]
Allocated zp ZP_BYTE:13 b#2 [ rvalue::b#2 ]
Allocated zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Allocated zp ZP_PTR_BYTE:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Allocated zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ]
Allocated zp ZP_PTR_BYTE:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Allocated zp ZP_BYTE:8 [ rvalue::i#2 rvalue::i#1 ]
Allocated zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ]
Allocated zp ZP_BYTE:10 [ rvaluevar::b#0 ]
Allocated zp ZP_BYTE:11 [ rvalue::b#0 ]
Allocated zp ZP_BYTE:12 [ rvalue::b#1 ]
Allocated zp ZP_BYTE:13 [ rvalue::b#2 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -2220,48 +2220,48 @@ lvalue: {
}
Statement [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 i [ lvaluevar::i#2 lvaluevar::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 i [ lvaluevar::i#2 lvaluevar::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ]
Statement [15] (byte) rvaluevar::b#0 ← * (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#2 ] always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 i [ rvaluevar::i#2 rvaluevar::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 i [ rvaluevar::i#2 rvaluevar::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ]
Statement [25] *((word) 1024) ← (byte) 1 [ ] always clobbers reg byte a
Statement [26] *((word) 1025) ← (byte) 2 [ ] always clobbers reg byte a
Statement [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 i [ lvalue::i#2 lvalue::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ]
Statement [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] always clobbers reg byte a reg byte y
Statement [15] (byte) rvaluevar::b#0 ← * (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#2 ] always clobbers reg byte a reg byte y
Statement [25] *((word) 1024) ← (byte) 1 [ ] always clobbers reg byte a
Statement [26] *((word) 1025) ← (byte) 2 [ ] always clobbers reg byte a
Statement [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] always clobbers reg byte a
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ lvaluevar::i#2 lvaluevar::i#1 ] : zp ZP_BYTE:2 i , reg byte x ,
Potential registers zp ZP_PTR_BYTE:3 screen [ lvaluevar::screen#2 lvaluevar::screen#1 ] : zp ZP_PTR_BYTE:3 screen ,
Potential registers zp ZP_BYTE:5 i [ rvaluevar::i#2 rvaluevar::i#1 ] : zp ZP_BYTE:5 i , reg byte x ,
Potential registers zp ZP_PTR_BYTE:6 screen [ rvaluevar::screen#2 rvaluevar::screen#1 ] : zp ZP_PTR_BYTE:6 screen ,
Potential registers zp ZP_BYTE:8 i [ rvalue::i#2 rvalue::i#1 ] : zp ZP_BYTE:8 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:9 i [ lvalue::i#2 lvalue::i#1 ] : zp ZP_BYTE:9 i , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:10 b [ rvaluevar::b#0 ] : zp ZP_BYTE:10 b , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:11 b [ rvalue::b#0 ] : zp ZP_BYTE:11 b , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:12 b#1 [ rvalue::b#1 ] : zp ZP_BYTE:12 b#1 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:13 b#2 [ rvalue::b#2 ] : zp ZP_BYTE:13 b#2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ] : zp ZP_BYTE:2 , reg byte x ,
Potential registers zp ZP_PTR_BYTE:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] : zp ZP_PTR_BYTE:3 ,
Potential registers zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ] : zp ZP_BYTE:5 , reg byte x ,
Potential registers zp ZP_PTR_BYTE:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] : zp ZP_PTR_BYTE:6 ,
Potential registers zp ZP_BYTE:8 [ rvalue::i#2 rvalue::i#1 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ] : zp ZP_BYTE:9 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:10 [ rvaluevar::b#0 ] : zp ZP_BYTE:10 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:11 [ rvalue::b#0 ] : zp ZP_BYTE:11 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:12 [ rvalue::b#1 ] : zp ZP_BYTE:12 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:13 [ rvalue::b#2 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [rvalue] ∞: zp ZP_BYTE:11 b [ rvalue::b#0 ] ∞: zp ZP_BYTE:12 b#1 [ rvalue::b#1 ] ∞: zp ZP_BYTE:13 b#2 [ rvalue::b#2 ] 36.67: zp ZP_BYTE:8 i [ rvalue::i#2 rvalue::i#1 ]
Uplift Scope [rvaluevar] ∞: zp ZP_BYTE:10 b [ rvaluevar::b#0 ] 30.25: zp ZP_BYTE:5 i [ rvaluevar::i#2 rvaluevar::i#1 ] 22: zp ZP_PTR_BYTE:6 screen [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Uplift Scope [lvaluevar] 30.25: zp ZP_BYTE:2 i [ lvaluevar::i#2 lvaluevar::i#1 ] 22: zp ZP_PTR_BYTE:3 screen [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Uplift Scope [lvalue] 36.67: zp ZP_BYTE:9 i [ lvalue::i#2 lvalue::i#1 ]
Uplift Scope [rvalue] ∞: zp ZP_BYTE:11 [ rvalue::b#0 ] ∞: zp ZP_BYTE:12 [ rvalue::b#1 ] ∞: zp ZP_BYTE:13 [ rvalue::b#2 ] 36.67: zp ZP_BYTE:8 [ rvalue::i#2 rvalue::i#1 ]
Uplift Scope [rvaluevar] ∞: zp ZP_BYTE:10 [ rvaluevar::b#0 ] 30.25: zp ZP_BYTE:5 [ rvaluevar::i#2 rvaluevar::i#1 ] 22: zp ZP_PTR_BYTE:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Uplift Scope [lvaluevar] 30.25: zp ZP_BYTE:2 [ lvaluevar::i#2 lvaluevar::i#1 ] 22: zp ZP_PTR_BYTE:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Uplift Scope [lvalue] 36.67: zp ZP_BYTE:9 [ lvalue::i#2 lvalue::i#1 ]
Uplift Scope [main]
Uplift Scope []
Uplifting [rvalue] best 2055 combination reg byte a [ rvalue::b#0 ] reg byte a [ rvalue::b#1 ] reg byte a [ rvalue::b#2 ] reg byte x [ rvalue::i#2 rvalue::i#1 ]
Uplifting [rvaluevar] best 1895 combination reg byte a [ rvaluevar::b#0 ] reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ] zp ZP_PTR_BYTE:6 screen [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Uplifting [lvaluevar] best 1775 combination reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ] zp ZP_PTR_BYTE:3 screen [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Uplifting [rvaluevar] best 1895 combination reg byte a [ rvaluevar::b#0 ] reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ] zp ZP_PTR_BYTE:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ]
Uplifting [lvaluevar] best 1775 combination reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ] zp ZP_PTR_BYTE:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ]
Uplifting [lvalue] best 1615 combination reg byte x [ lvalue::i#2 lvalue::i#1 ]
Uplifting [main] best 1615 combination
Uplifting [] best 1615 combination
Coalescing zero page register [ zp ZP_PTR_BYTE:3 screen [ lvaluevar::screen#2 lvaluevar::screen#1 ] ] with [ zp ZP_PTR_BYTE:6 screen [ rvaluevar::screen#2 rvaluevar::screen#1 ] ]
Allocated (was zp ZP_PTR_BYTE:3 screen) zp ZP_PTR_BYTE:2 screen#2 [ lvaluevar::screen#2 lvaluevar::screen#1 rvaluevar::screen#2 rvaluevar::screen#1 ]
Coalescing zero page register [ zp ZP_PTR_BYTE:3 [ lvaluevar::screen#2 lvaluevar::screen#1 ] ] with [ zp ZP_PTR_BYTE:6 [ rvaluevar::screen#2 rvaluevar::screen#1 ] ]
Allocated (was zp ZP_PTR_BYTE:3) zp ZP_PTR_BYTE:2 [ lvaluevar::screen#2 lvaluevar::screen#1 rvaluevar::screen#2 rvaluevar::screen#1 ]
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
@ -2352,9 +2352,9 @@ rvaluevar: {
b1_from_rvaluevar:
//SEG31 [12] phi (byte*) rvaluevar::screen#2 = (word) 1024 -- zpptrby1=cowo1
lda #<$400
sta lvaluevar.screen
sta screen
lda #>$400
sta lvaluevar.screen+$1
sta screen+$1
//SEG32 [12] phi (byte) rvaluevar::i#2 = (byte) 2 -- xby=coby1
ldx #$2
//SEG33 rvaluevar::@1
@ -2370,11 +2370,11 @@ rvaluevar: {
b2:
//SEG38 [15] (byte) rvaluevar::b#0 ← * (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#2 ] -- aby=_star_zpptrby1
ldy #$0
lda (lvaluevar.screen),y
lda (screen),y
//SEG39 [16] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::screen#1 rvaluevar::i#2 ] -- zpptrby1=_inc_zpptrby1
inc lvaluevar.screen
inc screen
bne !+
inc lvaluevar.screen+$1
inc screen+$1
!:
//SEG40 [17] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ] -- xby=_inc_xby
inx
@ -2533,9 +2533,9 @@ rvaluevar: {
//SEG30 [12] phi from rvaluevar to rvaluevar::@1
//SEG31 [12] phi (byte*) rvaluevar::screen#2 = (word) 1024 -- zpptrby1=cowo1
lda #<$400
sta lvaluevar.screen
sta screen
lda #>$400
sta lvaluevar.screen+$1
sta screen+$1
//SEG32 [12] phi (byte) rvaluevar::i#2 = (byte) 2 -- xby=coby1
ldx #$2
//SEG33 rvaluevar::@1
@ -2550,11 +2550,11 @@ rvaluevar: {
b2:
//SEG38 [15] (byte) rvaluevar::b#0 ← * (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#2 ] -- aby=_star_zpptrby1
ldy #$0
lda (lvaluevar.screen),y
lda (screen),y
//SEG39 [16] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::screen#1 rvaluevar::i#2 ] -- zpptrby1=_inc_zpptrby1
inc lvaluevar.screen
inc screen
bne !+
inc lvaluevar.screen+$1
inc screen+$1
!:
//SEG40 [17] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ] -- xby=_inc_xby
inx
@ -2641,8 +2641,8 @@ FINAL SYMBOL TABLE
(byte) lvaluevar::i#1 reg byte x 22.0
(byte) lvaluevar::i#2 reg byte x 8.25
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#1 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) lvaluevar::screen#2 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) lvaluevar::screen#1 screen zp ZP_PTR_BYTE:2 11.0
(byte*) lvaluevar::screen#2 screen zp ZP_PTR_BYTE:2 11.0
(void()) main()
(label) main::@1
(label) main::@2
@ -2670,11 +2670,11 @@ FINAL SYMBOL TABLE
(byte) rvaluevar::i#1 reg byte x 22.0
(byte) rvaluevar::i#2 reg byte x 8.25
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#1 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) rvaluevar::screen#2 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) rvaluevar::screen#1 screen zp ZP_PTR_BYTE:2 11.0
(byte*) rvaluevar::screen#2 screen zp ZP_PTR_BYTE:2 11.0
reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ]
zp ZP_PTR_BYTE:2 screen [ lvaluevar::screen#2 lvaluevar::screen#1 rvaluevar::screen#2 rvaluevar::screen#1 ]
zp ZP_PTR_BYTE:2 [ lvaluevar::screen#2 lvaluevar::screen#1 rvaluevar::screen#2 rvaluevar::screen#1 ]
reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ]
reg byte x [ rvalue::i#2 rvalue::i#1 ]
reg byte x [ lvalue::i#2 lvalue::i#1 ]
@ -2749,9 +2749,9 @@ rvaluevar: {
//SEG30 [12] phi from rvaluevar to rvaluevar::@1
//SEG31 [12] phi (byte*) rvaluevar::screen#2 = (word) 1024 -- zpptrby1=cowo1
lda #<$400
sta lvaluevar.screen
sta screen
lda #>$400
sta lvaluevar.screen+$1
sta screen+$1
//SEG32 [12] phi (byte) rvaluevar::i#2 = (byte) 2 -- xby=coby1
ldx #$2
//SEG33 rvaluevar::@1
@ -2766,11 +2766,11 @@ rvaluevar: {
b2:
//SEG38 [15] (byte) rvaluevar::b#0 ← * (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#2 ] -- aby=_star_zpptrby1
ldy #$0
lda (lvaluevar.screen),y
lda (screen),y
//SEG39 [16] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::screen#1 rvaluevar::i#2 ] -- zpptrby1=_inc_zpptrby1
inc lvaluevar.screen
inc screen
bne !+
inc lvaluevar.screen+$1
inc screen+$1
!:
//SEG40 [17] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ] -- xby=_inc_xby
inx

View File

@ -17,8 +17,8 @@
(byte) lvaluevar::i#1 reg byte x 22.0
(byte) lvaluevar::i#2 reg byte x 8.25
(byte*) lvaluevar::screen
(byte*) lvaluevar::screen#1 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) lvaluevar::screen#2 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) lvaluevar::screen#1 screen zp ZP_PTR_BYTE:2 11.0
(byte*) lvaluevar::screen#2 screen zp ZP_PTR_BYTE:2 11.0
(void()) main()
(label) main::@1
(label) main::@2
@ -46,11 +46,11 @@
(byte) rvaluevar::i#1 reg byte x 22.0
(byte) rvaluevar::i#2 reg byte x 8.25
(byte*) rvaluevar::screen
(byte*) rvaluevar::screen#1 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) rvaluevar::screen#2 zp ZP_PTR_BYTE:2 screen 11.0
(byte*) rvaluevar::screen#1 screen zp ZP_PTR_BYTE:2 11.0
(byte*) rvaluevar::screen#2 screen zp ZP_PTR_BYTE:2 11.0
reg byte x [ lvaluevar::i#2 lvaluevar::i#1 ]
zp ZP_PTR_BYTE:2 screen [ lvaluevar::screen#2 lvaluevar::screen#1 rvaluevar::screen#2 rvaluevar::screen#1 ]
zp ZP_PTR_BYTE:2 [ lvaluevar::screen#2 lvaluevar::screen#1 rvaluevar::screen#2 rvaluevar::screen#1 ]
reg byte x [ rvaluevar::i#2 rvaluevar::i#1 ]
reg byte x [ rvalue::i#2 rvalue::i#1 ]
reg byte x [ lvalue::i#2 lvalue::i#1 ]

View File

@ -484,8 +484,8 @@ Added variable main::b#0 to zero page equivalence class [ main::b#0 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::b#0 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 b#0 [ main::b#0 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::b#0 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -531,11 +531,11 @@ main: {
}
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 b [ main::b#0 ] : zp ZP_BYTE:3 b , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::b#0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] ∞: zp ZP_BYTE:3 b [ main::b#0 ] 36.67: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Uplift Scope [main] ∞: zp ZP_BYTE:3 [ main::b#0 ] 36.67: zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Uplift Scope []
Uplifting [main] best 235 combination reg byte a [ main::b#0 ] reg byte x [ main::i#2 main::i#1 ]

View File

@ -2,34 +2,34 @@
jsr main
main: {
lda #$1
sta render.y
sta addpoint.c
ldy #$5
lda #$0
sta numpoints
lda #$5
jsr addpoint
lda #$2
sta render.y
sta addpoint.c
ldy #$8
lda #$f
jsr addpoint
lda #$3
sta render.y
sta addpoint.c
ldy #$e
lda #$6
jsr addpoint
lda #$4
sta render.y
sta addpoint.c
ldy #$2
lda #$22
jsr addpoint
lda #$5
sta render.y
sta addpoint.c
ldy #$11
lda #$15
jsr addpoint
lda #$7
sta render.y
sta addpoint.c
ldy #$16
lda #$1f
jsr addpoint
@ -144,8 +144,9 @@ render: {
findcol: {
.label x = 9
.label y = 10
.label diff = 7
.label xp = 7
.label yp = 11
.label diff = 7
.label mindiff = 6
ldy #$0
lda #$ff
@ -153,11 +154,11 @@ findcol: {
ldx #$0
b1:
lda $1000,x
sta diff
sta xp
lda $1100,x
sta yp
lda x
cmp diff
cmp xp
bne b2
lda y
cmp yp
@ -167,7 +168,7 @@ findcol: {
rts
b2:
lda x
cmp diff
cmp xp
bcs b4
lda diff
sec
@ -212,37 +213,37 @@ findcol: {
jmp b5
}
initscreen: {
.label colline = 3
.label screen = 3
lda #<$400
sta render.colline
sta screen
lda #>$400
sta render.colline+$1
sta screen+$1
b1:
ldy #$0
lda #$e6
sta (render.colline),y
inc render.colline
sta (screen),y
inc screen
bne !+
inc render.colline+$1
inc screen+$1
!:
lda render.colline+$1
lda screen+$1
cmp #>$7e8
bcc b1
bne !+
lda render.colline
lda screen
cmp #<$7e8
bcc b1
!:
rts
}
addpoint: {
.label y = 2
.label c = 2
ldx numpoints
sta $1000,x
tya
ldy numpoints
sta $1100,y
lda render.y
lda c
ldx numpoints
sta $1200,x
inc numpoints

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
(void()) addpoint((byte) addpoint::x , (byte) addpoint::y , (byte) addpoint::c)
(label) addpoint::@return
(byte) addpoint::c
(byte) addpoint::c#6 zp ZP_BYTE:2 y 0.6666666666666666
(byte) addpoint::c#6 c zp ZP_BYTE:2 0.6666666666666666
(byte) addpoint::x
(byte) addpoint::x#6 reg byte a 2.0
(byte) addpoint::y
@ -64,11 +64,11 @@
(label) findcol::@9
(label) findcol::@return
(byte) findcol::diff
(byte) findcol::diff#0 zp ZP_BYTE:7 diff 20002.0
(byte) findcol::diff#1 zp ZP_BYTE:7 diff 20002.0
(byte) findcol::diff#0 diff zp ZP_BYTE:7 20002.0
(byte) findcol::diff#1 diff zp ZP_BYTE:7 20002.0
(byte) findcol::diff#2 reg byte a 20002.0
(byte) findcol::diff#3 reg byte a 20002.0
(byte) findcol::diff#4 zp ZP_BYTE:7 diff 10001.0
(byte) findcol::diff#4 diff zp ZP_BYTE:7 10001.0
(byte) findcol::diff#6 reg byte a 13334.666666666666
(byte) findcol::i
(byte) findcol::i#1 reg byte x 10001.0
@ -78,26 +78,26 @@
(byte) findcol::mincol#11 reg byte y 1176.5882352941176
(byte) findcol::mincol#2 reg byte y 10001.0
(byte) findcol::mindiff
(byte) findcol::mindiff#10 zp ZP_BYTE:6 mindiff 1875.1875
(byte) findcol::mindiff#10 mindiff zp ZP_BYTE:6 1875.1875
(byte) findcol::mindiff#11 reg byte a 10001.0
(byte~) findcol::mindiff#13 zp ZP_BYTE:6 mindiff 20002.0
(byte~) findcol::mindiff#13 mindiff zp ZP_BYTE:6 20002.0
(byte~) findcol::mindiff#14 reg byte a 20002.0
(byte) findcol::return
(byte) findcol::return#0 reg byte y 3667.333333333333
(byte) findcol::x
(byte) findcol::x#0 zp ZP_BYTE:9 x 1863.8636363636363
(byte) findcol::x#0 x zp ZP_BYTE:9 1863.8636363636363
(byte) findcol::xp
(byte) findcol::xp#0 zp ZP_BYTE:7 diff 10001.0
(byte) findcol::xp#0 xp zp ZP_BYTE:7 10001.0
(byte) findcol::y
(byte) findcol::y#0 zp ZP_BYTE:10 y 1863.8636363636363
(byte) findcol::y#0 y zp ZP_BYTE:10 1863.8636363636363
(byte) findcol::yp
(byte) findcol::yp#0 zp ZP_BYTE:11 yp 6250.625
(byte) findcol::yp#0 yp zp ZP_BYTE:11 6250.625
(void()) initscreen()
(label) initscreen::@1
(label) initscreen::@return
(byte*) initscreen::screen
(byte*) initscreen::screen#1 zp ZP_PTR_BYTE:3 colline 16.5
(byte*) initscreen::screen#2 zp ZP_PTR_BYTE:3 colline 16.5
(byte*) initscreen::screen#1 screen zp ZP_PTR_BYTE:3 16.5
(byte*) initscreen::screen#2 screen zp ZP_PTR_BYTE:3 16.5
(void()) main()
(label) main::@1
(label) main::@10
@ -110,8 +110,8 @@
(label) main::@8
(label) main::@return
(byte) numpoints
(byte) numpoints#1 zp ZP_BYTE:8 numpoints 455.13636363636346
(byte) numpoints#19 zp ZP_BYTE:8 numpoints 4.5
(byte) numpoints#1 numpoints zp ZP_BYTE:8 455.13636363636346
(byte) numpoints#19 numpoints zp ZP_BYTE:8 4.5
(void()) render()
(label) render::@1
(label) render::@2
@ -121,25 +121,25 @@
(byte) render::col
(byte) render::col#0 reg byte a 2002.0
(byte*) render::colline
(byte*) render::colline#1 zp ZP_PTR_BYTE:3 colline 67.33333333333333
(byte*) render::colline#2 zp ZP_PTR_BYTE:3 colline 36.45454545454545
(byte*) render::colline#1 colline zp ZP_PTR_BYTE:3 67.33333333333333
(byte*) render::colline#2 colline zp ZP_PTR_BYTE:3 36.45454545454545
(byte) render::x
(byte) render::x#1 zp ZP_BYTE:5 x 1501.5
(byte) render::x#2 zp ZP_BYTE:5 x 133.46666666666667
(byte) render::x#1 x zp ZP_BYTE:5 1501.5
(byte) render::x#2 x zp ZP_BYTE:5 133.46666666666667
(byte) render::y
(byte) render::y#1 zp ZP_BYTE:2 y 151.5
(byte) render::y#2 zp ZP_BYTE:2 y 35.38235294117647
(byte) render::y#1 y zp ZP_BYTE:2 151.5
(byte) render::y#2 y zp ZP_BYTE:2 35.38235294117647
zp ZP_BYTE:2 y [ render::y#2 render::y#1 addpoint::c#6 ]
zp ZP_PTR_BYTE:3 colline [ render::colline#2 render::colline#1 initscreen::screen#2 initscreen::screen#1 ]
zp ZP_BYTE:5 x [ render::x#2 render::x#1 ]
zp ZP_BYTE:2 [ render::y#2 render::y#1 addpoint::c#6 ]
zp ZP_PTR_BYTE:3 [ render::colline#2 render::colline#1 initscreen::screen#2 initscreen::screen#1 ]
zp ZP_BYTE:5 [ render::x#2 render::x#1 ]
reg byte x [ findcol::i#12 findcol::i#1 ]
zp ZP_BYTE:6 mindiff [ findcol::mindiff#10 findcol::mindiff#13 ]
zp ZP_BYTE:6 [ findcol::mindiff#10 findcol::mindiff#13 ]
reg byte y [ findcol::return#0 findcol::mincol#11 findcol::mincol#2 findcol::mincol#1 ]
zp ZP_BYTE:7 diff [ findcol::diff#4 findcol::diff#1 findcol::diff#0 findcol::xp#0 ]
zp ZP_BYTE:7 [ findcol::diff#4 findcol::diff#1 findcol::diff#0 findcol::xp#0 ]
reg byte a [ findcol::mindiff#11 findcol::diff#6 findcol::diff#3 findcol::diff#2 findcol::mindiff#14 ]
reg byte a [ addpoint::x#6 ]
zp ZP_BYTE:8 numpoints [ numpoints#19 numpoints#1 ]
zp ZP_BYTE:8 [ numpoints#19 numpoints#1 ]
reg byte y [ addpoint::y#6 ]
reg byte a [ animate::$0 ]
reg byte a [ animate::$1 ]
@ -161,9 +161,9 @@ reg byte a [ animate::$26 ]
reg byte a [ animate::$27 ]
reg byte a [ animate::$30 ]
reg byte a [ animate::$31 ]
zp ZP_BYTE:9 x [ findcol::x#0 ]
zp ZP_BYTE:10 y [ findcol::y#0 ]
zp ZP_BYTE:9 [ findcol::x#0 ]
zp ZP_BYTE:10 [ findcol::y#0 ]
reg byte a [ render::col#0 ]
zp ZP_BYTE:11 yp [ findcol::yp#0 ]
zp ZP_BYTE:11 [ findcol::yp#0 ]
reg byte a [ findcol::$12 ]
reg byte a [ findcol::$14 ]

View File

@ -17,7 +17,7 @@ main: {
tya
clc
adc #$2
sta sum.c
sta sum2.c
jsr sum2
sta $428,y
iny
@ -32,7 +32,7 @@ sum2: {
clc
adc $ff
clc
adc sum.c
adc c
rts
}
sum: {

View File

@ -1428,23 +1428,23 @@ Complete equivalence classes
[ sum2::return#0 ]
[ sum::$0 ]
[ sum::return#0 ]
Allocated zp ZP_BYTE:2 i#2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 $0 [ main::$0 ]
Allocated zp ZP_BYTE:4 $1 [ main::$1 ]
Allocated zp ZP_BYTE:5 a#0 [ sum::a#0 ]
Allocated zp ZP_BYTE:6 b#0 [ sum::b#0 ]
Allocated zp ZP_BYTE:7 c#0 [ sum::c#0 ]
Allocated zp ZP_BYTE:8 $2 [ main::$2 ]
Allocated zp ZP_BYTE:9 $3 [ main::$3 ]
Allocated zp ZP_BYTE:10 $4 [ main::$4 ]
Allocated zp ZP_BYTE:11 a#0 [ sum2::a#0 ]
Allocated zp ZP_BYTE:12 b#0 [ sum2::b#0 ]
Allocated zp ZP_BYTE:13 c#0 [ sum2::c#0 ]
Allocated zp ZP_BYTE:14 $5 [ main::$5 ]
Allocated zp ZP_BYTE:15 $0 [ sum2::$0 ]
Allocated zp ZP_BYTE:16 return#0 [ sum2::return#0 ]
Allocated zp ZP_BYTE:17 $0 [ sum::$0 ]
Allocated zp ZP_BYTE:18 return#0 [ sum::return#0 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::$0 ]
Allocated zp ZP_BYTE:4 [ main::$1 ]
Allocated zp ZP_BYTE:5 [ sum::a#0 ]
Allocated zp ZP_BYTE:6 [ sum::b#0 ]
Allocated zp ZP_BYTE:7 [ sum::c#0 ]
Allocated zp ZP_BYTE:8 [ main::$2 ]
Allocated zp ZP_BYTE:9 [ main::$3 ]
Allocated zp ZP_BYTE:10 [ main::$4 ]
Allocated zp ZP_BYTE:11 [ sum2::a#0 ]
Allocated zp ZP_BYTE:12 [ sum2::b#0 ]
Allocated zp ZP_BYTE:13 [ sum2::c#0 ]
Allocated zp ZP_BYTE:14 [ main::$5 ]
Allocated zp ZP_BYTE:15 [ sum2::$0 ]
Allocated zp ZP_BYTE:16 [ sum2::return#0 ]
Allocated zp ZP_BYTE:17 [ sum::$0 ]
Allocated zp ZP_BYTE:18 [ sum::return#0 ]
INITIAL ASM
//SEG0 Global ZP labels
//SEG1 @begin
@ -1597,43 +1597,43 @@ sum: {
}
Statement [3] (byte~) main::$1 ← (byte) main::i#2 + (byte) 2 [ main::i#2 main::$0 main::$1 ] always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 i [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 $0 [ main::$0 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::$0 ]
Statement [11] (byte~) main::$4 ← (byte) main::i#2 + (byte) 2 [ main::i#2 main::$3 main::$4 ] always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 $3 [ main::$3 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ main::$3 ]
Statement [3] (byte~) main::$1 ← (byte) main::i#2 + (byte) 2 [ main::i#2 main::$0 main::$1 ] always clobbers reg byte a
Statement [11] (byte~) main::$4 ← (byte) main::i#2 + (byte) 2 [ main::i#2 main::$3 main::$4 ] always clobbers reg byte a
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 i , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 $0 [ main::$0 ] : zp ZP_BYTE:3 $0 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 $1 [ main::$1 ] : zp ZP_BYTE:4 $1 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:5 a [ sum::a#0 ] : zp ZP_BYTE:5 a , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 b [ sum::b#0 ] : zp ZP_BYTE:6 b , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 c [ sum::c#0 ] : zp ZP_BYTE:7 c , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:8 $2 [ main::$2 ] : zp ZP_BYTE:8 $2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:9 $3 [ main::$3 ] : zp ZP_BYTE:9 $3 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:10 $4 [ main::$4 ] : zp ZP_BYTE:10 $4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:11 a [ sum2::a#0 ] : zp ZP_BYTE:11 a , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:12 b [ sum2::b#0 ] : zp ZP_BYTE:12 b , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:13 c [ sum2::c#0 ] : zp ZP_BYTE:13 c , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:14 $5 [ main::$5 ] : zp ZP_BYTE:14 $5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:15 $0 [ sum2::$0 ] : zp ZP_BYTE:15 $0 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:16 return [ sum2::return#0 ] : zp ZP_BYTE:16 return , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:17 $0 [ sum::$0 ] : zp ZP_BYTE:17 $0 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:18 return [ sum::return#0 ] : zp ZP_BYTE:18 return , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::$0 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 [ main::$1 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:5 [ sum::a#0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 [ sum::b#0 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ sum::c#0 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:8 [ main::$2 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:9 [ main::$3 ] : zp ZP_BYTE:9 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:10 [ main::$4 ] : zp ZP_BYTE:10 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:11 [ sum2::a#0 ] : zp ZP_BYTE:11 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:12 [ sum2::b#0 ] : zp ZP_BYTE:12 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:13 [ sum2::c#0 ] : zp ZP_BYTE:13 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:14 [ main::$5 ] : zp ZP_BYTE:14 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:15 [ sum2::$0 ] : zp ZP_BYTE:15 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:16 [ sum2::return#0 ] : zp ZP_BYTE:16 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:17 [ sum::$0 ] : zp ZP_BYTE:17 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:18 [ sum::return#0 ] : zp ZP_BYTE:18 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 22: zp ZP_BYTE:8 $2 [ main::$2 ] 22: zp ZP_BYTE:14 $5 [ main::$5 ] 21.28: zp ZP_BYTE:2 i [ main::i#2 main::i#1 ] 7.33: zp ZP_BYTE:3 $0 [ main::$0 ] 7.33: zp ZP_BYTE:4 $1 [ main::$1 ] 7.33: zp ZP_BYTE:9 $3 [ main::$3 ] 7.33: zp ZP_BYTE:10 $4 [ main::$4 ]
Uplift Scope [sum] 13: zp ZP_BYTE:7 c [ sum::c#0 ] 4.33: zp ZP_BYTE:18 return [ sum::return#0 ] 4: zp ZP_BYTE:17 $0 [ sum::$0 ] 2.17: zp ZP_BYTE:6 b [ sum::b#0 ] 1.86: zp ZP_BYTE:5 a [ sum::a#0 ]
Uplift Scope [sum2] 13: zp ZP_BYTE:13 c [ sum2::c#0 ] 4.33: zp ZP_BYTE:16 return [ sum2::return#0 ] 4: zp ZP_BYTE:15 $0 [ sum2::$0 ] 2.17: zp ZP_BYTE:12 b [ sum2::b#0 ] 1.86: zp ZP_BYTE:11 a [ sum2::a#0 ]
Uplift Scope [main] 22: zp ZP_BYTE:8 [ main::$2 ] 22: zp ZP_BYTE:14 [ main::$5 ] 21.28: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 7.33: zp ZP_BYTE:3 [ main::$0 ] 7.33: zp ZP_BYTE:4 [ main::$1 ] 7.33: zp ZP_BYTE:9 [ main::$3 ] 7.33: zp ZP_BYTE:10 [ main::$4 ]
Uplift Scope [sum] 13: zp ZP_BYTE:7 [ sum::c#0 ] 4.33: zp ZP_BYTE:18 [ sum::return#0 ] 4: zp ZP_BYTE:17 [ sum::$0 ] 2.17: zp ZP_BYTE:6 [ sum::b#0 ] 1.86: zp ZP_BYTE:5 [ sum::a#0 ]
Uplift Scope [sum2] 13: zp ZP_BYTE:13 [ sum2::c#0 ] 4.33: zp ZP_BYTE:16 [ sum2::return#0 ] 4: zp ZP_BYTE:15 [ sum2::$0 ] 2.17: zp ZP_BYTE:12 [ sum2::b#0 ] 1.86: zp ZP_BYTE:11 [ sum2::a#0 ]
Uplift Scope []
Uplifting [main] best 1100 combination reg byte a [ main::$2 ] reg byte a [ main::$5 ] reg byte y [ main::i#2 main::i#1 ] reg byte x [ main::$0 ] reg byte a [ main::$1 ] reg byte x [ main::$3 ] reg byte a [ main::$4 ]
Uplifting [sum] best 970 combination zp ZP_BYTE:7 c [ sum::c#0 ] reg byte a [ sum::return#0 ] reg byte a [ sum::$0 ] reg byte x [ sum::b#0 ] reg byte y [ sum::a#0 ]
Uplifting [sum2] best 840 combination zp ZP_BYTE:13 c [ sum2::c#0 ] reg byte a [ sum2::return#0 ] reg byte a [ sum2::$0 ] reg byte x [ sum2::b#0 ] reg byte y [ sum2::a#0 ]
Uplifting [sum] best 970 combination zp ZP_BYTE:7 [ sum::c#0 ] reg byte a [ sum::return#0 ] reg byte a [ sum::$0 ] reg byte x [ sum::b#0 ] reg byte y [ sum::a#0 ]
Uplifting [sum2] best 840 combination zp ZP_BYTE:13 [ sum2::c#0 ] reg byte a [ sum2::return#0 ] reg byte a [ sum2::$0 ] reg byte x [ sum2::b#0 ] reg byte y [ sum2::a#0 ]
Uplifting [] best 840 combination
Coalescing zero page register [ zp ZP_BYTE:7 c [ sum::c#0 ] ] with [ zp ZP_BYTE:13 c [ sum2::c#0 ] ]
Allocated (was zp ZP_BYTE:7 c) zp ZP_BYTE:2 c#0 [ sum::c#0 sum2::c#0 ]
Coalescing zero page register [ zp ZP_BYTE:7 [ sum::c#0 ] ] with [ zp ZP_BYTE:13 [ sum2::c#0 ] ]
Allocated (was zp ZP_BYTE:7) zp ZP_BYTE:2 [ sum::c#0 sum2::c#0 ]
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b3
@ -1697,7 +1697,7 @@ main: {
//SEG22 [13] (byte) sum2::b#0 ← (byte~) main::$3 [ main::i#2 main::$4 sum2::a#0 sum2::b#0 ]
// (byte) sum2::b#0 = (byte~) main::$3 // register copy reg byte x
//SEG23 [14] (byte) sum2::c#0 ← (byte~) main::$4 [ main::i#2 sum2::a#0 sum2::b#0 ] -- zpby1=aby
sta sum.c
sta sum2.c
//SEG24 [15] call sum2 param-assignment [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
jsr sum2
//SEG25 main::@4
@ -1726,7 +1726,7 @@ sum2: {
adc $ff
//SEG34 [22] (byte) sum2::return#0 ← (byte~) sum2::$0 + (byte) sum2::c#0 [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ] -- aby=aby_plus_zpby1
clc
adc sum.c
adc c
//SEG35 sum2::@return
breturn:
//SEG36 [23] return [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
@ -1806,7 +1806,7 @@ main: {
//SEG22 [13] (byte) sum2::b#0 ← (byte~) main::$3 [ main::i#2 main::$4 sum2::a#0 sum2::b#0 ]
// (byte) sum2::b#0 = (byte~) main::$3 // register copy reg byte x
//SEG23 [14] (byte) sum2::c#0 ← (byte~) main::$4 [ main::i#2 sum2::a#0 sum2::b#0 ] -- zpby1=aby
sta sum.c
sta sum2.c
//SEG24 [15] call sum2 param-assignment [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
jsr sum2
//SEG25 main::@4
@ -1835,7 +1835,7 @@ sum2: {
adc $ff
//SEG34 [22] (byte) sum2::return#0 ← (byte~) sum2::$0 + (byte) sum2::c#0 [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ] -- aby=aby_plus_zpby1
clc
adc sum.c
adc c
//SEG35 sum2::@return
breturn:
//SEG36 [23] return [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
@ -1917,7 +1917,7 @@ main: {
//SEG22 [13] (byte) sum2::b#0 ← (byte~) main::$3 [ main::i#2 main::$4 sum2::a#0 sum2::b#0 ]
// (byte) sum2::b#0 = (byte~) main::$3 // register copy reg byte x
//SEG23 [14] (byte) sum2::c#0 ← (byte~) main::$4 [ main::i#2 sum2::a#0 sum2::b#0 ] -- zpby1=aby
sta sum.c
sta sum2.c
//SEG24 [15] call sum2 param-assignment [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
jsr sum2
//SEG25 main::@4
@ -1944,7 +1944,7 @@ sum2: {
adc $ff
//SEG34 [22] (byte) sum2::return#0 ← (byte~) sum2::$0 + (byte) sum2::c#0 [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ] -- aby=aby_plus_zpby1
clc
adc sum.c
adc c
//SEG35 sum2::@return
//SEG36 [23] return [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
rts
@ -2016,7 +2016,7 @@ main: {
//SEG22 [13] (byte) sum2::b#0 ← (byte~) main::$3 [ main::i#2 main::$4 sum2::a#0 sum2::b#0 ]
// (byte) sum2::b#0 = (byte~) main::$3 // register copy reg byte x
//SEG23 [14] (byte) sum2::c#0 ← (byte~) main::$4 [ main::i#2 sum2::a#0 sum2::b#0 ] -- zpby1=aby
sta sum.c
sta sum2.c
//SEG24 [15] call sum2 param-assignment [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
jsr sum2
//SEG25 main::@4
@ -2043,7 +2043,7 @@ sum2: {
adc $ff
//SEG34 [22] (byte) sum2::return#0 ← (byte~) sum2::$0 + (byte) sum2::c#0 [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ] -- aby=aby_plus_zpby1
clc
adc sum.c
adc c
//SEG35 sum2::@return
//SEG36 [23] return [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
rts
@ -2091,7 +2091,7 @@ FINAL SYMBOL TABLE
(byte) sum::b
(byte) sum::b#0 reg byte x 2.1666666666666665
(byte) sum::c
(byte) sum::c#0 zp ZP_BYTE:2 c 13.0
(byte) sum::c#0 c zp ZP_BYTE:2 13.0
(byte) sum::return
(byte) sum::return#0 reg byte a 4.333333333333333
(byte()) sum2((byte) sum2::a , (byte) sum2::b , (byte) sum2::c)
@ -2102,7 +2102,7 @@ FINAL SYMBOL TABLE
(byte) sum2::b
(byte) sum2::b#0 reg byte x 2.1666666666666665
(byte) sum2::c
(byte) sum2::c#0 zp ZP_BYTE:2 c 13.0
(byte) sum2::c#0 c zp ZP_BYTE:2 13.0
(byte) sum2::return
(byte) sum2::return#0 reg byte a 4.333333333333333
@ -2111,7 +2111,7 @@ reg byte x [ main::$0 ]
reg byte a [ main::$1 ]
reg byte y [ sum::a#0 ]
reg byte x [ sum::b#0 ]
zp ZP_BYTE:2 c [ sum::c#0 sum2::c#0 ]
zp ZP_BYTE:2 [ sum::c#0 sum2::c#0 ]
reg byte a [ main::$2 ]
reg byte x [ main::$3 ]
reg byte a [ main::$4 ]
@ -2172,7 +2172,7 @@ main: {
//SEG22 [13] (byte) sum2::b#0 ← (byte~) main::$3 [ main::i#2 main::$4 sum2::a#0 sum2::b#0 ]
// (byte) sum2::b#0 = (byte~) main::$3 // register copy reg byte x
//SEG23 [14] (byte) sum2::c#0 ← (byte~) main::$4 [ main::i#2 sum2::a#0 sum2::b#0 ] -- zpby1=aby
sta sum.c
sta sum2.c
//SEG24 [15] call sum2 param-assignment [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
jsr sum2
//SEG25 main::@4
@ -2199,7 +2199,7 @@ sum2: {
adc $ff
//SEG34 [22] (byte) sum2::return#0 ← (byte~) sum2::$0 + (byte) sum2::c#0 [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ] -- aby=aby_plus_zpby1
clc
adc sum.c
adc c
//SEG35 sum2::@return
//SEG36 [23] return [ main::i#2 sum2::return#0 sum2::a#0 sum2::b#0 ]
rts

View File

@ -24,7 +24,7 @@
(byte) sum::b
(byte) sum::b#0 reg byte x 2.1666666666666665
(byte) sum::c
(byte) sum::c#0 zp ZP_BYTE:2 c 13.0
(byte) sum::c#0 c zp ZP_BYTE:2 13.0
(byte) sum::return
(byte) sum::return#0 reg byte a 4.333333333333333
(byte()) sum2((byte) sum2::a , (byte) sum2::b , (byte) sum2::c)
@ -35,7 +35,7 @@
(byte) sum2::b
(byte) sum2::b#0 reg byte x 2.1666666666666665
(byte) sum2::c
(byte) sum2::c#0 zp ZP_BYTE:2 c 13.0
(byte) sum2::c#0 c zp ZP_BYTE:2 13.0
(byte) sum2::return
(byte) sum2::return#0 reg byte a 4.333333333333333
@ -44,7 +44,7 @@ reg byte x [ main::$0 ]
reg byte a [ main::$1 ]
reg byte y [ sum::a#0 ]
reg byte x [ sum::b#0 ]
zp ZP_BYTE:2 c [ sum::c#0 sum2::c#0 ]
zp ZP_BYTE:2 [ sum::c#0 sum2::c#0 ]
reg byte a [ main::$2 ]
reg byte x [ main::$3 ]
reg byte a [ main::$4 ]