Update readme and tests
This commit is contained in:
parent
cf767b2401
commit
6a8a334903
|
@ -42,8 +42,8 @@ It is:
|
|||
**VM Architecture**
|
||||
|
||||
| Feature | Specification |
|
||||
|--------------------+-----------------------------------------------|
|
||||
| Instruction Format | 1-byte opcode, 3-variable operand (CISC-like) |
|
||||
|--------------------+----------------------------------------------------|
|
||||
| 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) |
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(lambda add-two (a b)
|
||||
(return (add a b)))
|
||||
(return (+ a b)))
|
||||
|
||||
(print (to-string (add-two 1 1)))
|
||||
|
|
|
@ -1 +1 @@
|
|||
(print (add 1.0 2.0))
|
||||
(print (+ 1.0 2.0))
|
|
@ -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'?")))
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Reference in New Issue