mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-26 09:29:18 +00:00
Merge branch 'master' of https://gitlab.com/tfisher98/kickc
This commit is contained in:
commit
bce68180ef
1
.idea/encodings.xml
generated
1
.idea/encodings.xml
generated
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
2
pom.xml
2
pom.xml
@ -82,6 +82,8 @@
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
<parallel>all</parallel>
|
||||
<threadCount>5</threadCount>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -11,9 +11,15 @@ class AsmFragmentTemplateSynthesisRule {
|
||||
* Contains matching groups (parenthesis) that are used in sigReplace to build the signature of the sub-fragment to synthesize from. */
|
||||
final String sigMatch;
|
||||
|
||||
/** Compiled regex for sigMatch */
|
||||
Pattern sigMatchPattern = null;
|
||||
|
||||
/** Regular expression that limits which fragments the synthesize rule can handle. */
|
||||
final String sigAvoid;
|
||||
|
||||
/** Compiled regex for sigAvoid */
|
||||
Pattern sigAvoidPattern = null;
|
||||
|
||||
/** ASM code prefixed to the sub-fragment when synthesizing. */
|
||||
final private String asmPrefix;
|
||||
|
||||
@ -62,7 +68,20 @@ class AsmFragmentTemplateSynthesisRule {
|
||||
* @return true if the rule matches the signature
|
||||
*/
|
||||
public boolean matches(String signature) {
|
||||
return signature.matches(sigMatch) && (sigAvoid == null || !signature.matches(sigAvoid));
|
||||
if (sigMatchPattern == null)
|
||||
sigMatchPattern = Pattern.compile(sigMatch);
|
||||
Matcher m = sigMatchPattern.matcher(signature);
|
||||
if (m.matches()) {
|
||||
if (sigAvoid == null)
|
||||
return true;
|
||||
else {
|
||||
if (sigAvoidPattern == null)
|
||||
sigAvoidPattern = Pattern.compile(sigAvoid);
|
||||
Matcher ma = sigAvoidPattern.matcher(signature);
|
||||
return !ma.matches();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -87,12 +106,12 @@ class AsmFragmentTemplateSynthesisRule {
|
||||
}
|
||||
|
||||
public AsmFragmentTemplate synthesize(String signature, AsmFragmentTemplate subTemplate) {
|
||||
if(!matches(signature)) {
|
||||
throw new RuntimeException("Synthesis error! Attempting to synthesize on non-matching signature signature:"+signature+" match:"+sigMatch+" avoid:"+sigAvoid);
|
||||
}
|
||||
if(!subTemplate.getSignature().equals(getSubSignature(signature))) {
|
||||
throw new RuntimeException("Synthesis error! Attempting to synthesize on non-matching sub template sub-signature:"+subTemplate.getSignature()+" expecting:"+getSubSignature(signature));
|
||||
}
|
||||
// if(!matches(signature)) {
|
||||
// throw new RuntimeException("Synthesis error! Attempting to synthesize on non-matching signature signature:"+signature+" match:"+sigMatch+" avoid:"+sigAvoid);
|
||||
// }
|
||||
// if(!subTemplate.getSignature().equals(getSubSignature(signature))) {
|
||||
// throw new RuntimeException("Synthesis error! Attempting to synthesize on non-matching sub template sub-signature:"+subTemplate.getSignature()+" expecting:"+getSubSignature(signature));
|
||||
// }
|
||||
if(subDontClobber!=null) {
|
||||
if(subDontClobber.contains("aa") && subTemplate.getClobber().isClobberA()) return null;
|
||||
if(subDontClobber.contains("xx") && subTemplate.getClobber().isClobberX()) return null;
|
||||
|
@ -1,17 +1,15 @@
|
||||
package dk.camelot64.kickc.model;
|
||||
|
||||
import dk.camelot64.kickc.model.iterator.ProgramValueIterator;
|
||||
import dk.camelot64.kickc.model.statements.Statement;
|
||||
import dk.camelot64.kickc.model.statements.StatementAssignment;
|
||||
import dk.camelot64.kickc.model.statements.StatementCall;
|
||||
import dk.camelot64.kickc.model.statements.StatementPhiBlock;
|
||||
import dk.camelot64.kickc.model.symbols.Procedure;
|
||||
import dk.camelot64.kickc.model.symbols.Symbol;
|
||||
import dk.camelot64.kickc.model.values.LabelRef;
|
||||
import dk.camelot64.kickc.model.values.ScopeRef;
|
||||
import dk.camelot64.kickc.model.values.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A named/labelled sequence of SSA statements connected to other basic blocks.
|
||||
@ -45,7 +43,6 @@ public class ControlFlowBlock {
|
||||
this.label = label;
|
||||
this.scope = scope;
|
||||
this.statements = new ArrayList<>();
|
||||
this.defaultSuccessor = null;
|
||||
this.conditionalSuccessor = null;
|
||||
this.comments = new ArrayList<>();
|
||||
}
|
||||
@ -207,7 +204,7 @@ public class ControlFlowBlock {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = label.hashCode();
|
||||
result = 31 * result + (statements != null ? statements.hashCode() : 0);
|
||||
result = 31 * result + statements.size();
|
||||
result = 31 * result + (defaultSuccessor != null ? defaultSuccessor.hashCode() : 0);
|
||||
result = 31 * result + (conditionalSuccessor != null ? conditionalSuccessor.hashCode() : 0);
|
||||
result = 31 * result + (callSuccessor != null ? callSuccessor.hashCode() : 0);
|
||||
|
@ -40,9 +40,13 @@ public class Pass5DoubleJumpElimination extends Pass5AsmOptimization {
|
||||
if(currentLabel != null) {
|
||||
AsmInstruction asmInstruction = (AsmInstruction) line;
|
||||
AsmInstructionType jmpType = AsmInstructionSet.getInstructionType("jmp", AsmAddressingMode.ABS, false);
|
||||
AsmInstructionType rtsType = AsmInstructionSet.getInstructionType("rts", AsmAddressingMode.NON, false);
|
||||
if(asmInstruction.getType().equals(jmpType)) {
|
||||
immediateJumps.put(currentScope + "::" + currentLabel, asmInstruction.getParameter());
|
||||
}
|
||||
if(asmInstruction.getType().equals(rtsType)) {
|
||||
immediateJumps.put(currentScope + "::" + currentLabel, "rts");
|
||||
}
|
||||
}
|
||||
currentLabel = null;
|
||||
} else {
|
||||
@ -62,7 +66,12 @@ public class Pass5DoubleJumpElimination extends Pass5AsmOptimization {
|
||||
AsmInstruction asmInstruction = (AsmInstruction) line;
|
||||
if(asmInstruction.getType().isJump()) {
|
||||
String immediateJmpTarget = immediateJumps.get(currentScope + "::" + asmInstruction.getParameter());
|
||||
if(immediateJmpTarget != null && !immediateJmpTarget.equals(asmInstruction.getParameter())) {
|
||||
if(immediateJmpTarget == "rts" && asmInstruction.getType().getMnemnonic() == "jmp") {
|
||||
getLog().append("Replacing jump to rts with rts in " + asmInstruction.toString());
|
||||
AsmInstructionType rtsType = AsmInstructionSet.getInstructionType("rts", AsmAddressingMode.NON, false);
|
||||
asmInstruction.setType(rtsType);
|
||||
optimized = true;
|
||||
} else if(immediateJmpTarget != null && immediateJmpTarget != "rts" && !immediateJmpTarget.equals(asmInstruction.getParameter())) {
|
||||
getLog().append("Skipping double jump to " + immediateJmpTarget + " in " + asmInstruction.toString());
|
||||
asmInstruction.setParameter(immediateJmpTarget);
|
||||
optimized = true;
|
||||
|
@ -20,6 +20,9 @@ public class PassNVariableReferenceInfos extends Pass2SsaOptimization {
|
||||
super(program);
|
||||
}
|
||||
|
||||
private LinkedHashMap<LabelRef, Collection<VariableRef>> blockDirectVarRefsMap = null;
|
||||
private LinkedHashMap<LabelRef, Collection<VariableRef>> blockDirectUsedVarsMap = null;
|
||||
|
||||
/** Create defined/referenced maps */
|
||||
@Override
|
||||
public boolean step() {
|
||||
@ -28,28 +31,40 @@ public class PassNVariableReferenceInfos extends Pass2SsaOptimization {
|
||||
LinkedHashMap<Integer, Collection<VariableRef>> stmtReferenced = new LinkedHashMap<>();
|
||||
LinkedHashMap<Integer, Collection<VariableRef>> stmtDefined = new LinkedHashMap<>();
|
||||
Map<SymbolVariableRef, Collection<VariableReferenceInfos.ReferenceToSymbolVar>> symbolVarReferences = new LinkedHashMap<>();
|
||||
blockDirectVarRefsMap = new LinkedHashMap<>();
|
||||
blockDirectUsedVarsMap = new LinkedHashMap<>();
|
||||
for(ControlFlowBlock block : getProgram().getGraph().getAllBlocks()) {
|
||||
LabelRef blockLabel = block.getLabel();
|
||||
blockReferencedVars.put(blockLabel, getReferencedVars(blockLabel, new ArrayList<>()));
|
||||
blockUsedVars.put(blockLabel, getUsedVars(blockLabel, new ArrayList<>()));
|
||||
LinkedHashSet<VariableRef> blockDirectVarRefs = new LinkedHashSet<>();;
|
||||
LinkedHashSet<VariableRef> blockDirectUsedVars = new LinkedHashSet<>();;
|
||||
for(Statement statement : block.getStatements()) {
|
||||
Collection<SymbolVariableRef> referenced = getReferenced(statement);
|
||||
Collection<VariableRef> defined = getDefinedVars(statement);
|
||||
LinkedHashSet<SymbolVariableRef> stmtSymbolVarRefs = new LinkedHashSet<>();
|
||||
LinkedHashSet<VariableRef> stmtVarRefs = new LinkedHashSet<>();
|
||||
LinkedHashSet<VariableRef> stmtUsedVars = new LinkedHashSet<>();
|
||||
ProgramValueIterator.execute(statement,
|
||||
(programValue, currentStmt, stmtIt, currentBlock) -> {
|
||||
if(programValue.get() instanceof SymbolVariableRef)
|
||||
stmtSymbolVarRefs.add((SymbolVariableRef) programValue.get());
|
||||
if(programValue.get() instanceof VariableRef)
|
||||
stmtVarRefs.add((VariableRef) programValue.get());
|
||||
}
|
||||
, null, null);
|
||||
Collection<VariableRef> stmtDefinedVars = getDefinedVars(statement);
|
||||
stmtUsedVars.addAll(stmtVarRefs);
|
||||
stmtUsedVars.removeAll(stmtDefinedVars);
|
||||
blockDirectVarRefs.addAll(stmtVarRefs);
|
||||
blockDirectUsedVars.addAll(stmtUsedVars);
|
||||
|
||||
// Add variable definitions to the statement
|
||||
stmtDefined.put(statement.getIndex(), defined);
|
||||
stmtDefined.put(statement.getIndex(), stmtDefinedVars);
|
||||
// Identify statement defining variables
|
||||
for(VariableRef variableRef : defined) {
|
||||
for(VariableRef variableRef : stmtDefinedVars) {
|
||||
symbolVarReferences.putIfAbsent(variableRef, new ArrayList<>());
|
||||
Collection<VariableReferenceInfos.ReferenceToSymbolVar> references = symbolVarReferences.get(variableRef);
|
||||
references.add(new VariableReferenceInfos.ReferenceInStatement(statement.getIndex(), VariableReferenceInfos.ReferenceToSymbolVar.ReferenceType.DEFINE, variableRef));
|
||||
}
|
||||
// Gather statements referencing variables/constants
|
||||
Collection<VariableRef> varRefs = new ArrayList<>();
|
||||
for(SymbolVariableRef referencedVarRef : referenced) {
|
||||
if(referencedVarRef instanceof VariableRef) {
|
||||
varRefs.add((VariableRef) referencedVarRef);
|
||||
}
|
||||
if(!defined.contains(referencedVarRef)) {
|
||||
for(SymbolVariableRef referencedVarRef : stmtSymbolVarRefs) {
|
||||
if(!stmtDefinedVars.contains(referencedVarRef)) {
|
||||
symbolVarReferences.putIfAbsent(referencedVarRef, new ArrayList<>());
|
||||
Collection<VariableReferenceInfos.ReferenceToSymbolVar> references = symbolVarReferences.get(referencedVarRef);
|
||||
references.add(
|
||||
@ -60,8 +75,19 @@ public class PassNVariableReferenceInfos extends Pass2SsaOptimization {
|
||||
}
|
||||
}
|
||||
// Add variable reference to the statement
|
||||
stmtReferenced.put(statement.getIndex(), varRefs);
|
||||
stmtReferenced.put(statement.getIndex(), stmtVarRefs);
|
||||
}
|
||||
LabelRef blockLabel = block.getLabel();
|
||||
blockDirectVarRefsMap.put(blockLabel, blockDirectVarRefs);
|
||||
blockDirectUsedVarsMap.put(blockLabel, blockDirectUsedVars);
|
||||
}
|
||||
for(ControlFlowBlock block : getProgram().getGraph().getAllBlocks()) {
|
||||
LabelRef blockLabel = block.getLabel();
|
||||
LinkedHashSet<VariableRef> blockRecursiveVarRefs = new LinkedHashSet<>();
|
||||
LinkedHashSet<VariableRef> blockRecursiveUsedVars = new LinkedHashSet<>();
|
||||
addReferencedVars(block.getLabel(), block, blockRecursiveVarRefs, blockRecursiveUsedVars, new ArrayList<>());
|
||||
blockReferencedVars.put(blockLabel, blockRecursiveVarRefs);
|
||||
blockUsedVars.put(blockLabel, blockRecursiveUsedVars);
|
||||
}
|
||||
// Gather symbols in the symbol table referencing other variables/constants
|
||||
Collection<SymbolVariable> allSymbolVariables = getProgram().getScope().getAllSymbolVariables(true);
|
||||
@ -81,7 +107,6 @@ public class PassNVariableReferenceInfos extends Pass2SsaOptimization {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get all variables referenced in an rValue
|
||||
*
|
||||
@ -131,67 +156,29 @@ public class PassNVariableReferenceInfos extends Pass2SsaOptimization {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all variables used inside a block and its successors (including any called method)
|
||||
* Recursively get all variables used or defined inside a block and its successors (including any called method)
|
||||
*
|
||||
* @param labelRef The block to examine
|
||||
* @param block The block to examine (optional, saves lookup)
|
||||
* @param referencedVars the set of referenced variables
|
||||
* @param usedVars the set of referenced variables
|
||||
* @param visited The blocks already visited during the search. Used to stop infinite recursion
|
||||
* @return All used variables
|
||||
*/
|
||||
private Collection<VariableRef> getUsedVars(LabelRef labelRef, Collection<LabelRef> visited) {
|
||||
if(labelRef == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if(visited.contains(labelRef)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
private void addReferencedVars(LabelRef labelRef, ControlFlowBlock block, LinkedHashSet<VariableRef> referencedVars, LinkedHashSet<VariableRef> usedVars, Collection<LabelRef> visited) {
|
||||
if(labelRef == null || visited.contains(labelRef))
|
||||
return;
|
||||
visited.add(labelRef);
|
||||
ControlFlowBlock block = getProgram().getGraph().getBlock(labelRef);
|
||||
if(block == null) {
|
||||
return new ArrayList<>();
|
||||
block = getProgram().getGraph().getBlock(labelRef);
|
||||
if(block == null)
|
||||
return;
|
||||
}
|
||||
LinkedHashSet<VariableRef> used = new LinkedHashSet<>();
|
||||
for(Statement statement : block.getStatements()) {
|
||||
used.addAll(getUsedVars(statement));
|
||||
if(statement instanceof StatementCall) {
|
||||
ProcedureRef procedure = ((StatementCall) statement).getProcedure();
|
||||
used.addAll(getUsedVars(procedure.getLabelRef(), visited));
|
||||
}
|
||||
}
|
||||
used.addAll(getUsedVars(block.getDefaultSuccessor(), visited));
|
||||
used.addAll(getUsedVars(block.getConditionalSuccessor(), visited));
|
||||
return used;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all variables used or defined inside a block and its successors (including any called method)
|
||||
*
|
||||
* @param labelRef The block to examine
|
||||
* @param visited The blocks already visited during the search. Used to stop infinite recursion
|
||||
* @return All used variables
|
||||
*/
|
||||
private Collection<VariableRef> getReferencedVars(LabelRef labelRef, Collection<LabelRef> visited) {
|
||||
if(labelRef == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if(visited.contains(labelRef)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
visited.add(labelRef);
|
||||
ControlFlowBlock block = getProgram().getGraph().getBlock(labelRef);
|
||||
if(block == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
LinkedHashSet<VariableRef> referenced = new LinkedHashSet<>();
|
||||
for(Statement statement : block.getStatements()) {
|
||||
referenced.addAll(getReferencedVars(statement));
|
||||
if(statement instanceof StatementCall) {
|
||||
ProcedureRef procedure = ((StatementCall) statement).getProcedure();
|
||||
referenced.addAll(getReferencedVars(procedure.getLabelRef(), visited));
|
||||
}
|
||||
}
|
||||
referenced.addAll(getReferencedVars(block.getDefaultSuccessor(), visited));
|
||||
referenced.addAll(getReferencedVars(block.getConditionalSuccessor(), visited));
|
||||
return referenced;
|
||||
referencedVars.addAll(blockDirectVarRefsMap.get(labelRef));
|
||||
usedVars.addAll(blockDirectUsedVarsMap.get(labelRef));
|
||||
addReferencedVars(block.getDefaultSuccessor(), null, referencedVars, usedVars, visited);
|
||||
addReferencedVars(block.getConditionalSuccessor(), null, referencedVars, usedVars, visited);
|
||||
addReferencedVars(block.getCallSuccessor(), null, referencedVars, usedVars, visited);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -230,50 +217,4 @@ public class PassNVariableReferenceInfos extends Pass2SsaOptimization {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the variables used, but not defined, in a statement
|
||||
*
|
||||
* @param statement The statement to examine
|
||||
* @return The used variables (not including defined variables)
|
||||
*/
|
||||
private Collection<VariableRef> getUsedVars(Statement statement) {
|
||||
LinkedHashSet<VariableRef> used = new LinkedHashSet<>();
|
||||
used.addAll(getReferencedVars(statement));
|
||||
used.removeAll(getDefinedVars(statement));
|
||||
return used;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the variables referenced (used or defined) in a statement
|
||||
*
|
||||
* @param statement The statement to examine
|
||||
* @return The referenced variables
|
||||
*/
|
||||
private Collection<VariableRef> getReferencedVars(Statement statement) {
|
||||
LinkedHashSet<VariableRef> referencedVars = new LinkedHashSet<>();
|
||||
getReferenced(statement)
|
||||
.stream()
|
||||
.filter(symbolVariableRef -> symbolVariableRef instanceof VariableRef)
|
||||
.forEach(symbolVariableRef -> referencedVars.add((VariableRef) symbolVariableRef));
|
||||
return referencedVars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the variables / constants referenced (used or defined) in a statement
|
||||
*
|
||||
* @param statement The statement to examine
|
||||
* @return The referenced variables / constants (VariableRef / ConstantRef)
|
||||
*/
|
||||
private Collection<SymbolVariableRef> getReferenced(Statement statement) {
|
||||
LinkedHashSet<SymbolVariableRef> referenced = new LinkedHashSet<>();
|
||||
ProgramValueIterator.execute(statement,
|
||||
(programValue, currentStmt, stmtIt, currentBlock) -> {
|
||||
if(programValue.get() instanceof SymbolVariableRef)
|
||||
referenced.add((SymbolVariableRef) programValue.get());
|
||||
}
|
||||
, null, null);
|
||||
return referenced;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -793,6 +793,11 @@ public class TestPrograms {
|
||||
compileAndCompare("const-param");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeepNesting() throws IOException, URISyntaxException {
|
||||
compileAndCompare("deep-nesting");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHelloWorld() throws IOException, URISyntaxException {
|
||||
compileAndCompare("examples/helloworld/helloworld");
|
||||
|
108
src/test/kc/deep-nesting.kc
Normal file
108
src/test/kc/deep-nesting.kc
Normal file
@ -0,0 +1,108 @@
|
||||
// Test that the compiler handles deep nesting well -- mainly a performance issue.
|
||||
|
||||
void main() {
|
||||
byte* screen = $400;
|
||||
const byte reverse = $80;
|
||||
screen[0] = f1(0);
|
||||
}
|
||||
|
||||
byte f1(byte x) { return f2(x) + 1; }
|
||||
byte f2(byte x) { return f3(x) + 1; }
|
||||
byte f3(byte x) { return f4(x) + 1; }
|
||||
byte f4(byte x) { return f5(x) + 1; }
|
||||
byte f5(byte x) { return f6(x) + 1; }
|
||||
byte f6(byte x) { return f7(x) + 1; }
|
||||
byte f7(byte x) { return f8(x) + 1; }
|
||||
byte f8(byte x) { return f9(x) + 1; }
|
||||
byte f9(byte x) { return f10(x) + 1; }
|
||||
byte f10(byte x) { return f11(x) + 1; }
|
||||
byte f11(byte x) { return f12(x) + 1; }
|
||||
byte f12(byte x) { return f13(x) + 1; }
|
||||
byte f13(byte x) { return f14(x) + 1; }
|
||||
byte f14(byte x) { return f15(x) + 1; }
|
||||
byte f15(byte x) { return f16(x) + 1; }
|
||||
byte f16(byte x) { return f17(x) + 1; }
|
||||
byte f17(byte x) { return f18(x) + 1; }
|
||||
byte f18(byte x) { return f19(x) + 1; }
|
||||
byte f19(byte x) { return f20(x) + 1; }
|
||||
byte f20(byte x) { return f21(x) + 1; }
|
||||
byte f21(byte x) { return f22(x) + 1; }
|
||||
byte f22(byte x) { return f23(x) + 1; }
|
||||
byte f23(byte x) { return f24(x) + 1; }
|
||||
byte f24(byte x) { return f25(x) + 1; }
|
||||
byte f25(byte x) { return f26(x) + 1; }
|
||||
byte f26(byte x) { return f27(x) + 1; }
|
||||
byte f27(byte x) { return f28(x) + 1; }
|
||||
byte f28(byte x) { return f29(x) + 1; }
|
||||
byte f29(byte x) { return f30(x) + 1; }
|
||||
byte f30(byte x) { return f31(x) + 1; }
|
||||
byte f31(byte x) { return f32(x) + 1; }
|
||||
byte f32(byte x) { return f33(x) + 1; }
|
||||
byte f33(byte x) { return f34(x) + 1; }
|
||||
byte f34(byte x) { return f35(x) + 1; }
|
||||
byte f35(byte x) { return f36(x) + 1; }
|
||||
byte f36(byte x) { return f37(x) + 1; }
|
||||
byte f37(byte x) { return f38(x) + 1; }
|
||||
byte f38(byte x) { return f39(x) + 1; }
|
||||
byte f39(byte x) { return f40(x) + 1; }
|
||||
byte f40(byte x) { return f41(x) + 1; }
|
||||
byte f41(byte x) { return f42(x) + 1; }
|
||||
byte f42(byte x) { return f43(x) + 1; }
|
||||
byte f43(byte x) { return f44(x) + 1; }
|
||||
byte f44(byte x) { return f45(x) + 1; }
|
||||
byte f45(byte x) { return f46(x) + 1; }
|
||||
byte f46(byte x) { return f47(x) + 1; }
|
||||
byte f47(byte x) { return f48(x) + 1; }
|
||||
byte f48(byte x) { return f49(x) + 1; }
|
||||
byte f49(byte x) { return f50(x) + 1; }
|
||||
byte f50(byte x) { return f51(x) + 1; }
|
||||
byte f51(byte x) { return f52(x) + 1; }
|
||||
byte f52(byte x) { return f53(x) + 1; }
|
||||
byte f53(byte x) { return f54(x) + 1; }
|
||||
byte f54(byte x) { return f55(x) + 1; }
|
||||
byte f55(byte x) { return f56(x) + 1; }
|
||||
byte f56(byte x) { return f57(x) + 1; }
|
||||
byte f57(byte x) { return f58(x) + 1; }
|
||||
byte f58(byte x) { return f59(x) + 1; }
|
||||
byte f59(byte x) { return f60(x) + 1; }
|
||||
byte f60(byte x) { return f61(x) + 1; }
|
||||
byte f61(byte x) { return f62(x) + 1; }
|
||||
byte f62(byte x) { return f63(x) + 1; }
|
||||
byte f63(byte x) { return f64(x) + 1; }
|
||||
byte f64(byte x) { return f65(x) + 1; }
|
||||
byte f65(byte x) { return f66(x) + 1; }
|
||||
byte f66(byte x) { return f67(x) + 1; }
|
||||
byte f67(byte x) { return f68(x) + 1; }
|
||||
byte f68(byte x) { return f69(x) + 1; }
|
||||
byte f69(byte x) { return f70(x) + 1; }
|
||||
byte f70(byte x) { return f71(x) + 1; }
|
||||
byte f71(byte x) { return f72(x) + 1; }
|
||||
byte f72(byte x) { return f73(x) + 1; }
|
||||
byte f73(byte x) { return f74(x) + 1; }
|
||||
byte f74(byte x) { return f75(x) + 1; }
|
||||
byte f75(byte x) { return f76(x) + 1; }
|
||||
byte f76(byte x) { return f77(x) + 1; }
|
||||
byte f77(byte x) { return f78(x) + 1; }
|
||||
byte f78(byte x) { return f79(x) + 1; }
|
||||
byte f79(byte x) { return f80(x) + 1; }
|
||||
byte f80(byte x) { return f81(x) + 1; }
|
||||
byte f81(byte x) { return f82(x) + 1; }
|
||||
byte f82(byte x) { return f83(x) + 1; }
|
||||
byte f83(byte x) { return f84(x) + 1; }
|
||||
byte f84(byte x) { return f85(x) + 1; }
|
||||
byte f85(byte x) { return f86(x) + 1; }
|
||||
byte f86(byte x) { return f87(x) + 1; }
|
||||
byte f87(byte x) { return f88(x) + 1; }
|
||||
byte f88(byte x) { return f89(x) + 1; }
|
||||
byte f89(byte x) { return f90(x) + 1; }
|
||||
byte f90(byte x) { return f91(x) + 1; }
|
||||
byte f91(byte x) { return f92(x) + 1; }
|
||||
byte f92(byte x) { return f93(x) + 1; }
|
||||
byte f93(byte x) { return f94(x) + 1; }
|
||||
byte f94(byte x) { return f95(x) + 1; }
|
||||
byte f95(byte x) { return f96(x) + 1; }
|
||||
byte f96(byte x) { return f97(x) + 1; }
|
||||
byte f97(byte x) { return f98(x) + 1; }
|
||||
byte f98(byte x) { return f99(x) + 1; }
|
||||
byte f99(byte x) { return f100(x) + 1; }
|
||||
byte f100(byte x) { return x;}
|
@ -66,11 +66,10 @@ test: {
|
||||
beq b1
|
||||
lda #RED
|
||||
sta cols,x
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
lda #GREEN
|
||||
sta cols,x
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
ref: .byte 3, 4, 3, $12, 9, 1, 4, 2, 4, 5, 1, 0
|
||||
|
@ -1169,7 +1169,10 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -1216,7 +1219,7 @@ reg byte x [ test::i#11 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 199
|
||||
Score: 202
|
||||
|
||||
//SEG0 File Comments
|
||||
// Test compound assignment operators
|
||||
@ -1370,7 +1373,6 @@ test: {
|
||||
lda #RED
|
||||
sta cols,x
|
||||
//SEG83 test::@return
|
||||
breturn:
|
||||
//SEG84 [32] return
|
||||
rts
|
||||
//SEG85 test::@1
|
||||
@ -1378,7 +1380,7 @@ test: {
|
||||
//SEG86 [33] *((const byte*) cols#0 + (byte) test::i#11) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #GREEN
|
||||
sta cols,x
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
ref: .byte 3, 4, 3, $12, 9, 1, 4, 2, 4, 5, 1, 0
|
||||
|
||||
|
@ -11,10 +11,9 @@ main: {
|
||||
sta $400+2
|
||||
cmp #0
|
||||
bne b1
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
lda #1
|
||||
sta $400+2+1
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
@ -244,7 +244,10 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -259,7 +262,7 @@ FINAL SYMBOL TABLE
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 37
|
||||
Score: 40
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests a pointer to a boolean
|
||||
@ -289,7 +292,6 @@ main: {
|
||||
cmp #0
|
||||
bne b1
|
||||
//SEG14 main::@return
|
||||
breturn:
|
||||
//SEG15 [8] return
|
||||
rts
|
||||
//SEG16 main::@1
|
||||
@ -297,6 +299,6 @@ main: {
|
||||
//SEG17 [9] *(++((bool*))(word/signed word/dword/signed dword) $400+(byte/signed byte/word/signed word/dword/signed dword) 2) ← true -- _deref_pboc1=vboc2
|
||||
lda #1
|
||||
sta $400+2+1
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
||||
|
@ -531,10 +531,9 @@ keyboard_event_get: {
|
||||
dec keyboard_events_size
|
||||
ldy keyboard_events_size
|
||||
lda keyboard_events,y
|
||||
jmp breturn
|
||||
rts
|
||||
b1:
|
||||
lda #$ff
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
// Scans the entire matrix to determine which keys have been pressed/depressed.
|
||||
@ -693,31 +692,30 @@ get_vic_screen: {
|
||||
sta return
|
||||
lda #>VIC_SCREEN4
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
b2:
|
||||
lda #<VIC_SCREEN0
|
||||
sta return
|
||||
lda #>VIC_SCREEN0
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
lda #<VIC_SCREEN1
|
||||
sta return
|
||||
lda #>VIC_SCREEN1
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
b4:
|
||||
lda #<VIC_SCREEN2
|
||||
sta return
|
||||
lda #>VIC_SCREEN2
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
b5:
|
||||
lda #<VIC_SCREEN3
|
||||
sta return
|
||||
lda #>VIC_SCREEN3
|
||||
sta return+1
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
// Get the VIC charset/bitmap address from the index
|
||||
@ -732,13 +730,12 @@ get_vic_charset: {
|
||||
sta return
|
||||
lda #>VIC_BITMAP
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
b2:
|
||||
lda #<VIC_CHARSET_ROM
|
||||
sta return
|
||||
lda #>VIC_CHARSET_ROM
|
||||
sta return+1
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
// Get plane address from a plane index (from the form)
|
||||
@ -797,7 +794,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_FULL>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b2:
|
||||
lda #<$ffffffff&VIC_SCREEN0
|
||||
sta return
|
||||
@ -807,7 +804,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN0>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
lda #<PLANE_HORISONTAL2
|
||||
sta return
|
||||
@ -817,7 +814,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_HORISONTAL2>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b4:
|
||||
lda #<PLANE_VERTICAL2
|
||||
sta return
|
||||
@ -827,7 +824,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_VERTICAL2>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b5:
|
||||
lda #<PLANE_CHARSET8
|
||||
sta return
|
||||
@ -837,7 +834,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_CHARSET8>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b6:
|
||||
lda #<PLANE_BLANK
|
||||
sta return
|
||||
@ -847,7 +844,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_BLANK>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b7:
|
||||
lda #<$ffffffff&VIC_SCREEN1
|
||||
sta return
|
||||
@ -857,7 +854,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN1>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b8:
|
||||
lda #<$ffffffff&VIC_SCREEN2
|
||||
sta return
|
||||
@ -867,7 +864,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN2>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b9:
|
||||
lda #<$ffffffff&VIC_SCREEN3
|
||||
sta return
|
||||
@ -877,7 +874,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN3>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b10:
|
||||
lda #<$ffffffff&VIC_BITMAP
|
||||
sta return
|
||||
@ -887,7 +884,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_BITMAP>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b11:
|
||||
lda #<$ffffffff&VIC_CHARSET_ROM
|
||||
sta return
|
||||
@ -897,7 +894,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_CHARSET_ROM>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b12:
|
||||
lda #<PLANE_8BPP_CHUNKY
|
||||
sta return
|
||||
@ -907,7 +904,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_8BPP_CHUNKY>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b13:
|
||||
lda #<PLANE_HORISONTAL
|
||||
sta return
|
||||
@ -917,7 +914,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_HORISONTAL>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
b14:
|
||||
lda #<PLANE_VERTICAL
|
||||
sta return
|
||||
@ -927,7 +924,6 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_VERTICAL>>$10
|
||||
sta return+3
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
// Show the form - and let the user change values
|
||||
@ -1357,7 +1353,6 @@ form_control: {
|
||||
lda #FORM_CURSOR_BLINK/2
|
||||
sta form_cursor_count
|
||||
ldx #0
|
||||
breturn:
|
||||
rts
|
||||
b12:
|
||||
inc form_field_idx
|
||||
@ -1391,7 +1386,7 @@ form_control: {
|
||||
sta (field),y
|
||||
b6:
|
||||
ldx #0
|
||||
jmp breturn
|
||||
rts
|
||||
b14:
|
||||
ldx form_field_idx
|
||||
inc form_fields_val,x
|
||||
@ -1407,7 +1402,7 @@ form_control: {
|
||||
cmp #KEY_SPACE
|
||||
bne b6
|
||||
ldx #$ff
|
||||
jmp breturn
|
||||
rts
|
||||
b2:
|
||||
lda #$80
|
||||
ldy #0
|
||||
@ -2007,7 +2002,6 @@ bitmap_line: {
|
||||
sta bitmap_line_ydxi.y1
|
||||
sty bitmap_line_ydxi.yd
|
||||
jsr bitmap_line_ydxi
|
||||
breturn:
|
||||
rts
|
||||
b8:
|
||||
stx bitmap_line_xdyi.x
|
||||
@ -2015,7 +2009,7 @@ bitmap_line: {
|
||||
sta bitmap_line_xdyi.y
|
||||
sty bitmap_line_xdyi.yd
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
b7:
|
||||
lda y1
|
||||
sec
|
||||
@ -2030,14 +2024,14 @@ bitmap_line: {
|
||||
sta bitmap_line_ydxd.y1
|
||||
sty bitmap_line_ydxd.yd
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
b9:
|
||||
stx bitmap_line_xdyd.x
|
||||
lda y1
|
||||
sta bitmap_line_xdyd.y
|
||||
sty bitmap_line_xdyd.yd
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
b1:
|
||||
txa
|
||||
sec
|
||||
@ -2055,14 +2049,14 @@ bitmap_line: {
|
||||
sta bitmap_line_ydxd.y
|
||||
sty bitmap_line_ydxd.yd
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
b12:
|
||||
lda x0
|
||||
sta bitmap_line_xdyd.x
|
||||
stx bitmap_line_xdyd.x1
|
||||
sty bitmap_line_xdyd.yd
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
b11:
|
||||
lda y1
|
||||
sec
|
||||
@ -2075,14 +2069,14 @@ bitmap_line: {
|
||||
ldx x0
|
||||
sty bitmap_line_ydxi.yd
|
||||
jsr bitmap_line_ydxi
|
||||
jmp breturn
|
||||
rts
|
||||
b13:
|
||||
lda x0
|
||||
sta bitmap_line_xdyi.x
|
||||
stx bitmap_line_xdyi.x1
|
||||
sty bitmap_line_xdyi.yd
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
// bitmap_line_xdyi(byte zeropage($e) x, byte zeropage($f) y, byte zeropage($d) x1, byte zeropage(8) xd, byte zeropage(7) yd)
|
||||
bitmap_line_xdyi: {
|
||||
|
@ -27164,16 +27164,44 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b9 in bne b9_from_b10
|
||||
Skipping double jump to breturn_from_b1 in bne b1
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to breturn_from_b1 in bne b1
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to breturn_from_b1 in bne b1
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b4 in jmp b3_from_b2
|
||||
Skipping double jump to b1 in bpl b20
|
||||
Skipping double jump to b13 in bne b21
|
||||
Skipping double jump to b21 in bne b22
|
||||
Skipping double jump to b13 in jmp b21
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to breturn_from_b23 in bne b23
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b2 in bne b6
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_gfx_mode to b10
|
||||
@ -27276,14 +27304,20 @@ Removing instruction lda y0
|
||||
Removing instruction lda y0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b5:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b1:
|
||||
Removing instruction b2:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b22:
|
||||
Removing instruction b23:
|
||||
Removing instruction b20:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b6:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Skipping double jump to b13 in bne b21
|
||||
@ -27301,15 +27335,15 @@ Removing instruction b21:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b13
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Fixing long branch [750] beq b7 to bne
|
||||
Fixing long branch [754] beq b8 to bne
|
||||
Fixing long branch [758] beq b9 to bne
|
||||
Fixing long branch [762] beq b10 to bne
|
||||
Fixing long branch [766] beq b11 to bne
|
||||
Fixing long branch [770] beq b12 to bne
|
||||
Fixing long branch [774] beq b13 to bne
|
||||
Fixing long branch [778] beq b14 to bne
|
||||
Fixing long branch [1328] bmi b2 to bpl
|
||||
Fixing long branch [747] beq b7 to bne
|
||||
Fixing long branch [751] beq b8 to bne
|
||||
Fixing long branch [755] beq b9 to bne
|
||||
Fixing long branch [759] beq b10 to bne
|
||||
Fixing long branch [763] beq b11 to bne
|
||||
Fixing long branch [767] beq b12 to bne
|
||||
Fixing long branch [771] beq b13 to bne
|
||||
Fixing long branch [775] beq b14 to bne
|
||||
Fixing long branch [1324] bmi b2 to bpl
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
@ -29022,7 +29056,7 @@ reg byte a [ gfx_init_screen0::$3 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 10142472
|
||||
Score: 10142556
|
||||
|
||||
//SEG0 File Comments
|
||||
// Interactive Explorer for C64DTV Screen Modes
|
||||
@ -29818,14 +29852,13 @@ keyboard_event_get: {
|
||||
//SEG258 [157] phi from keyboard_event_get::@1 to keyboard_event_get::@return [phi:keyboard_event_get::@1->keyboard_event_get::@return]
|
||||
//SEG259 [157] phi (byte) keyboard_events_size#24 = (byte) keyboard_events_size#4 [phi:keyboard_event_get::@1->keyboard_event_get::@return#0] -- register_copy
|
||||
//SEG260 [157] phi (byte) keyboard_event_get::return#2 = (byte) keyboard_event_get::return#1 [phi:keyboard_event_get::@1->keyboard_event_get::@return#1] -- register_copy
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG261 [157] phi from keyboard_event_get to keyboard_event_get::@return [phi:keyboard_event_get->keyboard_event_get::@return]
|
||||
b1:
|
||||
//SEG262 [157] phi (byte) keyboard_events_size#24 = (byte) keyboard_events_size#100 [phi:keyboard_event_get->keyboard_event_get::@return#0] -- register_copy
|
||||
//SEG263 [157] phi (byte) keyboard_event_get::return#2 = (byte/word/signed word/dword/signed dword) $ff [phi:keyboard_event_get->keyboard_event_get::@return#1] -- vbuaa=vbuc1
|
||||
lda #$ff
|
||||
//SEG264 keyboard_event_get::@return
|
||||
breturn:
|
||||
//SEG265 [158] return
|
||||
rts
|
||||
}
|
||||
@ -30118,7 +30151,7 @@ get_vic_screen: {
|
||||
sta return
|
||||
lda #>VIC_SCREEN4
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG399 [228] phi from get_vic_screen get_vic_screen::@1 to get_vic_screen::@return [phi:get_vic_screen/get_vic_screen::@1->get_vic_screen::@return]
|
||||
b2:
|
||||
//SEG400 [228] phi (byte*) get_vic_screen::return#5 = (const byte*) VIC_SCREEN0#0 [phi:get_vic_screen/get_vic_screen::@1->get_vic_screen::@return#0] -- pbuz1=pbuc1
|
||||
@ -30126,7 +30159,7 @@ get_vic_screen: {
|
||||
sta return
|
||||
lda #>VIC_SCREEN0
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG401 [228] phi from get_vic_screen::@2 to get_vic_screen::@return [phi:get_vic_screen::@2->get_vic_screen::@return]
|
||||
b3:
|
||||
//SEG402 [228] phi (byte*) get_vic_screen::return#5 = (const byte*) VIC_SCREEN1#0 [phi:get_vic_screen::@2->get_vic_screen::@return#0] -- pbuz1=pbuc1
|
||||
@ -30134,7 +30167,7 @@ get_vic_screen: {
|
||||
sta return
|
||||
lda #>VIC_SCREEN1
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG403 [228] phi from get_vic_screen::@3 to get_vic_screen::@return [phi:get_vic_screen::@3->get_vic_screen::@return]
|
||||
b4:
|
||||
//SEG404 [228] phi (byte*) get_vic_screen::return#5 = (const byte*) VIC_SCREEN2#0 [phi:get_vic_screen::@3->get_vic_screen::@return#0] -- pbuz1=pbuc1
|
||||
@ -30142,7 +30175,7 @@ get_vic_screen: {
|
||||
sta return
|
||||
lda #>VIC_SCREEN2
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG405 [228] phi from get_vic_screen::@4 to get_vic_screen::@return [phi:get_vic_screen::@4->get_vic_screen::@return]
|
||||
b5:
|
||||
//SEG406 [228] phi (byte*) get_vic_screen::return#5 = (const byte*) VIC_SCREEN3#0 [phi:get_vic_screen::@4->get_vic_screen::@return#0] -- pbuz1=pbuc1
|
||||
@ -30151,7 +30184,6 @@ get_vic_screen: {
|
||||
lda #>VIC_SCREEN3
|
||||
sta return+1
|
||||
//SEG407 get_vic_screen::@return
|
||||
breturn:
|
||||
//SEG408 [229] return
|
||||
rts
|
||||
//SEG409 [230] phi from get_vic_screen::@5 to get_vic_screen::@1 [phi:get_vic_screen::@5->get_vic_screen::@1]
|
||||
@ -30175,7 +30207,7 @@ get_vic_charset: {
|
||||
sta return
|
||||
lda #>VIC_BITMAP
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG417 [233] phi from get_vic_charset get_vic_charset::@1 to get_vic_charset::@return [phi:get_vic_charset/get_vic_charset::@1->get_vic_charset::@return]
|
||||
b2:
|
||||
//SEG418 [233] phi (byte*) get_vic_charset::return#2 = (const byte*) VIC_CHARSET_ROM#0 [phi:get_vic_charset/get_vic_charset::@1->get_vic_charset::@return#0] -- pbuz1=pbuc1
|
||||
@ -30184,7 +30216,6 @@ get_vic_charset: {
|
||||
lda #>VIC_CHARSET_ROM
|
||||
sta return+1
|
||||
//SEG419 get_vic_charset::@return
|
||||
breturn:
|
||||
//SEG420 [234] return
|
||||
rts
|
||||
//SEG421 [235] phi from get_vic_charset::@2 to get_vic_charset::@1 [phi:get_vic_charset::@2->get_vic_charset::@1]
|
||||
@ -30276,7 +30307,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_FULL>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG453 [251] phi from get_plane get_plane::@1 to get_plane::@return [phi:get_plane/get_plane::@1->get_plane::@return]
|
||||
b2:
|
||||
//SEG454 [251] phi (dword) get_plane::return#14 = ((dword))(const byte*) VIC_SCREEN0#0 [phi:get_plane/get_plane::@1->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30288,7 +30319,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN0>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG455 [251] phi from get_plane::@10 to get_plane::@return [phi:get_plane::@10->get_plane::@return]
|
||||
b3:
|
||||
//SEG456 [251] phi (dword) get_plane::return#14 = ((dword))(const dword) PLANE_HORISONTAL2#0 [phi:get_plane::@10->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30300,7 +30331,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_HORISONTAL2>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG457 [251] phi from get_plane::@11 to get_plane::@return [phi:get_plane::@11->get_plane::@return]
|
||||
b4:
|
||||
//SEG458 [251] phi (dword) get_plane::return#14 = ((dword))(const dword) PLANE_VERTICAL2#0 [phi:get_plane::@11->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30312,7 +30343,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_VERTICAL2>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG459 [251] phi from get_plane::@12 to get_plane::@return [phi:get_plane::@12->get_plane::@return]
|
||||
b5:
|
||||
//SEG460 [251] phi (dword) get_plane::return#14 = ((dword))(const dword) PLANE_CHARSET8#0 [phi:get_plane::@12->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30324,7 +30355,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_CHARSET8>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG461 [251] phi from get_plane::@13 to get_plane::@return [phi:get_plane::@13->get_plane::@return]
|
||||
b6:
|
||||
//SEG462 [251] phi (dword) get_plane::return#14 = ((dword))(const dword) PLANE_BLANK#0 [phi:get_plane::@13->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30336,7 +30367,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_BLANK>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG463 [251] phi from get_plane::@2 to get_plane::@return [phi:get_plane::@2->get_plane::@return]
|
||||
b7:
|
||||
//SEG464 [251] phi (dword) get_plane::return#14 = ((dword))(const byte*) VIC_SCREEN1#0 [phi:get_plane::@2->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30348,7 +30379,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN1>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG465 [251] phi from get_plane::@3 to get_plane::@return [phi:get_plane::@3->get_plane::@return]
|
||||
b8:
|
||||
//SEG466 [251] phi (dword) get_plane::return#14 = ((dword))(const byte*) VIC_SCREEN2#0 [phi:get_plane::@3->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30360,7 +30391,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN2>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG467 [251] phi from get_plane::@4 to get_plane::@return [phi:get_plane::@4->get_plane::@return]
|
||||
b9:
|
||||
//SEG468 [251] phi (dword) get_plane::return#14 = ((dword))(const byte*) VIC_SCREEN3#0 [phi:get_plane::@4->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30372,7 +30403,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_SCREEN3>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG469 [251] phi from get_plane::@5 to get_plane::@return [phi:get_plane::@5->get_plane::@return]
|
||||
b10:
|
||||
//SEG470 [251] phi (dword) get_plane::return#14 = ((dword))(const byte*) VIC_BITMAP#0 [phi:get_plane::@5->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30384,7 +30415,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_BITMAP>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG471 [251] phi from get_plane::@6 to get_plane::@return [phi:get_plane::@6->get_plane::@return]
|
||||
b11:
|
||||
//SEG472 [251] phi (dword) get_plane::return#14 = ((dword))(const byte*) VIC_CHARSET_ROM#0 [phi:get_plane::@6->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30396,7 +30427,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>$ffffffff&VIC_CHARSET_ROM>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG473 [251] phi from get_plane::@7 to get_plane::@return [phi:get_plane::@7->get_plane::@return]
|
||||
b12:
|
||||
//SEG474 [251] phi (dword) get_plane::return#14 = ((dword))(const dword) PLANE_8BPP_CHUNKY#0 [phi:get_plane::@7->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30408,7 +30439,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_8BPP_CHUNKY>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG475 [251] phi from get_plane::@8 to get_plane::@return [phi:get_plane::@8->get_plane::@return]
|
||||
b13:
|
||||
//SEG476 [251] phi (dword) get_plane::return#14 = ((dword))(const dword) PLANE_HORISONTAL#0 [phi:get_plane::@8->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30420,7 +30451,7 @@ get_plane: {
|
||||
sta return+2
|
||||
lda #>PLANE_HORISONTAL>>$10
|
||||
sta return+3
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG477 [251] phi from get_plane::@9 to get_plane::@return [phi:get_plane::@9->get_plane::@return]
|
||||
b14:
|
||||
//SEG478 [251] phi (dword) get_plane::return#14 = ((dword))(const dword) PLANE_VERTICAL#0 [phi:get_plane::@9->get_plane::@return#0] -- vduz1=vduc1
|
||||
@ -30433,7 +30464,6 @@ get_plane: {
|
||||
lda #>PLANE_VERTICAL>>$10
|
||||
sta return+3
|
||||
//SEG479 get_plane::@return
|
||||
breturn:
|
||||
//SEG480 [252] return
|
||||
rts
|
||||
//SEG481 [253] phi from get_plane::@14 to get_plane::@1 [phi:get_plane::@14->get_plane::@1]
|
||||
@ -31158,7 +31188,6 @@ form_control: {
|
||||
//SEG773 [388] phi (byte) form_control::return#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:form_control::@13->form_control::@return#2] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
//SEG774 form_control::@return
|
||||
breturn:
|
||||
//SEG775 [389] return
|
||||
rts
|
||||
//SEG776 [390] phi from form_control::@8 to form_control::@21 [phi:form_control::@8->form_control::@21]
|
||||
@ -31220,7 +31249,7 @@ form_control: {
|
||||
//SEG801 [388] phi (signed byte) form_cursor_count#16 = (signed byte) form_cursor_count#15 [phi:form_control::@15/form_control::@23->form_control::@return#1] -- register_copy
|
||||
//SEG802 [388] phi (byte) form_control::return#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:form_control::@15/form_control::@23->form_control::@return#2] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG803 form_control::@14
|
||||
b14:
|
||||
//SEG804 [401] *((const byte[]) form_fields_val#0 + (byte) form_field_idx#28) ← ++ *((const byte[]) form_fields_val#0 + (byte) form_field_idx#28) -- pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1
|
||||
@ -31247,7 +31276,7 @@ form_control: {
|
||||
//SEG812 [388] phi (signed byte) form_cursor_count#16 = (signed byte) form_cursor_count#15 [phi:form_control::@5->form_control::@return#1] -- register_copy
|
||||
//SEG813 [388] phi (byte) form_control::return#2 = (byte/word/signed word/dword/signed dword) $ff [phi:form_control::@5->form_control::@return#2] -- vbuxx=vbuc1
|
||||
ldx #$ff
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG814 [405] phi from form_control::@5 to form_control::@23 [phi:form_control::@5->form_control::@23]
|
||||
//SEG815 form_control::@23
|
||||
//SEG816 form_control::@2
|
||||
@ -32324,7 +32353,6 @@ bitmap_line: {
|
||||
//SEG1289 [703] phi (byte) bitmap_line_ydxi::xd#2 = (byte) bitmap_line_ydxi::xd#0 [phi:bitmap_line::@4->bitmap_line_ydxi#4] -- register_copy
|
||||
jsr bitmap_line_ydxi
|
||||
//SEG1290 bitmap_line::@return
|
||||
breturn:
|
||||
//SEG1291 [630] return
|
||||
rts
|
||||
//SEG1292 bitmap_line::@8
|
||||
@ -32346,7 +32374,7 @@ bitmap_line: {
|
||||
//SEG1303 [681] phi (byte) bitmap_line_xdyi::x#6 = (byte) bitmap_line_xdyi::x#0 [phi:bitmap_line::@8->bitmap_line_xdyi#3] -- register_copy
|
||||
//SEG1304 [681] phi (byte) bitmap_line_xdyi::yd#2 = (byte) bitmap_line_xdyi::yd#0 [phi:bitmap_line::@8->bitmap_line_xdyi#4] -- register_copy
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1305 bitmap_line::@7
|
||||
b7:
|
||||
//SEG1306 [637] (byte) bitmap_line::yd#1 ← (byte) bitmap_line::y1#0 - (byte) bitmap_line::y0#0 -- vbuyy=vbuz1_minus_vbuz2
|
||||
@ -32377,7 +32405,7 @@ bitmap_line: {
|
||||
//SEG1319 [733] phi (byte) bitmap_line_ydxd::x#5 = (byte) bitmap_line_ydxd::x#0 [phi:bitmap_line::@10->bitmap_line_ydxd#3] -- register_copy
|
||||
//SEG1320 [733] phi (byte) bitmap_line_ydxd::xd#2 = (byte) bitmap_line_ydxd::xd#0 [phi:bitmap_line::@10->bitmap_line_ydxd#4] -- register_copy
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1321 bitmap_line::@9
|
||||
b9:
|
||||
//SEG1322 [645] (byte) bitmap_line_xdyd::x#0 ← (byte) bitmap_line::x1#0 -- vbuz1=vbuxx
|
||||
@ -32397,7 +32425,7 @@ bitmap_line: {
|
||||
//SEG1332 [718] phi (byte) bitmap_line_xdyd::x#6 = (byte) bitmap_line_xdyd::x#0 [phi:bitmap_line::@9->bitmap_line_xdyd#3] -- register_copy
|
||||
//SEG1333 [718] phi (byte) bitmap_line_xdyd::yd#2 = (byte) bitmap_line_xdyd::yd#0 [phi:bitmap_line::@9->bitmap_line_xdyd#4] -- register_copy
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1334 bitmap_line::@1
|
||||
b1:
|
||||
//SEG1335 [651] (byte) bitmap_line::xd#1 ← (byte) bitmap_line::x1#0 - (byte) bitmap_line::x0#0 -- vbuz1=vbuxx_minus_vbuz2
|
||||
@ -32434,7 +32462,7 @@ bitmap_line: {
|
||||
//SEG1351 [733] phi (byte) bitmap_line_ydxd::x#5 = (byte) bitmap_line_ydxd::x#1 [phi:bitmap_line::@6->bitmap_line_ydxd#3] -- register_copy
|
||||
//SEG1352 [733] phi (byte) bitmap_line_ydxd::xd#2 = (byte) bitmap_line_ydxd::xd#1 [phi:bitmap_line::@6->bitmap_line_ydxd#4] -- register_copy
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1353 bitmap_line::@12
|
||||
b12:
|
||||
//SEG1354 [661] (byte) bitmap_line_xdyd::x#1 ← (byte) bitmap_line::x0#0 -- vbuz1=vbuz2
|
||||
@ -32454,7 +32482,7 @@ bitmap_line: {
|
||||
//SEG1364 [718] phi (byte) bitmap_line_xdyd::x#6 = (byte) bitmap_line_xdyd::x#1 [phi:bitmap_line::@12->bitmap_line_xdyd#3] -- register_copy
|
||||
//SEG1365 [718] phi (byte) bitmap_line_xdyd::yd#2 = (byte) bitmap_line_xdyd::yd#1 [phi:bitmap_line::@12->bitmap_line_xdyd#4] -- register_copy
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1366 bitmap_line::@11
|
||||
b11:
|
||||
//SEG1367 [667] (byte) bitmap_line::yd#11 ← (byte) bitmap_line::y1#0 - (byte) bitmap_line::y0#0 -- vbuyy=vbuz1_minus_vbuz2
|
||||
@ -32483,7 +32511,7 @@ bitmap_line: {
|
||||
//SEG1380 [703] phi (byte) bitmap_line_ydxi::x#5 = (byte) bitmap_line_ydxi::x#1 [phi:bitmap_line::@14->bitmap_line_ydxi#3] -- register_copy
|
||||
//SEG1381 [703] phi (byte) bitmap_line_ydxi::xd#2 = (byte) bitmap_line_ydxi::xd#1 [phi:bitmap_line::@14->bitmap_line_ydxi#4] -- register_copy
|
||||
jsr bitmap_line_ydxi
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1382 bitmap_line::@13
|
||||
b13:
|
||||
//SEG1383 [675] (byte) bitmap_line_xdyi::x#1 ← (byte) bitmap_line::x0#0 -- vbuz1=vbuz2
|
||||
@ -32503,7 +32531,7 @@ bitmap_line: {
|
||||
//SEG1393 [681] phi (byte) bitmap_line_xdyi::x#6 = (byte) bitmap_line_xdyi::x#1 [phi:bitmap_line::@13->bitmap_line_xdyi#3] -- register_copy
|
||||
//SEG1394 [681] phi (byte) bitmap_line_xdyi::yd#2 = (byte) bitmap_line_xdyi::yd#1 [phi:bitmap_line::@13->bitmap_line_xdyi#4] -- register_copy
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
//SEG1395 bitmap_line_xdyi
|
||||
// bitmap_line_xdyi(byte zeropage($e) x, byte zeropage($f) y, byte zeropage($d) x1, byte zeropage(8) xd, byte zeropage(7) yd)
|
||||
|
@ -184,7 +184,6 @@ menu: {
|
||||
cmp #0
|
||||
beq b5
|
||||
jsr mode_stdchar
|
||||
breturn:
|
||||
rts
|
||||
b5:
|
||||
ldy #KEY_2
|
||||
@ -192,70 +191,70 @@ menu: {
|
||||
cmp #0
|
||||
beq b6
|
||||
jsr mode_ecmchar
|
||||
jmp breturn
|
||||
rts
|
||||
b6:
|
||||
ldy #KEY_3
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b7
|
||||
jsr mode_mcchar
|
||||
jmp breturn
|
||||
rts
|
||||
b7:
|
||||
ldy #KEY_4
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b8
|
||||
jsr mode_stdbitmap
|
||||
jmp breturn
|
||||
rts
|
||||
b8:
|
||||
ldy #KEY_6
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b9
|
||||
jsr mode_hicolstdchar
|
||||
jmp breturn
|
||||
rts
|
||||
b9:
|
||||
ldy #KEY_7
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b10
|
||||
jsr mode_hicolecmchar
|
||||
jmp breturn
|
||||
rts
|
||||
b10:
|
||||
ldy #KEY_8
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b11
|
||||
jsr mode_hicolmcchar
|
||||
jmp breturn
|
||||
rts
|
||||
b11:
|
||||
ldy #KEY_A
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b12
|
||||
jsr mode_sixsfred2
|
||||
jmp breturn
|
||||
rts
|
||||
b12:
|
||||
ldy #KEY_B
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b13
|
||||
jsr mode_twoplanebitmap
|
||||
jmp breturn
|
||||
rts
|
||||
b13:
|
||||
ldy #KEY_C
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b14
|
||||
jsr mode_sixsfred
|
||||
jmp breturn
|
||||
rts
|
||||
b14:
|
||||
ldy #KEY_D
|
||||
jsr keyboard_key_pressed
|
||||
cmp #0
|
||||
beq b15
|
||||
jsr mode_8bpppixelcell
|
||||
jmp breturn
|
||||
rts
|
||||
b15:
|
||||
ldy #KEY_E
|
||||
jsr keyboard_key_pressed
|
||||
@ -264,7 +263,7 @@ menu: {
|
||||
jmp b4
|
||||
!b4:
|
||||
jsr mode_8bppchunkybmm
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
//Chunky 8bpp Bitmap Mode (BMM = 0, ECM/MCM/HICOL/LINEAR/CHUNK/COLDIS = 1)
|
||||
// Resolution: 320x200
|
||||
@ -1579,7 +1578,6 @@ bitmap_line: {
|
||||
sta bitmap_line_ydxi.y1
|
||||
sty bitmap_line_ydxi.yd
|
||||
jsr bitmap_line_ydxi
|
||||
breturn:
|
||||
rts
|
||||
b8:
|
||||
stx bitmap_line_xdyi.x
|
||||
@ -1587,7 +1585,7 @@ bitmap_line: {
|
||||
sta bitmap_line_xdyi.y
|
||||
sty bitmap_line_xdyi.yd
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
b7:
|
||||
lda y1
|
||||
sec
|
||||
@ -1602,14 +1600,14 @@ bitmap_line: {
|
||||
sta bitmap_line_ydxd.y1
|
||||
sty bitmap_line_ydxd.yd
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
b9:
|
||||
stx bitmap_line_xdyd.x
|
||||
lda y1
|
||||
sta bitmap_line_xdyd.y
|
||||
sty bitmap_line_xdyd.yd
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
b1:
|
||||
txa
|
||||
sec
|
||||
@ -1627,14 +1625,14 @@ bitmap_line: {
|
||||
sta bitmap_line_ydxd.y
|
||||
sty bitmap_line_ydxd.yd
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
b12:
|
||||
lda x0
|
||||
sta bitmap_line_xdyd.x
|
||||
stx bitmap_line_xdyd.x1
|
||||
sty bitmap_line_xdyd.yd
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
b11:
|
||||
lda y1
|
||||
sec
|
||||
@ -1647,14 +1645,14 @@ bitmap_line: {
|
||||
ldx x0
|
||||
sty bitmap_line_ydxi.yd
|
||||
jsr bitmap_line_ydxi
|
||||
jmp breturn
|
||||
rts
|
||||
b13:
|
||||
lda x0
|
||||
sta bitmap_line_xdyi.x
|
||||
stx bitmap_line_xdyi.x1
|
||||
sty bitmap_line_xdyi.yd
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
// bitmap_line_xdyi(byte zeropage($a) x, byte zeropage($b) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
|
||||
bitmap_line_xdyi: {
|
||||
|
@ -25160,8 +25160,26 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b11 in beq b27
|
||||
Skipping double jump to b1 in jmp b1_from_b18
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b2 in bne b6
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_b18 to b3
|
||||
@ -25237,13 +25255,15 @@ Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction b3:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b27:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b6:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b11
|
||||
Removing unreachable instruction jmp b2
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Fixing long branch [262] beq b4 to bne
|
||||
Fixing long branch [261] beq b4 to bne
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
@ -26766,7 +26786,7 @@ reg byte a [ print_str_lines::ch#0 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 2305587
|
||||
Score: 2305641
|
||||
|
||||
//SEG0 File Comments
|
||||
// Exploring C64DTV Screen Modes
|
||||
@ -27023,7 +27043,6 @@ menu: {
|
||||
//SEG67 [40] call mode_stdchar
|
||||
jsr mode_stdchar
|
||||
//SEG68 menu::@return
|
||||
breturn:
|
||||
//SEG69 [41] return
|
||||
rts
|
||||
//SEG70 [42] phi from menu::@30 to menu::@5 [phi:menu::@30->menu::@5]
|
||||
@ -27044,7 +27063,7 @@ menu: {
|
||||
//SEG80 menu::@17
|
||||
//SEG81 [48] call mode_ecmchar
|
||||
jsr mode_ecmchar
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG82 [49] phi from menu::@31 to menu::@6 [phi:menu::@31->menu::@6]
|
||||
//SEG83 menu::@6
|
||||
b6:
|
||||
@ -27063,7 +27082,7 @@ menu: {
|
||||
//SEG92 menu::@18
|
||||
//SEG93 [55] call mode_mcchar
|
||||
jsr mode_mcchar
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG94 [56] phi from menu::@32 to menu::@7 [phi:menu::@32->menu::@7]
|
||||
//SEG95 menu::@7
|
||||
b7:
|
||||
@ -27082,7 +27101,7 @@ menu: {
|
||||
//SEG104 menu::@19
|
||||
//SEG105 [62] call mode_stdbitmap
|
||||
jsr mode_stdbitmap
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG106 [63] phi from menu::@33 to menu::@8 [phi:menu::@33->menu::@8]
|
||||
//SEG107 menu::@8
|
||||
b8:
|
||||
@ -27101,7 +27120,7 @@ menu: {
|
||||
//SEG116 menu::@20
|
||||
//SEG117 [69] call mode_hicolstdchar
|
||||
jsr mode_hicolstdchar
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG118 [70] phi from menu::@34 to menu::@9 [phi:menu::@34->menu::@9]
|
||||
//SEG119 menu::@9
|
||||
b9:
|
||||
@ -27120,7 +27139,7 @@ menu: {
|
||||
//SEG128 menu::@21
|
||||
//SEG129 [76] call mode_hicolecmchar
|
||||
jsr mode_hicolecmchar
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG130 [77] phi from menu::@35 to menu::@10 [phi:menu::@35->menu::@10]
|
||||
//SEG131 menu::@10
|
||||
b10:
|
||||
@ -27139,7 +27158,7 @@ menu: {
|
||||
//SEG140 menu::@22
|
||||
//SEG141 [83] call mode_hicolmcchar
|
||||
jsr mode_hicolmcchar
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG142 [84] phi from menu::@36 to menu::@11 [phi:menu::@36->menu::@11]
|
||||
//SEG143 menu::@11
|
||||
b11:
|
||||
@ -27158,7 +27177,7 @@ menu: {
|
||||
//SEG152 menu::@23
|
||||
//SEG153 [90] call mode_sixsfred2
|
||||
jsr mode_sixsfred2
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG154 [91] phi from menu::@37 to menu::@12 [phi:menu::@37->menu::@12]
|
||||
//SEG155 menu::@12
|
||||
b12:
|
||||
@ -27177,7 +27196,7 @@ menu: {
|
||||
//SEG164 menu::@24
|
||||
//SEG165 [97] call mode_twoplanebitmap
|
||||
jsr mode_twoplanebitmap
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG166 [98] phi from menu::@38 to menu::@13 [phi:menu::@38->menu::@13]
|
||||
//SEG167 menu::@13
|
||||
b13:
|
||||
@ -27196,7 +27215,7 @@ menu: {
|
||||
//SEG176 menu::@25
|
||||
//SEG177 [104] call mode_sixsfred
|
||||
jsr mode_sixsfred
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG178 [105] phi from menu::@39 to menu::@14 [phi:menu::@39->menu::@14]
|
||||
//SEG179 menu::@14
|
||||
b14:
|
||||
@ -27215,7 +27234,7 @@ menu: {
|
||||
//SEG188 menu::@26
|
||||
//SEG189 [111] call mode_8bpppixelcell
|
||||
jsr mode_8bpppixelcell
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG190 [112] phi from menu::@40 to menu::@15 [phi:menu::@40->menu::@15]
|
||||
//SEG191 menu::@15
|
||||
b15:
|
||||
@ -27236,7 +27255,7 @@ menu: {
|
||||
//SEG200 menu::@27
|
||||
//SEG201 [118] call mode_8bppchunkybmm
|
||||
jsr mode_8bppchunkybmm
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
//SEG202 mode_8bppchunkybmm
|
||||
//Chunky 8bpp Bitmap Mode (BMM = 0, ECM/MCM/HICOL/LINEAR/CHUNK/COLDIS = 1)
|
||||
@ -29471,7 +29490,6 @@ bitmap_line: {
|
||||
//SEG1120 [676] phi (byte) bitmap_line_ydxi::xd#2 = (byte) bitmap_line_ydxi::xd#0 [phi:bitmap_line::@4->bitmap_line_ydxi#4] -- register_copy
|
||||
jsr bitmap_line_ydxi
|
||||
//SEG1121 bitmap_line::@return
|
||||
breturn:
|
||||
//SEG1122 [603] return
|
||||
rts
|
||||
//SEG1123 bitmap_line::@8
|
||||
@ -29493,7 +29511,7 @@ bitmap_line: {
|
||||
//SEG1134 [654] phi (byte) bitmap_line_xdyi::x#6 = (byte) bitmap_line_xdyi::x#0 [phi:bitmap_line::@8->bitmap_line_xdyi#3] -- register_copy
|
||||
//SEG1135 [654] phi (byte) bitmap_line_xdyi::yd#2 = (byte) bitmap_line_xdyi::yd#0 [phi:bitmap_line::@8->bitmap_line_xdyi#4] -- register_copy
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1136 bitmap_line::@7
|
||||
b7:
|
||||
//SEG1137 [610] (byte) bitmap_line::yd#1 ← (byte) bitmap_line::y1#0 - (byte) bitmap_line::y0#0 -- vbuyy=vbuz1_minus_vbuz2
|
||||
@ -29524,7 +29542,7 @@ bitmap_line: {
|
||||
//SEG1150 [706] phi (byte) bitmap_line_ydxd::x#5 = (byte) bitmap_line_ydxd::x#0 [phi:bitmap_line::@10->bitmap_line_ydxd#3] -- register_copy
|
||||
//SEG1151 [706] phi (byte) bitmap_line_ydxd::xd#2 = (byte) bitmap_line_ydxd::xd#0 [phi:bitmap_line::@10->bitmap_line_ydxd#4] -- register_copy
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1152 bitmap_line::@9
|
||||
b9:
|
||||
//SEG1153 [618] (byte) bitmap_line_xdyd::x#0 ← (byte) bitmap_line::x1#0 -- vbuz1=vbuxx
|
||||
@ -29544,7 +29562,7 @@ bitmap_line: {
|
||||
//SEG1163 [691] phi (byte) bitmap_line_xdyd::x#6 = (byte) bitmap_line_xdyd::x#0 [phi:bitmap_line::@9->bitmap_line_xdyd#3] -- register_copy
|
||||
//SEG1164 [691] phi (byte) bitmap_line_xdyd::yd#2 = (byte) bitmap_line_xdyd::yd#0 [phi:bitmap_line::@9->bitmap_line_xdyd#4] -- register_copy
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1165 bitmap_line::@1
|
||||
b1:
|
||||
//SEG1166 [624] (byte) bitmap_line::xd#1 ← (byte) bitmap_line::x1#0 - (byte) bitmap_line::x0#0 -- vbuz1=vbuxx_minus_vbuz2
|
||||
@ -29581,7 +29599,7 @@ bitmap_line: {
|
||||
//SEG1182 [706] phi (byte) bitmap_line_ydxd::x#5 = (byte) bitmap_line_ydxd::x#1 [phi:bitmap_line::@6->bitmap_line_ydxd#3] -- register_copy
|
||||
//SEG1183 [706] phi (byte) bitmap_line_ydxd::xd#2 = (byte) bitmap_line_ydxd::xd#1 [phi:bitmap_line::@6->bitmap_line_ydxd#4] -- register_copy
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1184 bitmap_line::@12
|
||||
b12:
|
||||
//SEG1185 [634] (byte) bitmap_line_xdyd::x#1 ← (byte) bitmap_line::x0#0 -- vbuz1=vbuz2
|
||||
@ -29601,7 +29619,7 @@ bitmap_line: {
|
||||
//SEG1195 [691] phi (byte) bitmap_line_xdyd::x#6 = (byte) bitmap_line_xdyd::x#1 [phi:bitmap_line::@12->bitmap_line_xdyd#3] -- register_copy
|
||||
//SEG1196 [691] phi (byte) bitmap_line_xdyd::yd#2 = (byte) bitmap_line_xdyd::yd#1 [phi:bitmap_line::@12->bitmap_line_xdyd#4] -- register_copy
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1197 bitmap_line::@11
|
||||
b11:
|
||||
//SEG1198 [640] (byte) bitmap_line::yd#11 ← (byte) bitmap_line::y1#0 - (byte) bitmap_line::y0#0 -- vbuyy=vbuz1_minus_vbuz2
|
||||
@ -29630,7 +29648,7 @@ bitmap_line: {
|
||||
//SEG1211 [676] phi (byte) bitmap_line_ydxi::x#5 = (byte) bitmap_line_ydxi::x#1 [phi:bitmap_line::@14->bitmap_line_ydxi#3] -- register_copy
|
||||
//SEG1212 [676] phi (byte) bitmap_line_ydxi::xd#2 = (byte) bitmap_line_ydxi::xd#1 [phi:bitmap_line::@14->bitmap_line_ydxi#4] -- register_copy
|
||||
jsr bitmap_line_ydxi
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG1213 bitmap_line::@13
|
||||
b13:
|
||||
//SEG1214 [648] (byte) bitmap_line_xdyi::x#1 ← (byte) bitmap_line::x0#0 -- vbuz1=vbuz2
|
||||
@ -29650,7 +29668,7 @@ bitmap_line: {
|
||||
//SEG1224 [654] phi (byte) bitmap_line_xdyi::x#6 = (byte) bitmap_line_xdyi::x#1 [phi:bitmap_line::@13->bitmap_line_xdyi#3] -- register_copy
|
||||
//SEG1225 [654] phi (byte) bitmap_line_xdyi::yd#2 = (byte) bitmap_line_xdyi::yd#1 [phi:bitmap_line::@13->bitmap_line_xdyi#4] -- register_copy
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
//SEG1226 bitmap_line_xdyi
|
||||
// bitmap_line_xdyi(byte zeropage($a) x, byte zeropage($b) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
|
||||
|
@ -20,10 +20,9 @@ main: {
|
||||
beq b1
|
||||
lda #2
|
||||
sta BGCOL
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
lda #5
|
||||
sta BGCOL
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
@ -320,7 +320,10 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -351,7 +354,7 @@ FINAL SYMBOL TABLE
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 43
|
||||
Score: 46
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests that casting inside constants in the output handles precedence between cast and + correctly - should generate the following KA-expression ($ff & sumw>>1)+1
|
||||
@ -391,7 +394,6 @@ main: {
|
||||
lda #2
|
||||
sta BGCOL
|
||||
//SEG15 main::@return
|
||||
breturn:
|
||||
//SEG16 [8] return
|
||||
rts
|
||||
//SEG17 main::@1
|
||||
@ -399,6 +401,6 @@ main: {
|
||||
//SEG18 [9] *((const byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 -- _deref_pbuc1=vbuc2
|
||||
lda #5
|
||||
sta BGCOL
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,6 @@ play_movement: {
|
||||
lda game_over
|
||||
cmp #0
|
||||
beq b1
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
lda key_event
|
||||
@ -600,7 +599,7 @@ play_movement: {
|
||||
clc
|
||||
adc return
|
||||
sta return
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
// Rotate the current piece based on key-presses
|
||||
// Return non-zero if a render is needed
|
||||
@ -613,7 +612,6 @@ play_move_rotate: {
|
||||
beq b2
|
||||
b4:
|
||||
lda #0
|
||||
breturn:
|
||||
rts
|
||||
b2:
|
||||
lax current_orientation
|
||||
@ -642,7 +640,7 @@ play_move_rotate: {
|
||||
adc current_piece+1
|
||||
sta current_piece_gfx+1
|
||||
lda #1
|
||||
jmp breturn
|
||||
rts
|
||||
b1:
|
||||
lax current_orientation
|
||||
axs #$10
|
||||
@ -698,7 +696,6 @@ play_collision: {
|
||||
cmp #2*PLAYFIELD_LINES
|
||||
bcc b4
|
||||
lda #COLLISION_BOTTOM
|
||||
breturn:
|
||||
rts
|
||||
b4:
|
||||
lda #$80
|
||||
@ -706,20 +703,20 @@ play_collision: {
|
||||
cmp #0
|
||||
beq b5
|
||||
lda #COLLISION_LEFT
|
||||
jmp breturn
|
||||
rts
|
||||
b5:
|
||||
lda col
|
||||
cmp #PLAYFIELD_COLS
|
||||
bcc b6
|
||||
lda #COLLISION_RIGHT
|
||||
jmp breturn
|
||||
rts
|
||||
b6:
|
||||
ldy col
|
||||
lda (playfield_line),y
|
||||
cmp #0
|
||||
beq b3
|
||||
lda #COLLISION_PLAYFIELD
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
inc col
|
||||
inx
|
||||
@ -734,7 +731,7 @@ play_collision: {
|
||||
cmp l
|
||||
bne b9
|
||||
lda #COLLISION_NONE
|
||||
jmp breturn
|
||||
rts
|
||||
b9:
|
||||
lda i
|
||||
sta i_11
|
||||
@ -769,10 +766,9 @@ play_move_leftright: {
|
||||
inc current_xpos
|
||||
b2:
|
||||
lda #1
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
lda #0
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
ldx current_xpos
|
||||
@ -850,10 +846,9 @@ play_move_down: {
|
||||
lda #0
|
||||
sta current_movedown_counter
|
||||
ldx #1
|
||||
jmp breturn
|
||||
rts
|
||||
b5:
|
||||
ldx #0
|
||||
breturn:
|
||||
rts
|
||||
b10:
|
||||
inc current_ypos
|
||||
@ -1159,10 +1154,9 @@ keyboard_event_get: {
|
||||
dec keyboard_events_size
|
||||
ldy keyboard_events_size
|
||||
ldx keyboard_events,y
|
||||
jmp breturn
|
||||
rts
|
||||
b1:
|
||||
ldx #$ff
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
// Scans the entire matrix to determine which keys have been pressed/depressed.
|
||||
|
@ -22216,8 +22216,17 @@ Removing instruction b6:
|
||||
Removing instruction b7:
|
||||
Removing instruction b11:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b1 in bne b5
|
||||
Skipping double jump to b3 in bne b9
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b9 in bne b9_from_b10
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_render_score to b2
|
||||
@ -22254,8 +22263,14 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b5:
|
||||
Removing instruction b9:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b5:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b1
|
||||
@ -23592,7 +23607,7 @@ reg byte a [ sprites_irq::ptr#2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 3348864
|
||||
Score: 3348891
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tetris Game for the Commodore 64
|
||||
@ -24590,7 +24605,6 @@ play_movement: {
|
||||
//SEG404 [169] phi (byte) current_orientation#17 = (byte) current_orientation#20 [phi:play_movement::@2/play_movement::@4->play_movement::@return#2] -- register_copy
|
||||
//SEG405 [169] phi (byte) play_movement::return#2 = (byte) play_movement::render#1 [phi:play_movement::@2/play_movement::@4->play_movement::@return#3] -- register_copy
|
||||
//SEG406 play_movement::@return
|
||||
breturn:
|
||||
//SEG407 [170] return
|
||||
rts
|
||||
//SEG408 play_movement::@1
|
||||
@ -24617,7 +24631,7 @@ play_movement: {
|
||||
clc
|
||||
adc return
|
||||
sta return
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
//SEG421 play_move_rotate
|
||||
// Rotate the current piece based on key-presses
|
||||
@ -24639,7 +24653,6 @@ play_move_rotate: {
|
||||
//SEG428 [183] phi (byte) play_move_rotate::return#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:play_move_rotate::@4/play_move_rotate::@6->play_move_rotate::@return#2] -- vbuaa=vbuc1
|
||||
lda #0
|
||||
//SEG429 play_move_rotate::@return
|
||||
breturn:
|
||||
//SEG430 [184] return
|
||||
rts
|
||||
//SEG431 play_move_rotate::@2
|
||||
@ -24696,7 +24709,7 @@ play_move_rotate: {
|
||||
//SEG456 [183] phi (byte) current_orientation#25 = (byte) current_orientation#7 [phi:play_move_rotate::@5->play_move_rotate::@return#1] -- register_copy
|
||||
//SEG457 [183] phi (byte) play_move_rotate::return#2 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:play_move_rotate::@5->play_move_rotate::@return#2] -- vbuaa=vbuc1
|
||||
lda #1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG458 play_move_rotate::@1
|
||||
b1:
|
||||
//SEG459 [198] (byte/signed word/word/dword/signed dword~) play_move_rotate::$7 ← (byte) current_orientation#20 - (byte/signed byte/word/signed word/dword/signed dword) $10 -- vbuxx=vbuz1_minus_vbuc1
|
||||
@ -24777,7 +24790,6 @@ play_collision: {
|
||||
//SEG481 [210] phi (byte) play_collision::return#15 = (const byte) COLLISION_BOTTOM#0 [phi:play_collision::@7->play_collision::@return#0] -- vbuaa=vbuc1
|
||||
lda #COLLISION_BOTTOM
|
||||
//SEG482 play_collision::@return
|
||||
breturn:
|
||||
//SEG483 [211] return
|
||||
rts
|
||||
//SEG484 play_collision::@4
|
||||
@ -24791,7 +24803,7 @@ play_collision: {
|
||||
//SEG487 [210] phi from play_collision::@4 to play_collision::@return [phi:play_collision::@4->play_collision::@return]
|
||||
//SEG488 [210] phi (byte) play_collision::return#15 = (const byte) COLLISION_LEFT#0 [phi:play_collision::@4->play_collision::@return#0] -- vbuaa=vbuc1
|
||||
lda #COLLISION_LEFT
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG489 play_collision::@5
|
||||
b5:
|
||||
//SEG490 [214] if((byte) play_collision::col#2<(const byte) PLAYFIELD_COLS#0) goto play_collision::@6 -- vbuz1_lt_vbuc1_then_la1
|
||||
@ -24801,7 +24813,7 @@ play_collision: {
|
||||
//SEG491 [210] phi from play_collision::@5 to play_collision::@return [phi:play_collision::@5->play_collision::@return]
|
||||
//SEG492 [210] phi (byte) play_collision::return#15 = (const byte) COLLISION_RIGHT#0 [phi:play_collision::@5->play_collision::@return#0] -- vbuaa=vbuc1
|
||||
lda #COLLISION_RIGHT
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG493 play_collision::@6
|
||||
b6:
|
||||
//SEG494 [215] if(*((byte*) play_collision::playfield_line#0 + (byte) play_collision::col#2)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto play_collision::@3 -- pbuz1_derefidx_vbuz2_eq_0_then_la1
|
||||
@ -24812,7 +24824,7 @@ play_collision: {
|
||||
//SEG495 [210] phi from play_collision::@6 to play_collision::@return [phi:play_collision::@6->play_collision::@return]
|
||||
//SEG496 [210] phi (byte) play_collision::return#15 = (const byte) COLLISION_PLAYFIELD#0 [phi:play_collision::@6->play_collision::@return#0] -- vbuaa=vbuc1
|
||||
lda #COLLISION_PLAYFIELD
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG497 play_collision::@3
|
||||
b3:
|
||||
//SEG498 [216] (byte) play_collision::col#1 ← ++ (byte) play_collision::col#2 -- vbuz1=_inc_vbuz1
|
||||
@ -24837,7 +24849,7 @@ play_collision: {
|
||||
//SEG505 [210] phi from play_collision::@8 to play_collision::@return [phi:play_collision::@8->play_collision::@return]
|
||||
//SEG506 [210] phi (byte) play_collision::return#15 = (const byte) COLLISION_NONE#0 [phi:play_collision::@8->play_collision::@return#0] -- vbuaa=vbuc1
|
||||
lda #COLLISION_NONE
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG507 play_collision::@9
|
||||
b9:
|
||||
//SEG508 [222] (byte~) play_collision::i#11 ← (byte) play_collision::i#1 -- vbuz1=vbuz2
|
||||
@ -24908,14 +24920,13 @@ play_move_leftright: {
|
||||
//SEG541 [235] phi (byte) current_xpos#26 = (byte) current_xpos#6 [phi:play_move_leftright::@4/play_move_leftright::@5->play_move_leftright::@return#0] -- register_copy
|
||||
//SEG542 [235] phi (byte) play_move_leftright::return#2 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:play_move_leftright::@4/play_move_leftright::@5->play_move_leftright::@return#1] -- vbuaa=vbuc1
|
||||
lda #1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG543 [235] phi from play_move_leftright::@2 play_move_leftright::@6 play_move_leftright::@7 to play_move_leftright::@return [phi:play_move_leftright::@2/play_move_leftright::@6/play_move_leftright::@7->play_move_leftright::@return]
|
||||
b3:
|
||||
//SEG544 [235] phi (byte) current_xpos#26 = (byte) current_xpos#22 [phi:play_move_leftright::@2/play_move_leftright::@6/play_move_leftright::@7->play_move_leftright::@return#0] -- register_copy
|
||||
//SEG545 [235] phi (byte) play_move_leftright::return#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:play_move_leftright::@2/play_move_leftright::@6/play_move_leftright::@7->play_move_leftright::@return#1] -- vbuaa=vbuc1
|
||||
lda #0
|
||||
//SEG546 play_move_leftright::@return
|
||||
breturn:
|
||||
//SEG547 [236] return
|
||||
rts
|
||||
//SEG548 play_move_leftright::@1
|
||||
@ -25107,7 +25118,7 @@ play_move_down: {
|
||||
sta current_movedown_counter
|
||||
//SEG660 [281] phi (byte) play_move_down::return#3 = (byte/signed byte/word/signed word/dword/signed dword) 1 [phi:play_move_down::@11->play_move_down::@return#14] -- vbuxx=vbuc1
|
||||
ldx #1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG661 [281] phi from play_move_down::@3 to play_move_down::@return [phi:play_move_down::@3->play_move_down::@return]
|
||||
b5:
|
||||
//SEG662 [281] phi (byte) next_piece_idx#16 = (byte) next_piece_idx#10 [phi:play_move_down::@3->play_move_down::@return#0] -- register_copy
|
||||
@ -25127,7 +25138,6 @@ play_move_down: {
|
||||
//SEG676 [281] phi (byte) play_move_down::return#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:play_move_down::@3->play_move_down::@return#14] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
//SEG677 play_move_down::@return
|
||||
breturn:
|
||||
//SEG678 [282] return
|
||||
rts
|
||||
//SEG679 play_move_down::@10
|
||||
@ -25658,14 +25668,13 @@ keyboard_event_get: {
|
||||
//SEG900 [387] phi from keyboard_event_get::@1 to keyboard_event_get::@return [phi:keyboard_event_get::@1->keyboard_event_get::@return]
|
||||
//SEG901 [387] phi (byte) keyboard_events_size#16 = (byte) keyboard_events_size#4 [phi:keyboard_event_get::@1->keyboard_event_get::@return#0] -- register_copy
|
||||
//SEG902 [387] phi (byte) keyboard_event_get::return#2 = (byte) keyboard_event_get::return#1 [phi:keyboard_event_get::@1->keyboard_event_get::@return#1] -- register_copy
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG903 [387] phi from keyboard_event_get to keyboard_event_get::@return [phi:keyboard_event_get->keyboard_event_get::@return]
|
||||
b1:
|
||||
//SEG904 [387] phi (byte) keyboard_events_size#16 = (byte) keyboard_events_size#13 [phi:keyboard_event_get->keyboard_event_get::@return#0] -- register_copy
|
||||
//SEG905 [387] phi (byte) keyboard_event_get::return#2 = (byte/word/signed word/dword/signed dword) $ff [phi:keyboard_event_get->keyboard_event_get::@return#1] -- vbuxx=vbuc1
|
||||
ldx #$ff
|
||||
//SEG906 keyboard_event_get::@return
|
||||
breturn:
|
||||
//SEG907 [388] return
|
||||
rts
|
||||
}
|
||||
|
@ -76,13 +76,12 @@ bitmap_line: {
|
||||
sty bitmap_line_ydxi.y
|
||||
ldx x1
|
||||
jsr bitmap_line_ydxi
|
||||
breturn:
|
||||
rts
|
||||
b8:
|
||||
ldx x1
|
||||
sty bitmap_line_xdyi.y
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
b7:
|
||||
tya
|
||||
sec
|
||||
@ -95,14 +94,14 @@ bitmap_line: {
|
||||
ldx x0
|
||||
sty bitmap_line_ydxd.y1
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
b9:
|
||||
ldx x1
|
||||
sty bitmap_line_xdyd.y
|
||||
lda x0
|
||||
sta bitmap_line_xdyd.x1
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
b1:
|
||||
lda x1
|
||||
sec
|
||||
@ -123,11 +122,11 @@ bitmap_line: {
|
||||
sty bitmap_line_ydxd.y
|
||||
ldx x1
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
b12:
|
||||
ldx x0
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
b11:
|
||||
tya
|
||||
sec
|
||||
@ -140,13 +139,13 @@ bitmap_line: {
|
||||
ldx x0
|
||||
sty bitmap_line_ydxi.y1
|
||||
jsr bitmap_line_ydxi
|
||||
jmp breturn
|
||||
rts
|
||||
b13:
|
||||
ldx x0
|
||||
lda x1
|
||||
sta bitmap_line_xdyi.x1
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
// bitmap_line_xdyi(byte register(X) x, byte zeropage(6) y, byte zeropage(5) x1, byte zeropage(4) xd, byte zeropage(3) yd)
|
||||
bitmap_line_xdyi: {
|
||||
|
@ -5382,6 +5382,13 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b2 in bne b6
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
@ -5394,6 +5401,7 @@ Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda x0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b6:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b2
|
||||
@ -5809,7 +5817,7 @@ reg byte a [ bitmap_init::$10 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 221023
|
||||
Score: 221044
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -5954,7 +5962,6 @@ bitmap_line: {
|
||||
//SEG63 [109] phi (byte) bitmap_line_ydxi::xd#2 = (byte) bitmap_line_ydxi::xd#0 [phi:bitmap_line::@4->bitmap_line_ydxi#4] -- register_copy
|
||||
jsr bitmap_line_ydxi
|
||||
//SEG64 bitmap_line::@return
|
||||
breturn:
|
||||
//SEG65 [36] return
|
||||
rts
|
||||
//SEG66 bitmap_line::@8
|
||||
@ -5974,7 +5981,7 @@ bitmap_line: {
|
||||
//SEG77 [87] phi (byte) bitmap_line_xdyi::x#6 = (byte) bitmap_line_xdyi::x#0 [phi:bitmap_line::@8->bitmap_line_xdyi#3] -- register_copy
|
||||
//SEG78 [87] phi (byte) bitmap_line_xdyi::yd#2 = (byte) bitmap_line_xdyi::yd#0 [phi:bitmap_line::@8->bitmap_line_xdyi#4] -- register_copy
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG79 bitmap_line::@7
|
||||
b7:
|
||||
//SEG80 [43] (byte) bitmap_line::yd#1 ← (byte) bitmap_line::y1#0 - (byte) bitmap_line::y0#0 -- vbuz1=vbuyy_minus_vbuz2
|
||||
@ -6003,7 +6010,7 @@ bitmap_line: {
|
||||
//SEG93 [139] phi (byte) bitmap_line_ydxd::x#5 = (byte) bitmap_line_ydxd::x#0 [phi:bitmap_line::@10->bitmap_line_ydxd#3] -- register_copy
|
||||
//SEG94 [139] phi (byte) bitmap_line_ydxd::xd#2 = (byte) bitmap_line_ydxd::xd#0 [phi:bitmap_line::@10->bitmap_line_ydxd#4] -- register_copy
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG95 bitmap_line::@9
|
||||
b9:
|
||||
//SEG96 [51] (byte) bitmap_line_xdyd::x#0 ← (byte) bitmap_line::x1#0 -- vbuxx=vbuz1
|
||||
@ -6023,7 +6030,7 @@ bitmap_line: {
|
||||
//SEG106 [124] phi (byte) bitmap_line_xdyd::x#6 = (byte) bitmap_line_xdyd::x#0 [phi:bitmap_line::@9->bitmap_line_xdyd#3] -- register_copy
|
||||
//SEG107 [124] phi (byte) bitmap_line_xdyd::yd#2 = (byte) bitmap_line_xdyd::yd#0 [phi:bitmap_line::@9->bitmap_line_xdyd#4] -- register_copy
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG108 bitmap_line::@1
|
||||
b1:
|
||||
//SEG109 [57] (byte) bitmap_line::xd#1 ← (byte) bitmap_line::x1#0 - (byte) bitmap_line::x0#0 -- vbuz1=vbuz2_minus_vbuz3
|
||||
@ -6063,7 +6070,7 @@ bitmap_line: {
|
||||
//SEG125 [139] phi (byte) bitmap_line_ydxd::x#5 = (byte) bitmap_line_ydxd::x#1 [phi:bitmap_line::@6->bitmap_line_ydxd#3] -- register_copy
|
||||
//SEG126 [139] phi (byte) bitmap_line_ydxd::xd#2 = (byte) bitmap_line_ydxd::xd#1 [phi:bitmap_line::@6->bitmap_line_ydxd#4] -- register_copy
|
||||
jsr bitmap_line_ydxd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG127 bitmap_line::@12
|
||||
b12:
|
||||
//SEG128 [67] (byte) bitmap_line_xdyd::x#1 ← (byte) bitmap_line::x0#0 -- vbuxx=vbuz1
|
||||
@ -6080,7 +6087,7 @@ bitmap_line: {
|
||||
//SEG138 [124] phi (byte) bitmap_line_xdyd::x#6 = (byte) bitmap_line_xdyd::x#1 [phi:bitmap_line::@12->bitmap_line_xdyd#3] -- register_copy
|
||||
//SEG139 [124] phi (byte) bitmap_line_xdyd::yd#2 = (byte) bitmap_line_xdyd::yd#1 [phi:bitmap_line::@12->bitmap_line_xdyd#4] -- register_copy
|
||||
jsr bitmap_line_xdyd
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG140 bitmap_line::@11
|
||||
b11:
|
||||
//SEG141 [73] (byte) bitmap_line::yd#11 ← (byte) bitmap_line::y1#0 - (byte) bitmap_line::y0#0 -- vbuz1=vbuyy_minus_vbuz2
|
||||
@ -6109,7 +6116,7 @@ bitmap_line: {
|
||||
//SEG154 [109] phi (byte) bitmap_line_ydxi::x#5 = (byte) bitmap_line_ydxi::x#1 [phi:bitmap_line::@14->bitmap_line_ydxi#3] -- register_copy
|
||||
//SEG155 [109] phi (byte) bitmap_line_ydxi::xd#2 = (byte) bitmap_line_ydxi::xd#1 [phi:bitmap_line::@14->bitmap_line_ydxi#4] -- register_copy
|
||||
jsr bitmap_line_ydxi
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG156 bitmap_line::@13
|
||||
b13:
|
||||
//SEG157 [81] (byte) bitmap_line_xdyi::x#1 ← (byte) bitmap_line::x0#0 -- vbuxx=vbuz1
|
||||
@ -6128,7 +6135,7 @@ bitmap_line: {
|
||||
//SEG167 [87] phi (byte) bitmap_line_xdyi::x#6 = (byte) bitmap_line_xdyi::x#1 [phi:bitmap_line::@13->bitmap_line_xdyi#3] -- register_copy
|
||||
//SEG168 [87] phi (byte) bitmap_line_xdyi::yd#2 = (byte) bitmap_line_xdyi::yd#1 [phi:bitmap_line::@13->bitmap_line_xdyi#4] -- register_copy
|
||||
jsr bitmap_line_xdyi
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
//SEG169 bitmap_line_xdyi
|
||||
// bitmap_line_xdyi(byte register(X) x, byte zeropage(6) y, byte zeropage(5) x1, byte zeropage(4) xd, byte zeropage(3) yd)
|
||||
|
@ -3909,6 +3909,7 @@ Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to breturn in bne b5
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b4
|
||||
Removing instruction jmp b7
|
||||
@ -3923,7 +3924,7 @@ Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b5:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp breturn
|
||||
Removing unreachable instruction rts
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
|
@ -149,7 +149,6 @@ render_logo: {
|
||||
b5:
|
||||
cpy #$28
|
||||
bne b6
|
||||
breturn:
|
||||
rts
|
||||
b6:
|
||||
lda logo_idx
|
||||
@ -201,7 +200,7 @@ render_logo: {
|
||||
b11:
|
||||
cpy #$28
|
||||
bne b12
|
||||
jmp breturn
|
||||
rts
|
||||
b12:
|
||||
lda #0
|
||||
sta SCREEN,y
|
||||
|
@ -7770,7 +7770,9 @@ Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b4 in bne b6
|
||||
Skipping double jump to b4 in bne b6
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b3 in beq b12
|
||||
Replacing jump to rts with rts in jmp b3
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_sin16s to b4
|
||||
Succesful ASM optimization Pass5RelabelLongLabels
|
||||
@ -7792,10 +7794,11 @@ Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b6:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b12:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b4
|
||||
Removing unreachable instruction jmp b3
|
||||
Removing unreachable instruction rts
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -8272,7 +8275,7 @@ reg byte a [ divr16u::$2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 43610
|
||||
Score: 43910
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -8518,7 +8521,6 @@ render_logo: {
|
||||
cpy #$28
|
||||
bne b6
|
||||
//SEG92 render_logo::@return
|
||||
breturn:
|
||||
//SEG93 [49] return
|
||||
rts
|
||||
//SEG94 render_logo::@6
|
||||
@ -8622,7 +8624,7 @@ render_logo: {
|
||||
//SEG144 [75] if((byte) render_logo::screen_idx#15!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto render_logo::@12 -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #$28
|
||||
bne b12
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG145 render_logo::@12
|
||||
b12:
|
||||
//SEG146 [76] *((const byte*) SCREEN#0 + (byte) render_logo::screen_idx#15) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- pbuc1_derefidx_vbuyy=vbuc2
|
||||
|
@ -7586,6 +7586,7 @@ Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b2 in bne b7
|
||||
Skipping double jump to b2 in bne b7
|
||||
Skipping double jump to b3 in beq b12
|
||||
Replacing jump to rts with rts in jmp b3
|
||||
Skipping double jump to b2 in bne b6
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_sin16s to b4
|
||||
@ -7607,7 +7608,7 @@ Removing instruction b12:
|
||||
Removing instruction b6:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b2
|
||||
Removing unreachable instruction jmp b3
|
||||
Removing unreachable instruction rts
|
||||
Removing unreachable instruction jmp b2
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Fixing long branch [160] bcc b1 to bcs
|
||||
|
@ -26,13 +26,12 @@ getfn: {
|
||||
sta return
|
||||
lda #>fn2
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
b1:
|
||||
lda #<fn1
|
||||
sta return
|
||||
lda #>fn1
|
||||
sta return+1
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
fn2: {
|
||||
|
@ -568,9 +568,12 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label breturn_from_getfn to b1
|
||||
Succesful ASM optimization Pass5RelabelLongLabels
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -610,7 +613,7 @@ reg byte a [ getfn::$0 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 389
|
||||
Score: 392
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests creating, assigning returning and calling pointers to non-args no-return functions
|
||||
@ -671,7 +674,7 @@ getfn: {
|
||||
sta return
|
||||
lda #>fn2
|
||||
sta return+1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG31 [15] phi from getfn to getfn::@return [phi:getfn->getfn::@return]
|
||||
b1:
|
||||
//SEG32 [15] phi (void()*) getfn::return#3 = &(void()) fn1() [phi:getfn->getfn::@return#0] -- pprz1=pprc1
|
||||
@ -680,7 +683,6 @@ getfn: {
|
||||
lda #>fn1
|
||||
sta return+1
|
||||
//SEG33 getfn::@return
|
||||
breturn:
|
||||
//SEG34 [16] return
|
||||
rts
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ menu: {
|
||||
cmp #0
|
||||
beq b2
|
||||
jsr pressed
|
||||
breturn:
|
||||
rts
|
||||
b2:
|
||||
ldx #KEY_I
|
||||
@ -45,7 +44,7 @@ menu: {
|
||||
lda #RED
|
||||
sta BORDERCOL
|
||||
sei
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
ldx #KEY_E
|
||||
jsr keyboard_key_pressed
|
||||
@ -54,7 +53,7 @@ menu: {
|
||||
lda #GREEN
|
||||
sta BORDERCOL
|
||||
cli
|
||||
jmp breturn
|
||||
rts
|
||||
b4:
|
||||
inc SCREEN
|
||||
jmp b1
|
||||
|
@ -1961,7 +1961,11 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -2203,7 +2207,7 @@ reg byte a [ pressed::$0 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 2845
|
||||
Score: 2851
|
||||
|
||||
//SEG0 File Comments
|
||||
// Exploring keyboard glitch that finds "C" press when pressing space
|
||||
@ -2271,7 +2275,6 @@ menu: {
|
||||
//SEG27 [14] call pressed
|
||||
jsr pressed
|
||||
//SEG28 menu::@return
|
||||
breturn:
|
||||
//SEG29 [15] return
|
||||
rts
|
||||
//SEG30 [16] phi from menu::@8 to menu::@2 [phi:menu::@8->menu::@2]
|
||||
@ -2294,7 +2297,7 @@ menu: {
|
||||
sta BORDERCOL
|
||||
//SEG41 asm { sei }
|
||||
sei
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG42 [23] phi from menu::@9 to menu::@3 [phi:menu::@9->menu::@3]
|
||||
//SEG43 menu::@3
|
||||
b3:
|
||||
@ -2315,7 +2318,7 @@ menu: {
|
||||
sta BORDERCOL
|
||||
//SEG53 asm { cli }
|
||||
cli
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG54 menu::@4
|
||||
b4:
|
||||
//SEG55 [30] *((const byte*) SCREEN#0) ← ++ *((const byte*) SCREEN#0) -- _deref_pbuc1=_inc__deref_pbuc1
|
||||
|
@ -323,14 +323,13 @@ divr16s: {
|
||||
eor #$ff
|
||||
adc #0
|
||||
sta return+1
|
||||
breturn:
|
||||
rts
|
||||
b10:
|
||||
lda divr16u.rem
|
||||
sta rem16s
|
||||
lda divr16u.rem+1
|
||||
sta rem16s+1
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
sec
|
||||
lda _13
|
||||
|
@ -5679,6 +5679,7 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b2 in bne b6
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
@ -5691,6 +5692,7 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp b3
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b6:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b2
|
||||
@ -6107,7 +6109,7 @@ reg byte a [ bitmap_init::$7 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 21644
|
||||
Score: 21647
|
||||
|
||||
//SEG0 File Comments
|
||||
// Animated lines drawn on a single color bitmap
|
||||
@ -6588,7 +6590,6 @@ divr16s: {
|
||||
//SEG151 [86] phi (signed word) rem16s#3 = (signed word~) rem16s#57 [phi:divr16s::@10/divr16s::@5->divr16s::@return#0] -- register_copy
|
||||
//SEG152 [86] phi (signed word) divr16s::return#2 = (signed word~) divr16s::return#7 [phi:divr16s::@10/divr16s::@5->divr16s::@return#1] -- register_copy
|
||||
//SEG153 divr16s::@return
|
||||
breturn:
|
||||
//SEG154 [87] return
|
||||
rts
|
||||
//SEG155 divr16s::@10
|
||||
@ -6599,7 +6600,7 @@ divr16s: {
|
||||
sta rem16s
|
||||
lda divr16u.rem+1
|
||||
sta rem16s+1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG158 divr16s::@3
|
||||
b3:
|
||||
//SEG159 [90] (signed word~) divr16s::$13 ← - (signed word) divr16s::divisor#0 -- vwsz1=_neg_vwsz1
|
||||
|
@ -14,7 +14,6 @@ main: {
|
||||
lda str,x
|
||||
cmp #'@'
|
||||
bne b2
|
||||
breturn:
|
||||
rts
|
||||
b2:
|
||||
lda str,x
|
||||
@ -24,7 +23,7 @@ main: {
|
||||
inx
|
||||
cpx #0
|
||||
bne b1
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
lda str,x
|
||||
ldy #0
|
||||
|
@ -408,9 +408,12 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -438,7 +441,7 @@ zp ZP_WORD:2 [ main::screen#2 main::screen#5 main::screen#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 681
|
||||
Score: 711
|
||||
|
||||
//SEG0 File Comments
|
||||
// Illustrates both break & continue statements in a loop
|
||||
@ -476,7 +479,6 @@ main: {
|
||||
cmp #'@'
|
||||
bne b2
|
||||
//SEG19 main::@return
|
||||
breturn:
|
||||
//SEG20 [7] return
|
||||
rts
|
||||
//SEG21 main::@2
|
||||
@ -494,7 +496,7 @@ main: {
|
||||
//SEG27 [11] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 -- vbuxx_neq_0_then_la1
|
||||
cpx #0
|
||||
bne b1
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG28 main::@3
|
||||
b3:
|
||||
//SEG29 [12] *((byte*) main::screen#2) ← *((const byte[]) main::str#0 + (byte) main::i#2) -- _deref_pbuz1=pbuc1_derefidx_vbuxx
|
||||
|
@ -13,7 +13,6 @@ main: {
|
||||
lda (line),y
|
||||
cmp #'a'
|
||||
bne b5
|
||||
breturn:
|
||||
rts
|
||||
b5:
|
||||
ldy #0
|
||||
@ -37,7 +36,7 @@ main: {
|
||||
cmp #<$400+$28*$19
|
||||
bcc b1
|
||||
!:
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
lda #'a'
|
||||
sta (line),y
|
||||
|
@ -452,12 +452,15 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b2_from_b1 to b5
|
||||
Succesful ASM optimization Pass5RelabelLongLabels
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -483,7 +486,7 @@ reg byte y [ main::i#2 main::i#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 3556
|
||||
Score: 3586
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests break statement in a simple loop
|
||||
@ -518,7 +521,6 @@ main: {
|
||||
cmp #'a'
|
||||
bne b5
|
||||
//SEG17 main::@return
|
||||
breturn:
|
||||
//SEG18 [7] return
|
||||
rts
|
||||
//SEG19 [8] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
|
||||
@ -552,7 +554,7 @@ main: {
|
||||
cmp #<$400+$28*$19
|
||||
bcc b1
|
||||
!:
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG28 main::@3
|
||||
b3:
|
||||
//SEG29 [12] *((byte*) main::line#2 + (byte) main::i#2) ← (byte) 'a' -- pbuz1_derefidx_vbuyy=vbuc1
|
||||
|
@ -9,7 +9,6 @@ main: {
|
||||
lda SCREEN,x
|
||||
cmp #'a'
|
||||
bne b2
|
||||
breturn:
|
||||
rts
|
||||
b2:
|
||||
lda #'a'
|
||||
@ -17,5 +16,5 @@ main: {
|
||||
inx
|
||||
cpx #$28*6+1
|
||||
bne b1
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
@ -286,9 +286,12 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -309,7 +312,7 @@ reg byte x [ main::i#2 main::i#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 281
|
||||
Score: 311
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests break statement in a simple loop
|
||||
@ -340,7 +343,6 @@ main: {
|
||||
cmp #'a'
|
||||
bne b2
|
||||
//SEG17 main::@return
|
||||
breturn:
|
||||
//SEG18 [7] return
|
||||
rts
|
||||
//SEG19 main::@2
|
||||
@ -353,6 +355,6 @@ main: {
|
||||
//SEG22 [10] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 6+(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
|
||||
cpx #$28*6+1
|
||||
bne b1
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
||||
|
@ -108,6 +108,7 @@ f0: {
|
||||
jsr fa
|
||||
lda #0
|
||||
sta bb
|
||||
rts
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
@ -182,6 +183,7 @@ fa: {
|
||||
sta bc
|
||||
jsr fb
|
||||
ldx #0
|
||||
rts
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
@ -255,6 +257,7 @@ fb: {
|
||||
lda #0
|
||||
jsr fc
|
||||
ldy #0
|
||||
rts
|
||||
breturn:
|
||||
rts
|
||||
}
|
||||
|
@ -5942,16 +5942,16 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to breturn in bne b19
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp breturn
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b19:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp breturn
|
||||
Removing unreachable instruction rts
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -6241,7 +6241,7 @@ zp ZP_BYTE:6 [ be#138 be#44 be#137 be#43 be#136 be#42 be#135 be#41 be#134 be#40
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 995
|
||||
Score: 1013
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -6541,6 +6541,7 @@ f0: {
|
||||
//SEG187 [57] phi (byte) bb#13 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:f0::@19->f0::@return#3] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta bb
|
||||
rts
|
||||
//SEG188 [57] phi from f0::@9 to f0::@return [phi:f0::@9->f0::@return]
|
||||
//SEG189 [57] phi (byte) be#13 = (byte) be#105 [phi:f0::@9->f0::@return#0] -- register_copy
|
||||
//SEG190 [57] phi (byte) bd#13 = (byte) bd#137 [phi:f0::@9->f0::@return#1] -- register_copy
|
||||
@ -6761,6 +6762,7 @@ fa: {
|
||||
//SEG332 [108] phi (byte) bd#24 = (byte) bd#35 [phi:fa::@19->fa::@return#1] -- register_copy
|
||||
//SEG333 [108] phi (byte) bc#24 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:fa::@19->fa::@return#2] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
rts
|
||||
//SEG334 [108] phi from fa::@9 to fa::@return [phi:fa::@9->fa::@return]
|
||||
//SEG335 [108] phi (byte) be#24 = (byte) be#116 [phi:fa::@9->fa::@return#0] -- register_copy
|
||||
//SEG336 [108] phi (byte) bd#24 = (byte) bd#104 [phi:fa::@9->fa::@return#1] -- register_copy
|
||||
@ -6959,6 +6961,7 @@ fb: {
|
||||
//SEG457 [159] phi (byte) be#35 = (byte) be#46 [phi:fb::@19->fb::@return#0] -- register_copy
|
||||
//SEG458 [159] phi (byte) bd#35 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:fb::@19->fb::@return#1] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
rts
|
||||
//SEG459 [159] phi from fb::@9 to fb::@return [phi:fb::@9->fb::@return]
|
||||
//SEG460 [159] phi (byte) be#35 = (byte) be#127 [phi:fb::@9->fb::@return#0] -- register_copy
|
||||
//SEG461 [159] phi (byte) bd#35 = (byte) bd#115 [phi:fb::@9->fb::@return#1] -- register_copy
|
||||
|
@ -52,14 +52,13 @@ nexttext: {
|
||||
sta textp
|
||||
lda #>text2
|
||||
sta textp+1
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
lda #<text1
|
||||
sta textp
|
||||
lda #>text1
|
||||
sta textp+1
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
text1: .text "camelot @"
|
||||
text2: .text "rex @"
|
||||
|
@ -700,9 +700,12 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -749,7 +752,7 @@ reg byte a [ nexttext::$0 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 5758
|
||||
Score: 5761
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests pointer to pointer in a more complex setup
|
||||
@ -849,7 +852,6 @@ nexttext: {
|
||||
lda #>text2
|
||||
sta textp+1
|
||||
//SEG43 nexttext::@return
|
||||
breturn:
|
||||
//SEG44 [19] return
|
||||
rts
|
||||
//SEG45 nexttext::@1
|
||||
@ -859,7 +861,7 @@ nexttext: {
|
||||
sta textp
|
||||
lda #>text1
|
||||
sta textp+1
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
text1: .text "camelot @"
|
||||
text2: .text "rex @"
|
||||
|
@ -61,7 +61,6 @@ position_sprite: {
|
||||
eor #$ff
|
||||
and SPRITES_XMSB
|
||||
sta SPRITES_XMSB
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
lda #1
|
||||
@ -75,5 +74,5 @@ position_sprite: {
|
||||
!e:
|
||||
ora SPRITES_XMSB
|
||||
sta SPRITES_XMSB
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
@ -1044,9 +1044,12 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -1174,7 +1177,7 @@ reg byte a [ position_sprite::$6 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 559
|
||||
Score: 562
|
||||
|
||||
//SEG0 File Comments
|
||||
// Tests rolling sprite MSB by variable amount
|
||||
@ -1278,7 +1281,6 @@ position_sprite: {
|
||||
and SPRITES_XMSB
|
||||
sta SPRITES_XMSB
|
||||
//SEG38 position_sprite::@return
|
||||
breturn:
|
||||
//SEG39 [22] return
|
||||
rts
|
||||
//SEG40 position_sprite::@1
|
||||
@ -1296,6 +1298,6 @@ position_sprite: {
|
||||
//SEG42 [24] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte/signed byte/word/signed word/dword/signed dword~) position_sprite::$6 -- _deref_pbuc1=_deref_pbuc1_bor_vbuaa
|
||||
ora SPRITES_XMSB
|
||||
sta SPRITES_XMSB
|
||||
jmp breturn
|
||||
rts
|
||||
}
|
||||
|
||||
|
@ -5220,6 +5220,7 @@ Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b3 in beq b12
|
||||
Replacing jump to rts with rts in jmp b3
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_sin16s to b4
|
||||
Succesful ASM optimization Pass5RelabelLongLabels
|
||||
@ -5233,7 +5234,7 @@ Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b12:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b3
|
||||
Removing unreachable instruction rts
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
|
@ -7107,7 +7107,9 @@ Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b3 in beq b12
|
||||
Replacing jump to rts with rts in jmp b3
|
||||
Skipping double jump to b3 in beq b12
|
||||
Replacing jump to rts with rts in jmp b3
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_sin16sb to b4
|
||||
Relabelling long label b1_from_sin16s to b4
|
||||
@ -7124,8 +7126,8 @@ Removing instruction bbegin:
|
||||
Removing instruction b12:
|
||||
Removing instruction b12:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b3
|
||||
Removing unreachable instruction jmp b3
|
||||
Removing unreachable instruction rts
|
||||
Removing unreachable instruction rts
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
|
@ -305,11 +305,10 @@ sin8s: {
|
||||
eor #$ff
|
||||
clc
|
||||
adc #1
|
||||
b4:
|
||||
rts
|
||||
b14:
|
||||
txa
|
||||
jmp b4
|
||||
rts
|
||||
}
|
||||
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
|
||||
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
|
||||
|
@ -4670,6 +4670,8 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp b4
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_sin8s to b5
|
||||
Succesful ASM optimization Pass5RelabelLongLabels
|
||||
Removing instruction jmp b1
|
||||
@ -4680,6 +4682,7 @@ Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b4:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -4971,7 +4974,7 @@ reg byte a [ divr16u::$2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 15001
|
||||
Score: 15004
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -5504,7 +5507,6 @@ sin8s: {
|
||||
//SEG221 [109] phi from sin8s::@14 sin8s::@8 to sin8s::@4 [phi:sin8s::@14/sin8s::@8->sin8s::@4]
|
||||
//SEG222 [109] phi (signed byte) sin8s::return#1 = (signed byte~) sin8s::return#5 [phi:sin8s::@14/sin8s::@8->sin8s::@4#0] -- register_copy
|
||||
//SEG223 sin8s::@4
|
||||
b4:
|
||||
//SEG224 sin8s::@return
|
||||
//SEG225 [110] return
|
||||
rts
|
||||
@ -5512,7 +5514,7 @@ sin8s: {
|
||||
b14:
|
||||
//SEG227 [111] (signed byte~) sin8s::return#5 ← (signed byte)(byte) sin8s::usinx#4 -- vbsaa=vbsxx
|
||||
txa
|
||||
jmp b4
|
||||
rts
|
||||
}
|
||||
//SEG228 mulu8_sel
|
||||
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
|
||||
|
@ -760,11 +760,10 @@ sin8s: {
|
||||
eor #$ff
|
||||
clc
|
||||
adc #1
|
||||
b4:
|
||||
rts
|
||||
b14:
|
||||
txa
|
||||
jmp b4
|
||||
rts
|
||||
}
|
||||
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
|
||||
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
|
||||
|
@ -7660,6 +7660,8 @@ Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b3 in beq b12
|
||||
Replacing jump to rts with rts in jmp b3
|
||||
Replacing jump to rts with rts in jmp b4
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_sin16s to b4
|
||||
Relabelling long label b1_from_sin8s to b5
|
||||
@ -7675,8 +7677,9 @@ Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b12:
|
||||
Removing instruction b4:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp b3
|
||||
Removing unreachable instruction rts
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -8121,7 +8124,7 @@ reg byte a [ mul8u::$1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 28330
|
||||
Score: 28333
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -9318,7 +9321,6 @@ sin8s: {
|
||||
//SEG430 [219] phi from sin8s::@14 sin8s::@8 to sin8s::@4 [phi:sin8s::@14/sin8s::@8->sin8s::@4]
|
||||
//SEG431 [219] phi (signed byte) sin8s::return#1 = (signed byte~) sin8s::return#5 [phi:sin8s::@14/sin8s::@8->sin8s::@4#0] -- register_copy
|
||||
//SEG432 sin8s::@4
|
||||
b4:
|
||||
//SEG433 sin8s::@return
|
||||
//SEG434 [220] return
|
||||
rts
|
||||
@ -9326,7 +9328,7 @@ sin8s: {
|
||||
b14:
|
||||
//SEG436 [221] (signed byte~) sin8s::return#5 ← (signed byte)(byte) sin8s::usinx#4 -- vbsaa=vbsxx
|
||||
txa
|
||||
jmp b4
|
||||
rts
|
||||
}
|
||||
//SEG437 mulu8_sel
|
||||
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
|
||||
|
@ -481,11 +481,10 @@ sin8s: {
|
||||
eor #$ff
|
||||
clc
|
||||
adc #1
|
||||
b4:
|
||||
rts
|
||||
b14:
|
||||
txa
|
||||
jmp b4
|
||||
rts
|
||||
}
|
||||
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
|
||||
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
|
||||
|
@ -6869,6 +6869,8 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp b4
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b1_from_sin8s to b5
|
||||
Succesful ASM optimization Pass5RelabelLongLabels
|
||||
Removing instruction jmp b1
|
||||
@ -6878,6 +6880,7 @@ Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b4:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Fixing long branch [172] bcc b1 to bcs
|
||||
Fixing long branch [178] bcc b1 to bcs
|
||||
@ -7257,7 +7260,7 @@ reg byte a [ divr16u::$2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 19454
|
||||
Score: 19457
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -8133,7 +8136,6 @@ sin8s: {
|
||||
//SEG388 [178] phi from sin8s::@14 sin8s::@8 to sin8s::@4 [phi:sin8s::@14/sin8s::@8->sin8s::@4]
|
||||
//SEG389 [178] phi (signed byte) sin8s::return#0 = (signed byte~) sin8s::return#5 [phi:sin8s::@14/sin8s::@8->sin8s::@4#0] -- register_copy
|
||||
//SEG390 sin8s::@4
|
||||
b4:
|
||||
//SEG391 sin8s::@return
|
||||
//SEG392 [179] return
|
||||
rts
|
||||
@ -8141,7 +8143,7 @@ sin8s: {
|
||||
b14:
|
||||
//SEG394 [180] (signed byte~) sin8s::return#5 ← (signed byte)(byte) sin8s::usinx#4 -- vbsaa=vbsxx
|
||||
txa
|
||||
jmp b4
|
||||
rts
|
||||
}
|
||||
//SEG395 mulu8_sel
|
||||
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
|
||||
|
@ -454,11 +454,10 @@ div8s: {
|
||||
eor #$ff
|
||||
clc
|
||||
adc #1
|
||||
breturn:
|
||||
rts
|
||||
b9:
|
||||
tya
|
||||
jmp breturn
|
||||
rts
|
||||
b3:
|
||||
txa
|
||||
eor #$ff
|
||||
|
@ -8877,6 +8877,8 @@ Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to breturn in beq b9
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b1
|
||||
@ -8887,8 +8889,9 @@ Removing instruction jmp b1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b9:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Removing unreachable instruction jmp breturn
|
||||
Removing unreachable instruction rts
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Fixing long branch [76] bne b1 to beq
|
||||
|
||||
@ -9344,7 +9347,7 @@ reg byte a [ div8u::return#3 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 32651
|
||||
Score: 32654
|
||||
|
||||
//SEG0 File Comments
|
||||
// Test the binary division library
|
||||
@ -10189,7 +10192,6 @@ div8s: {
|
||||
//SEG384 [185] phi (signed byte) rem8s#3 = (signed byte) rem8s#2 [phi:div8s::@5/div8s::@9->div8s::@return#0] -- register_copy
|
||||
//SEG385 [185] phi (signed byte) div8s::return#2 = (signed byte) div8s::return#1 [phi:div8s::@5/div8s::@9->div8s::@return#1] -- register_copy
|
||||
//SEG386 div8s::@return
|
||||
breturn:
|
||||
//SEG387 [186] return
|
||||
rts
|
||||
//SEG388 div8s::@9
|
||||
@ -10197,7 +10199,7 @@ div8s: {
|
||||
//SEG389 [187] (signed byte~) div8s::return#7 ← (signed byte)(byte) div8s::resultu#0 -- vbsaa=vbsyy
|
||||
tya
|
||||
//SEG390 [188] (signed byte~) rem8s#33 ← (signed byte)(byte) rem8u#17
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG391 div8s::@3
|
||||
b3:
|
||||
//SEG392 [189] (signed byte~) div8s::$8 ← - (signed byte) div8s::divisor#0 -- vbsxx=_neg_vbsxx
|
||||
|
@ -99,7 +99,6 @@ mul16s_compare: {
|
||||
lda #2
|
||||
sta BGCOL
|
||||
jsr mul16s_error
|
||||
breturn:
|
||||
rts
|
||||
b5:
|
||||
iny
|
||||
@ -122,7 +121,7 @@ mul16s_compare: {
|
||||
sta print_str.str+1
|
||||
jsr print_str
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
str1: .text "signed word multiply results match!@"
|
||||
}
|
||||
// Print a newline
|
||||
@ -681,14 +680,13 @@ muls16s: {
|
||||
lda j
|
||||
cmp a
|
||||
bne b3
|
||||
jmp b1
|
||||
rts
|
||||
b5:
|
||||
lda #0
|
||||
sta return
|
||||
sta return+1
|
||||
sta return+2
|
||||
sta return+3
|
||||
b1:
|
||||
rts
|
||||
b6:
|
||||
lda #0
|
||||
@ -729,7 +727,7 @@ muls16s: {
|
||||
lda i
|
||||
cmp a
|
||||
bne b4
|
||||
jmp b1
|
||||
rts
|
||||
}
|
||||
// Perform many possible word multiplications (slow and fast) and compare the results
|
||||
mul16u_compare: {
|
||||
@ -820,7 +818,6 @@ mul16u_compare: {
|
||||
lda a+1
|
||||
sta mul16u_error.a+1
|
||||
jsr mul16u_error
|
||||
breturn:
|
||||
rts
|
||||
b5:
|
||||
iny
|
||||
@ -847,7 +844,7 @@ mul16u_compare: {
|
||||
sta print_str.str+1
|
||||
jsr print_str
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
str1: .text "word multiply results match!@"
|
||||
}
|
||||
// mul16u_error(word zeropage(3) a, word zeropage($17) b, dword zeropage($b) ms, dword zeropage($19) mn, dword zeropage($11) mf)
|
||||
@ -960,14 +957,13 @@ muls16u: {
|
||||
lda i
|
||||
cmp a
|
||||
bne b2
|
||||
jmp b1
|
||||
rts
|
||||
b3:
|
||||
lda #0
|
||||
sta return
|
||||
sta return+1
|
||||
sta return+2
|
||||
sta return+3
|
||||
b1:
|
||||
rts
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
|
@ -10189,8 +10189,12 @@ Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b4 in beq b15
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp b1
|
||||
Skipping double jump to b1 in jmp b1_from_b4
|
||||
Skipping double jump to b4 in beq b15
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp b1
|
||||
Skipping double jump to b5 in bne b7
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b3_from_b12 to b6
|
||||
@ -10215,17 +10219,24 @@ Removing instruction lda #0
|
||||
Removing instruction lda a+1
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b15:
|
||||
Removing instruction b2:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b15:
|
||||
Removing instruction b1:
|
||||
Removing instruction b7:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Replacing jump to rts with rts in jmp b1
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing unreachable instruction jmp b4
|
||||
Removing unreachable instruction jmp b4
|
||||
Removing unreachable instruction jmp b5
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Fixing long branch [110] bne b1 to beq
|
||||
Fixing long branch [831] bne b1 to beq
|
||||
Removing instruction b1:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Fixing long branch [109] bne b1 to beq
|
||||
Fixing long branch [828] bne b1 to beq
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
@ -10685,7 +10696,7 @@ reg byte a [ mulf_init::$12 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 436908
|
||||
Score: 439920
|
||||
|
||||
//SEG0 File Comments
|
||||
// Test the fast multiplication library
|
||||
@ -10883,7 +10894,6 @@ mul16s_compare: {
|
||||
//SEG93 [71] phi from mul16s_compare::@7 to mul16s_error [phi:mul16s_compare::@7->mul16s_error]
|
||||
jsr mul16s_error
|
||||
//SEG94 mul16s_compare::@return
|
||||
breturn:
|
||||
//SEG95 [47] return
|
||||
rts
|
||||
//SEG96 mul16s_compare::@5
|
||||
@ -10931,7 +10941,7 @@ mul16s_compare: {
|
||||
//SEG118 [59] phi (byte*) print_char_cursor#129 = (byte*) print_char_cursor#128 [phi:mul16s_compare::@14->print_ln#0] -- register_copy
|
||||
//SEG119 [59] phi (byte*) print_line_cursor#43 = (byte*) print_line_cursor#1 [phi:mul16s_compare::@14->print_ln#1] -- register_copy
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG120 [58] phi from mul16s_compare::@3 to mul16s_compare::@15 [phi:mul16s_compare::@3->mul16s_compare::@15]
|
||||
//SEG121 mul16s_compare::@15
|
||||
//SEG122 [38] phi from mul16s_compare::@15 to mul16s_compare::@4 [phi:mul16s_compare::@15->mul16s_compare::@4]
|
||||
@ -11772,7 +11782,7 @@ muls16s: {
|
||||
bne b3
|
||||
//SEG400 [193] phi from muls16s::@3 muls16s::@4 to muls16s::@1 [phi:muls16s::@3/muls16s::@4->muls16s::@1]
|
||||
//SEG401 [193] phi (signed dword) muls16s::return#0 = (signed dword) muls16s::m#1 [phi:muls16s::@3/muls16s::@4->muls16s::@1#0] -- register_copy
|
||||
jmp b1
|
||||
rts
|
||||
//SEG402 [193] phi from muls16s::@2 to muls16s::@1 [phi:muls16s::@2->muls16s::@1]
|
||||
b5:
|
||||
//SEG403 [193] phi (signed dword) muls16s::return#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:muls16s::@2->muls16s::@1#0] -- vdsz1=vbsc1
|
||||
@ -11782,7 +11792,6 @@ muls16s: {
|
||||
sta return+2
|
||||
sta return+3
|
||||
//SEG404 muls16s::@1
|
||||
b1:
|
||||
//SEG405 muls16s::@return
|
||||
//SEG406 [194] return
|
||||
rts
|
||||
@ -11835,7 +11844,7 @@ muls16s: {
|
||||
lda i
|
||||
cmp a
|
||||
bne b4
|
||||
jmp b1
|
||||
rts
|
||||
}
|
||||
//SEG417 mul16u_compare
|
||||
// Perform many possible word multiplications (slow and fast) and compare the results
|
||||
@ -12000,7 +12009,6 @@ mul16u_compare: {
|
||||
//SEG489 [245] phi from mul16u_compare::@7 to mul16u_error [phi:mul16u_compare::@7->mul16u_error]
|
||||
jsr mul16u_error
|
||||
//SEG490 mul16u_compare::@return
|
||||
breturn:
|
||||
//SEG491 [233] return
|
||||
rts
|
||||
//SEG492 mul16u_compare::@5
|
||||
@ -12052,7 +12060,7 @@ mul16u_compare: {
|
||||
//SEG514 [59] phi (byte*) print_char_cursor#129 = (byte*) print_char_cursor#128 [phi:mul16u_compare::@14->print_ln#0] -- register_copy
|
||||
//SEG515 [59] phi (byte*) print_line_cursor#43 = (byte*) print_line_cursor#1 [phi:mul16u_compare::@14->print_ln#1] -- register_copy
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG516 [244] phi from mul16u_compare::@3 to mul16u_compare::@15 [phi:mul16u_compare::@3->mul16u_compare::@15]
|
||||
//SEG517 mul16u_compare::@15
|
||||
//SEG518 [224] phi from mul16u_compare::@15 to mul16u_compare::@4 [phi:mul16u_compare::@15->mul16u_compare::@4]
|
||||
@ -12250,7 +12258,7 @@ muls16u: {
|
||||
bne b2
|
||||
//SEG599 [273] phi from muls16u::@2 to muls16u::@1 [phi:muls16u::@2->muls16u::@1]
|
||||
//SEG600 [273] phi (dword) muls16u::return#0 = (dword) muls16u::m#1 [phi:muls16u::@2->muls16u::@1#0] -- register_copy
|
||||
jmp b1
|
||||
rts
|
||||
//SEG601 [273] phi from muls16u to muls16u::@1 [phi:muls16u->muls16u::@1]
|
||||
b3:
|
||||
//SEG602 [273] phi (dword) muls16u::return#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:muls16u->muls16u::@1#0] -- vduz1=vbuc1
|
||||
@ -12260,7 +12268,6 @@ muls16u: {
|
||||
sta return+2
|
||||
sta return+3
|
||||
//SEG603 muls16u::@1
|
||||
b1:
|
||||
//SEG604 muls16u::@return
|
||||
//SEG605 [274] return
|
||||
rts
|
||||
|
@ -63,7 +63,6 @@ mul8s_compare: {
|
||||
sta BGCOL
|
||||
ldx a
|
||||
jsr mul8s_error
|
||||
breturn:
|
||||
rts
|
||||
b5:
|
||||
inc b
|
||||
@ -83,7 +82,7 @@ mul8s_compare: {
|
||||
sta print_str.str+1
|
||||
jsr print_str
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
str: .text "signed multiply results match!@"
|
||||
}
|
||||
// Print a newline
|
||||
@ -434,12 +433,11 @@ muls8s: {
|
||||
iny
|
||||
cpy a
|
||||
bne b3
|
||||
jmp b1
|
||||
rts
|
||||
b5:
|
||||
lda #0
|
||||
sta return
|
||||
sta return+1
|
||||
b1:
|
||||
rts
|
||||
b6:
|
||||
lda #0
|
||||
@ -464,7 +462,7 @@ muls8s: {
|
||||
dey
|
||||
cpy a
|
||||
bne b4
|
||||
jmp b1
|
||||
rts
|
||||
}
|
||||
// Perform all possible byte multiplications (slow and fast) and compare the results
|
||||
mul8u_compare: {
|
||||
@ -514,7 +512,6 @@ mul8u_compare: {
|
||||
sta BGCOL
|
||||
ldx a
|
||||
jsr mul8u_error
|
||||
breturn:
|
||||
rts
|
||||
b5:
|
||||
inc b
|
||||
@ -531,7 +528,7 @@ mul8u_compare: {
|
||||
sta print_str.str+1
|
||||
jsr print_str
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
str: .text "multiply results match!@"
|
||||
}
|
||||
// mul8u_error(byte register(X) a, byte zeropage(3) b, word zeropage(8) ms, word zeropage($c) mn, word zeropage($e) mf)
|
||||
@ -616,12 +613,11 @@ muls8u: {
|
||||
iny
|
||||
cpy a
|
||||
bne b2
|
||||
jmp b1
|
||||
rts
|
||||
b3:
|
||||
lda #0
|
||||
sta return
|
||||
sta return+1
|
||||
b1:
|
||||
rts
|
||||
}
|
||||
// Compare the ASM-based mul tables with the KC-based mul tables
|
||||
@ -668,7 +664,6 @@ mulf_tables_cmp: {
|
||||
sta print_line_cursor
|
||||
lda #>$400
|
||||
sta print_line_cursor+1
|
||||
breturn:
|
||||
rts
|
||||
b2:
|
||||
inc asm_sqr
|
||||
@ -705,7 +700,7 @@ mulf_tables_cmp: {
|
||||
sta print_char_cursor
|
||||
lda print_line_cursor+1
|
||||
sta print_char_cursor+1
|
||||
jmp breturn
|
||||
rts
|
||||
str: .text "multiply table mismatch at @"
|
||||
str1: .text " / @"
|
||||
str2: .text "multiply tables match!@"
|
||||
|
@ -10123,8 +10123,13 @@ Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Skipping double jump to b4 in beq b14
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp b1
|
||||
Skipping double jump to b1 in jmp b1_from_b4
|
||||
Skipping double jump to b4 in beq b14
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Replacing jump to rts with rts in jmp b1
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Skipping double jump to b5 in bne b7
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Relabelling long label b3_from_b12 to b6
|
||||
@ -10151,15 +10156,23 @@ Removing instruction lda #0
|
||||
Removing instruction lda a
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b14:
|
||||
Removing instruction b2:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b14:
|
||||
Removing instruction b1:
|
||||
Removing instruction breturn:
|
||||
Removing instruction b7:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Replacing jump to rts with rts in jmp b1
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing unreachable instruction jmp b4
|
||||
Removing unreachable instruction jmp b4
|
||||
Removing unreachable instruction jmp b5
|
||||
Succesful ASM optimization Pass5UnreachableCodeElimination
|
||||
Removing instruction b1:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
@ -10672,7 +10685,7 @@ reg byte a [ mulf_init::$12 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 224367
|
||||
Score: 227382
|
||||
|
||||
//SEG0 File Comments
|
||||
// Test the fast multiplication library
|
||||
@ -10825,7 +10838,6 @@ mul8s_compare: {
|
||||
//SEG84 [47] call mul8s_error
|
||||
jsr mul8s_error
|
||||
//SEG85 mul8s_compare::@return
|
||||
breturn:
|
||||
//SEG86 [48] return
|
||||
rts
|
||||
//SEG87 mul8s_compare::@5
|
||||
@ -10864,7 +10876,7 @@ mul8s_compare: {
|
||||
//SEG103 [58] phi (byte*) print_char_cursor#133 = (byte*) print_char_cursor#132 [phi:mul8s_compare::@13->print_ln#0] -- register_copy
|
||||
//SEG104 [58] phi (byte*) print_line_cursor#45 = (byte*) print_line_cursor#1 [phi:mul8s_compare::@13->print_ln#1] -- register_copy
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG105 [57] phi from mul8s_compare::@3 to mul8s_compare::@14 [phi:mul8s_compare::@3->mul8s_compare::@14]
|
||||
//SEG106 mul8s_compare::@14
|
||||
//SEG107 [39] phi from mul8s_compare::@14 to mul8s_compare::@4 [phi:mul8s_compare::@14->mul8s_compare::@4]
|
||||
@ -11503,7 +11515,7 @@ muls8s: {
|
||||
bne b3
|
||||
//SEG391 [196] phi from muls8s::@3 muls8s::@4 to muls8s::@1 [phi:muls8s::@3/muls8s::@4->muls8s::@1]
|
||||
//SEG392 [196] phi (signed word) muls8s::return#0 = (signed word) muls8s::m#1 [phi:muls8s::@3/muls8s::@4->muls8s::@1#0] -- register_copy
|
||||
jmp b1
|
||||
rts
|
||||
//SEG393 [196] phi from muls8s::@2 to muls8s::@1 [phi:muls8s::@2->muls8s::@1]
|
||||
b5:
|
||||
//SEG394 [196] phi (signed word) muls8s::return#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:muls8s::@2->muls8s::@1#0] -- vwsz1=vbuc1
|
||||
@ -11511,7 +11523,6 @@ muls8s: {
|
||||
sta return
|
||||
sta return+1
|
||||
//SEG395 muls8s::@1
|
||||
b1:
|
||||
//SEG396 muls8s::@return
|
||||
//SEG397 [197] return
|
||||
rts
|
||||
@ -11548,7 +11559,7 @@ muls8s: {
|
||||
//SEG407 [201] if((signed byte) muls8s::i#1!=(signed byte) muls8s::a#0) goto muls8s::@4 -- vbsyy_neq_vbsz1_then_la1
|
||||
cpy a
|
||||
bne b4
|
||||
jmp b1
|
||||
rts
|
||||
}
|
||||
//SEG408 mul8u_compare
|
||||
// Perform all possible byte multiplications (slow and fast) and compare the results
|
||||
@ -11653,7 +11664,6 @@ mul8u_compare: {
|
||||
//SEG461 [243] phi from mul8u_compare::@7 to mul8u_error [phi:mul8u_compare::@7->mul8u_error]
|
||||
jsr mul8u_error
|
||||
//SEG462 mul8u_compare::@return
|
||||
breturn:
|
||||
//SEG463 [233] return
|
||||
rts
|
||||
//SEG464 mul8u_compare::@5
|
||||
@ -11689,7 +11699,7 @@ mul8u_compare: {
|
||||
//SEG480 [58] phi (byte*) print_char_cursor#133 = (byte*) print_char_cursor#132 [phi:mul8u_compare::@13->print_ln#0] -- register_copy
|
||||
//SEG481 [58] phi (byte*) print_line_cursor#45 = (byte*) print_line_cursor#10 [phi:mul8u_compare::@13->print_ln#1] -- register_copy
|
||||
jsr print_ln
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG482 [242] phi from mul8u_compare::@3 to mul8u_compare::@14 [phi:mul8u_compare::@3->mul8u_compare::@14]
|
||||
//SEG483 mul8u_compare::@14
|
||||
//SEG484 [224] phi from mul8u_compare::@14 to mul8u_compare::@4 [phi:mul8u_compare::@14->mul8u_compare::@4]
|
||||
@ -11874,7 +11884,7 @@ muls8u: {
|
||||
bne b2
|
||||
//SEG580 [278] phi from muls8u::@2 to muls8u::@1 [phi:muls8u::@2->muls8u::@1]
|
||||
//SEG581 [278] phi (word) muls8u::return#0 = (word) muls8u::m#1 [phi:muls8u::@2->muls8u::@1#0] -- register_copy
|
||||
jmp b1
|
||||
rts
|
||||
//SEG582 [278] phi from muls8u to muls8u::@1 [phi:muls8u->muls8u::@1]
|
||||
b3:
|
||||
//SEG583 [278] phi (word) muls8u::return#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:muls8u->muls8u::@1#0] -- vwuz1=vbuc1
|
||||
@ -11882,7 +11892,6 @@ muls8u: {
|
||||
sta return
|
||||
sta return+1
|
||||
//SEG584 muls8u::@1
|
||||
b1:
|
||||
//SEG585 muls8u::@return
|
||||
//SEG586 [279] return
|
||||
rts
|
||||
@ -11968,7 +11977,6 @@ mulf_tables_cmp: {
|
||||
sta print_line_cursor+1
|
||||
//SEG622 [291] phi (byte*) print_char_cursor#31 = (byte*) print_char_cursor#18 [phi:mulf_tables_cmp::@7->mulf_tables_cmp::@return#1] -- register_copy
|
||||
//SEG623 mulf_tables_cmp::@return
|
||||
breturn:
|
||||
//SEG624 [292] return
|
||||
rts
|
||||
//SEG625 mulf_tables_cmp::@2
|
||||
@ -12026,7 +12034,7 @@ mulf_tables_cmp: {
|
||||
//SEG642 [291] phi from mulf_tables_cmp::@8 to mulf_tables_cmp::@return [phi:mulf_tables_cmp::@8->mulf_tables_cmp::@return]
|
||||
//SEG643 [291] phi (byte*) print_line_cursor#10 = (byte*) print_line_cursor#1 [phi:mulf_tables_cmp::@8->mulf_tables_cmp::@return#0] -- register_copy
|
||||
//SEG644 [291] phi (byte*) print_char_cursor#31 = (byte*~) print_char_cursor#225 [phi:mulf_tables_cmp::@8->mulf_tables_cmp::@return#1] -- register_copy
|
||||
jmp breturn
|
||||
rts
|
||||
str: .text "multiply table mismatch at @"
|
||||
str1: .text " / @"
|
||||
str2: .text "multiply tables match!@"
|
||||
|
@ -17,11 +17,10 @@ main: {
|
||||
beq b1
|
||||
lda #2
|
||||
sta bgcol
|
||||
breturn:
|
||||
rts
|
||||
b1:
|
||||
lda #5
|
||||
sta bgcol
|
||||
jmp breturn
|
||||
rts
|
||||
bs: .byte 'c', 'm'
|
||||
}
|
||||
|
@ -298,7 +298,10 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -326,7 +329,7 @@ FINAL SYMBOL TABLE
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 37
|
||||
Score: 40
|
||||
|
||||
//SEG0 File Comments
|
||||
//SEG1 Basic Upstart
|
||||
@ -362,7 +365,6 @@ main: {
|
||||
lda #2
|
||||
sta bgcol
|
||||
//SEG14 main::@return
|
||||
breturn:
|
||||
//SEG15 [7] return
|
||||
rts
|
||||
//SEG16 main::@1
|
||||
@ -370,7 +372,7 @@ main: {
|
||||
//SEG17 [8] *((const byte*) main::bgcol#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 -- _deref_pbuc1=vbuc2
|
||||
lda #5
|
||||
sta bgcol
|
||||
jmp breturn
|
||||
rts
|
||||
bs: .byte 'c', 'm'
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,6 @@ findcol: {
|
||||
bne b2
|
||||
lda #0
|
||||
sta return
|
||||
breturn:
|
||||
rts
|
||||
b2:
|
||||
txa
|
||||
@ -163,7 +162,7 @@ findcol: {
|
||||
iny
|
||||
cpy #numpoints
|
||||
bcc b12
|
||||
jmp breturn
|
||||
rts
|
||||
b12:
|
||||
stx mindiff
|
||||
jmp b1
|
||||
|
@ -2280,6 +2280,8 @@ Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Replacing jump to rts with rts in jmp breturn
|
||||
Succesful ASM optimization Pass5DoubleJumpElimination
|
||||
Removing instruction jmp b1
|
||||
Removing instruction jmp b2
|
||||
Removing instruction jmp b1
|
||||
@ -2289,6 +2291,7 @@ Removing instruction lda #$28
|
||||
Removing instruction lda y
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
@ -2426,7 +2429,7 @@ reg byte a [ findcol::$10 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 1504588
|
||||
Score: 1504591
|
||||
|
||||
//SEG0 File Comments
|
||||
// The screen
|
||||
@ -2662,7 +2665,6 @@ findcol: {
|
||||
lda #0
|
||||
sta return
|
||||
//SEG100 findcol::@return
|
||||
breturn:
|
||||
//SEG101 [58] return
|
||||
rts
|
||||
//SEG102 findcol::@2
|
||||
@ -2720,7 +2722,7 @@ findcol: {
|
||||
bcc b12
|
||||
//SEG125 [57] phi from findcol::@7 to findcol::@return [phi:findcol::@7->findcol::@return]
|
||||
//SEG126 [57] phi (byte) findcol::return#2 = (byte) findcol::mincol#2 [phi:findcol::@7->findcol::@return#0] -- register_copy
|
||||
jmp breturn
|
||||
rts
|
||||
//SEG127 findcol::@12
|
||||
b12:
|
||||
//SEG128 [71] (byte~) findcol::mindiff#13 ← (byte) findcol::mindiff#11 -- vbuz1=vbuxx
|
||||
|
Loading…
x
Reference in New Issue
Block a user