diff options
Diffstat (limited to 'listbas.c')
-rw-r--r-- | listbas.c | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -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() { |