aboutsummaryrefslogtreecommitdiff
path: root/whichbas.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-08 04:07:57 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-08 04:07:57 -0400
commitdd2b3e2f8109c81b11cb040c455fdff9089ae40f (patch)
tree555d8d2f1685534d2c95a04ca08c84897a38c33b /whichbas.c
parentfbecac46197807f11907b503f90702d1745cab4c (diff)
downloadbw-atari8-tools-dd2b3e2f8109c81b11cb040c455fdff9089ae40f.tar.gz
whichbas: partial detection for 2-argument DPEEK in BXE.
Diffstat (limited to 'whichbas.c')
-rw-r--r--whichbas.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/whichbas.c b/whichbas.c
index ca4d6b4..c8012da 100644
--- a/whichbas.c
+++ b/whichbas.c
@@ -319,6 +319,25 @@ CALLBACK(handle_op) {
remove_type(BT_BXL_BXE);
}
break;
+ case 0x5e: /* FRAC (num func, 1 arg) or DPEEK (num func, 1 arg) in BXL...
+ however BXE has an optional 2nd arg. */
+ {
+ /* partial: This detects the 2nd arg for simple cases where the
+ 1st arg is a constant or a numeric variable, but not if the
+ 1st arg is an expression or an array element. */
+ int has2 = 0;
+ if(nexttok2 == OP_NUMCONST || nexttok == OP_HEXCONST) {
+ if(program[pos + 9] == OP_ARR_COMMA)
+ has2 = 1;
+ } else if(nexttok2 >= 0x80 && program[pos + 3] == OP_ARR_COMMA) {
+ has2 = (get_vartype(nexttok2) == TYPE_SCALAR);
+ }
+ if(has2) {
+ bas_type = BT_BXE;
+ print_result();
+ }
+ }
+ break;
case 0x5f: /* TIME$ in TB, SYS (function) in BXL/BXE */
case 0x60: /* TIME in TB, VSTICK (function) in BXL/BXE */
case 0x61: /* MOD (infix op) in TB, HSTICK (function) in BXL/BXE */