52 lines
1.1 KiB
Markdown
52 lines
1.1 KiB
Markdown
# twasm
|
|
|
|
this will be a self hosted, very minimal subset of 64 bit asm
|
|
|
|
### goals
|
|
|
|
I want to compile Bootler and Twasm with the Twasm assembler
|
|
|
|
### memory map
|
|
|
|
```
|
|
+------ 0x00100000 ------+
|
|
| hardware, bios stuff |
|
|
+------ 0x00080000 ------+
|
|
| output binary |
|
|
+------ 0x00070000 ------+
|
|
| token table |
|
|
+------ 0x00060000 ------+
|
|
| stack (rsp) |
|
|
+------------------------+
|
|
| input |
|
|
+------------------------+ this is lined up to a sector
|
|
| | and this is less than a sector
|
|
+------------------------+
|
|
| assembler |
|
|
+------ 0x00010000 ------+
|
|
| bootloader, bios, etc. |
|
|
+------------------------+
|
|
```
|
|
|
|
each word represents a token on the token table.
|
|
|
|
#### token table (TT)
|
|
|
|
each token gets loaded into the token table with the following form:
|
|
|
|
```
|
|
+----------+-----------------------+
|
|
| 31 16 | 15 0 |
|
|
+----------+-----------------------+
|
|
| reserved | token id |
|
|
+----------+-----------------------+
|
|
```
|
|
|
|
### token IDs
|
|
|
|
supported tokens are listed below
|
|
|
|
| token | id | notes |
|
|
|-------|--------|-|
|
|
| | 0xFFFF | unrecognised token |
|