1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-05-29 03:41:40 +00:00

Implemented #platform target() functionality configured by a TGT-file in JSON.

This commit is contained in:
jespergravgaard 2020-05-11 02:36:37 +02:00
parent f2ece49ded
commit 239cfdb48e
661 changed files with 2222 additions and 3341 deletions

View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: javax.json:javax.json-api:1.1.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/json/javax.json-api/1.1.4/javax.json-api-1.1.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/json/javax.json-api/1.1.4/javax.json-api-1.1.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/json/javax.json-api/1.1.4/javax.json-api-1.1.4-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.glassfish:javax.json:1.0.4">
<library name="Maven: org.glassfish:javax.json:1.1.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/javax.json/1.0.4/javax.json-1.0.4.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/javax.json/1.1.4/javax.json-1.1.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/javax.json/1.0.4/javax.json-1.0.4-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/javax.json/1.1.4/javax.json-1.1.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/javax.json/1.0.4/javax.json-1.0.4-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/javax.json/1.1.4/javax.json-1.1.4-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -17,12 +17,13 @@
<orderEntry type="library" scope="PROVIDED" name="Maven: org.antlr:antlr-runtime:3.5.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.antlr:ST4:4.0.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.abego.treelayout:org.abego.treelayout.core:1.0.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.glassfish:javax.json:1.0.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.ibm.icu:icu4j:58.2" level="project" />
<orderEntry type="library" name="Maven: org.antlr:antlr4-runtime:4.7.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: cml.kickass:kickassembler:5.14" level="project" />
<orderEntry type="library" name="Maven: info.picocli:picocli:4.2.0" level="project" />
<orderEntry type="library" name="Maven: javax.json:javax.json-api:1.1.4" level="project" />
<orderEntry type="library" name="Maven: org.glassfish:javax.json:1.1.4" level="project" />
</component>
</module>

10
pom.xml
View File

@ -51,6 +51,16 @@
<artifactId>picocli</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.1.4</version>
</dependency>
</dependencies>
<build>

View File

@ -17,7 +17,6 @@
<includes>
<include>*.c</include>
<include>*.h</include>
<include>*.ld</include>
</includes>
</fileSet>
<fileSet>
@ -26,6 +25,13 @@
<includes>
<include>*.c</include>
<include>*.h</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/kc/target</directory>
<outputDirectory>target</outputDirectory>
<includes>
<include>*.tgt</include>
<include>*.ld</include>
</includes>
</fileSet>

View File

@ -43,9 +43,6 @@ public class Compiler {
*/
private boolean enableLoopHeadConstant = false;
/** File name of link script to use (from command line parameter). */
private String linkScriptFileName;
/** Variable optimization/memory area configuration to use (from command line parameter). */
private VariableBuilderConfig variableBuilderConfig;
@ -72,10 +69,6 @@ public class Compiler {
program.setWarnArrayType(warnArrayType);
}
public void setLinkScriptFileName(String linkScript) {
this.linkScriptFileName = linkScript;
}
public void setVariableBuilderConfig(VariableBuilderConfig variableBuilderConfig) {
this.variableBuilderConfig = variableBuilderConfig;
}
@ -104,14 +97,6 @@ public class Compiler {
this.program.setEnableLiveRangeCallPath(enableLiveRangeCallPath);
}
void setTargetPlatform(TargetPlatform targetPlatform) {
program.setTargetPlatform(targetPlatform);
}
public void setTargetCpu(TargetCpu targetCpu) {
program.setTargetCpu(targetCpu);
}
public void setAsmFragmentBaseFolder(Path asmFragmentBaseFolder) {
program.setAsmFragmentBaseFolder(asmFragmentBaseFolder);
}
@ -120,10 +105,6 @@ public class Compiler {
program.setAsmFragmentCacheFolder(asmFragmentcacheDir);
}
public void initAsmFragmentSynthesizer() {
program.initAsmFragmentSynthesizer();
}
public void initAsmFragmentSynthesizer(AsmFragmentTemplateSynthesizer synthesizer) {
program.initAsmFragmentSynthesizer(synthesizer);
}
@ -148,6 +129,10 @@ public class Compiler {
program.getLibraryPaths().add(path);
}
public void addTargetPlatformPath(String path) {
program.getTargetPlatformPaths().add(path);
}
/**
* Create a CParser and initialize it by adding any command-line defines and loading the files.
*
@ -196,9 +181,6 @@ public class Compiler {
try {
Path currentPath = new File(".").toPath();
if(this.linkScriptFileName != null) {
SourceLoader.loadLinkScriptFile(linkScriptFileName, currentPath, program);
}
program.setStatementSequence(new StatementSequence());
CParser cParser = initializeParser(defines, cFiles, currentPath);

View File

@ -71,6 +71,9 @@ public class KickC implements Callable<Integer> {
@CommandLine.Option(names = {"-F", "-fragmentdir"}, description = "Path to the ASM fragment folder, where the compiler looks for ASM fragments.")
private Path fragmentDir = null;
@CommandLine.Option(names = {"-P", "-platformdir", "-targetdir"}, description = "Path to a target platform folder, where the compiler looks for target platform files. This option can be repeated to add multiple target platform folders.")
private List<Path> targetPlatformDir = null;
@CommandLine.Option(names = {"-Ouplift"}, description = "Optimization Option. Number of combinations to test when uplifting variables to registers in a scope. By default 100 combinations are tested.")
private Integer optimizeUpliftCombinations = null;
@ -152,11 +155,11 @@ public class KickC implements Callable<Integer> {
@CommandLine.Option(names = {"-Si"}, description = "Interleave comments with intermediate language code and ASM fragment names in the generated ASM.")
private boolean interleaveIclFile = false;
@CommandLine.Option(names = {"-t", "-target"}, description = "The target system. Default is C64 with BASIC upstart. See #pragma target")
private String target = TargetPlatform.C64BASIC.getName();
@CommandLine.Option(names = {"-p", "-t", "-target", "-platform"}, description = "The target platform. Default is C64 with BASIC upstart. See #pragma target")
private String targetPlatform = null;
@CommandLine.Option(names = {"-cpu"}, description = "The target CPU. Default is 6502 with illegal opcodes. See #pragma cpu")
private String cpu = TargetCpu.MOS6502X.getName();
private String cpu = null;
@CommandLine.Option(names = {"-T", "-link"}, description = "Link using a linker script in KickAss segment format. See #pragma link")
private String linkScript = null;
@ -184,36 +187,6 @@ public class KickC implements Callable<Integer> {
Compiler compiler = new Compiler();
if(target != null) {
TargetPlatform targetPlatform = TargetPlatform.getTargetPlatform(target);
if(targetPlatform == null) {
System.err.println("Unknown target platform " + target);
StringBuffer supported = new StringBuffer();
supported.append("The supported target platforms are: ");
for(TargetPlatform value : TargetPlatform.values()) {
supported.append(value.getName()).append(" ");
}
System.err.println(supported);
return COMPILE_ERROR;
}
compiler.setTargetPlatform(targetPlatform);
}
if(cpu != null) {
TargetCpu targetCpu = TargetCpu.getTargetCpu(cpu);
if(targetCpu == null) {
System.err.println("Unknown target CPU " + cpu);
StringBuffer supported = new StringBuffer();
supported.append("The supported target CPUs are: ");
for(TargetCpu value : TargetCpu.values()) {
supported.append(value.getName()).append(" ");
}
System.err.println(supported);
return COMPILE_ERROR;
}
compiler.setTargetCpu(targetCpu);
}
if(includeDir != null) {
for(Path includePath : includeDir) {
compiler.addIncludePath(includePath.toString());
@ -226,6 +199,12 @@ public class KickC implements Callable<Integer> {
}
}
if(targetPlatformDir != null) {
for(Path platformPath : targetPlatformDir) {
compiler.addTargetPlatformPath(platformPath.toString());
}
}
if(fragmentDir == null) {
fragmentDir = new File("fragment/").toPath();
}
@ -243,7 +222,35 @@ public class KickC implements Callable<Integer> {
compiler.setAsmFragmentBaseFolder(fragmentDir);
compiler.setAsmFragmentCacheFolder(fragmentCacheDir);
compiler.initAsmFragmentSynthesizer();
Program program = compiler.getProgram();
Path currentPath = new File(".").toPath();
// Set up Target Platform
try {
if(targetPlatform != null) {
TargetPlatform.setTargetPlatform(targetPlatform, currentPath, program, null);
} else {
TargetPlatform.setTargetPlatform(TargetPlatform.DEFAULT_NAME, currentPath, program, null);
}
} catch(CompileError e) {
// Print the error and exit with compile error
System.err.println(e.getMessage());
return COMPILE_ERROR;
}
// Update link script
if(linkScript != null) {
program.getTargetPlatform().setLinkScriptFile(SourceLoader.loadFile(linkScript, currentPath, program.getTargetPlatformPaths()));
}
// Update CPU
if(cpu != null) {
TargetCpu targetCpu = TargetCpu.getTargetCpu(cpu, false);
program.getTargetPlatform().setCpu(targetCpu);
}
program.initAsmFragmentSynthesizer();
if(fragment != null) {
if(verbose) {
@ -312,10 +319,6 @@ public class KickC implements Callable<Integer> {
compiler.setWarnArrayType(true);
}
if(linkScript != null) {
compiler.setLinkScriptFileName(linkScript);
}
if(varModel != null) {
List<String> settings = Arrays.asList(varModel.split(","));
settings = settings.stream().map(String::trim).collect(Collectors.toList());
@ -359,7 +362,6 @@ public class KickC implements Callable<Integer> {
}
System.out.println("Compiling " + CFileNames);
Program program = compiler.getProgram();
try {
compiler.compile(cFiles, defines);
} catch(CompileError e) {
@ -399,8 +401,8 @@ public class KickC implements Callable<Integer> {
// Find emulator - if set by #pragma
if(emulator == null) {
if(program.getEmulatorCommand() != null && (debug || execute))
emulator = program.getEmulatorCommand();
if(program.getTargetPlatform().getEmulatorCommand() != null && (debug || execute))
emulator = program.getTargetPlatform().getEmulatorCommand();
else if(debug)
emulator = "C64Debugger";
else if(execute)
@ -564,7 +566,7 @@ public class KickC implements Callable<Integer> {
? keyValue[1]
: "1";
Map<String, String> map = argSpec.getValue();
if(map==null) {
if(map == null) {
map = new LinkedHashMap<>();
argSpec.setValue(map);
}

View File

@ -1,12 +1,6 @@
package dk.camelot64.kickc;
import dk.camelot64.kickc.model.CompileError;
import dk.camelot64.kickc.model.Program;
import dk.camelot64.kickc.model.TargetPlatform;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -18,6 +12,7 @@ public class SourceLoader {
/**
* Locate a file and load it. Looks through the current path and a set of search folder.
*
* @param fileName The file to look for.
* @param currentPath The current path. May be null.
* @param searchPaths The search paths to look through if the file is not found in the current path.
@ -44,18 +39,34 @@ public class SourceLoader {
return null;
}
public static void loadLinkScriptFile(String fileName, Path currentPath, Program program) {
try {
File file = loadFile(fileName, currentPath, program.getIncludePaths());
if(file==null)
throw new CompileError("File not found " + fileName);
Path filePath = file.toPath();
String linkScript = new String(Files.readAllBytes(filePath));
program.setLinkScript(filePath, linkScript);
program.setTargetPlatform(TargetPlatform.CUSTOM);
} catch(IOException e) {
throw new CompileError("Error loading link script file " + fileName, e);
/**
* Find all files with a specific extension
*
* @param currentPath The current folder
* @param searchPaths The folders to search
* @param extension The extension to look for (excluding the dot)
* @return All files in the folders with the given extension.
*/
public static List<File> listFiles(Path currentPath, List<String> searchPaths, String extension) {
List<File> allFiles = new ArrayList<>();
List<String> allSearchPaths = new ArrayList<>();
if(currentPath != null)
allSearchPaths.add(currentPath.toString());
allSearchPaths.addAll(searchPaths);
for(String searchPath : allSearchPaths) {
if(!searchPath.endsWith("/")) {
searchPath += "/";
}
final File searchFolder = new File(searchPath);
if(searchFolder.exists() && searchFolder.isDirectory()) {
final String[] files = searchFolder.list((dir, name) -> name.endsWith("." + extension));
if(files != null)
for(String file : files) {
allFiles.add(new File(file));
}
}
}
return allFiles;
}
}

