| ... | ... |
@@ -1,32 +1,26 @@ |
| 1 | 1 |
# Uxn |
| 2 | 2 |
|
| 3 |
-A stack-based VM, written in ANSI C. |
|
| 4 |
- |
|
| 5 |
-## Build |
|
| 6 |
- |
|
| 7 |
-``` |
|
| 8 |
-cc uxn.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o uxn |
|
| 9 |
-``` |
|
| 3 |
+A [stack-based VM](https://wiki.xxiivv.com/site/uxn.html), written in ANSI C. |
|
| 10 | 4 |
|
| 11 | 5 |
## Assembly Syntax |
| 12 | 6 |
|
| 13 | 7 |
### Write |
| 14 | 8 |
|
| 15 |
-- `;variable`, set a label to an assigned address |
|
| 16 |
-- `:const`, set a label to a constant short |
|
| 17 |
-- `@label`, set a label to an address |
|
| 9 |
+- `;variable`, automatically assign an address to a label. |
|
| 10 |
+- `:const FFCF`, manually assign an address to a label. |
|
| 11 |
+- `@label`, assign the current address to a label. |
|
| 18 | 12 |
|
| 19 | 13 |
### Read |
| 20 | 14 |
|
| 21 |
-- `,literal`, push label value to stack |
|
| 22 |
-- `.pointer`, read label value |
|
| 15 |
+- `,literal`, push label value to stack, prefixed with `LIT LEN`. |
|
| 16 |
+- `.pointer`, push label value to stack. |
|
| 23 | 17 |
|
| 24 | 18 |
### Special |
| 25 | 19 |
|
| 26 |
-- `( comment )`, toggle parsing on/off |
|
| 27 |
-- `|0010`, move to position in the program |
|
| 28 |
-- `"hello`, push literal bytes for word "hello" |
|
| 29 |
-- `#04`, a zero-page address, equivalent to `,0004` |
|
| 20 |
+- `( comment )`, toggle parsing on/off. |
|
| 21 |
+- `|0010`, move to position in the program. |
|
| 22 |
+- `"hello`, push literal bytes for word "hello". |
|
| 23 |
+- `#04`, a zero-page address, equivalent to `,0004`. |
|
| 30 | 24 |
|
| 31 | 25 |
### Operator modes |
| 32 | 26 |
|
| ... | ... |
@@ -68,7 +62,7 @@ BRK |
| 68 | 62 |
|FFFA .RESET .FRAME .ERROR |
| 69 | 63 |
``` |
| 70 | 64 |
|
| 71 |
-## Mission |
|
| 65 |
+## TODOs |
|
| 72 | 66 |
|
| 73 | 67 |
### Assembler |
| 74 | 68 |
|
| ... | ... |
@@ -27,7 +27,7 @@ void wspush16(Uxn *u, Uint16 s) { wspush8(u,s >> 8); wspush8(u,s & 0xff); }
|
| 27 | 27 |
Uint16 wspop16(Uxn *u) { return wspop8(u) + (wspop8(u) << 8); }
|
| 28 | 28 |
Uint16 wspeek16(Uxn *u, Uint8 o) { return bytes2short(u->wst.dat[u->wst.ptr - o], u->wst.dat[u->wst.ptr - o + 1]); }
|
| 29 | 29 |
void rspush16(Uxn *u, Uint16 a) { u->rst.dat[u->rst.ptr++] = a; }
|
| 30 |
-Uint16 mempeek16(Uxn *u, Uint16 s) { return (u->ram.dat[s] << 8) + (u->ram.dat[s+1] & 0xff); }
|
|
| 30 |
+Uint16 mempeek16(Uxn *u, Uint16 s) { return (u->ram.dat[s] << 8) + (u->ram.dat[s + 1] & 0xff); }
|
|
| 31 | 31 |
|
| 32 | 32 |
/* I/O */ |
| 33 | 33 |
void op_brk(Uxn *u) { setflag(&u->status,FLAG_HALT, 1); }
|