From c71536ee8e43017bf6abd8f740a29121428f0394 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 7 Jul 2024 02:38:51 -0400 Subject: bas.c: handle possibility of turbo/bxl/bxe hex constant. --- bas.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'bas.c') diff --git a/bas.c b/bas.c index 13385f1..595ed97 100644 --- a/bas.c +++ b/bas.c @@ -11,6 +11,7 @@ #include "bas.h" int verbose = 0; +int allow_hex_const = 0; unsigned short lomem; unsigned short vntp; unsigned short vntd; @@ -340,9 +341,16 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) { tok = program[pos]; switch(tok) { case OP_NUMCONST: - CALL(on_exp_token); + case OP_HEXCONST: + if(allow_hex_const) { + CALL(on_exp_token); + } else { + fprintf(stderr, "%s: found Turbo/BXL/BXE hex constant at line %d, skipping\n", self, lineno); + } pos++; - CALL(on_num_const); + if(allow_hex_const) { + CALL(on_num_const); + } pos += 6; break; case OP_STRCONST: -- cgit v1.2.3