aboutsummaryrefslogtreecommitdiff
path: root/listbas.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-16 05:04:53 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-16 05:04:53 -0400
commit56e65923ce6dd9167fbf49d41559d558c278f78d (patch)
tree5eee62dfc8b95ddb9c71a1de152abca704cfb204 /listbas.c
parent42be594d26e472d4990f6ca1d39fc30757f5006d (diff)
downloadbw-atari8-tools-56e65923ce6dd9167fbf49d41559d558c278f78d.tar.gz
listbas: initial support for BASIC XE.
Diffstat (limited to 'listbas.c')
-rw-r--r--listbas.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/listbas.c b/listbas.c
index d964baa..5972aa8 100644
--- a/listbas.c
+++ b/listbas.c
@@ -14,9 +14,7 @@
#include "turbo_tokens.h"
#include "aplus_tokens.h"
#include "bxl_tokens.h"
-/*
#include "bxe_tokens.h"
-*/
#include "atables.h"
#include "whichbas.h"
@@ -66,6 +64,8 @@
const char *cmd_tokens[256];
const char *op_tokens[256];
+int dump_tables = 0;
+
int bas_type = B_ATARI;
int output_mode = M_UTF8;
@@ -162,8 +162,9 @@ void parse_args(int argc, char **argv, int from_env) {
optind = 1;
- while( (opt = getopt(argc, argv, "b:UCviamnBdhxulc:")) != -1) {
+ while( (opt = getopt(argc, argv, "Db:UCviamnBdhxulc:")) != -1) {
switch(opt) {
+ case 'D': dump_tables = 1; break;
case 'U': output_mode = M_UTF8; break;
case 'a': output_mode = M_ATASCII; break;
case 'm': output_mode = M_MAG; break;
@@ -669,8 +670,11 @@ void init_bxl_tables() {
memmove(op_tokens + last_operator + 1, bxl_ops, bxl_ops_size);
}
+/* BXE's token table is identical to BXL's, and the commands are the
+ same up to token 0x56 (FAST). */
void init_bxe_tables() {
- die("BASIC XE not supported yet!");
+ init_bxl_tables();
+ memmove(cmd_tokens + 0x57, bxe_cmds, bxe_cmd_size);
}
void init_token_tables() {
@@ -687,6 +691,17 @@ void init_token_tables() {
init_bxl_tables();
else if(bas_type == B_BXE)
init_bxe_tables();
+
+ if(dump_tables) {
+ int i;
+ printf("commands:\n\n");
+ for(i = 0; i < 0x65; i++)
+ printf("%s $%02x\n", (cmd_tokens[i] ? cmd_tokens[i] : "(null)"), i);
+ printf("operators:\n\n");
+ for(i = 0x12; i < 0x69; i++)
+ printf("%s $%02x\n", (op_tokens[i] ? op_tokens[i] : "(null)"), i);
+ exit(0);
+ }
}
void init_bas_dialect() {