From 2f04ed949072a747a25193879d572dff1f3b91ec Mon Sep 17 00:00:00 2001 From: Paul Robson Date: Mon, 19 Aug 2024 20:29:27 +0100 Subject: [PATCH] Fixed line numbers at edit error --- basic/scripts/errors.py | 1 + basic/sources/editing/editing/warmstart.asm | 1 + basic/sources/editing/tokenise/tokenise.asm | 3 +++ .../editing/tokenise/workers/tok_intconstant.asm | 2 +- basic/test.bsc | 15 +-------------- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/basic/scripts/errors.py b/basic/scripts/errors.py index dcc28b2c..ce6b827c 100644 --- a/basic/scripts/errors.py +++ b/basic/scripts/errors.py @@ -35,6 +35,7 @@ array : array not declared hardware : hardware error mos : mos command error + badline : illegal line number """ err = [] diff --git a/basic/sources/editing/editing/warmstart.asm b/basic/sources/editing/editing/warmstart.asm index 2f69f239..990bd6cc 100644 --- a/basic/sources/editing/editing/warmstart.asm +++ b/basic/sources/editing/editing/warmstart.asm @@ -40,6 +40,7 @@ WarmStartNoClear: _WSNotSerialLinkMos: stz ControlStatus ; clear break flag. + jsr TOKTokenise ; tokenise it. lda tokLineNumber ; any line number ? if not, execute it. ora tokLineNumber+1 diff --git a/basic/sources/editing/tokenise/tokenise.asm b/basic/sources/editing/tokenise/tokenise.asm index 0fe07488..53c2d4b8 100644 --- a/basic/sources/editing/tokenise/tokenise.asm +++ b/basic/sources/editing/tokenise/tokenise.asm @@ -26,6 +26,9 @@ TOKTokenise: sta tokLineSize ; line length itself and the line numbers. stz tokLineNumber stz tokLineNumber+1 + stz ERRLine ; suppresses line # on error + stz ERRLine+1 + ; stz inputPos ; input position. _TOKMainLoop: diff --git a/basic/sources/editing/tokenise/workers/tok_intconstant.asm b/basic/sources/editing/tokenise/workers/tok_intconstant.asm index 528ec08d..e39044c0 100644 --- a/basic/sources/editing/tokenise/workers/tok_intconstant.asm +++ b/basic/sources/editing/tokenise/workers/tok_intconstant.asm @@ -47,7 +47,7 @@ _TICLineNumber: sta tokLineNumber+1 rts _TICSyntax: - .error_syntax + .error_badline .send code diff --git a/basic/test.bsc b/basic/test.bsc index 1825c81e..9979a63f 100644 --- a/basic/test.bsc +++ b/basic/test.bsc @@ -1,14 +1 @@ -sfx 0,19 -end - -proc snd(ch,fq,ms,sl,ty,v) - while peek($FF00):wend - poke $FF04,ch - doke $FF05,fq - doke $FF07,ms - doke $FF09,sl - poke $FF0B,ty - poke $FF0C,v - poke $FF01,7 - poke $FF00,8 -endproc \ No newline at end of file +print "98765"; \ No newline at end of file