From 966b017670fb268b187f9b7afc9fc518e731165a Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Mon, 22 Jul 2024 01:05:58 +0200 Subject: [PATCH] tweaks --- compiler/test/ast/TestVariousCompilerAst.kt | 8 ++++---- examples/cx16/pcmaudio/adpcm.p8 | 4 ++-- examples/queens.p8 | 3 ++- scripts/profiler.py | 13 ++++++++----- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/compiler/test/ast/TestVariousCompilerAst.kt b/compiler/test/ast/TestVariousCompilerAst.kt index 03ad9441e..94d791cb3 100644 --- a/compiler/test/ast/TestVariousCompilerAst.kt +++ b/compiler/test/ast/TestVariousCompilerAst.kt @@ -597,10 +597,10 @@ main { main { sub start() { uword @shared a,b - b = a ; works - cx16.r1L = lsb(a) ; works - funcw(a) ; works - funcb(lsb(a)) ; fails :-( TODO FIX + b = a + cx16.r1L = lsb(a) + funcw(a) + funcb(lsb(a)) } sub funcw(uword arg) { diff --git a/examples/cx16/pcmaudio/adpcm.p8 b/examples/cx16/pcmaudio/adpcm.p8 index 934c2c409..fabf4a32b 100644 --- a/examples/cx16/pcmaudio/adpcm.p8 +++ b/examples/cx16/pcmaudio/adpcm.p8 @@ -64,7 +64,7 @@ adpcm { pstep_2 = t_step[index_2] } - sub decode_nibble(ubyte nibble) { + sub decode_nibble(ubyte @zp nibble) { ; Decoder for nibbles for the first channel. ; this is the hotspot of the decoder algorithm! ; Note that the generated assembly from this is pretty efficient, @@ -100,7 +100,7 @@ adpcm { pstep = t_step[index] } - sub decode_nibble_second(ubyte nibble) { + sub decode_nibble_second(ubyte @zp nibble) { ; Decoder for nibbles for the second channel. ; this is the hotspot of the decoder algorithm! ; Note that the generated assembly from this is pretty efficient, diff --git a/examples/queens.p8 b/examples/queens.p8 index ba1f28d8d..6e42e1920 100644 --- a/examples/queens.p8 +++ b/examples/queens.p8 @@ -1,5 +1,4 @@ %import textio -%zeropage basicsafe ; Recursive N-Queens solver. ; The problem is: find all possible ways to place 8 Queen chess pieces on a chess board, so that none of them attacks any other. @@ -68,5 +67,7 @@ main { uword duration=100*cbm.RDTIM16()/6 txt.print_uw(duration) txt.print(" milliseconds\n") + repeat { + } } } diff --git a/scripts/profiler.py b/scripts/profiler.py index 86ff31cf3..72eb2e7f8 100755 --- a/scripts/profiler.py +++ b/scripts/profiler.py @@ -32,11 +32,14 @@ class AsmList: value, symbol, _ = line.split(maxsplit=2) value = value[1:] if value: - if value[0] == '$': - address = int(value[1:], 16) - else: - address = int(value) - symbols[symbol] = (address, index) + try: + if value[0] == '$': + address = int(value[1:], 16) + else: + address = int(value) + symbols[symbol] = (address, index) + except ValueError: + pass elif line[0] == '>': value, rest = line.split(maxsplit=1) address = int(value[1:], 16)