Update readme and tests

This commit is contained in:
zongor 2025-09-21 11:07:44 -07:00
parent cf767b2401
commit 6a8a334903
5 changed files with 20 additions and 12 deletions

View File

@ -41,15 +41,15 @@ It is:
**VM Architecture**
| Feature | Specification |
|--------------------+-----------------------------------------------|
| Instruction Format | 1-byte opcode, 3-variable operand (CISC-like) |
| Register Set | 32 general-purpose registers (R0-R31) |
| Initialization | **ZII**: Zero Is Initialization |
| Memory Model | Frame-based arenas (function scope = frame) |
| Heap Behavior | Copy-on-write; allocations append to frame |
| Frame Exit | Pointer resets on return (stack-GC style) |
| Error Handling | Returns stub pointers to zeroed memory |
| Feature | Specification |
|--------------------+----------------------------------------------------|
| Instruction Format | 1-byte opcode, variable length operand (CISC-like) |
| Register Set | 32 general-purpose registers (R0-R31) |
| Initialization | **ZII**: Zero Is Initialization |
| Memory Model | Frame-based arenas (function scope = frame) |
| Heap Behavior | Copy-on-write; allocations append to frame |
| Frame Exit | Pointer resets on return (stack-GC style) |
| Error Handling | Returns stub pointers to zeroed memory |
This ensures:
- No =malloc=, no =free=, no GC

View File

@ -1,4 +1,4 @@
(lambda add-two (a b)
(return (add a b)))
(return (+ a b)))
(print (to-string (add-two 1 1)))

View File

@ -1 +1 @@
(print (add 1.0 2.0))
(print (+ 1.0 2.0))

View File

@ -4,7 +4,11 @@
(load $1 &hello-str)
(strlen $2 $1)
(syscall DEVICE_WRITE $0 $1 $2)
(load $3 &new-line)
(string-length $4 $3)
(syscall DEVICE-WRITE, $0, $3, $4)
(halt)))
(data
(label terminal-str "/dev/term/0")
(label new-line "\n")
(label hello-str "nuqneH 'u'?")))

View File

@ -7,7 +7,11 @@
(string-length $4 $3)
(load $5 &terminal-str)
(syscall DEVICE-WRITE, $5, $3, $4)
(load $6 &new-line)
(string-length $7 $6)
(syscall DEVICE-WRITE, $5, $6, $7)
(halt)))
(data (label terminal-str "/dev/term/0")
(label new-line "\n")
(label x 1.0)
(label y 2.0)))