aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-16 03:54:22 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-16 03:54:22 -0400
commit7c52caa25312980a2fe9e065a8c2f3ed54673287 (patch)
tree392d9a7c2a9f5e6485d366141e3334ecfb3bc2ee
parent0ce647158b93421659e0aebdb531fe32a96d2a5c (diff)
downloadbw-atari8-tools-7c52caa25312980a2fe9e065a8c2f3ed54673287.tar.gz
listbas: initial (incomplete) support for BASIC XL.
-rw-r--r--Makefile4
-rw-r--r--bxl_tokens.c64
-rw-r--r--bxl_tokens.h5
-rw-r--r--listbas.c5
-rw-r--r--turbo_tokens.h8
5 files changed, 78 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 3115456..b0221cd 100644
--- a/Makefile
+++ b/Makefile
@@ -63,8 +63,8 @@ vxrefbas: bas.o
cxrefbas: bas.o bcdfp.o linetab.o
-listbas: listbas.c bas.o bcdfp.o tokens.o atables.o turbo_tokens.o aplus_tokens.o
- $(CC) $(CFLAGS) -o listbas listbas.c bas.o bcdfp.o tokens.o atables.o turbo_tokens.o aplus_tokens.o -lm
+listbas: listbas.c bas.o bcdfp.o tokens.o atables.o turbo_tokens.o aplus_tokens.o bxl_tokens.o
+ $(CC) $(CFLAGS) -o listbas listbas.c bas.o bcdfp.o tokens.o atables.o turbo_tokens.o aplus_tokens.o bxl_tokens.o -lm
bas.o: bas.c bas.h
diff --git a/bxl_tokens.c b/bxl_tokens.c
new file mode 100644
index 0000000..3543f11
--- /dev/null
+++ b/bxl_tokens.c
@@ -0,0 +1,64 @@
+const char *bxl_cmds[] = {
+ "WHILE", /* $38 */
+ "ENDWHILE", /* $39 */
+ "TRACEOFF", /* $3A */
+ "TRACE", /* $3B */
+ "ELSE", /* $3C */
+ "ENDIF", /* $3D */
+ "DPOKE", /* $3E */
+ "LOMEM", /* $3F */
+ "DEL", /* $40 */
+ "RPUT", /* $41 */
+ "RGET", /* $42 */
+ "BPUT", /* $43 */
+ "BGET", /* $44 */
+ "TAB", /* $45 */
+ "CP", /* $46 */
+ "ERASE", /* $47 */
+ "PROTECT", /* $48 */
+ "UNPROTECT", /* $49 */
+ "DIR", /* $4A */
+ "RENAME", /* $4B */
+ "MOVE", /* $4C */
+ "MISSILE", /* $4D */
+ "PMCLR", /* $4E */
+ "PMCOLOR", /* $4F */
+ "PMGRAPHICS", /* $50 */
+ "PMMOVE", /* $51 */
+ "PMWIDTH", /* $52 */
+ "SET", /* $53 */
+ "LVAR", /* $54 */
+ "RENUM", /* $55 */
+ "FAST", /* $56 */
+ "NUM", /* $57 */
+ "END", /* $58 */
+ 0, /* $59 */
+ "", /* $5A, disk extensions */
+};
+
+const int bxl_cmd_size = sizeof(bxl_cmds);
+
+const char *bxl_ops[] = {
+ " USING ", /* $55 */
+ "%", /* $56 */
+ "!", /* $57 */
+ "&", /* $58 */
+ ";", /* $59 */
+ "BUMP(", /* $5A */
+ "FIND(", /* $5B */
+ "HEX$", /* $5C */
+ "RANDOM(", /* $5D */
+ "DPEEK", /* $5E */
+ "SYS", /* $5F */
+ "VSTICK", /* $60 */
+ "HSTICK", /* $61 */
+ "PMADR", /* $62 */
+ "ERR", /* $63 */
+ "TAB", /* $64 */
+ "PEN", /* $65 */
+ "LEFT$(", /* $66 */
+ "RIGHT$(", /* $67 */
+ "MID$(", /* $68 */
+};
+
+const int bxl_ops_size = sizeof(bxl_ops);
diff --git a/bxl_tokens.h b/bxl_tokens.h
new file mode 100644
index 0000000..b769038
--- /dev/null
+++ b/bxl_tokens.h
@@ -0,0 +1,5 @@
+extern const char *bxl_cmds[];
+extern const int bxl_cmd_size;
+
+extern const char *bxl_ops[];
+extern const int bxl_ops_size;
diff --git a/listbas.c b/listbas.c
index 884f763..0fdafed 100644
--- a/listbas.c
+++ b/listbas.c
@@ -13,8 +13,8 @@
#include "tokens.h"
#include "turbo_tokens.h"
#include "aplus_tokens.h"
-/*
#include "bxl_tokens.h"
+/*
#include "bxe_tokens.h"
*/
#include "atables.h"
@@ -620,7 +620,8 @@ void init_turbo_tables() {
}
void init_bxl_tables() {
- die("BASIC XL not supported yet!");
+ memmove(cmd_tokens + last_command + 1, bxl_cmds, bxl_cmd_size);
+ memmove(op_tokens + last_operator + 1, bxl_ops, bxl_ops_size);
}
void init_bxe_tables() {
diff --git a/turbo_tokens.h b/turbo_tokens.h
index 7696d52..3cb83ec 100644
--- a/turbo_tokens.h
+++ b/turbo_tokens.h
@@ -1,5 +1,5 @@
-extern const char *turbo_cmds[] ;
-extern const int turbo_cmd_size ;
+extern const char *turbo_cmds[];
+extern const int turbo_cmd_size;
-extern const char *turbo_ops[] ;
-extern const int turbo_ops_size ;
+extern const char *turbo_ops[];
+extern const int turbo_ops_size;