From 5c9e0c9f5187ab18c342df75e4669c6061c7286a Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 15 Nov 2020 02:02:16 +0100 Subject: [PATCH] emit extra nop for breakpoints so vice label list works again (requires 64tass 1.55.2257 or newer!) --- compiler/res/prog8lib/conv.p8 | 2 -- compiler/res/version.txt | 2 +- .../src/prog8/compiler/target/c64/codegen/AsmGen.kt | 4 +++- docs/source/index.rst | 13 ++++++++----- docs/source/todo.rst | 2 +- examples/test.p8 | 13 ++----------- 6 files changed, 15 insertions(+), 21 deletions(-) diff --git a/compiler/res/prog8lib/conv.p8 b/compiler/res/prog8lib/conv.p8 index e280db7dd..911acb130 100644 --- a/compiler/res/prog8lib/conv.p8 +++ b/compiler/res/prog8lib/conv.p8 @@ -254,7 +254,6 @@ asmsub str2ubyte(str string @ AY) clobbers(Y) -> ubyte @A { ; -- returns the unsigned byte value of the string number argument in AY ; the number may NOT be preceded by a + sign and may NOT contain spaces ; (any non-digit character will terminate the number string that is parsed) - ; TODO implement optimized custom version of this instead of simply reusing str2uword %asm {{ jmp str2uword }} @@ -264,7 +263,6 @@ asmsub str2byte(str string @ AY) clobbers(Y) -> ubyte @A { ; -- returns the signed byte value of the string number argument in AY ; the number may be preceded by a + or - sign but may NOT contain spaces ; (any non-digit character will terminate the number string that is parsed) - ; TODO implement optimized custom version of this instead of simply reusing str2word %asm {{ jmp str2word }} diff --git a/compiler/res/version.txt b/compiler/res/version.txt index 819e07a22..f80e3edd8 100644 --- a/compiler/res/version.txt +++ b/compiler/res/version.txt @@ -1 +1 @@ -5.0 +5.1-SNAPSHOT diff --git a/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt b/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt index cdfe5f225..9681d1fd9 100644 --- a/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt +++ b/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt @@ -1131,7 +1131,9 @@ $counterVar .byte 0""") "%breakpoint" -> { val label = "_prog8_breakpoint_${breakpointLabels.size+1}" breakpointLabels.add(label) - out("$label\tnop") + out(""" + nop +$label nop""") } } } diff --git a/docs/source/index.rst b/docs/source/index.rst index 3c27058ba..c6c5f89bd 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -143,14 +143,17 @@ Required tools `64tass `_ - cross assembler. Install this on your shell path. It's very easy to compile yourself. A recent precompiled .exe for Windows can be obtained from my `clone `_ of this project. +*You need at least version 1.55.2257 of this assembler to correctly use the breakpoints feature.* +It's possible to use older versions, but it is very likely that the automatic Vice breakpoints won't work with them. A **Java runtime (jre or jdk), version 8 or newer** is required to run the prog8 compiler itself. -If you're scared of Oracle's licensing terms, most Linux distributions ship OpenJDK instead. -Fnd for Windows it's possible to get that as well. Check out `AdoptOpenJDK `_ . +If you're scared of Oracle's licensing terms, most Linux distributions ship OpenJDK in their packages repository instead. +For Windows it's possible to get that as well; check out `AdoptOpenJDK `_ . +For MacOS you can use the Homebrew system to install a recent version of OpenJDK. -Finally: a **C-64 emulator** (or a real C-64 ofcourse) can be nice to test and run your programs on. -The compiler assumes the presence of the `Vice emulator `_. -If you're targeting the CommanderX16, there's the `x16emu `_. +Finally: an **emulator** (or a real machine ofcourse) to test and run your programs on. +In C64 mode, thhe compiler assumes the presence of the `Vice emulator `_. +If you're targeting the CommanderX16 instead, there's the `x16emu `_. .. important:: **Building the compiler itself:** (*Only needed if you have not downloaded a pre-built 'fat-jar'*) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 2ce3b64f9..6c69c60f5 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -2,7 +2,7 @@ TODO ==== -- 64tass doesn't output all labels anymore in the vice-mon-list, so %breakpoint labels are no longer present.... +- use assignment utility functions in asmgen/assignmentAsmgen instead of creating AsmAssignment instances everywhere - make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as '_' - option to load the built-in library files from a directory instead of the embedded ones (for easier library development/debugging) - see if we can group some errors together for instance the (now single) errors about unidentified symbols diff --git a/examples/test.p8 b/examples/test.p8 index ece650769..1ef762e66 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -1,20 +1,11 @@ %import textio -%import floats -%import syslib -%zeropage basicsafe main { sub start() { - str s1 = "irmen" - str s2 = "hello" - -; byte c = strcmp(s1, s2) -; txt.print_b(c) -; txt.chrout('\n') - txt.print_ub(s1<=s2) - txt.chrout('\n') + ; TODO breakpoint label is no longer outputted by 64tass ... + %breakpoint testX() }