diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-08 04:07:57 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-08 04:07:57 -0400 |
commit | dd2b3e2f8109c81b11cb040c455fdff9089ae40f (patch) | |
tree | 555d8d2f1685534d2c95a04ca08c84897a38c33b | |
parent | fbecac46197807f11907b503f90702d1745cab4c (diff) | |
download | bw-atari8-tools-dd2b3e2f8109c81b11cb040c455fdff9089ae40f.tar.gz |
whichbas: partial detection for 2-argument DPEEK in BXE.
-rw-r--r-- | whichbas.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 */ |