summaryrefslogtreecommitdiff
path: root/twasm/README.md
blob: 6640f5d0979e4c0d4824f9ae834dee581ca5e803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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 |