diff --git a/README.org b/README.org index fec3a47..b988348 100644 --- a/README.org +++ b/README.org @@ -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 diff --git a/bench/add.lisp b/bench/add.lisp index ce9a266..95e29c0 100644 --- a/bench/add.lisp +++ b/bench/add.lisp @@ -1,4 +1,4 @@ (lambda add-two (a b) - (return (add a b))) + (return (+ a b))) (print (to-string (add-two 1 1))) diff --git a/bench/simple.lisp b/bench/simple.lisp index bde3185..a20fde5 100644 --- a/bench/simple.lisp +++ b/bench/simple.lisp @@ -1 +1 @@ -(print (add 1.0 2.0)) \ No newline at end of file +(print (+ 1.0 2.0)) \ No newline at end of file diff --git a/test/hello.asm.lisp b/test/hello.asm.lisp index 38496a3..6d60d49 100644 --- a/test/hello.asm.lisp +++ b/test/hello.asm.lisp @@ -3,8 +3,12 @@ (load $0 &terminal-str) (load $1 &hello-str) (strlen $2 $1) - (syscall DEVICE_WRITE $0 $1 $2) + (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'?"))) diff --git a/test/simple.asm.lisp b/test/simple.asm.lisp index 5574242..f1a5286 100644 --- a/test/simple.asm.lisp +++ b/test/simple.asm.lisp @@ -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)))