From dd2b3e2f8109c81b11cb040c455fdff9089ae40f Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 8 Jul 2024 04:07:57 -0400 Subject: whichbas: partial detection for 2-argument DPEEK in BXE. --- whichbas.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'whichbas.c') 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 */ -- cgit v1.2.3