View File

@ -307,7 +307,14 @@ public class AsmChunk {
* @return true if the line is an instruction or similar.
*/
private boolean shouldIndentAsm(AsmLine line) {
return line instanceof AsmInstruction || line instanceof AsmLabelDecl || line instanceof AsmConstant || line instanceof AsmDataNumeric || line instanceof AsmDataFill || line instanceof AsmDataString || line instanceof AsmDataAlignment || line instanceof AsmInlineKickAsm;
return line instanceof AsmInstruction ||
line instanceof AsmLabelDecl ||
line instanceof AsmConstant ||
line instanceof AsmDataNumeric ||
line instanceof AsmDataFill ||
line instanceof AsmDataString ||
line instanceof AsmDataAlignment ||
(line instanceof AsmInlineKickAsm && !line.getAsm().contains(".pc"));
}
@Override

View File

@ -14,8 +14,8 @@ public class CompileError extends RuntimeException {
}
public CompileError(String message, StatementSource source) {
super(message+"\n"+source.toString());
this.source = source.toString();
super(message+"\n"+(source==null?"":source.toString()));
this.source = (source==null?"":source.toString());
}
public CompileError(String message, Token token) {

View File

@ -25,13 +25,13 @@ public class Program {
private List<String> includePaths;
/** Paths used for library files. PASS 0 (STATIC) */
private List<String> libraryPaths;
/** Paths used for target files. PASS 0 (STATIC) */
private List<String> targetPlatformPaths;
/** All loaded H/C-files. PASS 0 (STATIC) */
private List<String> loadedFiles;
/** The target platform that the program is being build for. PASS 0-5 (STATIC) */
private TargetPlatform targetPlatform = TargetPlatform.DEFAULT;
/** The target CPU that the program is being build for. PASS 0-5 (STATIC) */
private TargetCpu targetCpu = TargetCpu.DEFAULT;
private TargetPlatform targetPlatform;
/** Base folder for finding ASM fragment files. (STATIC) */
private Path asmFragmentBaseFolder;
@ -45,13 +45,6 @@ public class Program {
/** Array syntax used on types (eg. char[8] x; ) produce a warning instead of an error (STATIC) */
private boolean warnArrayType = false;
/** Path to any custom link script file used for linking (STATIC) */
private Path linkScriptFilePath;
/** Body to any custom link script file used for linking (STATIC) */
private String linkScriptBody;
/** The program name for the emulator to pass the compiled program to. */
private String emulatorCommand;
/** Absolute start address of the code. Null to start ad 0x080d. PASS 0-5 (STATIC) */
private Number programPc;
/** Reserved ZP addresses that the compiler cannot use. PASS 0-5 (STATIC) */
@ -112,6 +105,7 @@ public class Program {
this.log = new CompileLog();
this.includePaths = new ArrayList<>();
this.libraryPaths = new ArrayList<>();
this.targetPlatformPaths = new ArrayList<>();
this.loadedFiles = new ArrayList<>();
this.asmResourceFiles = new ArrayList<>();
this.reservedZps = new ArrayList<>();
@ -123,6 +117,7 @@ public class Program {
public void endPass1() {
this.includePaths = null;
this.libraryPaths = null;
this.targetPlatformPaths = null;
this.loadedFiles = null;
this.statementSequence = null;
this.procedureModifiedVars = null;
@ -216,21 +211,13 @@ public class Program {
}
public void initAsmFragmentSynthesizer() {
this.asmFragmentSynthesizer = new AsmFragmentTemplateSynthesizer(asmFragmentBaseFolder, targetCpu, asmFragmentCacheFolder, getLog());
this.asmFragmentSynthesizer = new AsmFragmentTemplateSynthesizer(asmFragmentBaseFolder, targetPlatform.getCpu(), asmFragmentCacheFolder, getLog());
}
public void initAsmFragmentSynthesizer(AsmFragmentTemplateSynthesizer synthesizer) {
this.asmFragmentSynthesizer = synthesizer;
}
public TargetCpu getTargetCpu() {
return targetCpu;
}
public void setTargetCpu(TargetCpu targetCpu) {
this.targetCpu = targetCpu;
}
public TargetPlatform getTargetPlatform() {
return targetPlatform;
}
@ -239,6 +226,11 @@ public class Program {
this.targetPlatform = targetPlatform;
}
public TargetCpu getTargetCpu() {
return getTargetPlatform().getCpu();
}
public StructVariableMemberUnwinding getStructVariableMemberUnwinding() {
return structVariableMemberUnwinding;
}
@ -263,6 +255,10 @@ public class Program {
return libraryPaths;
}
public List<String> getTargetPlatformPaths() {
return targetPlatformPaths;
}
public List<String> getLoadedFiles() {
return loadedFiles;
}
@ -508,14 +504,6 @@ public class Program {
return programPc;
}
public void setEmulatorCommand(String emulatorCommand) {
this.emulatorCommand = emulatorCommand;
}
public String getEmulatorCommand() {
return emulatorCommand;
}
public CompileLog getLog() {
return log;
}
@ -524,18 +512,6 @@ public class Program {
this.log = log;
}
public void setLinkScript(Path linkScriptFilePath, String linkScriptBody) {
this.linkScriptFilePath = linkScriptFilePath;
this.linkScriptBody = linkScriptBody;
}
public Path getLinkScriptFilePath() {
return linkScriptFilePath;
}
public String getLinkScriptBody() {
return linkScriptBody;
}
/**
* Get information about the size of the program

View File

@ -66,7 +66,7 @@ public enum TargetCpu {
}
/**
* Get the features of the CPU decising which fragments is usable
* Get the features of the CPU deciding which fragments is usable
* @return The features
*/
public List<Feature> getFeatures() {
@ -74,14 +74,19 @@ public enum TargetCpu {
}
/** Get a target CPU by name. */
public static TargetCpu getTargetCpu(String name) {
public static TargetCpu getTargetCpu(String name, boolean missingOk) {
for(TargetCpu value : TargetCpu.values()) {
if(value.getName().equalsIgnoreCase(name)) {
return value;
}
}
return null;
if(missingOk)
return null;
StringBuilder supported = new StringBuilder();
for(TargetCpu value : TargetCpu.values()) {
supported.append(value.getName()).append(" ");
}
throw new CompileError("Unknown CPU. Supported: " + supported.toString());
}
}

View File

@ -1,23 +1,50 @@
package dk.camelot64.kickc.model;
import dk.camelot64.kickc.SourceLoader;
import dk.camelot64.kickc.model.statements.StatementSource;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.stream.JsonParsingException;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
/**
* The target platform the compiler is creating a program for.
* <p>
* The target platform is represented by a .tgt-file in the target-folder, which typically sets up
* link script, cpu, emulator and some platform #defines
*/
public enum TargetPlatform {
/** Commodore 64 with BASIC upstart SYS-command. */
C64BASIC("c64basic"),
/** 6502 assembler (with no upstart code.)*/
ASM6502("asm6502"),
/** Custom target platform specified in a separate linker file passed using -T option or using #pragma link() */
CUSTOM("custom");
public class TargetPlatform {
/** The default target platform. */
public static final TargetPlatform DEFAULT = C64BASIC;
/** The name of the default target platform. */
public static String DEFAULT_NAME = "c64basic";
/** The file extension used for target platform files. */
public static final String FILE_EXTENSION = "tgt";
/** The platform name. */
private String name;
TargetPlatform(String name) {
/** The target CPU. */
private TargetCpu cpu;
/** The link script file. */
private File linkScriptFile;
/** The command to use for starting an emulator. */
private String emulatorCommand;
/** A number of preprocessor macro defines. */
private Map<String, String> defines = null;
public TargetPlatform(String name) {
this.name = name;
}
@ -25,14 +52,81 @@ public enum TargetPlatform {
return name;
}
/** Get a target platform by name. */
public static TargetPlatform getTargetPlatform(String name) {
for(TargetPlatform value : TargetPlatform.values()) {
if(value.getName().equalsIgnoreCase(name)) {
return value;
public void setName(String name) {
this.name = name;
}
public TargetCpu getCpu() {
return cpu;
}
public void setCpu(TargetCpu cpu) {
this.cpu = cpu;
}
public File getLinkScriptFile() {
return linkScriptFile;
}
public void setLinkScriptFile(File linkScriptFile) {
this.linkScriptFile = linkScriptFile;
}
public String getEmulatorCommand() {
return emulatorCommand;
}
public void setEmulatorCommand(String emulatorCommand) {
this.emulatorCommand = emulatorCommand;
}
public Map<String, String> getDefines() {
return defines;
}
public void setDefines(Map<String, String> defines) {
this.defines = defines;
}
/**
* Set the target platform from a platform name
*
* @param platformName The platform name
* @param currentFolder The current folder (added to the search path)
* @param program The program.
* @param statementSource The source file & line used for errors
*/
public static void setTargetPlatform(String platformName, Path currentFolder, Program program, StatementSource statementSource) {
final File platformFile = SourceLoader.loadFile(platformName + "." + FILE_EXTENSION, currentFolder, program.getTargetPlatformPaths());
if(platformFile != null) {
// Set the target platform
try {
final JsonReader jsonReader = Json.createReader(new BufferedInputStream(new FileInputStream(platformFile)));
final JsonObject platformJson = jsonReader.readObject();
TargetPlatform targetPlatform = new TargetPlatform(platformName);
final String cpuName = platformJson.getString("cpu", null);
if(cpuName != null)
targetPlatform.setCpu(TargetCpu.getTargetCpu(cpuName, false));
final String linkScriptName = platformJson.getString("link", null);
if(linkScriptName != null)
targetPlatform.setLinkScriptFile(SourceLoader.loadFile(linkScriptName, currentFolder, program.getTargetPlatformPaths()));
final String emulatorCommand = platformJson.getString("emulator", null);
if(emulatorCommand != null)
targetPlatform.setEmulatorCommand(emulatorCommand);
program.setTargetPlatform(targetPlatform);
} catch(CompileError | IOException | JsonParsingException e) {
throw new CompileError("Error parsing target platform file " + platformFile.getAbsolutePath() + "\n"+e.getMessage(), statementSource);
}
} else {
StringBuilder supported = new StringBuilder();
final List<File> platformFiles = SourceLoader.listFiles(currentFolder, program.getTargetPlatformPaths(), FILE_EXTENSION);
for(File file : platformFiles) {
String name = file.getName();
name = name.substring(0, name.length()- FILE_EXTENSION.length()-1);
supported.append(name).append(" ");
}
throw new CompileError("Unknown target platform '"+platformName+"'. Supported: " + supported.toString(), statementSource);
}
return null;
}
}

View File

@ -129,10 +129,11 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
@Override
public Object visitGlobalDirectiveLinkScript(KickCParser.GlobalDirectiveLinkScriptContext ctx) {
String linkName = ctx.STRING().getText();
String linkFileName = linkName.substring(1, linkName.length() - 1);
String linkScriptName = linkName.substring(1, linkName.length() - 1);
program.getLog().append("Loading link script " + linkName);
Path currentPath = cParser.getSourceFolderPath(ctx);
SourceLoader.loadLinkScriptFile(linkFileName, currentPath, program);
final File linkScriptFile = SourceLoader.loadFile(linkScriptName, currentPath, program.getTargetPlatformPaths());
program.getTargetPlatform().setLinkScriptFile(linkScriptFile);
return null;
}
@ -140,7 +141,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
public Object visitGlobalDirectiveEmulator(KickCParser.GlobalDirectiveEmulatorContext ctx) {
String emuName = ctx.STRING().getText();
emuName = emuName.substring(1, emuName.length() - 1);
program.setEmulatorCommand(emuName);
program.getTargetPlatform().setEmulatorCommand(emuName);
return null;
}
@ -178,24 +179,19 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
@Override
public Object visitGlobalDirectivePlatform(KickCParser.GlobalDirectivePlatformContext ctx) {
TargetPlatform platform = TargetPlatform.getTargetPlatform(ctx.NAME().getText());
if(platform != null) {
program.setTargetPlatform(platform);
} else {
throw new CompileError("Unknown target platform in #pragma platform directive", new StatementSource(ctx));
}
final String platformName = ctx.NAME().getText();
final Path currentFolder = cParser.getSourceFolderPath(ctx);
final StatementSource statementSource = new StatementSource(ctx);
TargetPlatform.setTargetPlatform(platformName, currentFolder, program, statementSource);
return null;
}
@Override
public Object visitGlobalDirectiveCpu(KickCParser.GlobalDirectiveCpuContext ctx) {
TargetCpu cpu = TargetCpu.getTargetCpu(ctx.NAME().getText());
if(cpu != null) {
program.setTargetCpu(cpu);
program.initAsmFragmentSynthesizer();
} else {
throw new CompileError("Unknown target CPU in #pragma cpu directive", new StatementSource(ctx));
}
final String cpuName = ctx.NAME().getText();
TargetCpu cpu = TargetCpu.getTargetCpu(cpuName, false);
program.getTargetPlatform().setCpu(cpu);
program.initAsmFragmentSynthesizer();
return null;
}

View File

@ -16,6 +16,8 @@ import dk.camelot64.kickc.passes.calcs.PassNCalcVariableReferenceInfos;
import dk.camelot64.kickc.passes.utils.SizeOfConstants;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.*;
/**
@ -79,36 +81,30 @@ public class Pass4CodeGeneration {
// Add file level comments
asm.startChunk(currentScope, null, "File Comments");
generateComments(asm, program.getFileComments());
asm.startChunk(currentScope, null, "Upstart");
Number programPc = program.getProgramPc();
if(TargetPlatform.C64BASIC.equals(program.getTargetPlatform())) {
useSegments = false;
if(programPc == null) programPc = 0x080d;
asm.addLine(new AsmSetPc("Basic", AsmFormat.getAsmNumber(0x0801)));
asm.addLine(new AsmBasicUpstart("__bbegin"));
asm.addLine(new AsmSetPc("Program", AsmFormat.getAsmNumber(programPc)));
} else if(TargetPlatform.ASM6502.equals(program.getTargetPlatform())) {
useSegments = false;
if(programPc == null) programPc = 0x2000;
asm.addLine(new AsmSetPc("Program", AsmFormat.getAsmNumber(programPc)));
} else if(TargetPlatform.CUSTOM.equals(program.getTargetPlatform())) {
useSegments = true;
String linkScriptBody = program.getLinkScriptBody();
if(linkScriptBody != null) {
String outputFileName = new File(program.getPrimaryFileName()).getName();
linkScriptBody = linkScriptBody.replace("%O", outputFileName);
linkScriptBody = linkScriptBody.replace("%_O", outputFileName.toLowerCase());
linkScriptBody = linkScriptBody.replace("%^O", outputFileName.toUpperCase());
final ControlFlowBlock beginBlock = getGraph().getBlock(new LabelRef(SymbolRef.BEGIN_BLOCK_NAME));
String entryName = (beginBlock == null) ? "main" : "__bbegin";
linkScriptBody = linkScriptBody.replace("%E", entryName);
asm.addLine(new AsmInlineKickAsm(linkScriptBody, 0L, 0L));
}
if(programPc != null) {
asm.addLine(new AsmSetPc("Program", AsmFormat.getAsmNumber(programPc)));
}
final File linkScriptFile = program.getTargetPlatform().getLinkScriptFile();
if(linkScriptFile == null)
throw new InternalError("No link script found! Cannot link program.");
String linkScriptBody = null;
try {
linkScriptBody = new String(Files.readAllBytes(linkScriptFile.toPath()));
} catch(IOException e) {
throw new CompileError("Cannot read link script file " + linkScriptFile.getAbsolutePath(), e);
}
String outputFileName = new File(program.getPrimaryFileName()).getName();
linkScriptBody = linkScriptBody.replace("%O", outputFileName);
linkScriptBody = linkScriptBody.replace("%_O", outputFileName.toLowerCase());
linkScriptBody = linkScriptBody.replace("%^O", outputFileName.toUpperCase());
final boolean skipBegin = Pass5SkipBegin.canSkipBegin(program.getGraph());
String entryName = skipBegin ? "main" : "__bbegin";
linkScriptBody = linkScriptBody.replace("%E", entryName);
Number programPc = program.getProgramPc();
if(programPc == null) programPc = 0x080d;
linkScriptBody = linkScriptBody.replace("%P", AsmFormat.getAsmNumber(programPc));
asm.addLine(new AsmInlineKickAsm(linkScriptBody, 0L, 0L));
// If the link script contains ".segment" then generate segments!
useSegments = linkScriptBody.contains(".segment");
// Generate global ZP labels
asm.startChunk(currentScope, null, "Global Constants & labels");

View File

@ -5,6 +5,7 @@ import dk.camelot64.kickc.asm.AsmChunk;
import dk.camelot64.kickc.asm.AsmInstruction;
import dk.camelot64.kickc.asm.AsmLine;
import dk.camelot64.kickc.model.ControlFlowBlock;
import dk.camelot64.kickc.model.ControlFlowGraph;
import dk.camelot64.kickc.model.Program;
import dk.camelot64.kickc.model.statements.*;
import dk.camelot64.kickc.model.values.LabelRef;
@ -23,8 +24,7 @@ public class Pass5SkipBegin extends Pass5AsmOptimization {
}
public boolean optimize() {
ControlFlowBlock beginBlock = getProgram().getGraph().getBlock(new LabelRef(SymbolRef.BEGIN_BLOCK_NAME));
boolean canSkip = canSkipBegin(beginBlock);
boolean canSkip = canSkipBegin(getProgram().getGraph());
boolean optimized = false;
if(canSkip) {
// Change BasicUpstart() to call main directly and remove the JSR main
@ -55,6 +55,11 @@ public class Pass5SkipBegin extends Pass5AsmOptimization {
return optimized;
}
static boolean canSkipBegin(ControlFlowGraph graph) {
ControlFlowBlock beginBlock = graph.getBlock(new LabelRef(SymbolRef.BEGIN_BLOCK_NAME));
return canSkipBegin(beginBlock, graph);
}
/**
* Examines whether the @begin/@end code can be skipped
* This looks through all statements to check that the only one is a call to main()
@ -62,7 +67,7 @@ public class Pass5SkipBegin extends Pass5AsmOptimization {
* @param block The block to examine (initially the @begin block)
* @return true if the @begin/@end code can be skipped
*/
private boolean canSkipBegin(ControlFlowBlock block) {
private static boolean canSkipBegin(ControlFlowBlock block, ControlFlowGraph graph) {
for(Statement statement : block.getStatements()) {
if(statement instanceof StatementPhiBlock) {
if(((StatementPhiBlock) statement).getPhiVariables().size() > 0) {
@ -83,8 +88,8 @@ public class Pass5SkipBegin extends Pass5AsmOptimization {
return false;
}
if(block.getDefaultSuccessor() != null) {
ControlFlowBlock successor = getProgram().getGraph().getBlock(block.getDefaultSuccessor());
return canSkipBegin(successor);
ControlFlowBlock successor = graph.getBlock(block.getDefaultSuccessor());
return canSkipBegin(successor, graph);
}
return true;
}

View File

@ -51,7 +51,7 @@ public class Pass5UnusedLabelElimination extends Pass5AsmOptimization {
}
}
}
if(getProgram().getLinkScriptBody()!=null) {
if(!Pass5SkipBegin.canSkipBegin(getProgram().getGraph())) {
usedLabels.add("::__bbegin");
}
return usedLabels;

View File

@ -1,9 +0,0 @@
.file [name="%O.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$080d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(%E)
.segment Code

View File

@ -1,9 +0,0 @@
.file [name="%O.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$1001]
.segmentdef Code [start=$100d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(%E)
.segment Code

View File

@ -10,11 +10,13 @@ echo KICKC_STDLIB=%KICKC_STDINCLUDE%
echo KICKC_STDINCLUDE=%KICKC_STDINCLUDE%
set KICKC_FRAGMENT_HOME=%KICKC_HOME%\fragment
echo KICKC_FRAGMENT_HOME=%KICKC_FRAGMENT_HOME%
set KICKC_PLATFORM_HOME=%KICKC_HOME%\target
echo KICKC_PLATFORM_HOME=%KICKC_PLATFORM_HOME%
REM KICKASSEMBLER HOME
REM VICE HOME
REM KICKC_JAR
for %%I in ( %KICKC_HOME%\jar\kickc-*.jar ) do set KICKC_JAR=%%I
echo KICKC_JAR=%KICKC_JAR%
echo java -jar %KICKC_JAR% -I %KICKC_STDINCLUDE% -L %KICKC_STDLIB% -F %KICKC_FRAGMENT_HOME% %*
java -jar %KICKC_JAR% -I %KICKC_STDINCLUDE% -L %KICKC_STDLIB% -F %KICKC_FRAGMENT_HOME% %*
echo java -jar %KICKC_JAR% -I %KICKC_STDINCLUDE% -L %KICKC_STDLIB% -F %KICKC_FRAGMENT_HOME% -P %KICKC_PLATFORM_HOME% %*
java -jar %KICKC_JAR% -I %KICKC_STDINCLUDE% -L %KICKC_STDLIB% -F %KICKC_FRAGMENT_HOME% -P %KICKC_PLATFORM_HOME% %*

View File

@ -9,6 +9,8 @@ export KICKC_STDINCLUDE="$KICKC_HOME/include"
export KICKC_STDLIB="$KICKC_HOME/lib"
# FRAGMENTS HOME
export KICKC_FRAGMENT_HOME="$KICKC_HOME/fragment"
# STANDARD PLATFORM
export KICKC_PLATFORM="$KICKC_HOME/target"
# KICKASSEMBLER HOME
# VICE HOME
# KICKC_JAR
@ -21,5 +23,5 @@ while [[ "$#" -gt 0 ]]; do case $1 in
*) export PARAM="$PARAM $1"; shift;;
esac; done
echo java -jar $KICKC_JAR -F $KICKC_FRAGMENT_HOME $PARAM -I $KICKC_STDINCLUDE -L $KICKC_STDLIB
java -jar $KICKC_JAR -F $KICKC_FRAGMENT_HOME $PARAM -I $KICKC_STDINCLUDE -L $KICKC_STDLIB
echo java -jar $KICKC_JAR -F $KICKC_FRAGMENT_HOME $PARAM -I $KICKC_STDINCLUDE -L $KICKC_STDLIB -P $KICKC_PLATFORM
java -jar $KICKC_JAR -F $KICKC_FRAGMENT_HOME $PARAM -I $KICKC_STDINCLUDE -L $KICKC_STDLIB -P $KICKC_PLATFORM

View File

@ -7,6 +7,7 @@ import dk.camelot64.kickc.fragment.AsmFragmentTemplateSynthesizer;
import dk.camelot64.kickc.model.CompileError;
import dk.camelot64.kickc.model.Program;
import dk.camelot64.kickc.model.TargetCpu;
import dk.camelot64.kickc.model.TargetPlatform;
import kickass.KickAssembler;
import kickass.nonasm.c64.CharToPetsciiConverter;
import org.junit.AfterClass;
@ -34,6 +35,7 @@ public class TestPrograms {
final String stdIncludePath = "src/main/kc/include";
final String stdLibPath = "src/main/kc/lib";
final String stdPlatformPath = "src/main/kc/target";
final String testPath = "src/test/kc";
final String refPath = "src/test/ref/";
@ -4294,9 +4296,10 @@ public class TestPrograms {
if(compileLog != null) {
compiler.setLog(compileLog);
}
compiler.addIncludePath(stdIncludePath);
compiler.addIncludePath(testPath);
compiler.addIncludePath(stdIncludePath);
compiler.addLibraryPath(stdLibPath);
compiler.addTargetPlatformPath(stdPlatformPath);
compiler.initAsmFragmentSynthesizer(asmFragmentSynthesizer);
if(upliftCombinations != null) {
compiler.setUpliftCombinations(upliftCombinations);
@ -4304,8 +4307,9 @@ public class TestPrograms {
final ArrayList<Path> files = new ArrayList<>();
final Path filePath = Paths.get(fileName);
files.add(filePath);
compiler.compile(files, null);
Program program = compiler.getProgram();
TargetPlatform.setTargetPlatform(TargetPlatform.DEFAULT_NAME, filePath, program, null);
compiler.compile(files, null);
compileAsm(fileName, program);
boolean success = true;
ReferenceHelper helper = new ReferenceHelperFolder(refPath);

View File

@ -1,6 +1,5 @@
// Random walk with color fading for Commodore Plus/4 / C16
#pragma link("plus4.ld")
#pragma emulator("xplus4")
#pragma target(plus4)
#include <plus4.h>
#include <string.h>

View File

@ -1,6 +1,7 @@
// Tests the target platform ASM6502
#pragma target(asm6502)
#pragma pc(0x2000)
unsigned char TABLE[10];

View File

@ -104,7 +104,7 @@ Target platform is c64basic / MOS6502X
// Hard-coded zero-page address - local variable
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -173,7 +173,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Hard-coded zero-page address - local variable
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -231,14 +231,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -104,7 +104,7 @@ Target platform is c64basic / MOS6502X
// Hard-coded mainmem address - local variable
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -173,7 +173,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Hard-coded mainmem address - local variable
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -231,14 +231,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -129,7 +129,7 @@ Target platform is c64basic / MOS6502X
// Incrementing a load/store variable will result in cause two *SIZEOF's
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -224,7 +224,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Incrementing a load/store variable will result in cause two *SIZEOF's
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -299,14 +299,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -124,7 +124,7 @@ Target platform is c64basic / MOS6502X
// Test address-of - use the pointer to get the value
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -196,7 +196,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test address-of - use the pointer to get the value
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -255,14 +255,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -215,7 +215,7 @@ Target platform is c64basic / MOS6502X
// Test address-of - pass the pointer as parameter
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -366,7 +366,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test address-of - pass the pointer as parameter
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -495,6 +495,7 @@ Removing instruction setByte_from___b1:
Removing instruction __b2_from___b1:
Removing instruction setByte_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction setByte_from_main:
Removing instruction __b1:
@ -503,11 +504,8 @@ Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -291,7 +291,7 @@ Target platform is c64basic / MOS6502X
// Test address-of an array element
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const SIZEOF_SIGNED_WORD = 2
@ -454,7 +454,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test address-of an array element
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const SIZEOF_SIGNED_WORD = 2
@ -593,6 +593,7 @@ Removing instruction __b2_from_main:
Removing instruction print_from___b2:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction print_from_main:
Removing instruction __b2:
@ -602,13 +603,10 @@ Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -254,7 +254,7 @@ Target platform is c64basic / MOS6502X
// http://8bitworkshop.com/blog/compilers/2019/03/17/cc65-optimization.html
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -427,7 +427,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// http://8bitworkshop.com/blog/compilers/2019/03/17/cc65-optimization.html
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -537,19 +537,17 @@ Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -122,7 +122,7 @@ Target platform is c64basic / MOS6502X
// Illustrates symbolic array lengths
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const SZ = $f
@ -192,7 +192,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Illustrates symbolic array lengths
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const SZ = $f
@ -256,17 +256,15 @@ Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -229,7 +229,7 @@ Target platform is c64basic / MOS6502X
// Illustrates symbolic array lengths
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const ITEM_COUNT = 3
@ -362,7 +362,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Illustrates symbolic array lengths
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const ITEM_COUNT = 3
@ -474,19 +474,17 @@ Removing instruction __b1_from___b3:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -87,7 +87,7 @@ Target platform is c64basic / MOS6502X
// Test initializing array using KickAssembler
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -137,7 +137,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test initializing array using KickAssembler
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -181,14 +181,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -177,7 +177,7 @@ Target platform is c64basic / MOS6502X
// Test a short array initializer - the rest should be zero-filled
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -290,7 +290,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test a short array initializer - the rest should be zero-filled
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -381,6 +381,7 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b3_from___b1:
@ -388,11 +389,8 @@ Removing instruction __breturn:
Removing instruction __b3_from___b4:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -121,7 +121,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -181,7 +181,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -235,14 +235,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -76,7 +76,7 @@ Target platform is c64basic / MOS6502X
// https://gitlab.com/camelot/kickc/issues/302
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -128,7 +128,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// https://gitlab.com/camelot/kickc/issues/302
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -172,14 +172,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -124,7 +124,7 @@ Target platform is c64basic / MOS6502X
// Works if the C-lexer and the ASM-lexer are separated properly
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label lda = $400
@ -198,7 +198,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Works if the C-lexer and the ASM-lexer are separated properly
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label lda = $400
@ -265,17 +265,15 @@ Removing instruction __b1:
Removing instruction __bend_from___b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp a
Succesful ASM optimization Pass5DoubleJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -101,7 +101,7 @@ Target platform is c64basic / MOS6502X
// Tests that inline asm uses clause makes the compiler not cull a procedure referenced
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label BG_COLOR = $d020
@ -161,7 +161,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests that inline asm uses clause makes the compiler not cull a procedure referenced
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label BG_COLOR = $d020
@ -213,15 +213,13 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -151,7 +151,7 @@ Target platform is c64basic / MOS6502X
// Tests that chained assignments work as intended
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -222,7 +222,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests that chained assignments work as intended
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -282,14 +282,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -696,7 +696,7 @@ Target platform is c64basic / MOS6502X
// Test compound assignment operators
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const GREEN = 5
@ -971,7 +971,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test compound assignment operators
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const GREEN = 5
@ -1230,6 +1230,7 @@ Removing instruction __b8_from___b7:
Removing instruction __b9_from___b8:
Removing instruction __b10_from___b9:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction test_from_main:
Removing instruction __b1:
@ -1255,12 +1256,10 @@ Removing instruction test_from___b10:
Removing instruction __breturn:
Removing instruction __b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
Succesful ASM optimization Pass5DoubleJumpElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

View File

@ -74,7 +74,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const BLACK = 0
@ -120,7 +120,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const BLACK = 0
@ -161,14 +161,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -1298,7 +1298,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -2178,7 +2178,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -2896,6 +2896,7 @@ Removing instruction __b4_from___b5:
Removing instruction __b1_from_fill:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction fill_from_main:
Removing instruction __b4:
@ -2929,11 +2930,8 @@ Removing instruction __b2:
Removing instruction __b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [112] bmi __b3 to bpl
Fixing long branch [309] bmi __breturn to bpl
Fixing long branch [319] bmi __breturn to bpl

View File

@ -1195,7 +1195,7 @@ Target platform is c64basic / MOS6502X
// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -1972,7 +1972,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -2599,6 +2599,7 @@ Removing instruction __b4_from___b5:
Removing instruction __b1_from_fill:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction fill_from_main:
Removing instruction __b2:
@ -2627,11 +2628,8 @@ Removing instruction __b1_from___b13:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [81] bmi __b3 to bpl
FINAL SYMBOL TABLE

View File

@ -2569,7 +2569,7 @@ Target platform is c64basic / MOS6502X
// Reported by Janne Johansson
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -3698,7 +3698,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Reported by Janne Johansson
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -4549,6 +4549,7 @@ Removing instruction __b3_from___b4:
Removing instruction __b4_from___b3:
Removing instruction __b4_from___b5:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction bitmap_init_from_main:
Removing instruction __b2:
@ -4596,7 +4597,6 @@ Removing instruction __b3_from___b2:
Removing instruction __b5:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
@ -4615,7 +4615,6 @@ Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction lda.z e with TXA
Replacing instruction lda.z e with TXA
Removing instruction __bbegin:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

View File

@ -2286,7 +2286,7 @@ Target platform is c64basic / MOS6502X
// See bitmap-line-anim-1.kc
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -3396,7 +3396,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// See bitmap-line-anim-1.kc
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -4301,6 +4301,7 @@ Removing instruction __b3_from___b4:
Removing instruction __b4_from___b3:
Removing instruction __b4_from___b5:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction bitmap_init_from_main:
Removing instruction __b3:
@ -4338,7 +4339,6 @@ Removing instruction __b3_from___b2:
Removing instruction __b5:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Skipping double jump to __b1 in bne __b2
@ -4358,7 +4358,6 @@ Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __breturn:

View File

@ -2436,7 +2436,7 @@ Target platform is c64basic / MOS6502X
// Plots a few lines using the bresenham line algorithm
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -3660,7 +3660,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Plots a few lines using the bresenham line algorithm
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -4582,6 +4582,7 @@ Removing instruction __b3_from___b4:
Removing instruction __b4_from___b3:
Removing instruction __b4_from___b5:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction bitmap_init_from_main:
Removing instruction __b5:
@ -4620,7 +4621,6 @@ Removing instruction __b3_from___b2:
Removing instruction __b5:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
@ -4635,7 +4635,6 @@ Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __b2:

View File

@ -857,7 +857,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const BMM = $20
@ -1397,7 +1397,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const BMM = $20
@ -1815,6 +1815,7 @@ Removing instruction __b3_from___b4:
Removing instruction __b4_from___b3:
Removing instruction __b4_from___b5:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction init_screen_from_main:
Removing instruction __b3:
@ -1837,15 +1838,12 @@ Removing instruction __breturn:
Removing instruction __b3_from___b4:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -124,7 +124,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -203,7 +203,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -267,17 +267,15 @@ Removing instruction __b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -373,7 +373,7 @@ Target platform is c64basic / MOS6502X
// A Minimal test of boolean constants.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -493,7 +493,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// A Minimal test of boolean constants.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -612,6 +612,7 @@ Removing instruction bool_const_vars_from___b1:
Removing instruction __b2_from___b1:
Removing instruction bool_const_inline_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction bool_const_if_from_main:
Removing instruction __b1:
@ -624,11 +625,8 @@ Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -275,7 +275,7 @@ Target platform is c64basic / MOS6502X
// Test a function taking boolean parameter and returning boolean result
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -448,7 +448,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test a function taking boolean parameter and returning boolean result
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -569,6 +569,7 @@ Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b5:
@ -576,13 +577,10 @@ Removing instruction __b4:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -179,7 +179,7 @@ Target platform is c64basic / MOS6502X
// A test of boolean conditions using && || and !
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -274,7 +274,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// A test of boolean conditions using && || and !
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -357,19 +357,17 @@ Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b4:
Removing instruction __b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -635,7 +635,7 @@ Target platform is c64basic / MOS6502X
// A test of boolean conditions using && || and !
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -1007,7 +1007,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// A test of boolean conditions using && || and !
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -1336,6 +1336,7 @@ Removing instruction __b1_from___b3:
Removing instruction __b1_from___b3:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction bool_and_from_main:
Removing instruction __b1:
@ -1358,7 +1359,6 @@ Removing instruction __b1_from_bool_and:
Removing instruction __b5:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
@ -1366,8 +1366,6 @@ Removing instruction jmp __b1
Removing instruction jmp __b1
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -138,7 +138,7 @@ Target platform is c64basic / MOS6502X
// Some bool code that causes a NullPointerException
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label framedone = 2
@ -200,7 +200,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Some bool code that causes a NullPointerException
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -256,16 +256,14 @@ Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Relabelling long label __b1_from___b2 to __b1
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -138,7 +138,7 @@ Target platform is c64basic / MOS6502X
// Tests a pointer to a boolean
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -203,7 +203,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests a pointer to a boolean
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -260,14 +260,13 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
Succesful ASM optimization Pass5DoubleJumpElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

View File

@ -688,7 +688,7 @@ Target platform is c64basic / MOS6502X
// A test of boolean conditions using && || and !
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -1086,7 +1086,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// A test of boolean conditions using && || and !
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -1426,6 +1426,7 @@ Removing instruction __b1_from___b3:
Removing instruction __b1_from___b3:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction bool_and_from_main:
Removing instruction __b1:
@ -1447,7 +1448,6 @@ Removing instruction __b1_from_bool_and:
Removing instruction __b5:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
@ -1455,8 +1455,6 @@ Removing instruction jmp __b1
Removing instruction jmp __b1
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -351,7 +351,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const STAR = $51
@ -507,7 +507,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const STAR = $51
@ -636,18 +636,16 @@ Removing instruction __b1_from___b2:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -362,7 +362,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -529,7 +529,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -669,18 +669,16 @@ Removing instruction __b1_from___b2:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -2178,7 +2178,7 @@ Target platform is c64basic / MOS6502X
// Tests the different standard C types
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label print_line_cursor = 2
@ -3248,7 +3248,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests the different standard C types
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label print_line_cursor = 2
@ -4323,6 +4323,7 @@ Removing instruction print_char_from___b1:
Removing instruction __b2_from___b1:
Removing instruction print_uchar_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction print_cls_from_main:
Removing instruction __b1:
@ -4394,11 +4395,8 @@ Removing instruction __b1_from_memset:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -1300,7 +1300,7 @@ Target platform is c64basic / MOS6502X
// C64DTV 8bpp charmode stretcher
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -2090,7 +2090,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// C64DTV 8bpp charmode stretcher
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -2730,6 +2730,7 @@ Removing instruction __b1_from___b3:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction gfx_init_from_main:
Removing instruction __b6:
@ -2754,7 +2755,6 @@ Removing instruction __b1_from_gfx_init_screen0:
Removing instruction __b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Relabelling long label __b4_from___b3 to __b5
@ -2766,8 +2766,6 @@ Removing instruction jmp __b3
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -895,7 +895,7 @@ Target platform is c64basic / MOS6502X
// C64DTV 8bpp charmode stretcher
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -1457,7 +1457,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// C64DTV 8bpp charmode stretcher
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -1925,6 +1925,7 @@ Removing instruction __b2_from___b3:
Removing instruction __b3_from___b2:
Removing instruction __b6_from___b5:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction gfx_init_chunky_from_main:
Removing instruction __b6:
@ -1942,7 +1943,6 @@ Removing instruction dtvSetCpuBankSegment1_from___b6:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
@ -1951,8 +1951,6 @@ Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction ldx #0 with TAX
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -473,7 +473,7 @@ Target platform is c64basic / MOS6502X
// Fill a box on the screen using the blitter
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const DTV_FEATURE_ENABLE = 1
@ -741,7 +741,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Fill a box on the screen using the blitter
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const DTV_FEATURE_ENABLE = 1
@ -969,14 +969,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -510,7 +510,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const DTV_FEATURE_ENABLE = 1
@ -838,7 +838,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const DTV_FEATURE_ENABLE = 1
@ -1096,18 +1096,16 @@ Removing instruction __bend_from___b1:
Removing instruction __b1_from___b1:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -389,7 +389,7 @@ Target platform is c64basic / MOS6502X
// Test C64DTV v2 256-colors and the 16-color redefinable palette
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const DTV_FEATURE_ENABLE = 1
@ -554,7 +554,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test C64DTV v2 256-colors and the 16-color redefinable palette
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const DTV_FEATURE_ENABLE = 1
@ -694,19 +694,17 @@ Removing instruction __bend_from___b1:
Removing instruction __b3_from___b3:
Removing instruction __b4_from___b4:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b2:
Removing instruction __b3_from___b2:
Removing instruction __b4_from___b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b3
Removing instruction jmp __b4
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -13031,7 +13031,7 @@ Target platform is c64basic / MOS6502X
// Interactive Explorer for C64DTV Screen Modes
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -20330,7 +20330,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Interactive Explorer for C64DTV Screen Modes
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -26260,6 +26260,7 @@ Removing instruction __b1_from___b3:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b3:
Removing instruction __b1_from___b3:
@ -26552,7 +26553,6 @@ Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
@ -26681,7 +26681,6 @@ Removing instruction ldy.z form_field_idx
Removing instruction ldy.z form_field_idx
Removing instruction lda.z x0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Removing instruction __b5:
Removing instruction __breturn:

View File

@ -11986,7 +11986,7 @@ Target platform is c64basic / MOS6502X
// Exploring C64DTV Screen Modes
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -18965,7 +18965,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Exploring C64DTV Screen Modes
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_ECM = $40
@ -24362,6 +24362,7 @@ Removing instruction print_ln_from___b5:
Removing instruction __b1_from_print_ln:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_menu:
Removing instruction __b2_from___b1:
@ -24587,7 +24588,6 @@ Removing instruction __breturn:
Removing instruction __b1_from___b2:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
@ -24678,7 +24678,6 @@ Replacing instruction ldx #0 with TAX
Replacing instruction ldx #0 with TAX
Removing instruction lda.z x0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

View File

@ -253,7 +253,7 @@ Target platform is c64basic / MOS6502X
// Test auto-casting of call-parameters
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -375,7 +375,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test auto-casting of call-parameters
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -485,6 +485,7 @@ Removing instruction print_from___b1:
Removing instruction __b2_from___b1:
Removing instruction print_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction print_from_main:
Removing instruction __b1:
@ -492,11 +493,8 @@ Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -273,7 +273,7 @@ Target platform is c64basic / MOS6502X
// Reason: Multiple versioned parameter constants x0#0, x0#1 are only output as a single constant in the ASM .const x0 = 0
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label screen = 3
@ -398,7 +398,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Reason: Multiple versioned parameter constants x0#0, x0#1 are only output as a single constant in the ASM .const x0 = 0
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label screen = 3
@ -510,17 +510,15 @@ Removing instruction line_from___b1:
Removing instruction __b1_from_line:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction line_from_main:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -120,7 +120,7 @@ Target platform is c64basic / MOS6502X
// Example of NOP-casting a dereferenced signed byte to a byte
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -192,7 +192,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Example of NOP-casting a dereferenced signed byte to a byte
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -255,17 +255,15 @@ Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -204,7 +204,7 @@ Target platform is c64basic / MOS6502X
// Tests a cast that is not needed
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -282,7 +282,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests a cast that is not needed
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -353,17 +353,15 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction getScreen1:
Removing instruction spritePtr1:
Removing instruction __b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -203,7 +203,7 @@ Target platform is c64basic / MOS6502X
// Tests a cast that is not needed
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -287,7 +287,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests a cast that is not needed
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -360,17 +360,15 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction getScreen1:
Removing instruction spritePtr1:
Removing instruction __b1:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -109,7 +109,7 @@ Target platform is c64basic / MOS6502X
// Tests a cast that is not needed
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label sprite = $5000
@ -157,7 +157,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests a cast that is not needed
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label sprite = $5000
@ -199,14 +199,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -204,7 +204,7 @@ Target platform is c64basic / MOS6502X
// Tests that casting inside constants in the output handles precedence between cast and + correctly - should generate the following KA-expression ($ff & sumw>>1)+1
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -280,7 +280,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests that casting inside constants in the output handles precedence between cast and + correctly - should generate the following KA-expression ($ff & sumw>>1)+1
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -347,15 +347,14 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
Succesful ASM optimization Pass5DoubleJumpElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

View File

@ -330,7 +330,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -487,7 +487,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -616,6 +616,7 @@ Removing instruction __b2_from___b1:
Removing instruction w_from___b2:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2:
@ -623,14 +624,11 @@ Removing instruction __breturn:
Removing instruction __b1_from_w:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -369,7 +369,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label PROCPORT = 1
@ -554,7 +554,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label PROCPORT = 1
@ -714,6 +714,7 @@ Removing instruction __b2_from___b3:
Removing instruction __b4_from___b2:
Removing instruction __b3_from___b4:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2_from___b1:
@ -722,7 +723,6 @@ Removing instruction __b5:
Removing instruction __b6:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Relabelling long label __b3_from___b2 to __b4
@ -730,8 +730,6 @@ Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -286,7 +286,7 @@ Target platform is c64basic / MOS6502X
// Draws a chess board in the upper left corner of the screen
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -445,7 +445,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Draws a chess board in the upper left corner of the screen
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -579,19 +579,17 @@ Removing instruction __b1_from___b3:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -745,7 +745,7 @@ Target platform is c64basic / MOS6502X
// Counting cycles using a CIA timer
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// Timer Control - Start/stop timer (0:stop, 1: start)
@ -1174,7 +1174,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Counting cycles using a CIA timer
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// Timer Control - Start/stop timer (0:stop, 1: start)
@ -1493,6 +1493,7 @@ Removing instruction __bend_from___b1:
Removing instruction __b1_from_main:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b2:
Removing instruction __b3:
@ -1512,11 +1513,8 @@ Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -725,7 +725,7 @@ Target platform is c64basic / MOS6502X
// Setup and run a simple CIA-timer
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// Timer Control - Start/stop timer (0:stop, 1: start)
@ -1112,7 +1112,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Setup and run a simple CIA-timer
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// Timer Control - Start/stop timer (0:stop, 1: start)
@ -1404,6 +1404,7 @@ Removing instruction __bend_from___b1:
Removing instruction __b1_from_main:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b2:
Removing instruction print_uint_at_from_print_ulong_at:
@ -1422,11 +1423,8 @@ Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -241,7 +241,7 @@ Target platform is c64basic / MOS6502X
// Tests variable coalescing over assignments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -380,7 +380,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests variable coalescing over assignments
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -489,19 +489,17 @@ Removing instruction __b1_from___b3:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b3:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -154,7 +154,7 @@ Target platform is c64basic / MOS6502X
// Test code after return in main()
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const b = 0
@ -201,7 +201,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test code after return in main()
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const b = 0
@ -242,14 +242,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -90,7 +90,7 @@ Target platform is c64basic / MOS6502X
// Test code after return in main()
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -136,7 +136,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test code after return in main()
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -176,14 +176,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -101,7 +101,7 @@ Target platform is c64basic / MOS6502X
// Tests comma-separated declarations with different array-ness
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -158,7 +158,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests comma-separated declarations with different array-ness
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -207,14 +207,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -145,7 +145,7 @@ Target platform is c64basic / MOS6502X
// Tests comma-separated declarations inside for()
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -223,7 +223,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests comma-separated declarations inside for()
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -290,16 +290,14 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -128,7 +128,7 @@ Target platform is c64basic / MOS6502X
// Tests comma-separated declarations
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -185,7 +185,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests comma-separated declarations
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -234,14 +234,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -99,7 +99,7 @@ Target platform is c64basic / MOS6502X
// Tests simple comma-expression (in parenthesis)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -147,7 +147,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests simple comma-expression (in parenthesis)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -189,14 +189,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -97,7 +97,7 @@ Target platform is c64basic / MOS6502X
// Tests simple comma-expressions (without parenthesis)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -144,7 +144,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests simple comma-expressions (without parenthesis)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -185,14 +185,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -145,7 +145,7 @@ Target platform is c64basic / MOS6502X
// Tests comma-expressions in for()-statement
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -223,7 +223,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests comma-expressions in for()-statement
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -290,16 +290,14 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -182,7 +182,7 @@ Target platform is c64basic / MOS6502X
// Test rewriting of constant comparisons for pointers
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -305,7 +305,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test rewriting of constant comparisons for pointers
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -419,6 +419,7 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b3_from___b1:
@ -426,11 +427,8 @@ Removing instruction __breturn:
Removing instruction __b3_from___b4:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -473,7 +473,7 @@ Target platform is c64basic / MOS6502X
// Test rewriting of constant comparisons
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -724,7 +724,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test rewriting of constant comparisons
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
@ -940,6 +940,7 @@ Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b1_from_main:
Removing instruction __b2_from___b1:
@ -953,13 +954,10 @@ Removing instruction __b15:
Removing instruction __b4_from___b10:
Removing instruction __b2_from___b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -174,7 +174,7 @@ Target platform is c64basic / MOS6502X
// Test to provoke Exception when using complex || condition
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
@ -255,7 +255,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Test to provoke Exception when using complex || condition
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
@ -334,18 +334,16 @@ Removing instruction __b4_from___b3:
Removing instruction __b4:
Removing instruction __b2_from___b4:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Relabelling long label __b2_from___b3 to __b3
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -10,7 +10,6 @@
.segment Code
init:
.label BG_COLOR = $c01a
__bbegin:
.segment Code
main: {
// (*BG_COLOR)++;

View File

@ -156,7 +156,7 @@ Complete equivalence classes
Allocated zp[1]:2 [ entryPoint::i#2 entryPoint::i#1 ]
INITIAL ASM
Target platform is custom / MOS6502X
Target platform is c64basic / MOS6502X
// File Comments
// Atari Tempest ROM Development Template
// Each function of the kernal is a no-args function
@ -388,6 +388,7 @@ Removing instruction __bend_from___b1:
Removing instruction __breturn:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Removing instruction __b1_from_entryPoint:
@ -439,7 +440,6 @@ init:
// Global Constants & labels
.label BG_COLOR = $c01a
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
// [2] call main

View File

@ -215,7 +215,7 @@ Target platform is c64basic / MOS6502X
// Includes a system library - ignores the local file with the same name
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -344,7 +344,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Includes a system library - ignores the local file with the same name
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -454,6 +454,7 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction strlen_from_main:
Removing instruction __b1:
@ -462,11 +463,8 @@ Removing instruction __b1_from_strlen:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -151,7 +151,7 @@ Target platform is c64basic / MOS6502X
// Includes a local file with the same name as a system library
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -218,7 +218,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Includes a local file with the same name as a system library
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -280,17 +280,15 @@ Removing instruction __b1:
Removing instruction main_from___b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction strlen_from_main:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -134,7 +134,7 @@ Target platform is c64basic / MOS6502X
// A file using a library
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -184,7 +184,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// A file using a library
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
@ -227,14 +227,12 @@ Removing instruction __b1_from___bbegin:
Removing instruction __b1:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -502,7 +502,7 @@ Target platform is c64basic / MOS6502X
// https://csdb.dk/release/?id=178673
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// The colors of the C64
@ -687,7 +687,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// https://csdb.dk/release/?id=178673
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// The colors of the C64
@ -845,16 +845,14 @@ Removing instruction memcpy_from___b2:
Removing instruction __b1_from_memcpy:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction memcpy_from_main:
Removing instruction __b2:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1

View File

@ -4577,7 +4577,7 @@ Target platform is c64basic / MOS6502X
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const KEY_SPACE = $3c
@ -6687,7 +6687,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const KEY_SPACE = $3c
@ -8382,6 +8382,7 @@ Removing instruction __b8_from___b9:
Removing instruction __b3_from___b2:
Removing instruction __b3_from___b4:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction mulf_init_from_main:
Removing instruction __b11:
@ -8467,7 +8468,6 @@ Removing instruction __b5_from___b8:
Removing instruction __b4:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
@ -8483,7 +8483,6 @@ Removing instruction jmp __b2
Removing instruction jmp __b1
Removing instruction jmp __b8
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

View File

@ -4929,7 +4929,7 @@ Target platform is c64basic / MOS6502X
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const KEY_SPACE = $3c
@ -7413,7 +7413,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const KEY_SPACE = $3c
@ -9247,6 +9247,7 @@ Removing instruction __b8_from___b9:
Removing instruction __b3_from___b2:
Removing instruction __b3_from___b4:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction mulf_init_from_main:
Removing instruction __b9:
@ -9342,7 +9343,6 @@ Removing instruction __b5_from___b8:
Removing instruction __b4:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
@ -9357,7 +9357,6 @@ Removing instruction jmp __b2
Removing instruction jmp __b1
Removing instruction jmp __b8
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

View File

@ -5225,7 +5225,7 @@ Target platform is c64basic / MOS6502X
// Show a few simple splines using the splines library
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -8699,7 +8699,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Show a few simple splines using the splines library
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.const VIC_BMM = $20
@ -11118,6 +11118,7 @@ Removing instruction __b8_from___b9:
Removing instruction __b3_from___b2:
Removing instruction __b3_from___b4:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bbegin:
Removing instruction __bend:
Removing instruction mulf_init_from_main:
Removing instruction __b8:
@ -11200,7 +11201,6 @@ Removing instruction __b5_from___b8:
Removing instruction __b4:
Removing instruction __b1_from___b3:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Replacing jump to rts with rts in jmp __breturn
@ -11220,7 +11220,6 @@ Removing instruction jmp __b3
Removing instruction jmp __b8
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction ldy #0 with TAY
Removing instruction __bbegin:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __b2:

View File

@ -17,7 +17,6 @@
.label SCREEN = $400
.label BG_COLOR = $d021
.label COLS = $d800
__bbegin:
.segment Code
main: {
// Print message

Some files were not shown because too many files have changed in this diff Show More