aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-08 02:07:24 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-08 02:07:24 -0400
commit0fbcfa141b459fb900529e1c194a2e67e31785a7 (patch)
treef2f5b7037fd8245afc08698c34a1076e6eb4193c
parent96df8082f2016b155c1fa9dee5022e4c53298108 (diff)
downloadbw-atari8-tools-0fbcfa141b459fb900529e1c194a2e67e31785a7.tar.gz
whichbas: improve op 0x59 logic (INKEY$ or string semicolon); comment why op 0x5e not detected.
-rw-r--r--whichbas.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/whichbas.c b/whichbas.c
index bc70916..fcd4b70 100644
--- a/whichbas.c
+++ b/whichbas.c
@@ -267,8 +267,9 @@ CALLBACK(handle_op) {
Undecidables are:
0x56 & (logical AND) or % (XOR), both infix numeric ops; can't tell apart
0x57 ! (logical OR) in both Turbo and BXL/BXE, can't tell apart
- 0x5e FRAC (num func, 1 arg) or DPEEK (num func, 1 arg (BXE may use 2), can't tell apart...
- TODO: ...*unless* there are 2 args
+ 0x5e FRAC (num func, 1 arg) or DPEEK (num func, 1 arg in BXL... BXE
+ can take an optional 2nd arg, but it'd be a lot of effort
+ to detect, and I suspect it's a rarely used construct anyway.
0x63 RND (func, 1 num arg) or ERR (func, 1 num arg), can't tell apart
0x64 RAND (func, 1 num arg) or TAB (func, 1 num arg), can't tell apart
0x65 TRUNC (func, 1 num arg) or PEN (func, 1 num arg), can't tell apart
@@ -291,7 +292,7 @@ CALLBACK(handle_op) {
}
break;
case 0x59: /* INKEY$ (0 arg pseudo-func) in TB, string array separator semicolon in BXL/BXE */
- if(nexttok == OP_NUMCONST || nexttok >= 0x80) {
+ if(nexttok == OP_NUMCONST || nexttok == OP_HEXCONST || nexttok >= 0x80) {
/* INKEY$ may not be followed by a numeric constant or a variable of any kind */
remove_type(BT_TURBO);
}
@@ -325,9 +326,9 @@ CALLBACK(handle_op) {
remove_type(BT_BXL_BXE);
}
break;
- case 0x66: /* %0 in TB, LEFT$ (pseudo-func, takes string) in BXL/BXE */
- case 0x67: /* %1 in TB, RIGHT$ (pseudo-func, takes string) in BXL/BXE */
- case 0x68: /* %2 in TB, MID$ (pseudo-func, takes string) in BXL/BXE */
+ case 0x66: /* %0 in TB, LEFT$( (pseudo-func, takes string) in BXL/BXE */
+ case 0x67: /* %1 in TB, RIGHT$( (pseudo-func, takes string) in BXL/BXE */
+ case 0x68: /* %2 in TB, MID$( (pseudo-func, takes string) in BXL/BXE */
if(nexttok == OP_STRCONST || nexttok >= 0x80) {
/* %0 %1 %2 can't be followed by a string constant *or* a variable */
remove_type(BT_TURBO);