From b638fedd81fddd4b3f8e1b5ba1a298f0e93a3a4c Mon Sep 17 00:00:00 2001 From: zongor Date: Sat, 29 Nov 2025 09:26:35 -0800 Subject: [PATCH] Update readme --- README.org | 94 +++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/README.org b/README.org index 4635c9a..76d5fff 100644 --- a/README.org +++ b/README.org @@ -60,28 +60,28 @@ global str new_line = "\n" global str message = "nuqneH 'u'?" function main () - str hello $0 + str hello $0; - load_immediate message -> hello - call pln hello -> void - exit 0 + load_immediate message -> hello; + call pln hello -> void; + exit 0; function pln (str message $0) - str ts $1 - int mode $5 - int msg_length $2 - str nl $3 - int nl_length $4 + str ts $1; + int mode $5; + int msg_length $2; + str nl $3; + int nl_length $4; - load_immediate terminal_namespace -> ts - load_immediate 0 -> mode - syscall OPEN ts mode -> ts - strlen message -> msg_length - syscall WRITE ts message msg_length - load_immediate new_line -> nl - strlen nl -> nl_length - syscall WRITE ts nl nl_length - return + load_immediate terminal_namespace -> ts; + load_immediate 0 -> mode; + syscall OPEN ts mode -> ts; + strlen message -> msg_length; + syscall WRITE ts message msg_length; + load_immediate new_line -> nl; + strlen nl -> nl_length; + syscall WRITE ts nl nl_length; + return; #+END_SRC #+BEGIN_SRC sh @@ -97,46 +97,46 @@ memory is managed via frame based arenas. function scopes defines a memory frame heap allocations using the internal malloc opcode push pointers within this frame. when a frame exits, the pointer is reset like stack based gc. #+BEGIN_SRC sh -global str terminal_namespace = "/dev/term/0" -global str prompt = "Enter a string:" -global str new_line = "\n" +global str terminal_namespace = "/dev/term/0"; +global str prompt = "Enter a string:"; +global str new_line = "\n"; function main () int mode $11; str term $10; - load_immediate terminal_namespace -> term - load_immediate 0 -> mode - syscall OPEN term mode -> term // Terminal term = open("/dev/term/0", 0); + load_immediate terminal_namespace -> term; + load_immediate 0 -> mode; + syscall OPEN term mode -> term; // Terminal term = open("/dev/term/0", 0); - load_immediate prompt -> $7 - string_length $7 -> $8 - syscall WRITE term $7 $8 // print prompt + load_immediate prompt -> $7; + string_length $7 -> $8; + syscall WRITE term $7 $8; // print prompt - str user_string $9 - load_immediate 32 -> $8 - malloc $8 -> user_string - syscall READ term user_string $8 // read in max 32 byte string + str user_string $9; + load_immediate 32 -> $8; + malloc $8 -> user_string; + syscall READ term user_string $8; // read in max 32 byte string - call pln user_string -> void - exit 0 + call pln user_string -> void; + exit 0; function pln (str message $0) - str ts $1 - int mode $5 - int msg_length $2 - str nl $3 - int nl_length $4 + str ts $1; + int mode $5; + int msg_length $2; + str nl $3; + int nl_length $4; - load_immediate terminal_namespace -> ts - load_immediate 0 -> mode - syscall OPEN ts mode -> ts - strlen message -> msg_length - syscall WRITE ts message msg_length - load_immediate new_line -> nl - strlen nl -> nl_length - syscall WRITE ts nl nl_length - return + load_immediate terminal_namespace -> ts; + load_immediate 0 -> mode; + syscall OPEN ts mode -> ts; + strlen message -> msg_length; + syscall WRITE ts message msg_length; + load_immediate new_line -> nl; + strlen nl -> nl_length; + syscall WRITE ts nl nl_length; + return; #+END_SRC