summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-03-08 11:15:05 +0100
committerandromeda <andromeda@lenovo>2026-03-08 11:15:05 +0100
commitf4cadcfff92bb1e03d7f5839f24e770141bbeef9 (patch)
tree59d46c1f7a19c6b1fa86884909261a4d75432795
parentd90c39b6bc2c6a6b3659f219f52cf216d21c81d2 (diff)
change token table entries, remove temporary file :shame:
-rw-r--r--twasm/.bootle/diskbin1474560 -> 0 bytes
-rw-r--r--twasm/README.md10
-rw-r--r--twasm/asm/main.asm7
3 files changed, 8 insertions, 9 deletions
diff --git a/twasm/.bootle/disk b/twasm/.bootle/disk
deleted file mode 100644
index a115815..0000000
--- a/twasm/.bootle/disk
+++ /dev/null
Binary files differ
diff --git a/twasm/README.md b/twasm/README.md
index cd2fa8b..83dab90 100644
--- a/twasm/README.md
+++ b/twasm/README.md
@@ -35,11 +35,11 @@ each word represents a token on the token table.
each token gets loaded into the token table with the following form:
```
-+----------+----------+
-| 31 16 | 15 0 |
-+----------+----------+
-| reserved | token id |
-+----------+----------+
++----------+
+| 15 0 |
++----------+
+| token id |
++----------+
```
### token IDs
diff --git a/twasm/asm/main.asm b/twasm/asm/main.asm
index 2e5710c..e4d8b86 100644
--- a/twasm/asm/main.asm
+++ b/twasm/asm/main.asm
@@ -5,8 +5,8 @@ TEST_ARENA_SIZE equ 0x1000 ; maximum size tests can use
TOKEN_TABLE_ADDR equ 0x00060000 ; address the token table is loaded at
TOKEN_TABLE_SIZE equ 0x1000 ; max length of table
-TOKEN_TABLE_ENTRY_SIZE equ 8 ; size of token table entry; a LOT of things
- ; may break if this ever changes
+TOKEN_TABLE_ENTRY_SIZE equ 2 ; size of token table entry; things may break
+ ; if this ever changes
OUTPUT_ADDR equ 0x00070000 ; address of outputed binary
OUTPUT_SIZE equ 0x1000 ; max length of outputed binary
@@ -84,10 +84,9 @@ tokenise:
mov edx, 1 ; byte length is 1
.continue:
-
add rdi, rdx ; current byte + length of token = next unread byte
- mov [TOKEN_TABLE_ADDR + rcx * TOKEN_TABLE_ENTRY_SIZE], rax ; fill next entry
+ mov [TOKEN_TABLE_ADDR + rcx * TOKEN_TABLE_ENTRY_SIZE], ax ; fill next entry
; in token table
inc rcx ; +1 token processed
jmp .loop