aboutsummaryrefslogtreecommitdiff
path: root/listbas.c
diff options
context:
space:
mode:
Diffstat (limited to 'listbas.c')
-rw-r--r--listbas.c26
1 files changed, 25 insertions, 1 deletions
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;
}