aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-16 04:22:51 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-16 04:22:51 -0400
commitd4942ad6efac89f7228264d8c124c0ae9c47245f (patch)
tree45daf05bd19d4fd48f91e292f08f1682fdd125d1
parent9c2fb3b26b63eeebb272683aae25e80c4d60c462 (diff)
downloadbw-atari8-tools-d4942ad6efac89f7228264d8c124c0ae9c47245f.tar.gz
listbas: BXL token 0x5a WIP.
-rw-r--r--bas.c8
-rw-r--r--bas.h1
-rw-r--r--listbas.c3
3 files changed, 12 insertions, 0 deletions
diff --git a/bas.c b/bas.c
index 110e625..b3893fe 100644
--- a/bas.c
+++ b/bas.c
@@ -27,6 +27,9 @@ int allow_hex_const = 0;
an A+ program so it can handle this token correctly. */
int aplus_errtok_hack = 0;
+/* BASIC XL token 0x5a is followed by a single "subtoken", this skips it. */
+int bxl_exttok_hack = 0;
+
unsigned short lomem;
unsigned short vntp;
unsigned short vntd;
@@ -373,7 +376,12 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) {
while(pos < end) { /* loop over tokens within a statement */
pos++;
CALL(on_cmd_token);
+
switch(program[pos]) {
+ case 0x5a:
+ if(bxl_exttok_hack) pos++; /* skip subtoken */
+ pos++;
+ break;
case CMD_REM:
case CMD_DATA:
case CMD_ERROR:
diff --git a/bas.h b/bas.h
index 7faa2bb..945b51b 100644
--- a/bas.h
+++ b/bas.h
@@ -204,6 +204,7 @@ extern char *output_filename;
extern int verbose;
extern int allow_hex_const;
extern int aplus_errtok_hack;
+extern int bxl_exttok_hack;
extern void set_self(const char *argv0);
extern void die(const char *msg);
diff --git a/listbas.c b/listbas.c
index 4b5c16a..961ec32 100644
--- a/listbas.c
+++ b/listbas.c
@@ -701,6 +701,9 @@ int main(int argc, char **argv) {
if(bas_type == B_APLUS)
aplus_errtok_hack = 1;
+ if(bas_type == B_BXL)
+ bxl_exttok_hack = 1;
+
init_token_tables();
readfile();