mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-14 23:04:57 +00:00
Implemented asm template usage statistics. Now prefer synthesis over loading.
This commit is contained in:
parent
203af62173
commit
4f30cef2d3
@ -18,8 +18,8 @@ public class AsmFragment {
|
||||
/** The name of the fragment used in error messages. */
|
||||
private String name;
|
||||
|
||||
/** The fragment template ASM code. */
|
||||
private KickCParser.AsmLinesContext fragmentFile;
|
||||
/** The fragment template for the ASM code. */
|
||||
private AsmFragmentTemplate fragmentTemplate;
|
||||
|
||||
/** Binding of named values in the fragment to values (constants, variables, ...) . */
|
||||
private Map<String, Value> bindings;
|
||||
@ -31,11 +31,11 @@ public class AsmFragment {
|
||||
Program program,
|
||||
String name,
|
||||
ScopeRef codeScopeRef,
|
||||
KickCParser.AsmLinesContext fragmentFile,
|
||||
AsmFragmentTemplate fragmentTemplate,
|
||||
Map<String, Value> bindings) {
|
||||
this.program = program;
|
||||
this.name = name;
|
||||
this.fragmentFile = fragmentFile;
|
||||
this.fragmentTemplate = fragmentTemplate;
|
||||
this.bindings = bindings;
|
||||
this.codeScopeRef = codeScopeRef;
|
||||
}
|
||||
@ -127,7 +127,7 @@ public class AsmFragment {
|
||||
*/
|
||||
public void generate(AsmProgram asm) {
|
||||
AsmSequenceGenerator asmSequenceGenerator = new AsmSequenceGenerator(name, this, asm);
|
||||
asmSequenceGenerator.generate(fragmentFile);
|
||||
asmSequenceGenerator.generate(fragmentTemplate.getBodyAsm());
|
||||
}
|
||||
|
||||
private static class AsmSequenceGenerator extends KickCBaseVisitor {
|
||||
|
@ -2,16 +2,14 @@ package dk.camelot64.kickc.fragment;
|
||||
|
||||
import dk.camelot64.kickc.CompileLog;
|
||||
import dk.camelot64.kickc.asm.AsmProgram;
|
||||
import dk.camelot64.kickc.parser.KickCLexer;
|
||||
import dk.camelot64.kickc.parser.KickCParser;
|
||||
import org.antlr.v4.runtime.*;
|
||||
import org.antlr.v4.runtime.CharStream;
|
||||
import org.antlr.v4.runtime.CharStreams;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Provides fragments from their signature.
|
||||
@ -21,68 +19,111 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class AsmFragmentManager {
|
||||
|
||||
/** Cache for fragment files. Maps signature to the parsed file. */
|
||||
private static Map<String, KickCParser.AsmLinesContext> fragmentFileCache = new HashMap<>();
|
||||
/** Cache for the best fragment templates. Maps signature to the best fragment template for the signature. */
|
||||
private static Map<String, AsmFragmentTemplate> bestFragmentCache = new HashMap<>();
|
||||
|
||||
private static KickCParser.AsmLinesContext UNKNOWN = new KickCParser.AsmLinesContext(null, 0);
|
||||
/** Caches all asm fragment templates for all encountered signatures. */
|
||||
private static Map<String, List<AsmFragmentTemplate>> fragmentTemplateCache = new LinkedHashMap<>();
|
||||
|
||||
/** Usage Statistics for fragment templates. */
|
||||
private static Map<AsmFragmentTemplate, Integer> fragmentTemplateUsage = new HashMap<>();
|
||||
|
||||
/** Special singleton representing that the fragment can not be synthesized or loaded. */
|
||||
private static AsmFragmentTemplate UNKNOWN = new AsmFragmentTemplate("UNKNOWN", null);
|
||||
|
||||
public static AsmFragment getFragment(AsmFragmentSignature signature, CompileLog log) {
|
||||
KickCParser.AsmLinesContext fragmentAsmLines = fragmentFileCache.get(signature.getSignature());
|
||||
if (fragmentAsmLines == UNKNOWN) {
|
||||
AsmFragmentTemplate bestTemplate = bestFragmentCache.get(signature.getSignature());
|
||||
if (bestTemplate == UNKNOWN) {
|
||||
if (log.isVerboseFragmentLog()) {
|
||||
log.append("Unknown fragment " + signature.getSignature());
|
||||
}
|
||||
throw new UnknownFragmentException(signature.toString());
|
||||
}
|
||||
if (fragmentAsmLines == null) {
|
||||
if (bestTemplate == null) {
|
||||
AsmFragmentTemplateSynthesizer synthesizer = new AsmFragmentTemplateSynthesizer(signature, log);
|
||||
List<AsmFragmentTemplate> candidates = synthesizer.loadOrSynthesizeFragment(signature.getSignature());
|
||||
if (candidates.size() == 0) {
|
||||
if (log.isVerboseFragmentLog()) {
|
||||
log.append("Unknown fragment " + signature.toString());
|
||||
}
|
||||
fragmentFileCache.put(signature.getSignature(), UNKNOWN);
|
||||
bestFragmentCache.put(signature.getSignature(), UNKNOWN);
|
||||
throw new UnknownFragmentException(signature.toString());
|
||||
|
||||
}
|
||||
double minScore = Double.MAX_VALUE;
|
||||
for (AsmFragmentTemplate candidate : candidates) {
|
||||
KickCParser.AsmLinesContext candidateAsmLines =
|
||||
parseFragment(candidate.getBody(), signature.getSignature());
|
||||
for (AsmFragmentTemplate candidateTemplate : candidates) {
|
||||
AsmFragment candidateFragment = new AsmFragment(
|
||||
signature.getProgram(),
|
||||
signature.getSignature(),
|
||||
signature.getCodeScope(),
|
||||
candidateAsmLines,
|
||||
candidateTemplate,
|
||||
signature.getBindings());
|
||||
AsmProgram condidateAsm = new AsmProgram();
|
||||
condidateAsm.startSegment(null, signature.toString());
|
||||
candidateFragment.generate(condidateAsm);
|
||||
double score = condidateAsm.getCycles();
|
||||
AsmProgram candidateAsm = new AsmProgram();
|
||||
candidateAsm.startSegment(null, signature.toString());
|
||||
candidateFragment.generate(candidateAsm);
|
||||
double score = candidateAsm.getCycles();
|
||||
if (score < minScore) {
|
||||
minScore = score;
|
||||
fragmentAsmLines = candidateAsmLines;
|
||||
bestTemplate = candidateTemplate;
|
||||
}
|
||||
}
|
||||
if (log.isVerboseFragmentLog()) {
|
||||
log.append("Found fragment " + signature + " score: " + minScore + " from " + candidates.size() + " candidates");
|
||||
}
|
||||
fragmentFileCache.put(signature.getSignature(), fragmentAsmLines);
|
||||
bestFragmentCache.put(signature.getSignature(), bestTemplate);
|
||||
}
|
||||
// Count usages
|
||||
incUsage(bestTemplate);
|
||||
// Return the resulting fragment instance
|
||||
return new AsmFragment(
|
||||
signature.getProgram(),
|
||||
signature.getSignature(),
|
||||
signature.getCodeScope(),
|
||||
fragmentAsmLines,
|
||||
bestTemplate,
|
||||
signature.getBindings());
|
||||
}
|
||||
|
||||
/**
|
||||
* Count one usage of ASM fragment templates - directly or through synthesis
|
||||
* @param fragmentTemplate The template to increment usage of
|
||||
*/
|
||||
private static void incUsage(AsmFragmentTemplate fragmentTemplate) {
|
||||
Integer usage = fragmentTemplateUsage.get(fragmentTemplate);
|
||||
if (usage == null) {
|
||||
usage = 0;
|
||||
}
|
||||
fragmentTemplateUsage.put(fragmentTemplate, usage + 1);
|
||||
AsmFragmentTemplate subFragment = fragmentTemplate.getSubFragment();
|
||||
if (subFragment != null) {
|
||||
incUsage(subFragment);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the usage of all template fragemnts (both loaded and synthesized).
|
||||
* @param log The compile log to add the output to
|
||||
*/
|
||||
public static void logUsages(CompileLog log) {
|
||||
log.append("ASM FRAGMENT USAGES");
|
||||
|
||||
ArrayList<String> signatures = new ArrayList<>(fragmentTemplateCache.keySet());
|
||||
Collections.sort(signatures);
|
||||
for (String signature : signatures) {
|
||||
List<AsmFragmentTemplate> templates = fragmentTemplateCache.get(signature);
|
||||
for (AsmFragmentTemplate template : templates) {
|
||||
Integer usage = fragmentTemplateUsage.get(template);
|
||||
if(usage==null) usage = 0;
|
||||
log.append(String.format("%8d", usage)+" "+template.getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Capable of creating fragments from signatures by loading them or synthesizing them from other smaller fragments.
|
||||
* <p>
|
||||
* The synthesizer tries a lot of different combinations and keeps track of what has already been attempted.
|
||||
*/
|
||||
public static class AsmFragmentTemplateSynthesizer {
|
||||
static class AsmFragmentTemplateSynthesizer {
|
||||
|
||||
/** Signature of the fragment being synthesized. */
|
||||
private AsmFragmentSignature signature;
|
||||
@ -90,27 +131,16 @@ public class AsmFragmentManager {
|
||||
/** The log. */
|
||||
private CompileLog log;
|
||||
|
||||
/** Caches all asm fragment templates for all encountered signatures. */
|
||||
private static Map<String, List<AsmFragmentTemplate>> templateCache = new LinkedHashMap<>();
|
||||
|
||||
public AsmFragmentTemplateSynthesizer(AsmFragmentSignature signature, CompileLog log) {
|
||||
AsmFragmentTemplateSynthesizer(AsmFragmentSignature signature, CompileLog log) {
|
||||
this.signature = signature;
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
public List<AsmFragmentTemplate> loadOrSynthesizeFragment(String signature) {
|
||||
if (templateCache.get(signature) != null) {
|
||||
return templateCache.get(signature);
|
||||
List<AsmFragmentTemplate> loadOrSynthesizeFragment(String signature) {
|
||||
if (fragmentTemplateCache.get(signature) != null) {
|
||||
return fragmentTemplateCache.get(signature);
|
||||
}
|
||||
List<AsmFragmentTemplate> candidates = new ArrayList<>();
|
||||
// Load the fragment from disk
|
||||
CharStream fragmentCharStream = loadFragment(signature);
|
||||
if (fragmentCharStream != null) {
|
||||
candidates.add(new AsmFragmentTemplate(signature, fragmentCharStream.toString()));
|
||||
if (log.isVerboseFragmentLog()) {
|
||||
log.append("Finding fragment " + this.signature.getSignature() + " - Successfully loaded fragment " + signature);
|
||||
}
|
||||
}
|
||||
// Synthesize the fragment from other fragments
|
||||
List<AsmFragmentSynthesis> synths = getFragmentSyntheses();
|
||||
for (AsmFragmentSynthesis synth : synths) {
|
||||
@ -122,156 +152,17 @@ public class AsmFragmentManager {
|
||||
candidates.addAll(synthesized);
|
||||
}
|
||||
}
|
||||
templateCache.put(signature, candidates);
|
||||
return candidates;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An ASM fragment template usable for generating KickAssembler code for different bindings.
|
||||
* The AsmFragmentTemplateSynthesizer can generate multiple different templates usable for a specific fragment signature.
|
||||
*/
|
||||
public static class AsmFragmentTemplate {
|
||||
|
||||
/** The fragment template signature name. */
|
||||
private String signature;
|
||||
|
||||
/** The fragment template body */
|
||||
private String body;
|
||||
|
||||
/** true if the fragment was loaded from disk. */
|
||||
boolean loaded;
|
||||
|
||||
/** The synthesis that created the fragment. null if the fragment template was loaded. */
|
||||
private AsmFragmentSynthesis synthesis;
|
||||
|
||||
/** The sub fragment template that the synthesis modified to create this. null if the fragment template was loaded. */
|
||||
private AsmFragmentTemplate subFragment;
|
||||
|
||||
public AsmFragmentTemplate(String signature, String body) {
|
||||
this.signature = signature;
|
||||
this.body = body;
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
public AsmFragmentTemplate(String signature, String body, AsmFragmentSynthesis synthesis, AsmFragmentTemplate subFragment) {
|
||||
this.signature = signature;
|
||||
this.body = body;
|
||||
this.synthesis = synthesis;
|
||||
this.subFragment = subFragment;
|
||||
this.loaded = false;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
return loaded;
|
||||
}
|
||||
|
||||
public AsmFragmentSynthesis getSynthesis() {
|
||||
return synthesis;
|
||||
}
|
||||
|
||||
public AsmFragmentTemplate getSubFragment() {
|
||||
return subFragment;
|
||||
}
|
||||
}
|
||||
|
||||
/** AsmFragment synthesis mechanism based on matching fragment signature and reusing another fragment with added prefix/postfix and some bind-mappings */
|
||||
private static class AsmFragmentSynthesis {
|
||||
|
||||
private String sigMatch;
|
||||
private String sigAvoid;
|
||||
private String asmPrefix;
|
||||
private String sigReplace;
|
||||
private String asmPostfix;
|
||||
private Map<String, String> bindMappings;
|
||||
private boolean mapSignature;
|
||||
private String subSignature;
|
||||
|
||||
public AsmFragmentSynthesis(String sigMatch, String sigAvoid, String asmPrefix, String sigReplace, String asmPostfix, Map<String, String> bindMappings, boolean mapSignature) {
|
||||
this.sigMatch = sigMatch;
|
||||
this.sigAvoid = sigAvoid;
|
||||
this.asmPrefix = asmPrefix;
|
||||
this.sigReplace = sigReplace;
|
||||
this.asmPostfix = asmPostfix;
|
||||
this.bindMappings = bindMappings;
|
||||
this.mapSignature = mapSignature;
|
||||
}
|
||||
|
||||
public AsmFragmentSynthesis(String sigMatch, String sigAvoid, String asmPrefix, String sigReplace, String asmPostfix, Map<String, String> bindMappings) {
|
||||
this(sigMatch, sigAvoid, asmPrefix, sigReplace, asmPostfix, bindMappings, true);
|
||||
}
|
||||
|
||||
public List<AsmFragmentTemplate> synthesize(String signature, AsmFragmentTemplateSynthesizer synthesizer) {
|
||||
ArrayList<AsmFragmentTemplate> candidates = new ArrayList<>();
|
||||
if (signature.matches(sigMatch)) {
|
||||
if (sigAvoid == null || !signature.matches(sigAvoid)) {
|
||||
subSignature = regexpRewriteSignature(signature, sigMatch, sigReplace);
|
||||
if (mapSignature && bindMappings != null) {
|
||||
// When mapping the signature we do the map replacement in the signature
|
||||
for (String bound : bindMappings.keySet()) {
|
||||
subSignature = subSignature.replace(bound, bindMappings.get(bound));
|
||||
}
|
||||
}
|
||||
List<AsmFragmentTemplate> subFragmentTemplates = synthesizer.loadOrSynthesizeFragment(subSignature);
|
||||
for (AsmFragmentTemplate subFragmentTemplate : subFragmentTemplates) {
|
||||
if (subFragmentTemplate != null) {
|
||||
StringBuilder newFragment = new StringBuilder();
|
||||
if (asmPrefix != null) {
|
||||
newFragment.append(asmPrefix);
|
||||
}
|
||||
String subFragment = subFragmentTemplate.getBody();
|
||||
if (bindMappings != null) {
|
||||
if (mapSignature) {
|
||||
// When mapping the signature we do the reverse replacement in the ASM
|
||||
List<String> reverse = new ArrayList<>(bindMappings.keySet());
|
||||
Collections.reverse(reverse);
|
||||
for (String bound : reverse) {
|
||||
subFragment = subFragment.replace("{" + bindMappings.get(bound) + "}", "{" + bound + "}");
|
||||
}
|
||||
} else {
|
||||
// When not mapping the signature we do the replacement directly in the ASM
|
||||
for (String bound : bindMappings.keySet()) {
|
||||
subFragment = subFragment.replace("{" + bound + "}", "{" + bindMappings.get(bound) + "}");
|
||||
}
|
||||
}
|
||||
}
|
||||
newFragment.append(subFragment);
|
||||
if (asmPostfix != null) {
|
||||
newFragment.append("\n");
|
||||
newFragment.append(asmPostfix);
|
||||
}
|
||||
candidates.add(new AsmFragmentTemplate(signature, newFragment.toString(), this, subFragmentTemplate));
|
||||
}
|
||||
}
|
||||
// Load the fragment from disk
|
||||
CharStream fragmentCharStream = loadFragment(signature);
|
||||
if (fragmentCharStream != null) {
|
||||
candidates.add(new AsmFragmentTemplate(signature, fragmentCharStream.toString()));
|
||||
if (log.isVerboseFragmentLog()) {
|
||||
log.append("Finding fragment " + this.signature.getSignature() + " - Successfully loaded fragment " + signature);
|
||||
}
|
||||
}
|
||||
fragmentTemplateCache.put(signature, candidates);
|
||||
return candidates;
|
||||
}
|
||||
|
||||
public String getSubSignature() {
|
||||
return subSignature;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static String regexpRewriteSignature(String signature, String match, String replace) {
|
||||
Pattern p = Pattern.compile(match);
|
||||
Matcher m = p.matcher(signature);
|
||||
String output = signature;
|
||||
if (m.find()) {
|
||||
// getReplacement first number with "number" and second number with the first
|
||||
output = m.replaceAll(replace);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@ -295,34 +186,11 @@ public class AsmFragmentManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an ASM fragment.
|
||||
*
|
||||
* @param fragmentCharStream The stream containing the fragment syntax
|
||||
* @param fragmentFileName The filename (used in error messages)
|
||||
* @return The parsed fragment ready for generating
|
||||
* @throws IOException if the parsing/loading fails
|
||||
*/
|
||||
public static KickCParser.AsmLinesContext parseFragment(String fragmentBody, final String fragmentFileName) {
|
||||
CodePointCharStream fragmentCharStream = CharStreams.fromString(fragmentBody);
|
||||
KickCLexer kickCLexer = new KickCLexer(fragmentCharStream);
|
||||
KickCParser kickCParser = new KickCParser(new CommonTokenStream(kickCLexer));
|
||||
kickCParser.addErrorListener(new BaseErrorListener() {
|
||||
@Override
|
||||
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) {
|
||||
throw new RuntimeException("Error parsing fragment " + fragmentFileName + "\n - Line: " + line + "\n - Message: " + msg);
|
||||
}
|
||||
});
|
||||
kickCParser.setBuildParseTree(true);
|
||||
KickCParser.AsmFileContext asmFile = kickCParser.asmFile();
|
||||
return asmFile.asmLines();
|
||||
}
|
||||
|
||||
public static class UnknownFragmentException extends RuntimeException {
|
||||
|
||||
private String fragmentSignature;
|
||||
|
||||
public UnknownFragmentException(String signature) {
|
||||
UnknownFragmentException(String signature) {
|
||||
super("Fragment not found " + signature + ".asm");
|
||||
this.fragmentSignature = signature;
|
||||
}
|
||||
@ -533,6 +401,7 @@ public class AsmFragmentManager {
|
||||
synths.add(new AsmFragmentSynthesis("(.*)=p..([cz].)_(plus|minus|bor|bxor)_(.*)", null, null, "$1=vwu$2_$3_$4", null, null));
|
||||
synths.add(new AsmFragmentSynthesis("p..([cz].)=(.*)_(sethi|setlo|plus|minus)_(.*)", null, null, "vwu$1=$2_$3_$4", null, null));
|
||||
synths.add(new AsmFragmentSynthesis("(.*)=p..([cz].)_(sethi|setlo|plus|minus)_(.*)", null, null, "$1=vwu$2_$3_$4", null, null));
|
||||
|
||||
return synths;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,103 @@
|
||||
package dk.camelot64.kickc.fragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** AsmFragment synthesis mechanism based on matching fragment signature and reusing another fragment with added prefix/postfix and some bind-mappings */
|
||||
class AsmFragmentSynthesis {
|
||||
|
||||
private String sigMatch;
|
||||
private String sigAvoid;
|
||||
private String asmPrefix;
|
||||
private String sigReplace;
|
||||
private String asmPostfix;
|
||||
private Map<String, String> bindMappings;
|
||||
private boolean mapSignature;
|
||||
private String subSignature;
|
||||
|
||||
AsmFragmentSynthesis(String sigMatch, String sigAvoid, String asmPrefix, String sigReplace, String asmPostfix, Map<String, String> bindMappings, boolean mapSignature) {
|
||||
this.sigMatch = sigMatch;
|
||||
this.sigAvoid = sigAvoid;
|
||||
this.asmPrefix = asmPrefix;
|
||||
this.sigReplace = sigReplace;
|
||||
this.asmPostfix = asmPostfix;
|
||||
this.bindMappings = bindMappings;
|
||||
this.mapSignature = mapSignature;
|
||||
}
|
||||
|
||||
public AsmFragmentSynthesis(String sigMatch, String sigAvoid, String asmPrefix, String sigReplace, String asmPostfix, Map<String, String> bindMappings) {
|
||||
this(sigMatch, sigAvoid, asmPrefix, sigReplace, asmPostfix, bindMappings, true);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return sigMatch + (sigAvoid == null ? "" : ("/" + sigAvoid));
|
||||
}
|
||||
|
||||
public List<AsmFragmentTemplate> synthesize(String signature, AsmFragmentManager.AsmFragmentTemplateSynthesizer synthesizer) {
|
||||
ArrayList<AsmFragmentTemplate> candidates = new ArrayList<>();
|
||||
if (signature.matches(sigMatch)) {
|
||||
if (sigAvoid == null || !signature.matches(sigAvoid)) {
|
||||
subSignature = regexpRewriteSignature(signature, sigMatch, sigReplace);
|
||||
if (mapSignature && bindMappings != null) {
|
||||
// When mapping the signature we do the map replacement in the signature
|
||||
for (String bound : bindMappings.keySet()) {
|
||||
subSignature = subSignature.replace(bound, bindMappings.get(bound));
|
||||
}
|
||||
}
|
||||
List<AsmFragmentTemplate> subFragmentTemplates = synthesizer.loadOrSynthesizeFragment(subSignature);
|
||||
for (AsmFragmentTemplate subFragmentTemplate : subFragmentTemplates) {
|
||||
if (subFragmentTemplate != null) {
|
||||
StringBuilder newFragment = new StringBuilder();
|
||||
if (asmPrefix != null) {
|
||||
newFragment.append(asmPrefix);
|
||||
}
|
||||
String subFragment = subFragmentTemplate.getBody();
|
||||
if (bindMappings != null) {
|
||||
if (mapSignature) {
|
||||
// When mapping the signature we do the reverse replacement in the ASM
|
||||
List<String> reverse = new ArrayList<>(bindMappings.keySet());
|
||||
Collections.reverse(reverse);
|
||||
for (String bound : reverse) {
|
||||
subFragment = subFragment.replace("{" + bindMappings.get(bound) + "}", "{" + bound + "}");
|
||||
}
|
||||
} else {
|
||||
// When not mapping the signature we do the replacement directly in the ASM
|
||||
for (String bound : bindMappings.keySet()) {
|
||||
subFragment = subFragment.replace("{" + bound + "}", "{" + bindMappings.get(bound) + "}");
|
||||
}
|
||||
}
|
||||
}
|
||||
newFragment.append(subFragment);
|
||||
if (asmPostfix != null) {
|
||||
newFragment.append("\n");
|
||||
newFragment.append(asmPostfix);
|
||||
}
|
||||
candidates.add(new AsmFragmentTemplate(signature, newFragment.toString(), this, subFragmentTemplate));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return candidates;
|
||||
}
|
||||
|
||||
public String getSubSignature() {
|
||||
return subSignature;
|
||||
}
|
||||
|
||||
static String regexpRewriteSignature(String signature, String match, String replace) {
|
||||
Pattern p = Pattern.compile(match);
|
||||
Matcher m = p.matcher(signature);
|
||||
String output = signature;
|
||||
if (m.find()) {
|
||||
// getReplacement first number with "number" and second number with the first
|
||||
output = m.replaceAll(replace);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package dk.camelot64.kickc.fragment;
|
||||
|
||||
import dk.camelot64.kickc.parser.KickCLexer;
|
||||
import dk.camelot64.kickc.parser.KickCParser;
|
||||
import org.antlr.v4.runtime.*;
|
||||
|
||||
/**
|
||||
* An ASM fragment template usable for generating KickAssembler code for different bindings.
|
||||
* The AsmFragmentTemplateSynthesizer can generate multiple different templates usable for a specific fragment signature.
|
||||
*/
|
||||
public class AsmFragmentTemplate {
|
||||
|
||||
/** The fragment template signature name. */
|
||||
private String signature;
|
||||
|
||||
/** The fragment template body */
|
||||
private String body;
|
||||
|
||||
/** The parsed ASM lines. Initially null. Will be non-null, is the template is ever used to generate ASM code. */
|
||||
private KickCParser.AsmLinesContext bodyAsm;
|
||||
|
||||
/** true if the fragment was loaded from disk. */
|
||||
boolean loaded;
|
||||
|
||||
/** The synthesis that created the fragment. null if the fragment template was loaded. */
|
||||
private AsmFragmentSynthesis synthesis;
|
||||
|
||||
/** The sub fragment template that the synthesis modified to create this. null if the fragment template was loaded. */
|
||||
private AsmFragmentTemplate subFragment;
|
||||
|
||||
public AsmFragmentTemplate(String signature, String body) {
|
||||
this.signature = signature;
|
||||
this.body = body;
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
AsmFragmentTemplate(String signature, String body, AsmFragmentSynthesis synthesis, AsmFragmentTemplate subFragment) {
|
||||
this.signature = signature;
|
||||
this.body = body;
|
||||
this.synthesis = synthesis;
|
||||
this.subFragment = subFragment;
|
||||
this.loaded = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an inline ASM fragment template
|
||||
*
|
||||
* @param bodyLines Parsed ASM body
|
||||
*/
|
||||
public AsmFragmentTemplate(KickCParser.AsmLinesContext bodyLines) {
|
||||
this.signature = "--inline--";
|
||||
this.bodyAsm = bodyLines;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public KickCParser.AsmLinesContext getBodyAsm() {
|
||||
if (bodyAsm == null) {
|
||||
bodyAsm = parseBody(body, signature);
|
||||
}
|
||||
return bodyAsm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an ASM fragment.
|
||||
*
|
||||
* @param fragmentBody The stream containing the fragment syntax
|
||||
* @param fragmentFileName The filename (used in error messages)
|
||||
* @return The parsed fragment ready for generating
|
||||
*/
|
||||
private static KickCParser.AsmLinesContext parseBody(String fragmentBody, final String fragmentFileName) {
|
||||
CodePointCharStream fragmentCharStream = CharStreams.fromString(fragmentBody);
|
||||
KickCLexer kickCLexer = new KickCLexer(fragmentCharStream);
|
||||
KickCParser kickCParser = new KickCParser(new CommonTokenStream(kickCLexer));
|
||||
kickCParser.addErrorListener(new BaseErrorListener() {
|
||||
@Override
|
||||
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) {
|
||||
throw new RuntimeException("Error parsing fragment " + fragmentFileName + "\n - Line: " + line + "\n - Message: " + msg);
|
||||
}
|
||||
});
|
||||
kickCParser.setBuildParseTree(true);
|
||||
KickCParser.AsmFileContext asmFile = kickCParser.asmFile();
|
||||
return asmFile.asmLines();
|
||||
}
|
||||
|
||||
|
||||
public boolean isLoaded() {
|
||||
return loaded;
|
||||
}
|
||||
|
||||
public AsmFragmentSynthesis getSynthesis() {
|
||||
return synthesis;
|
||||
}
|
||||
|
||||
public AsmFragmentTemplate getSubFragment() {
|
||||
return subFragment;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
StringBuilder name = new StringBuilder();
|
||||
name.append(signature);
|
||||
if (synthesis != null) {
|
||||
name.append(" < ");
|
||||
name.append(subFragment.getName());
|
||||
}
|
||||
return name.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AsmFragmentTemplate that = (AsmFragmentTemplate) o;
|
||||
return getName().equals(that.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getName().hashCode();
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
lda {z1}
|
||||
clc
|
||||
adc #<{c1}
|
||||
adc #{c1}
|
||||
sta {z1}
|
||||
bcc !+
|
||||
inc {z1}+1
|
||||
!:
|
||||
lda {z1}+1
|
||||
adc #0
|
||||
sta {z1}+1
|
@ -1,6 +1,6 @@
|
||||
lda {z2}
|
||||
clc
|
||||
adc #<{c1}
|
||||
adc #{c1}
|
||||
sta {z1}
|
||||
lda {z2}+1
|
||||
adc #0
|
||||
|
@ -6,7 +6,7 @@ file
|
||||
;
|
||||
|
||||
asmFile
|
||||
: asmLines EOF
|
||||
: bodyAsm EOF
|
||||
;
|
||||
|
||||
importSeq
|
||||
@ -58,7 +58,7 @@ stmt
|
||||
| 'do' stmt 'while' '(' expr ')' ';' #stmtDoWhile
|
||||
| 'for' '(' forDeclaration? forIteration ')' stmt #stmtFor
|
||||
| 'return' expr? ';' #stmtReturn
|
||||
| 'asm' '{' asmLines '}' #stmtAsm
|
||||
| 'asm' '{' bodyAsm '}' #stmtAsm
|
||||
;
|
||||
|
||||
forDeclaration
|
||||
@ -109,7 +109,7 @@ parameterList
|
||||
: expr (',' expr)*
|
||||
;
|
||||
|
||||
asmLines
|
||||
bodyAsm
|
||||
: asmLine*
|
||||
;
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
package dk.camelot64.kickc.passes;
|
||||
|
||||
import dk.camelot64.kickc.asm.*;
|
||||
import dk.camelot64.kickc.fragment.AsmFormat;
|
||||
import dk.camelot64.kickc.fragment.AsmFragment;
|
||||
import dk.camelot64.kickc.fragment.AsmFragmentManager;
|
||||
import dk.camelot64.kickc.fragment.AsmFragmentSignature;
|
||||
import dk.camelot64.kickc.fragment.*;
|
||||
import dk.camelot64.kickc.model.*;
|
||||
|
||||
import java.util.*;
|
||||
@ -276,7 +273,7 @@ public class Pass4CodeGeneration {
|
||||
} else if (statement instanceof StatementAsm) {
|
||||
StatementAsm statementAsm = (StatementAsm) statement;
|
||||
HashMap<String, Value> bindings = new HashMap<>();
|
||||
AsmFragment asmFragment = new AsmFragment(program, "inline", block.getScope(), statementAsm.getAsmLines(), bindings);
|
||||
AsmFragment asmFragment = new AsmFragment(program, "inline", block.getScope(), new AsmFragmentTemplate(statementAsm.getAsmLines()), bindings);
|
||||
asmFragment.generate(asm);
|
||||
} else {
|
||||
throw new RuntimeException("Statement not supported " + statement);
|
||||
|
@ -1,17 +1,23 @@
|
||||
package dk.camelot64.kickc.test;
|
||||
|
||||
import dk.camelot64.kickc.CompileLog;
|
||||
import dk.camelot64.kickc.Compiler;
|
||||
import dk.camelot64.kickc.fragment.AsmFragmentManager;
|
||||
import dk.camelot64.kickc.model.CompileError;
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import static junit.framework.TestCase.fail;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Compile a number of source files and compare the resulting assembler with expected output
|
||||
*/
|
||||
public class TestPrograms extends TestCase {
|
||||
public class TestPrograms {
|
||||
|
||||
ReferenceHelper helper;
|
||||
|
||||
@ -22,351 +28,444 @@ public class TestPrograms extends TestCase {
|
||||
helper = new ReferenceHelper("dk/camelot64/kickc/test/ref/");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() throws Exception {
|
||||
CompileLog log = new CompileLog();
|
||||
log.setSysOut(true);
|
||||
AsmFragmentManager.logUsages(log);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMemAlignment() throws IOException, URISyntaxException {
|
||||
compileAndCompare("mem-alignment");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiply() throws IOException, URISyntaxException {
|
||||
compileAndCompare("test-multiply");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testArraysInit() throws IOException, URISyntaxException {
|
||||
compileAndCompare("arrays-init");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstantStringConcat() throws IOException, URISyntaxException {
|
||||
compileAndCompare("constant-string-concat");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTrueInlineWords() throws IOException, URISyntaxException {
|
||||
compileAndCompare("true-inline-words");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncrementInArray() throws IOException, URISyntaxException {
|
||||
compileAndCompare("incrementinarray");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForIncrementAssign() throws IOException, URISyntaxException {
|
||||
compileAndCompare("forincrementassign");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstants() throws IOException, URISyntaxException {
|
||||
compileAndCompare("constants");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInlineAssignment() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inline-assignment");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInlineWord() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inline-word");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSignedWords() throws IOException, URISyntaxException {
|
||||
compileAndCompare("signed-words");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSinusSprites() throws IOException, URISyntaxException {
|
||||
compileAndCompare("sinus-sprites");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstantAbsMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("constabsmin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicFloats() throws IOException, URISyntaxException {
|
||||
compileAndCompare("sinus-basic");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoubleImport() throws IOException, URISyntaxException {
|
||||
compileAndCompare("double-import");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImporting() throws IOException, URISyntaxException {
|
||||
compileAndCompare("importing");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnusedVars() throws IOException, URISyntaxException {
|
||||
compileAndCompare("unused-vars");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFillscreen() throws IOException, URISyntaxException {
|
||||
compileAndCompare("fillscreen");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLiverangeCallProblem() throws IOException, URISyntaxException {
|
||||
compileAndCompare("liverange-call-problem");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPrintProblem() throws IOException, URISyntaxException {
|
||||
compileAndCompare("print-problem");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPrintMsg() throws IOException, URISyntaxException {
|
||||
compileAndCompare("printmsg");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnusedMethod() throws IOException, URISyntaxException {
|
||||
compileAndCompare("unused-method");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInlineString() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inline-string");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLocalString() throws IOException, URISyntaxException {
|
||||
compileAndCompare("local-string");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInlineArrayProblem() throws IOException, URISyntaxException {
|
||||
String filename = "inlinearrayproblem";
|
||||
compileAndCompare(filename);
|
||||
compileAndCompare("inlinearrayproblem");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImmZero() throws IOException, URISyntaxException {
|
||||
compileAndCompare("immzero");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWordExpr() throws IOException, URISyntaxException {
|
||||
compileAndCompare("wordexpr");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testZpptr() throws IOException, URISyntaxException {
|
||||
compileAndCompare("zpptr");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCasting() throws IOException, URISyntaxException {
|
||||
compileAndCompare("casting");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSignedBytes() throws IOException, URISyntaxException {
|
||||
compileAndCompare("signed-bytes");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScrollBig() throws IOException, URISyntaxException {
|
||||
compileAndCompare("scrollbig");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPtrComplex() throws IOException, URISyntaxException {
|
||||
compileAndCompare("ptr-complex");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncD020() throws IOException, URISyntaxException {
|
||||
compileAndCompare("incd020");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOverlapAllocation2() throws IOException, URISyntaxException {
|
||||
compileAndCompare("overlap-allocation-2");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOverlapAllocation() throws IOException, URISyntaxException {
|
||||
compileAndCompare("overlap-allocation");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBitmapBresenham() throws IOException, URISyntaxException {
|
||||
compileAndCompare("bitmap-bresenham");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAsmClobber() throws IOException, URISyntaxException {
|
||||
compileAndCompare("asm-clobber");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInlineAsm() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inline-asm");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChargen() throws IOException, URISyntaxException {
|
||||
compileAndCompare("chargen");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBitmapPlotter() throws IOException, URISyntaxException {
|
||||
compileAndCompare("bitmap-plotter");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstIdentification() throws IOException, URISyntaxException {
|
||||
compileAndCompare("const-identification");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCallConstParam() throws IOException, URISyntaxException {
|
||||
compileAndCompare("callconstparam");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScrollClobber() throws IOException, URISyntaxException {
|
||||
compileAndCompare("scroll-clobber");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHalfscii() throws IOException, URISyntaxException {
|
||||
compileAndCompare("halfscii");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLiterals() throws IOException, URISyntaxException {
|
||||
compileAndCompare("literals");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScroll() throws IOException, URISyntaxException {
|
||||
compileAndCompare("scroll");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstantMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("constantmin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLiveRange() throws IOException, URISyntaxException {
|
||||
compileAndCompare("liverange");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testZpParamMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("zpparammin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInMemArray() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inmemarray");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInMemConstArray() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inmem-const-array");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInMemString() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inmemstring");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVoronoi() throws IOException, URISyntaxException {
|
||||
compileAndCompare("voronoi");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFlipper() throws IOException, URISyntaxException {
|
||||
compileAndCompare("flipper-rex2");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBresenham() throws IOException, URISyntaxException {
|
||||
compileAndCompare("bresenham");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBresenhamArr() throws IOException, URISyntaxException {
|
||||
compileAndCompare("bresenhamarr");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIterArray() throws IOException, URISyntaxException {
|
||||
compileAndCompare("iterarray");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoopMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("loopmin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSumMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("summin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoopSplit() throws IOException, URISyntaxException {
|
||||
compileAndCompare("loopsplit");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoopNest() throws IOException, URISyntaxException {
|
||||
compileAndCompare("loopnest");
|
||||
}
|
||||
|
||||
public void testLoopNest2() throws IOException, URISyntaxException {
|
||||
@Test
|
||||
public void testLoopNest2() throws IOException, URISyntaxException {
|
||||
compileAndCompare("loopnest2");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFibMem() throws IOException, URISyntaxException {
|
||||
compileAndCompare("fibmem");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPtrTest() throws IOException, URISyntaxException {
|
||||
compileAndCompare("ptrtest");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPtrTestMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("ptrtestmin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUseGlobal() throws IOException, URISyntaxException {
|
||||
compileAndCompare("useglobal");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModGlobal() throws IOException, URISyntaxException {
|
||||
compileAndCompare("modglobal");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testModGlobalMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("modglobalmin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIfMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("ifmin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForClassicMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("forclassicmin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForRangeMin() throws IOException, URISyntaxException {
|
||||
compileAndCompare("forrangemin");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAssignConst() throws IOException, URISyntaxException {
|
||||
assertError("assign-const", "Constants can not be modified");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStmtOutsideMethod() throws IOException, URISyntaxException {
|
||||
assertError("stmt-outside-method", "Error parsing");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUseUndeclared() throws IOException, URISyntaxException {
|
||||
assertError("useundeclared", "Unknown variable");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUseUninitialized() throws IOException, URISyntaxException {
|
||||
assertError("useuninitialized", "Variable used before being defined");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTypeMismatch() throws IOException, URISyntaxException {
|
||||
assertError("typemismatch", "Type mismatch");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToManyParams() throws IOException, URISyntaxException {
|
||||
assertError("tomanyparams", "Wrong number of parameters in call");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToFewParams() throws IOException, URISyntaxException {
|
||||
assertError("tofewparams", "Wrong number of parameters in call");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoReturn() throws IOException, URISyntaxException {
|
||||
assertError("noreturn", "Method must end with a return statement");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureNotFound() throws IOException, URISyntaxException {
|
||||
assertError("procedurenotfound", "Called procedure not found");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIllegalLValue() throws IOException, URISyntaxException {
|
||||
assertError("illegallvalue", "LValue is illegal");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidConstType() throws IOException, URISyntaxException {
|
||||
assertError("invalid-consttype", "Constant variable has a non-matching type");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValueListError() throws IOException, URISyntaxException {
|
||||
assertError("valuelist-error", "Value list not resolved to word constructor");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testArrayUninitialized() throws IOException, URISyntaxException {
|
||||
assertError("array-uninitialized", "Cannot determine array size.");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testArrayLengthMismatch() throws IOException, URISyntaxException {
|
||||
assertError("array-length-mismatch", "Array length mismatch");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringLengthMismatch() throws IOException, URISyntaxException {
|
||||
assertError("string-length-mismatch", "Array length mismatch");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIllegalAlignment() throws IOException, URISyntaxException {
|
||||
assertError("illegal-alignment", "Cannot align variable");
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
.const SCREEN = $400
|
||||
jsr main
|
||||
main: {
|
||||
.label l = 2
|
||||
.label k = 2
|
||||
ldx #0
|
||||
b1:
|
||||
lda #0
|
||||
@ -17,21 +17,22 @@ main: {
|
||||
inx
|
||||
cpx #$65
|
||||
bne b1
|
||||
ldy #0
|
||||
b3:
|
||||
lda #0
|
||||
sta l
|
||||
sta k
|
||||
b3:
|
||||
ldy #0
|
||||
b4:
|
||||
eor #$55
|
||||
tax
|
||||
lda l
|
||||
sta SCREEN,y
|
||||
inc l
|
||||
lda l
|
||||
cmp #$65
|
||||
bne b4
|
||||
tya
|
||||
ldx k
|
||||
sta SCREEN,x
|
||||
iny
|
||||
cpy #$65
|
||||
bne b4
|
||||
inc k
|
||||
lda k
|
||||
cmp #$65
|
||||
bne b3
|
||||
rts
|
||||
}
|
||||
|
@ -594,11 +594,11 @@ REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 303: zp ZP_BYTE:3 [ main::j#2 main::j#1 ] 252.5: zp ZP_BYTE:5 [ main::l#2 main::l#1 ] 41.1: zp ZP_BYTE:2 [ main::i#4 main::i#1 ] 37: zp ZP_BYTE:4 [ main::k#4 main::k#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 6638 combination reg byte a [ main::j#2 main::j#1 ] zp ZP_BYTE:5 [ main::l#2 main::l#1 ] reg byte x [ main::i#4 main::i#1 ] reg byte y [ main::k#4 main::k#1 ]
|
||||
Uplifting [] best 6638 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ main::l#2 main::l#1 ]
|
||||
Uplifting [main] best 6638 combination zp ZP_BYTE:5 [ main::l#2 main::l#1 ]
|
||||
Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:2 [ main::l#2 main::l#1 ]
|
||||
Uplifting [main] best 6028 combination reg byte a [ main::j#2 main::j#1 ] reg byte y [ main::l#2 main::l#1 ] reg byte x [ main::i#4 main::i#1 ] zp ZP_BYTE:4 [ main::k#4 main::k#1 ]
|
||||
Uplifting [] best 6028 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:4 [ main::k#4 main::k#1 ]
|
||||
Uplifting [main] best 6028 combination zp ZP_BYTE:4 [ main::k#4 main::k#1 ]
|
||||
Allocated (was zp ZP_BYTE:4) zp ZP_BYTE:2 [ main::k#4 main::k#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
//SEG0 Basic Upstart
|
||||
@ -625,7 +625,7 @@ bend_from_b1:
|
||||
bend:
|
||||
//SEG9 main
|
||||
main: {
|
||||
.label l = 2
|
||||
.label k = 2
|
||||
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
b1_from_main:
|
||||
//SEG11 [5] phi (byte) main::i#4 = (byte/signed byte/word/signed word) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
||||
@ -666,8 +666,9 @@ main: {
|
||||
bne b1_from_b5
|
||||
//SEG26 [12] phi from main::@5 to main::@3 [phi:main::@5->main::@3]
|
||||
b3_from_b5:
|
||||
//SEG27 [12] phi (byte) main::k#4 = (byte/signed byte/word/signed word) 0 [phi:main::@5->main::@3#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
//SEG27 [12] phi (byte) main::k#4 = (byte/signed byte/word/signed word) 0 [phi:main::@5->main::@3#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta k
|
||||
jmp b3
|
||||
//SEG28 [12] phi from main::@7 to main::@3 [phi:main::@7->main::@3]
|
||||
b3_from_b7:
|
||||
@ -677,9 +678,8 @@ main: {
|
||||
b3:
|
||||
//SEG31 [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
b4_from_b3:
|
||||
//SEG32 [13] phi (byte) main::l#2 = (byte/signed byte/word/signed word) 0 [phi:main::@3->main::@4#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta l
|
||||
//SEG32 [13] phi (byte) main::l#2 = (byte/signed byte/word/signed word) 0 [phi:main::@3->main::@4#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
jmp b4
|
||||
//SEG33 [13] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
b4_from_b4:
|
||||
@ -690,22 +690,23 @@ main: {
|
||||
//SEG36 asm { eor#$55 tax }
|
||||
eor #$55
|
||||
tax
|
||||
//SEG37 [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) -- pbuc1_derefidx_vbuyy=vbuz1
|
||||
lda l
|
||||
sta SCREEN,y
|
||||
//SEG38 [16] (byte) main::l#1 ← ++ (byte) main::l#2 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuz1=_inc_vbuz1
|
||||
inc l
|
||||
//SEG39 [17] if((byte) main::l#1!=(byte/signed byte/word/signed word) 101) goto main::@4 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
||||
lda l
|
||||
cmp #$65
|
||||
//SEG37 [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) -- pbuc1_derefidx_vbuz1=vbuyy
|
||||
tya
|
||||
ldx k
|
||||
sta SCREEN,x
|
||||
//SEG38 [16] (byte) main::l#1 ← ++ (byte) main::l#2 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
//SEG39 [17] if((byte) main::l#1!=(byte/signed byte/word/signed word) 101) goto main::@4 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #$65
|
||||
bne b4_from_b4
|
||||
jmp b7
|
||||
//SEG40 main::@7
|
||||
b7:
|
||||
//SEG41 [18] (byte) main::k#1 ← ++ (byte) main::k#4 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
//SEG42 [19] if((byte) main::k#1!=(byte/signed byte/word/signed word) 101) goto main::@3 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #$65
|
||||
//SEG41 [18] (byte) main::k#1 ← ++ (byte) main::k#4 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuz1=_inc_vbuz1
|
||||
inc k
|
||||
//SEG42 [19] if((byte) main::k#1!=(byte/signed byte/word/signed word) 101) goto main::@3 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
||||
lda k
|
||||
cmp #$65
|
||||
bne b3_from_b7
|
||||
jmp breturn
|
||||
//SEG43 main::@return
|
||||
@ -775,20 +776,20 @@ FINAL SYMBOL TABLE
|
||||
(byte) main::j#1 reg byte a 151.5
|
||||
(byte) main::j#2 reg byte a 151.5
|
||||
(byte) main::k
|
||||
(byte) main::k#1 reg byte y 16.5
|
||||
(byte) main::k#4 reg byte y 20.499999999999996
|
||||
(byte) main::k#1 k zp ZP_BYTE:2 16.5
|
||||
(byte) main::k#4 k zp ZP_BYTE:2 20.499999999999996
|
||||
(byte) main::l
|
||||
(byte) main::l#1 l zp ZP_BYTE:2 151.5
|
||||
(byte) main::l#2 l zp ZP_BYTE:2 101.0
|
||||
(byte) main::l#1 reg byte y 151.5
|
||||
(byte) main::l#2 reg byte y 101.0
|
||||
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte y [ main::k#4 main::k#1 ]
|
||||
zp ZP_BYTE:2 [ main::l#2 main::l#1 ]
|
||||
zp ZP_BYTE:2 [ main::k#4 main::k#1 ]
|
||||
reg byte y [ main::l#2 main::l#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 4682
|
||||
Score: 4072
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
@ -806,7 +807,7 @@ Score: 4682
|
||||
//SEG8 @end
|
||||
//SEG9 main
|
||||
main: {
|
||||
.label l = 2
|
||||
.label k = 2
|
||||
//SEG10 [5] phi from main to main::@1 [phi:main->main::@1]
|
||||
//SEG11 [5] phi (byte) main::i#4 = (byte/signed byte/word/signed word) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
@ -836,16 +837,16 @@ main: {
|
||||
cpx #$65
|
||||
bne b1
|
||||
//SEG26 [12] phi from main::@5 to main::@3 [phi:main::@5->main::@3]
|
||||
//SEG27 [12] phi (byte) main::k#4 = (byte/signed byte/word/signed word) 0 [phi:main::@5->main::@3#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
//SEG27 [12] phi (byte) main::k#4 = (byte/signed byte/word/signed word) 0 [phi:main::@5->main::@3#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta k
|
||||
//SEG28 [12] phi from main::@7 to main::@3 [phi:main::@7->main::@3]
|
||||
//SEG29 [12] phi (byte) main::k#4 = (byte) main::k#1 [phi:main::@7->main::@3#0] -- register_copy
|
||||
//SEG30 main::@3
|
||||
b3:
|
||||
//SEG31 [13] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
|
||||
//SEG32 [13] phi (byte) main::l#2 = (byte/signed byte/word/signed word) 0 [phi:main::@3->main::@4#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta l
|
||||
//SEG32 [13] phi (byte) main::l#2 = (byte/signed byte/word/signed word) 0 [phi:main::@3->main::@4#0] -- vbuyy=vbuc1
|
||||
ldy #0
|
||||
//SEG33 [13] phi from main::@4 to main::@4 [phi:main::@4->main::@4]
|
||||
//SEG34 [13] phi (byte) main::l#2 = (byte) main::l#1 [phi:main::@4->main::@4#0] -- register_copy
|
||||
//SEG35 main::@4
|
||||
@ -853,20 +854,21 @@ main: {
|
||||
//SEG36 asm { eor#$55 tax }
|
||||
eor #$55
|
||||
tax
|
||||
//SEG37 [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) -- pbuc1_derefidx_vbuyy=vbuz1
|
||||
lda l
|
||||
sta SCREEN,y
|
||||
//SEG38 [16] (byte) main::l#1 ← ++ (byte) main::l#2 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuz1=_inc_vbuz1
|
||||
inc l
|
||||
//SEG39 [17] if((byte) main::l#1!=(byte/signed byte/word/signed word) 101) goto main::@4 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
||||
lda l
|
||||
cmp #$65
|
||||
//SEG37 [15] *((const byte*) SCREEN#0 + (byte) main::k#4) ← (byte) main::l#2 [ main::k#4 main::l#2 ] ( main:2 [ main::k#4 main::l#2 ] ) -- pbuc1_derefidx_vbuz1=vbuyy
|
||||
tya
|
||||
ldx k
|
||||
sta SCREEN,x
|
||||
//SEG38 [16] (byte) main::l#1 ← ++ (byte) main::l#2 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
//SEG39 [17] if((byte) main::l#1!=(byte/signed byte/word/signed word) 101) goto main::@4 [ main::k#4 main::l#1 ] ( main:2 [ main::k#4 main::l#1 ] ) -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #$65
|
||||
bne b4
|
||||
//SEG40 main::@7
|
||||
//SEG41 [18] (byte) main::k#1 ← ++ (byte) main::k#4 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
//SEG42 [19] if((byte) main::k#1!=(byte/signed byte/word/signed word) 101) goto main::@3 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuyy_neq_vbuc1_then_la1
|
||||
cpy #$65
|
||||
//SEG41 [18] (byte) main::k#1 ← ++ (byte) main::k#4 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuz1=_inc_vbuz1
|
||||
inc k
|
||||
//SEG42 [19] if((byte) main::k#1!=(byte/signed byte/word/signed word) 101) goto main::@3 [ main::k#1 ] ( main:2 [ main::k#1 ] ) -- vbuz1_neq_vbuc1_then_la1
|
||||
lda k
|
||||
cmp #$65
|
||||
bne b3
|
||||
//SEG43 main::@return
|
||||
//SEG44 [20] return [ ] ( main:2 [ ] )
|
||||
|
@ -18,13 +18,13 @@
|
||||
(byte) main::j#1 reg byte a 151.5
|
||||
(byte) main::j#2 reg byte a 151.5
|
||||
(byte) main::k
|
||||
(byte) main::k#1 reg byte y 16.5
|
||||
(byte) main::k#4 reg byte y 20.499999999999996
|
||||
(byte) main::k#1 k zp ZP_BYTE:2 16.5
|
||||
(byte) main::k#4 k zp ZP_BYTE:2 20.499999999999996
|
||||
(byte) main::l
|
||||
(byte) main::l#1 l zp ZP_BYTE:2 151.5
|
||||
(byte) main::l#2 l zp ZP_BYTE:2 101.0
|
||||
(byte) main::l#1 reg byte y 151.5
|
||||
(byte) main::l#2 reg byte y 101.0
|
||||
|
||||
reg byte x [ main::i#4 main::i#1 ]
|
||||
reg byte a [ main::j#2 main::j#1 ]
|
||||
reg byte y [ main::k#4 main::k#1 ]
|
||||
zp ZP_BYTE:2 [ main::l#2 main::l#1 ]
|
||||
zp ZP_BYTE:2 [ main::k#4 main::k#1 ]
|
||||
reg byte y [ main::l#2 main::l#1 ]
|
||||
|
@ -193,9 +193,9 @@ line_ydxi: {
|
||||
ldy y
|
||||
jsr plot
|
||||
inc y
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
lda yd
|
||||
cmp e
|
||||
@ -253,9 +253,9 @@ line_xdyi: {
|
||||
ldy y
|
||||
jsr plot
|
||||
inx
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
lda xd
|
||||
cmp e
|
||||
@ -287,9 +287,9 @@ line_ydxd: {
|
||||
ldy y
|
||||
jsr plot
|
||||
inc y
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
lda yd
|
||||
cmp e
|
||||
@ -321,9 +321,9 @@ line_xdyd: {
|
||||
ldy y
|
||||
jsr plot
|
||||
inx
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
lda xd
|
||||
cmp e
|
||||
@ -403,8 +403,8 @@ init_screen: {
|
||||
lda #>BITMAP
|
||||
sta b+1
|
||||
b1:
|
||||
ldy #0
|
||||
tya
|
||||
lda #0
|
||||
tay
|
||||
sta (b),y
|
||||
inc b
|
||||
bne !+
|
||||
@ -421,8 +421,8 @@ init_screen: {
|
||||
lda #>SCREEN
|
||||
sta c+1
|
||||
b2:
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
inc c
|
||||
bne !+
|
||||
|
@ -4781,9 +4781,9 @@ line_ydxi: {
|
||||
//SEG183 [93] (byte) line_ydxi::y#2 ← (byte) line_ydxi::y#3 + (byte/signed byte/word/signed word) 1 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG184 [94] (byte) line_ydxi::e#1 ← (byte) line_ydxi::e#3 + (byte) line_ydxi::xd#2 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
//SEG185 [95] if((byte) line_ydxi::yd#5>=(byte) line_ydxi::e#1) goto line_ydxi::@2 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda yd
|
||||
@ -4863,8 +4863,8 @@ plot: {
|
||||
ora plot_bit,x
|
||||
sta _1
|
||||
//SEG203 [108] *((byte*) plot::plotter#0) ← (byte~) plot::$1 [ ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda _1
|
||||
ldy #0
|
||||
sta (plotter),y
|
||||
jmp breturn
|
||||
//SEG204 plot::@return
|
||||
@ -4912,9 +4912,9 @@ line_xdyi: {
|
||||
//SEG220 [116] (byte) line_xdyi::x#2 ← (byte) line_xdyi::x#3 + (byte/signed byte/word/signed word) 1 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
//SEG221 [117] (byte) line_xdyi::e#1 ← (byte) line_xdyi::e#3 + (byte) line_xdyi::yd#2 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
//SEG222 [118] if((byte) line_xdyi::xd#5>=(byte) line_xdyi::e#1) goto line_xdyi::@2 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda xd
|
||||
@ -4993,9 +4993,9 @@ line_ydxd: {
|
||||
//SEG248 [131] (byte) line_ydxd::y#2 ← (byte) line_ydxd::y#3 + (byte/signed byte/word/signed word) 1 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG249 [132] (byte) line_ydxd::e#1 ← (byte) line_ydxd::e#3 + (byte) line_ydxd::xd#2 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
//SEG250 [133] if((byte) line_ydxd::yd#5>=(byte) line_ydxd::e#1) goto line_ydxd::@2 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda yd
|
||||
@ -5074,9 +5074,9 @@ line_xdyd: {
|
||||
//SEG276 [146] (byte) line_xdyd::x#2 ← (byte) line_xdyd::x#3 + (byte/signed byte/word/signed word) 1 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
//SEG277 [147] (byte) line_xdyd::e#1 ← (byte) line_xdyd::e#3 + (byte) line_xdyd::yd#2 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
//SEG278 [148] if((byte) line_xdyd::xd#5>=(byte) line_xdyd::e#1) goto line_xdyd::@2 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda xd
|
||||
@ -5282,8 +5282,8 @@ init_screen: {
|
||||
//SEG342 init_screen::@1
|
||||
b1:
|
||||
//SEG343 [183] *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (b),y
|
||||
//SEG344 [184] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 [ init_screen::b#1 ] ( main:2::init_screen:8 [ init_screen::b#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc b
|
||||
@ -5312,8 +5312,8 @@ init_screen: {
|
||||
//SEG350 init_screen::@2
|
||||
b2:
|
||||
//SEG351 [187] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word) 20 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
//SEG352 [188] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 [ init_screen::c#1 ] ( main:2::init_screen:8 [ init_screen::c#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc c
|
||||
@ -6122,9 +6122,9 @@ line_ydxi: {
|
||||
//SEG183 [93] (byte) line_ydxi::y#2 ← (byte) line_ydxi::y#3 + (byte/signed byte/word/signed word) 1 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG184 [94] (byte) line_ydxi::e#1 ← (byte) line_ydxi::e#3 + (byte) line_ydxi::xd#2 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
//SEG185 [95] if((byte) line_ydxi::yd#5>=(byte) line_ydxi::e#1) goto line_ydxi::@2 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda yd
|
||||
@ -6236,9 +6236,9 @@ line_xdyi: {
|
||||
//SEG220 [116] (byte) line_xdyi::x#2 ← (byte) line_xdyi::x#3 + (byte/signed byte/word/signed word) 1 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] ) -- vbuxx=vbuxx_plus_1
|
||||
inx
|
||||
//SEG221 [117] (byte) line_xdyi::e#1 ← (byte) line_xdyi::e#3 + (byte) line_xdyi::yd#2 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
//SEG222 [118] if((byte) line_xdyi::xd#5>=(byte) line_xdyi::e#1) goto line_xdyi::@2 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda xd
|
||||
@ -6312,9 +6312,9 @@ line_ydxd: {
|
||||
//SEG248 [131] (byte) line_ydxd::y#2 ← (byte) line_ydxd::y#3 + (byte/signed byte/word/signed word) 1 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG249 [132] (byte) line_ydxd::e#1 ← (byte) line_ydxd::e#3 + (byte) line_ydxd::xd#2 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
//SEG250 [133] if((byte) line_ydxd::yd#5>=(byte) line_ydxd::e#1) goto line_ydxd::@2 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda yd
|
||||
@ -6388,9 +6388,9 @@ line_xdyd: {
|
||||
//SEG276 [146] (byte) line_xdyd::x#2 ← (byte) line_xdyd::x#3 + (byte/signed byte/word/signed word) 1 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] ) -- vbuxx=vbuxx_plus_1
|
||||
inx
|
||||
//SEG277 [147] (byte) line_xdyd::e#1 ← (byte) line_xdyd::e#3 + (byte) line_xdyd::yd#2 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
//SEG278 [148] if((byte) line_xdyd::xd#5>=(byte) line_xdyd::e#1) goto line_xdyd::@2 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda xd
|
||||
@ -6570,8 +6570,8 @@ init_screen: {
|
||||
//SEG342 init_screen::@1
|
||||
b1:
|
||||
//SEG343 [183] *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (b),y
|
||||
//SEG344 [184] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 [ init_screen::b#1 ] ( main:2::init_screen:8 [ init_screen::b#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc b
|
||||
@ -6600,8 +6600,8 @@ init_screen: {
|
||||
//SEG350 init_screen::@2
|
||||
b2:
|
||||
//SEG351 [187] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word) 20 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
//SEG352 [188] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 [ init_screen::c#1 ] ( main:2::init_screen:8 [ init_screen::c#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc c
|
||||
@ -6690,7 +6690,7 @@ Removing instruction lda yd
|
||||
Removing instruction ldy #0
|
||||
Removing instruction lda #>0
|
||||
Replacing instruction ldx #0 with TAX
|
||||
Replacing instruction lda #0 with TYA
|
||||
Replacing instruction ldy #0 with TAY
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label b1_from_b5 with b1
|
||||
Replacing label b1_from_b3 with b1
|
||||
@ -7519,9 +7519,9 @@ line_ydxi: {
|
||||
//SEG183 [93] (byte) line_ydxi::y#2 ← (byte) line_ydxi::y#3 + (byte/signed byte/word/signed word) 1 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::e#3 line_ydxi::y#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG184 [94] (byte) line_ydxi::e#1 ← (byte) line_ydxi::e#3 + (byte) line_ydxi::xd#2 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
//SEG185 [95] if((byte) line_ydxi::yd#5>=(byte) line_ydxi::e#1) goto line_ydxi::@2 [ line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ( main:2::lines:12::line:21::line_ydxi:42 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] main:2::lines:12::line:21::line_ydxi:86 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#2 line_ydxi::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda yd
|
||||
@ -7617,9 +7617,9 @@ line_xdyi: {
|
||||
//SEG220 [116] (byte) line_xdyi::x#2 ← (byte) line_xdyi::x#3 + (byte/signed byte/word/signed word) 1 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::e#3 line_xdyi::x#2 ] ) -- vbuxx=vbuxx_plus_1
|
||||
inx
|
||||
//SEG221 [117] (byte) line_xdyi::e#1 ← (byte) line_xdyi::e#3 + (byte) line_xdyi::yd#2 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
//SEG222 [118] if((byte) line_xdyi::xd#5>=(byte) line_xdyi::e#1) goto line_xdyi::@2 [ line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ( main:2::lines:12::line:21::line_xdyi:35 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] main:2::lines:12::line:21::line_xdyi:80 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::y#3 line_xdyi::x#2 line_xdyi::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda xd
|
||||
@ -7680,9 +7680,9 @@ line_ydxd: {
|
||||
//SEG248 [131] (byte) line_ydxd::y#2 ← (byte) line_ydxd::y#3 + (byte/signed byte/word/signed word) 1 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::e#3 line_ydxd::y#2 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc y
|
||||
//SEG249 [132] (byte) line_ydxd::e#1 ← (byte) line_ydxd::e#3 + (byte) line_ydxd::xd#2 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda xd
|
||||
clc
|
||||
adc xd
|
||||
adc e
|
||||
sta e
|
||||
//SEG250 [133] if((byte) line_ydxd::yd#5>=(byte) line_ydxd::e#1) goto line_ydxd::@2 [ line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ( main:2::lines:12::line:21::line_ydxd:56 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] main:2::lines:12::line:21::line_ydxd:72 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#2 line_ydxd::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda yd
|
||||
@ -7743,9 +7743,9 @@ line_xdyd: {
|
||||
//SEG276 [146] (byte) line_xdyd::x#2 ← (byte) line_xdyd::x#3 + (byte/signed byte/word/signed word) 1 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::e#3 line_xdyd::x#2 ] ) -- vbuxx=vbuxx_plus_1
|
||||
inx
|
||||
//SEG277 [147] (byte) line_xdyd::e#1 ← (byte) line_xdyd::e#3 + (byte) line_xdyd::yd#2 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda e
|
||||
lda yd
|
||||
clc
|
||||
adc yd
|
||||
adc e
|
||||
sta e
|
||||
//SEG278 [148] if((byte) line_xdyd::xd#5>=(byte) line_xdyd::e#1) goto line_xdyd::@2 [ line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ( main:2::lines:12::line:21::line_xdyd:50 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] main:2::lines:12::line:21::line_xdyd:66 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::y#3 line_xdyd::x#2 line_xdyd::e#1 ] ) -- vbuz1_ge_vbuz2_then_la1
|
||||
lda xd
|
||||
@ -7891,8 +7891,8 @@ init_screen: {
|
||||
//SEG342 init_screen::@1
|
||||
b1:
|
||||
//SEG343 [183] *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
tya
|
||||
lda #0
|
||||
tay
|
||||
sta (b),y
|
||||
//SEG344 [184] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 [ init_screen::b#1 ] ( main:2::init_screen:8 [ init_screen::b#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc b
|
||||
@ -7917,8 +7917,8 @@ init_screen: {
|
||||
//SEG350 init_screen::@2
|
||||
b2:
|
||||
//SEG351 [187] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word) 20 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
//SEG352 [188] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 [ init_screen::c#1 ] ( main:2::init_screen:8 [ init_screen::c#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc c
|
||||
|
@ -138,8 +138,8 @@ init_screen: {
|
||||
lda #>BITMAP
|
||||
sta b+1
|
||||
b1:
|
||||
ldy #0
|
||||
tya
|
||||
lda #0
|
||||
tay
|
||||
sta (b),y
|
||||
inc b
|
||||
bne !+
|
||||
@ -156,8 +156,8 @@ init_screen: {
|
||||
lda #>SCREEN
|
||||
sta c+1
|
||||
b2:
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
inc c
|
||||
bne !+
|
||||
|
@ -1904,10 +1904,10 @@ plot: {
|
||||
lda plot_yhi,x
|
||||
sta _8
|
||||
//SEG50 [30] (word) plot::plotter_y#1 ← (byte/signed byte/word/signed word) 0 hi= (byte~) plot::$8 [ plot::x#0 plot::y#0 plot::plotter_x#2 plot::plotter_y#1 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::y#0 plot::plotter_x#2 plot::plotter_y#1 ] ) -- vwuz1=vbuc1_sethi_vbuz2
|
||||
lda #0
|
||||
sta plotter_y
|
||||
lda _8
|
||||
sta plotter_y+1
|
||||
lda #<0
|
||||
sta plotter_y
|
||||
//SEG51 [31] (byte~) plot::$9 ← *((const byte[256]) plot_ylo#0 + (byte) plot::y#0) [ plot::x#0 plot::plotter_x#2 plot::plotter_y#1 plot::$9 ] ( main:2::plots:13::plot:21 [ plots::i#2 plot::x#0 plot::plotter_x#2 plot::plotter_y#1 plot::$9 ] ) -- vbuz1=pbuc1_derefidx_vbuz2
|
||||
ldx y
|
||||
lda plot_ylo,x
|
||||
@ -1932,8 +1932,8 @@ plot: {
|
||||
ora plot_bit,x
|
||||
sta _5
|
||||
//SEG55 [35] *((byte*) plot::plotter#0) ← (byte~) plot::$5 [ ] ( main:2::plots:13::plot:21 [ plots::i#2 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda _5
|
||||
ldy #0
|
||||
sta (plotter),y
|
||||
jmp breturn
|
||||
//SEG56 plot::@return
|
||||
@ -2108,8 +2108,8 @@ init_screen: {
|
||||
//SEG110 init_screen::@1
|
||||
b1:
|
||||
//SEG111 [65] *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (b),y
|
||||
//SEG112 [66] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 [ init_screen::b#1 ] ( main:2::init_screen:8 [ init_screen::b#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc b
|
||||
@ -2138,8 +2138,8 @@ init_screen: {
|
||||
//SEG118 init_screen::@2
|
||||
b2:
|
||||
//SEG119 [69] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word) 20 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
//SEG120 [70] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 [ init_screen::c#1 ] ( main:2::init_screen:8 [ init_screen::c#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc c
|
||||
@ -2590,8 +2590,8 @@ init_screen: {
|
||||
//SEG110 init_screen::@1
|
||||
b1:
|
||||
//SEG111 [65] *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #0
|
||||
ldy #0
|
||||
sta (b),y
|
||||
//SEG112 [66] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 [ init_screen::b#1 ] ( main:2::init_screen:8 [ init_screen::b#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc b
|
||||
@ -2620,8 +2620,8 @@ init_screen: {
|
||||
//SEG118 init_screen::@2
|
||||
b2:
|
||||
//SEG119 [69] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word) 20 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
//SEG120 [70] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 [ init_screen::c#1 ] ( main:2::init_screen:8 [ init_screen::c#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc c
|
||||
@ -2677,7 +2677,7 @@ Removing instruction ldx i
|
||||
Removing instruction ldy #0
|
||||
Removing instruction lda #>0
|
||||
Replacing instruction ldx #0 with TAX
|
||||
Replacing instruction lda #0 with TYA
|
||||
Replacing instruction ldy #0 with TAY
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label b1_from_b3 with b1
|
||||
Replacing label b10_from_b1 with b10
|
||||
@ -3125,8 +3125,8 @@ init_screen: {
|
||||
//SEG110 init_screen::@1
|
||||
b1:
|
||||
//SEG111 [65] *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word) 0 [ init_screen::b#2 ] ( main:2::init_screen:8 [ init_screen::b#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
tya
|
||||
lda #0
|
||||
tay
|
||||
sta (b),y
|
||||
//SEG112 [66] (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 [ init_screen::b#1 ] ( main:2::init_screen:8 [ init_screen::b#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc b
|
||||
@ -3151,8 +3151,8 @@ init_screen: {
|
||||
//SEG118 init_screen::@2
|
||||
b2:
|
||||
//SEG119 [69] *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word) 20 [ init_screen::c#2 ] ( main:2::init_screen:8 [ init_screen::c#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #$14
|
||||
ldy #0
|
||||
sta (c),y
|
||||
//SEG120 [70] (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 [ init_screen::c#1 ] ( main:2::init_screen:8 [ init_screen::c#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc c
|
||||
|
@ -21,8 +21,8 @@ main: {
|
||||
lda #>SCREEN+4*$28+4
|
||||
sta cursor+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #STAR
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
inc x
|
||||
inc cursor
|
||||
|
@ -640,8 +640,8 @@ main: {
|
||||
//SEG20 main::@1
|
||||
b1:
|
||||
//SEG21 [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #STAR
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG22 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word) 1 [ main::cursor#3 main::e#3 main::y#2 main::x#1 ] ( main:2 [ main::cursor#3 main::e#3 main::y#2 main::x#1 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
@ -788,8 +788,8 @@ main: {
|
||||
//SEG20 main::@1
|
||||
b1:
|
||||
//SEG21 [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #STAR
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG22 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word) 1 [ main::cursor#3 main::e#3 main::y#2 main::x#1 ] ( main:2 [ main::cursor#3 main::e#3 main::y#2 main::x#1 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
@ -968,8 +968,8 @@ main: {
|
||||
//SEG20 main::@1
|
||||
b1:
|
||||
//SEG21 [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ( main:2 [ main::cursor#3 main::x#2 main::e#3 main::y#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #STAR
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG22 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word) 1 [ main::cursor#3 main::e#3 main::y#2 main::x#1 ] ( main:2 [ main::cursor#3 main::e#3 main::y#2 main::x#1 ] ) -- vbuz1=vbuz1_plus_1
|
||||
inc x
|
||||
|
@ -46,9 +46,9 @@ main: {
|
||||
clc
|
||||
adc #<$28
|
||||
sta idx
|
||||
bcc !+
|
||||
inc idx+1
|
||||
!:
|
||||
lda idx+1
|
||||
adc #>$28
|
||||
sta idx+1
|
||||
tya
|
||||
sec
|
||||
sbc #xd
|
||||
|
@ -659,9 +659,9 @@ main: {
|
||||
clc
|
||||
adc #<$28
|
||||
sta idx
|
||||
bcc !+
|
||||
inc idx+1
|
||||
!:
|
||||
lda idx+1
|
||||
adc #>$28
|
||||
sta idx+1
|
||||
//SEG29 [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) -- vbuz1=vbuz1_minus_vbuc1
|
||||
lda e
|
||||
sec
|
||||
@ -708,10 +708,10 @@ REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [main] 55: zp ZP_BYTE:5 [ main::e#3 main::e#5 main::e#1 main::e#2 ] 46.75: zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] 29.33: zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] 14.67: zp ZP_BYTE:4 [ main::x#2 main::x#1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [main] best 1238 combination reg byte y [ main::e#3 main::e#5 main::e#1 main::e#2 ] zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] reg byte x [ main::x#2 main::x#1 ]
|
||||
Uplifting [] best 1238 combination
|
||||
Uplifting [main] best 1243 combination reg byte y [ main::e#3 main::e#5 main::e#1 main::e#2 ] zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ] reg byte x [ main::x#2 main::x#1 ]
|
||||
Uplifting [] best 1243 combination
|
||||
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Uplifting [main] best 1238 combination zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Uplifting [main] best 1243 combination zp ZP_BYTE:6 [ main::y#2 main::y#4 main::y#1 ]
|
||||
Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:4 [ main::y#2 main::y#4 main::y#1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
@ -806,9 +806,9 @@ main: {
|
||||
clc
|
||||
adc #<$28
|
||||
sta idx
|
||||
bcc !+
|
||||
inc idx+1
|
||||
!:
|
||||
lda idx+1
|
||||
adc #>$28
|
||||
sta idx+1
|
||||
//SEG29 [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) -- vbuyy=vbuyy_minus_vbuc1
|
||||
tya
|
||||
sec
|
||||
@ -910,7 +910,7 @@ zp ZP_BYTE:4 [ main::y#2 main::y#4 main::y#1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 1082
|
||||
Score: 1087
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
@ -989,9 +989,9 @@ main: {
|
||||
clc
|
||||
adc #<$28
|
||||
sta idx
|
||||
bcc !+
|
||||
inc idx+1
|
||||
!:
|
||||
lda idx+1
|
||||
adc #>$28
|
||||
sta idx+1
|
||||
//SEG29 [13] (byte) main::e#2 ← (byte) main::e#1 - (const byte) main::xd#0 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ( main:2 [ main::x#1 main::y#1 main::idx#2 main::e#2 ] ) -- vbuyy=vbuyy_minus_vbuc1
|
||||
tya
|
||||
sec
|
||||
|
@ -462,8 +462,8 @@ line: {
|
||||
//SEG28 line::@1
|
||||
b1:
|
||||
//SEG29 [11] *((byte*) screen#10) ← (byte) line::x#2 [ line::x1#3 line::x#2 screen#10 ] ( main:2::line:5 [ line::x1#3 line::x#2 screen#10 ] main:2::line:7 [ line::x1#3 line::x#2 screen#10 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda x
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
//SEG30 [12] (byte*) screen#11 ← ++ (byte*) screen#10 [ line::x1#3 screen#11 line::x#2 ] ( main:2::line:5 [ line::x1#3 screen#11 line::x#2 ] main:2::line:7 [ line::x1#3 screen#11 line::x#2 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc screen
|
||||
|
@ -711,8 +711,8 @@ main: {
|
||||
//SEG36 main::@3
|
||||
b3:
|
||||
//SEG37 [13] *((byte*) main::sc#3) ← (byte) main::c#2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ( main:2 [ main::y#2 main::bits#2 main::sc#3 main::x#2 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda c
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG38 [14] (byte*) main::sc#1 ← ++ (byte*) main::sc#3 [ main::y#2 main::bits#2 main::x#2 main::sc#1 ] ( main:2 [ main::y#2 main::bits#2 main::x#2 main::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
|
@ -237,8 +237,8 @@ print_cls: {
|
||||
lda #>$400
|
||||
sta sc+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inc sc
|
||||
bne !+
|
||||
|
@ -2897,8 +2897,8 @@ print_cls: {
|
||||
//SEG178 print_cls::@1
|
||||
b1:
|
||||
//SEG179 [70] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG180 [71] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -3519,8 +3519,8 @@ print_cls: {
|
||||
//SEG178 print_cls::@1
|
||||
b1:
|
||||
//SEG179 [70] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG180 [71] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -4202,8 +4202,8 @@ print_cls: {
|
||||
//SEG178 print_cls::@1
|
||||
b1:
|
||||
//SEG179 [70] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG180 [71] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
|
@ -1602,8 +1602,8 @@ main: {
|
||||
asl
|
||||
sta bits_gen_7
|
||||
//SEG73 [48] *((byte*) main::charset4#10) ← (byte) main::bits_gen#7 [ main::chargen#10 main::charset4#10 ] ( main:2 [ main::chargen#10 main::charset4#10 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda bits_gen_7
|
||||
ldy #0
|
||||
sta (charset4),y
|
||||
//SEG74 [49] (byte*) main::charset4#1 ← ++ (byte*) main::charset4#10 [ main::chargen#10 main::charset4#1 ] ( main:2 [ main::chargen#10 main::charset4#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc charset4
|
||||
|
@ -85,8 +85,8 @@ print_cls: {
|
||||
lda #>$400
|
||||
sta sc+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inc sc
|
||||
bne !+
|
||||
|
@ -1177,8 +1177,8 @@ print_cls: {
|
||||
//SEG63 print_cls::@1
|
||||
b1:
|
||||
//SEG64 [29] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG65 [30] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -1431,8 +1431,8 @@ print_cls: {
|
||||
//SEG63 print_cls::@1
|
||||
b1:
|
||||
//SEG64 [29] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG65 [30] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -1705,8 +1705,8 @@ print_cls: {
|
||||
//SEG63 print_cls::@1
|
||||
b1:
|
||||
//SEG64 [29] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG65 [30] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
|
@ -16,8 +16,8 @@ main: {
|
||||
lda his,y
|
||||
sta w+1
|
||||
stx w
|
||||
ldy #0
|
||||
lda #'*'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inx
|
||||
cpx #8
|
||||
|
@ -420,8 +420,8 @@ main: {
|
||||
lda w+1
|
||||
sta sc+1
|
||||
//SEG22 [9] *((byte*) main::sc#0) ← (byte) '*' [ main::h#4 main::l#2 ] ( main:2 [ main::h#4 main::l#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #'*'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG23 [10] (byte) main::l#1 ← ++ (byte) main::l#2 [ main::h#4 main::l#1 ] ( main:2 [ main::h#4 main::l#1 ] ) -- vbuz1=_inc_vbuz1
|
||||
inc l
|
||||
@ -540,8 +540,8 @@ main: {
|
||||
stx w
|
||||
//SEG21 [8] (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 [ main::h#4 main::l#2 main::sc#0 ] ( main:2 [ main::h#4 main::l#2 main::sc#0 ] ) -- pbuz1=_ptrby_vwuz1
|
||||
//SEG22 [9] *((byte*) main::sc#0) ← (byte) '*' [ main::h#4 main::l#2 ] ( main:2 [ main::h#4 main::l#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #'*'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG23 [10] (byte) main::l#1 ← ++ (byte) main::l#2 [ main::h#4 main::l#1 ] ( main:2 [ main::h#4 main::l#1 ] ) -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
@ -666,8 +666,8 @@ main: {
|
||||
stx w
|
||||
//SEG21 [8] (byte*) main::sc#0 ← ((byte*)) (word) main::w#0 [ main::h#4 main::l#2 main::sc#0 ] ( main:2 [ main::h#4 main::l#2 main::sc#0 ] ) -- pbuz1=_ptrby_vwuz1
|
||||
//SEG22 [9] *((byte*) main::sc#0) ← (byte) '*' [ main::h#4 main::l#2 ] ( main:2 [ main::h#4 main::l#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #'*'
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG23 [10] (byte) main::l#1 ← ++ (byte) main::l#2 [ main::h#4 main::l#1 ] ( main:2 [ main::h#4 main::l#1 ] ) -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
|
@ -325,9 +325,9 @@ main: {
|
||||
//SEG18 main::@3
|
||||
b3:
|
||||
//SEG19 [7] (byte) main::s#1 ← (byte) main::s#2 + (byte) main::i#2 [ main::i#2 main::s#1 ] ( main:2 [ main::i#2 main::s#1 ] ) -- vbuz1=vbuz1_plus_vbuz2
|
||||
lda s
|
||||
lda i
|
||||
clc
|
||||
adc i
|
||||
adc s
|
||||
sta s
|
||||
//SEG20 [8] phi from main::@1 main::@3 to main::@2 [phi:main::@1/main::@3->main::@2]
|
||||
b2_from_b1:
|
||||
|
@ -22,8 +22,8 @@ lvaluevar: {
|
||||
bcc b2
|
||||
rts
|
||||
b2:
|
||||
ldy #0
|
||||
lda #b
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
inc screen
|
||||
bne !+
|
||||
|
@ -929,8 +929,8 @@ lvaluevar: {
|
||||
//SEG33 lvaluevar::@2
|
||||
b2:
|
||||
//SEG34 [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #b
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
//SEG35 [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::i#2 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc screen
|
||||
@ -1178,8 +1178,8 @@ lvaluevar: {
|
||||
//SEG33 lvaluevar::@2
|
||||
b2:
|
||||
//SEG34 [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #b
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
//SEG35 [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::i#2 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc screen
|
||||
@ -1462,8 +1462,8 @@ lvaluevar: {
|
||||
//SEG33 lvaluevar::@2
|
||||
b2:
|
||||
//SEG34 [17] *((byte*) lvaluevar::screen#2) ← (const byte) lvaluevar::b#0 [ lvaluevar::i#2 lvaluevar::screen#2 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #b
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
//SEG35 [18] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::i#2 lvaluevar::screen#1 ] ( main:2::lvaluevar:11 [ lvaluevar::i#2 lvaluevar::screen#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc screen
|
||||
|
@ -64,8 +64,8 @@ fillscreen: {
|
||||
lda #>SCREEN
|
||||
sta cursor+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
inc cursor
|
||||
bne !+
|
||||
|
@ -1212,8 +1212,8 @@ fillscreen: {
|
||||
//SEG66 fillscreen::@1
|
||||
b1:
|
||||
//SEG67 [29] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG68 [30] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc cursor
|
||||
@ -1445,8 +1445,8 @@ fillscreen: {
|
||||
//SEG66 fillscreen::@1
|
||||
b1:
|
||||
//SEG67 [29] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG68 [30] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc cursor
|
||||
@ -1727,8 +1727,8 @@ fillscreen: {
|
||||
//SEG66 fillscreen::@1
|
||||
b1:
|
||||
//SEG67 [29] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG68 [30] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc cursor
|
||||
|
@ -169,8 +169,8 @@ fillscreen: {
|
||||
lda #>SCREEN
|
||||
sta cursor+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
inc cursor
|
||||
bne !+
|
||||
|
@ -2773,12 +2773,12 @@ scroll_bit: {
|
||||
rol
|
||||
sta c+1
|
||||
//SEG66 [29] (byte*) current_chargen#5 ← (const byte*) CHARGEN#0 + (word~) scroll_bit::$4 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:17 [ current_chargen#5 nxt#19 ] ) -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda #<CHARGEN
|
||||
lda _4
|
||||
clc
|
||||
adc _4
|
||||
adc #<CHARGEN
|
||||
sta current_chargen
|
||||
lda #>CHARGEN
|
||||
adc _4+1
|
||||
lda _4+1
|
||||
adc #>CHARGEN
|
||||
sta current_chargen+1
|
||||
//SEG67 [30] phi from scroll_bit::@8 to scroll_bit::@1 [phi:scroll_bit::@8->scroll_bit::@1]
|
||||
b1_from_b8:
|
||||
@ -2857,8 +2857,8 @@ scroll_bit: {
|
||||
//SEG97 scroll_bit::@3
|
||||
b3:
|
||||
//SEG98 [40] *((byte*) scroll_bit::sc#2) ← (byte) scroll_bit::b#2 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ( main:2::scroll_soft:10::scroll_bit:17 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda b
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG99 [41] (byte*) scroll_bit::sc#1 ← (byte*) scroll_bit::sc#2 + (byte/signed byte/word/signed word) 40 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ( main:2::scroll_soft:10::scroll_bit:17 [ current_bit#21 nxt#36 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ) -- pbuz1=pbuz1_plus_vbuc1
|
||||
lda sc
|
||||
@ -3020,8 +3020,8 @@ fillscreen: {
|
||||
//SEG145 fillscreen::@1
|
||||
b1:
|
||||
//SEG146 [68] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG147 [69] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc cursor
|
||||
@ -3535,8 +3535,8 @@ fillscreen: {
|
||||
//SEG145 fillscreen::@1
|
||||
b1:
|
||||
//SEG146 [68] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG147 [69] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc cursor
|
||||
@ -4112,8 +4112,8 @@ fillscreen: {
|
||||
//SEG145 fillscreen::@1
|
||||
b1:
|
||||
//SEG146 [68] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #fill
|
||||
ldy #0
|
||||
sta (cursor),y
|
||||
//SEG147 [69] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] ( main:2::fillscreen:5 [ fillscreen::cursor#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc cursor
|
||||
|
@ -189,8 +189,8 @@ init: {
|
||||
lda #>SCREEN
|
||||
sta sc+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inc sc
|
||||
bne !+
|
||||
|
@ -1817,8 +1817,8 @@ init: {
|
||||
//SEG87 init::@1
|
||||
b1:
|
||||
//SEG88 [42] *((byte*) init::sc#2) ← (byte) ' ' [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG89 [43] (byte*) init::sc#1 ← ++ (byte*) init::sc#2 [ init::sc#1 ] ( main:2::init:5 [ init::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -2277,8 +2277,8 @@ init: {
|
||||
//SEG87 init::@1
|
||||
b1:
|
||||
//SEG88 [42] *((byte*) init::sc#2) ← (byte) ' ' [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG89 [43] (byte*) init::sc#1 ← ++ (byte*) init::sc#2 [ init::sc#1 ] ( main:2::init:5 [ init::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -2776,8 +2776,8 @@ init: {
|
||||
//SEG87 init::@1
|
||||
b1:
|
||||
//SEG88 [42] *((byte*) init::sc#2) ← (byte) ' ' [ init::sc#2 ] ( main:2::init:5 [ init::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG89 [43] (byte*) init::sc#1 ← ++ (byte*) init::sc#2 [ init::sc#1 ] ( main:2::init:5 [ init::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
|
@ -2974,8 +2974,8 @@ print_byte: {
|
||||
print_char: {
|
||||
.label ch = 6
|
||||
//SEG122 [57] *((byte*) char_cursor#23) ← (byte) print_char::ch#2 [ char_cursor#23 ] ( main:2::print_word:31::print_byte:44::print_char:51 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:46::print_char:51 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#23 ] main:2::print_word:31::print_byte:44::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#23 ] main:2::print_word:31::print_byte:46::print_char:54 [ main::i#10 line_cursor#13 char_cursor#23 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda ch
|
||||
ldy #0
|
||||
sta (char_cursor),y
|
||||
//SEG123 [58] (byte*) char_cursor#10 ← ++ (byte*) char_cursor#23 [ char_cursor#10 ] ( main:2::print_word:31::print_byte:44::print_char:51 [ main::i#10 line_cursor#13 print_word::w#0 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:46::print_char:51 [ main::i#10 line_cursor#13 print_byte::b#2 char_cursor#10 ] main:2::print_word:31::print_byte:44::print_char:54 [ main::i#10 line_cursor#13 print_word::w#0 char_cursor#10 ] main:2::print_word:31::print_byte:46::print_char:54 [ main::i#10 line_cursor#13 char_cursor#10 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc char_cursor
|
||||
|
@ -171,8 +171,8 @@ clear_screen: {
|
||||
lda #>SCREEN
|
||||
sta sc+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inc sc
|
||||
bne !+
|
||||
|
@ -6630,8 +6630,8 @@ clear_screen: {
|
||||
//SEG148 clear_screen::@1
|
||||
b1:
|
||||
//SEG149 [69] *((byte*) clear_screen::sc#2) ← (byte) ' ' [ clear_screen::sc#2 ] ( main:2::init:5::clear_screen:46 [ clear_screen::sc#2 ] main:2::init:5::clear_screen:65 [ clear_screen::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG150 [70] (byte*) clear_screen::sc#1 ← ++ (byte*) clear_screen::sc#2 [ clear_screen::sc#1 ] ( main:2::init:5::clear_screen:46 [ clear_screen::sc#1 ] main:2::init:5::clear_screen:65 [ clear_screen::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -7322,12 +7322,12 @@ gen_chargen_sprite: {
|
||||
rol
|
||||
sta _0+1
|
||||
//SEG374 [184] (byte*) gen_chargen_sprite::chargen#0 ← (const byte*) CHARGEN#0 + (word~) gen_chargen_sprite::$1 [ gen_chargen_sprite::sprite#0 gen_chargen_sprite::chargen#0 ] ( main:2::init:5::gen_sprites:55::gen_chargen_sprite:177 [ gen_sprites::i#2 gen_sprites::spr#2 gen_chargen_sprite::sprite#0 gen_chargen_sprite::chargen#0 ] ) -- pbuz1=pbuc1_plus_vwuz2
|
||||
lda #<CHARGEN
|
||||
lda _1
|
||||
clc
|
||||
adc _1
|
||||
adc #<CHARGEN
|
||||
sta chargen
|
||||
lda #>CHARGEN
|
||||
adc _1+1
|
||||
lda _1+1
|
||||
adc #>CHARGEN
|
||||
sta chargen+1
|
||||
//SEG375 asm { sei }
|
||||
sei
|
||||
@ -8379,8 +8379,8 @@ clear_screen: {
|
||||
//SEG148 clear_screen::@1
|
||||
b1:
|
||||
//SEG149 [69] *((byte*) clear_screen::sc#2) ← (byte) ' ' [ clear_screen::sc#2 ] ( main:2::init:5::clear_screen:46 [ clear_screen::sc#2 ] main:2::init:5::clear_screen:65 [ clear_screen::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG150 [70] (byte*) clear_screen::sc#1 ← ++ (byte*) clear_screen::sc#2 [ clear_screen::sc#1 ] ( main:2::init:5::clear_screen:46 [ clear_screen::sc#1 ] main:2::init:5::clear_screen:65 [ clear_screen::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
@ -10278,8 +10278,8 @@ clear_screen: {
|
||||
//SEG148 clear_screen::@1
|
||||
b1:
|
||||
//SEG149 [69] *((byte*) clear_screen::sc#2) ← (byte) ' ' [ clear_screen::sc#2 ] ( main:2::init:5::clear_screen:46 [ clear_screen::sc#2 ] main:2::init:5::clear_screen:65 [ clear_screen::sc#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
//SEG150 [70] (byte*) clear_screen::sc#1 ← ++ (byte*) clear_screen::sc#2 [ clear_screen::sc#1 ] ( main:2::init:5::clear_screen:46 [ clear_screen::sc#1 ] main:2::init:5::clear_screen:65 [ clear_screen::sc#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc sc
|
||||
|
@ -741,8 +741,8 @@ print_cls: {
|
||||
lda #>$400
|
||||
sta sc+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #' '
|
||||
ldy #0
|
||||
sta (sc),y
|
||||
inc sc
|
||||
bne !+
|
||||
|
File diff suppressed because one or more lines are too long
@ -183,8 +183,8 @@ initscreen: {
|
||||
lda #>SCREEN
|
||||
sta screen+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #FILL
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
inc screen
|
||||
bne !+
|
||||
|
@ -2463,8 +2463,8 @@ initscreen: {
|
||||
//SEG148 initscreen::@1
|
||||
b1:
|
||||
//SEG149 [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #FILL
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
//SEG150 [81] (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#2 [ initscreen::screen#1 ] ( main:2::initscreen:5 [ initscreen::screen#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc screen
|
||||
@ -3049,8 +3049,8 @@ initscreen: {
|
||||
//SEG148 initscreen::@1
|
||||
b1:
|
||||
//SEG149 [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #FILL
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
//SEG150 [81] (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#2 [ initscreen::screen#1 ] ( main:2::initscreen:5 [ initscreen::screen#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc screen
|
||||
@ -3658,8 +3658,8 @@ initscreen: {
|
||||
//SEG148 initscreen::@1
|
||||
b1:
|
||||
//SEG149 [80] *((byte*) initscreen::screen#2) ← (const byte) FILL#0 [ initscreen::screen#2 ] ( main:2::initscreen:5 [ initscreen::screen#2 ] ) -- _deref_pbuz1=vbuc1
|
||||
ldy #0
|
||||
lda #FILL
|
||||
ldy #0
|
||||
sta (screen),y
|
||||
//SEG150 [81] (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#2 [ initscreen::screen#1 ] ( main:2::initscreen:5 [ initscreen::screen#1 ] ) -- pbuz1=_inc_pbuz1
|
||||
inc screen
|
||||
|
@ -32,8 +32,8 @@ main: {
|
||||
}
|
||||
sum2: {
|
||||
.label c = 2
|
||||
stx $ff
|
||||
tya
|
||||
stx $ff
|
||||
clc
|
||||
adc $ff
|
||||
clc
|
||||
@ -42,8 +42,8 @@ sum2: {
|
||||
}
|
||||
sum: {
|
||||
.label c = 2
|
||||
stx $ff
|
||||
tya
|
||||
stx $ff
|
||||
clc
|
||||
adc $ff
|
||||
clc
|
||||
|
@ -917,8 +917,8 @@ main: {
|
||||
sum2: {
|
||||
.label c = 2
|
||||
//SEG36 [23] (byte/word~) sum2::$0 ← (byte) sum2::a#0 + (byte) sum2::b#0 [ sum2::c#0 sum2::$0 ] ( main:2::sum2:16 [ main::i#2 sum2::c#0 sum2::$0 ] ) -- vbuaa=vbuxx_plus_vbuyy
|
||||
stx $ff
|
||||
tya
|
||||
stx $ff
|
||||
clc
|
||||
adc $ff
|
||||
//SEG37 [24] (byte) sum2::return#1 ← (byte/word~) sum2::$0 + (byte) sum2::c#0 [ sum2::return#1 ] ( main:2::sum2:16 [ main::i#2 sum2::return#1 ] ) -- vbuaa=vbuaa_plus_vbuz1
|
||||
@ -934,8 +934,8 @@ sum2: {
|
||||
sum: {
|
||||
.label c = 2
|
||||
//SEG41 [26] (byte/word~) sum::$0 ← (byte) sum::a#0 + (byte) sum::b#0 [ sum::c#0 sum::$0 ] ( main:2::sum:9 [ main::i#2 sum::c#0 sum::$0 ] ) -- vbuaa=vbuxx_plus_vbuyy
|
||||
stx $ff
|
||||
tya
|
||||
stx $ff
|
||||
clc
|
||||
adc $ff
|
||||
//SEG42 [27] (byte) sum::return#1 ← (byte/word~) sum::$0 + (byte) sum::c#0 [ sum::return#1 ] ( main:2::sum:9 [ main::i#2 sum::return#1 ] ) -- vbuaa=vbuaa_plus_vbuz1
|
||||
@ -1116,8 +1116,8 @@ main: {
|
||||
sum2: {
|
||||
.label c = 2
|
||||
//SEG36 [23] (byte/word~) sum2::$0 ← (byte) sum2::a#0 + (byte) sum2::b#0 [ sum2::c#0 sum2::$0 ] ( main:2::sum2:16 [ main::i#2 sum2::c#0 sum2::$0 ] ) -- vbuaa=vbuxx_plus_vbuyy
|
||||
stx $ff
|
||||
tya
|
||||
stx $ff
|
||||
clc
|
||||
adc $ff
|
||||
//SEG37 [24] (byte) sum2::return#1 ← (byte/word~) sum2::$0 + (byte) sum2::c#0 [ sum2::return#1 ] ( main:2::sum2:16 [ main::i#2 sum2::return#1 ] ) -- vbuaa=vbuaa_plus_vbuz1
|
||||
@ -1131,8 +1131,8 @@ sum2: {
|
||||
sum: {
|
||||
.label c = 2
|
||||
//SEG41 [26] (byte/word~) sum::$0 ← (byte) sum::a#0 + (byte) sum::b#0 [ sum::c#0 sum::$0 ] ( main:2::sum:9 [ main::i#2 sum::c#0 sum::$0 ] ) -- vbuaa=vbuxx_plus_vbuyy
|
||||
stx $ff
|
||||
tya
|
||||
stx $ff
|
||||
clc
|
||||
adc $ff
|
||||
//SEG42 [27] (byte) sum::return#1 ← (byte/word~) sum::$0 + (byte) sum::c#0 [ sum::return#1 ] ( main:2::sum:9 [ main::i#2 sum::return#1 ] ) -- vbuaa=vbuaa_plus_vbuz1
|
||||
|
@ -518,8 +518,8 @@ main: {
|
||||
adc zpptr2+1
|
||||
sta w+1
|
||||
//SEG28 [11] *((byte*) main::zpptr2#1) ← (byte) main::k#2 [ main::j#6 main::i#4 main::k#2 ] ( main:2 [ main::j#6 main::i#4 main::k#2 ] ) -- _deref_pbuz1=vbuz2
|
||||
ldy #0
|
||||
lda k
|
||||
ldy #0
|
||||
sta (zpptr2_1),y
|
||||
//SEG29 [12] (byte) main::k#1 ← ++ (byte) main::k#2 [ main::j#6 main::i#4 main::k#1 ] ( main:2 [ main::j#6 main::i#4 main::k#1 ] ) -- vbuz1=_inc_vbuz1
|
||||
inc k
|
||||
|
Loading…
Reference in New Issue
Block a user