From 9c2fb3b26b63eeebb272683aae25e80c4d60c462 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 16 Jul 2024 04:17:09 -0400 Subject: listbas: initial support for BASIC XL token 0x5a (disk extensions). not working yet... --- listbas.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'listbas.c') diff --git a/listbas.c b/listbas.c index eefe736..4b5c16a 100644 --- a/listbas.c +++ b/listbas.c @@ -431,6 +431,25 @@ void print_string(unsigned int pos, unsigned int len) { if(color) color_off(); } +const char *get_bxl_ext_name(unsigned char tok) { + switch(tok) { + case 0x10: + return "Local"; + case 0x11: + return "Exit"; + case 0x12: + return "Procedure"; + case 0x13: + return "Call"; + case 0x14: + return "Sortup"; + case 0x15: + return "Sortdown"; + default: + return "(bad BXL ext token)"; + } +} + CALLBACK(print_lineno) { if(skip_lineno) return; if(color) color_on(color_lineno); @@ -444,10 +463,14 @@ CALLBACK(print_cmd) { if(tok == CMD_ILET) return; if(color) color_on(color_cmd); + if((!(name = cmd_tokens[tok]))) { fprintf(outfh, "(bad cmd token $%02x) ", tok); badtok = 1; } else { + if(bas_type == B_BXL && tok == 0x5a) + name = get_bxl_ext_name(program[pos + 1]); + if(bas_type == B_BXL || bas_type == B_BXE) { print_mixed_case(name); outchr(' '); @@ -455,6 +478,7 @@ CALLBACK(print_cmd) { fprintf(outfh, "%s ", name); } } + if(color) color_off(); } @@ -689,7 +713,7 @@ int main(int argc, char **argv) { list(); if(badtok) { - fprintf(stderr, "%s: Program has unknown tokens; maybe Turbo BASIC or BASIC XL/XE?\n", self); + fprintf(stderr, "%s: Program has unknown tokens; wrong BASIC dialect?\n", self); return 2; } -- cgit v1.2.3