diff --git a/README.md b/README.md index 9a470acf6..ebe15e74d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ KickC is a C-compiler for 6502-based platforms creating optimized and readable assembler code. -The language is 95% standard C with a few limitations, and a few extensions to ensure an optimal fit for creating 6502 assembler code. +The language is 95% standard C99 with a few limitations, and a few extensions to ensure an optimal fit for creating 6502 assembler code. The KickC-compiler includes all necessary linker and header files to makes it easy to create and test binaries for the following 6502-based platforms out-of-the-box: - Commodore VIC 20 diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java b/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java index fe3b91824..02749b92e 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java @@ -117,7 +117,7 @@ public class Pass5FixLongBranches extends Pass5AsmOptimization { } } // KickAssembler returned error, but no long branch was found. Fail with the output from KickAss - throw new CompileError("Error! Failed to compile using KickAss\n" + output); + throw new CompileError("Error! Failed to compile using KickAss\n" + output); } return false; } diff --git a/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java b/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java index ec00a11dd..7d1227c46 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java +++ b/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java @@ -4318,6 +4318,11 @@ public class TestProgramsFast extends TestPrograms { compileAndCompare("test-lowhigh.c"); } + @Test + public void testLongJump3() throws IOException { + assertError("longjump3.c", "Error! Failed to compile using KickAss", false); + } + @Test public void testLongJump2() throws IOException { compileAndCompare("longjump2.c"); diff --git a/src/test/kc/longjump3.c b/src/test/kc/longjump3.c new file mode 100644 index 000000000..b604cdbc0 --- /dev/null +++ b/src/test/kc/longjump3.c @@ -0,0 +1,270 @@ +// Example program generating a long jump - and an ASM compile problem shadowing the detection + +__export char PROBLEM[1] = kickasm {{ + #import "qwe.asd" +}}; + +void main() { + byte* SCREEN = (byte*)$400; + for(byte i : 0..10) { + asm { + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + } + SCREEN[i] = i; + } +}