fix fatal bug in data, get prefix down, start work on awaiting_label, add debug function, more

This commit is contained in:
andromeda
2026-04-02 00:13:47 +02:00
parent 395c42dff4
commit 18125e6b20
2 changed files with 165 additions and 36 deletions

View File

@@ -95,15 +95,15 @@ label definitions are stored and recalled from this table. The memory addresses
```
16 bytes
+---------+
| 127 64 |
+---------+
| address |
+---------+
| 63 0 |
+---------+
| hash |
+---------+
+----------+---------+
| 127 96 | 95 64 |
+----------+---------+
| reserved | address |
+----------+---------+
| 63 0 |
+--------------------+
| hash |
+--------------------+
```
#### awaiting label table (ALT)
@@ -113,7 +113,7 @@ forward references are stored in this table to be filled in after assembly is ot
```
16 bytes
+----------+----------+------------------+---------+
| 127 105 | 104 104 | 103 96 | 95 64 |
| 127 101 | 100 | 99 96 | 95 64 |
+----------+----------+------------------+---------+
| reserved | abs flag | # bytes reserved | address |
+----------+----------+------------------+---------+
@@ -263,7 +263,7 @@ entries are as follows:
| 63 56 | 55 48 | 47 40 | 39 32 |
+----------+---------------+---------------+------------------+
| opcode | opcode | opcode | opcode |
| dst=rel8 | dest=rel | dst=imm8 | dst=imm |
| dst=rel8 | dst=rel | dst=imm8 | dst=imm |
+----------+---------------+---------------+------------------+
| 31 24 | 23 16 | 15 0 |
+----------+---------------+----------------------------------+
@@ -319,7 +319,8 @@ rel ; rel 16/32
rel8 ; rel 8
opX&8 ; low 8 bits are the operator flag that goes with opcode at offset X from
; the first opcode in the table entry
; the first opcode in the table entry. High bit is (somewhat confusingly)
; a flag for whether or not the operator comes with an `0F` prefix
```
note much room to expand. If an opcode doesn't exist, it should be 0x00
@@ -431,8 +432,7 @@ supported tokens are listed below
| db | 0x0100 | pseudo-operator |
| | 0x10XX | some memory address; `XX` is as specified below |
| | 0x20XX | some constant; `XX` is as specified below |
| | 0x3XXX | some label definition; `XXX` is its entry index in the label table |
| | 0x4XXX | some label reference; `XXX` is its entry index in the label table
| | 0x3XXX | some label; `XXX` is its entry index in the label table |
| | 0xFEXX | used to pass some raw value `XX` in place of a token id to a couple of functions that mention this as a feature. If the function doesn't mention it, it will lead to undefined behaviour |
| | 0xFFFF | unrecognised token |