diff --git a/test/add.asm.lisp b/test/add.asm.lisp index 39b6a17..e8a0263 100644 --- a/test/add.asm.lisp +++ b/test/add.asm.lisp @@ -16,11 +16,10 @@ (load-immediate $11 0) (syscall OPEN $1 $1 $11) (load-immediate $3 &new-line) - (load-offset-32 $7 $1 4) ; load handle (string-length $2 $0) - (syscall WRITE $7 $0 $2) + (syscall WRITE $1 $0 $2) (string-length $4 $3) - (syscall WRITE $7 $3 $4) + (syscall WRITE $1 $3 $4) (return nil))) (data (label terminal-namespace "/dev/term/0") diff --git a/test/add.rom b/test/add.rom index d7392a3..618c517 100644 Binary files a/test/add.rom and b/test/add.rom differ diff --git a/test/fib.asm.lisp b/test/fib.asm.lisp index c6b4cba..e8f2333 100644 --- a/test/fib.asm.lisp +++ b/test/fib.asm.lisp @@ -23,11 +23,10 @@ (load-immediate $11 0) (syscall OPEN $1 $1 $11) (load-immediate $3 &new-line) - (load-offset-32 $7 $1 4) ; load handle (string-length $2 $0) - (syscall WRITE $7 $0 $2) + (syscall WRITE $1 $0 $2) (string-length $4 $3) - (syscall WRITE $7 $3 $4) + (syscall WRITE $1 $3 $4) (return nil))) (data (label terminal-namespace "/dev/term/0") diff --git a/test/fib.rom b/test/fib.rom index a0ba28f..d7bf65e 100644 Binary files a/test/fib.rom and b/test/fib.rom differ diff --git a/test/hello.asm.lisp b/test/hello.asm.lisp index 92ad930..f410cc5 100644 --- a/test/hello.asm.lisp +++ b/test/hello.asm.lisp @@ -8,11 +8,10 @@ (load-immediate $11 0) (syscall OPEN $1 $1 $11) (load-immediate $3 &new-line) - (load-offset-32 $7 $1 4) ; load handle (string-length $2 $0) - (syscall WRITE $7 $0 $2) + (syscall WRITE $1 $0 $2) (string-length $4 $3) - (syscall WRITE $7 $3 $4) + (syscall WRITE $1 $3 $4) (return nil))) (data (label terminal-namespace "/dev/term/0") diff --git a/test/hello.rom b/test/hello.rom index 06153fc..d2c1302 100644 Binary files a/test/hello.rom and b/test/hello.rom differ diff --git a/test/loop.asm.lisp b/test/loop.asm.lisp index d217c6f..f297802 100644 --- a/test/loop.asm.lisp +++ b/test/loop.asm.lisp @@ -10,15 +10,19 @@ (add-int $1 $1 $3) (jump-ge-int &loop-body $1 $2)) (load-immediate $10 &terminal-namespace) - (real-to-nat $1 $0) - (load-immediate $7 &help) - (string-length $8 $7) - (syscall WRITE $10 $7 $8) - (load-immediate $8 32) + (load-immediate $11 0) + (syscall OPEN $10 $10 $11) ; Terminal term = open(namespace, flags) + (real-to-nat $1 $0) + (load-immediate $7 &prompt) + (string-length $8 $7) + (syscall WRITE $10 $7 $8) ; print prompt + + (load-immediate $8 32) (malloc $11 $8) - (syscall READ $10 $2 $8 $11) - (call &pln ($2) nil) + (syscall READ $10 $11 $8) ; read in max 32 byte string + + (call &pln ($11) nil) (nat-to-string $4 $1) (call &pln ($4) nil) (real-to-string $3 $0) @@ -29,13 +33,12 @@ (load-immediate $11 0) (syscall OPEN $1 $1 $11) (load-immediate $3 &new-line) - (load-offset-32 $7 $1 4) ; load handle (string-length $2 $0) - (syscall WRITE $7 $0 $2) + (syscall WRITE $1 $0 $2) (string-length $4 $3) - (syscall WRITE $7 $3 $4) + (syscall WRITE $1 $3 $4) (return nil))) (data (label terminal-namespace "/dev/term/0") - (label help "Enter a string: ") + (label prompt "Enter a string: ") (label new-line "\n"))) diff --git a/test/loop.rom b/test/loop.rom index 5b2be2b..42eabd8 100644 Binary files a/test/loop.rom and b/test/loop.rom differ diff --git a/test/malloc.asm.lisp b/test/malloc.asm.lisp index 44c44de..1ba7907 100644 --- a/test/malloc.asm.lisp +++ b/test/malloc.asm.lisp @@ -9,18 +9,16 @@ (load-immediate $1 32) ; read in a string of max 32 char length (malloc $4 $1) ; allocate memory for the string - (load-offset-32 $7 $0 4) ; load handle - (syscall READ $7 $2 $1 $4) ; read the string + (syscall READ $0 $4 $1) ; read the string (call &pln ($0 $4) nil) ; print the string (halt)) (label pln (load-immediate $3 &new-line) - (load-offset-32 $7 $0 4) ; load handle (string-length $2 $1) - (syscall WRITE $7 $1 $2) + (syscall WRITE $0 $1 $2) (string-length $4 $3) - (syscall WRITE $7 $3 $4) + (syscall WRITE $0 $3 $4) (return nil))) (data (label terminal-namespace "/dev/term/0") diff --git a/test/malloc.rom b/test/malloc.rom index 6d04d8e..a2839c2 100644 Binary files a/test/malloc.rom and b/test/malloc.rom differ diff --git a/test/paint-bw.rom b/test/paint-bw.rom index 5b276e1..eeff462 100644 Binary files a/test/paint-bw.rom and b/test/paint-bw.rom differ diff --git a/test/paint.rom b/test/paint.rom index 1d68daa..6d8d266 100644 Binary files a/test/paint.rom and b/test/paint.rom differ diff --git a/test/simple.asm.lisp b/test/simple.asm.lisp index 6562d0b..c0aae82 100644 --- a/test/simple.asm.lisp +++ b/test/simple.asm.lisp @@ -11,11 +11,10 @@ (load-immediate $11 0) (syscall OPEN $1 $1 $11) (load-immediate $3 &new-line) - (load-offset-32 $7 $1 4) ; load handle (string-length $2 $0) - (syscall WRITE $7 $0 $2) + (syscall WRITE $1 $0 $2) (string-length $4 $3) - (syscall WRITE $7 $3 $4) + (syscall WRITE $1 $3 $4) (return nil))) (data (label terminal-namespace "/dev/term/0") (label new-line "\n") diff --git a/test/simple.rom b/test/simple.rom index 1bd007c..13f146d 100644 Binary files a/test/simple.rom and b/test/simple.rom differ diff --git a/test/window.rom b/test/window.rom index 4d19cc0..09acde3 100644 Binary files a/test/window.rom and b/test/window.rom differ