fix silly missing `get_reg` error. all non gui ones are working now
This commit is contained in:
parent
9218051b87
commit
07528b1f3f
File diff suppressed because it is too large
Load Diff
|
|
@ -2,13 +2,12 @@ global str terminal_namespace = "/dev/term/0";
|
|||
global str new_line = "\n";
|
||||
|
||||
function main ()
|
||||
int n $0;
|
||||
int str_n $1;
|
||||
|
||||
load_immediate 35 -> n;
|
||||
call fib n -> n;
|
||||
int_to_string n -> str_n;
|
||||
call pln str_n -> void;
|
||||
load_immediate 36 -> $0;
|
||||
call fib $0 -> $0;
|
||||
int_to_string $0 -> str_n;
|
||||
call pln str_n;
|
||||
exit 0;
|
||||
|
||||
function fib (int n $0)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
global str terminal_namespace = "/dev/term/0";
|
||||
global str new_line = "\n";
|
||||
global str message = "nuqneH 'u'?";
|
||||
global str hello = "nuqneH 'u'?";
|
||||
|
||||
function main ()
|
||||
str hello $0;
|
||||
str msg $0;
|
||||
|
||||
load_address message -> hello;
|
||||
call pln hello;
|
||||
load_address hello -> msg;
|
||||
call pln msg;
|
||||
exit 0;
|
||||
|
||||
function pln (str message $0)
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ global str new_line = "\n";
|
|||
function main ()
|
||||
real a $0;
|
||||
int i $1;
|
||||
int mode $11;
|
||||
str term $10;
|
||||
int in_mode $11;
|
||||
str in_term $10;
|
||||
|
||||
load_immediate 5.0 -> a;
|
||||
load_immediate 5000 -> i;
|
||||
|
|
@ -18,20 +18,20 @@ function main ()
|
|||
add_int i $3 -> i;
|
||||
jump_ge_int loop_body i $2;
|
||||
|
||||
load_address terminal_namespace -> term;
|
||||
load_immediate 0 -> mode;
|
||||
syscall OPEN term mode -> term; // Terminal term = open("/dev/term/0", 0);
|
||||
load_address terminal_namespace -> in_term;
|
||||
load_immediate 0 -> in_mode;
|
||||
syscall OPEN in_term in_mode -> in_term; // Terminal term = open("/dev/term/0", 0);
|
||||
|
||||
nat b $1;
|
||||
real_to_nat a -> b;
|
||||
load_address prompt -> $7;
|
||||
string_length $7 -> $8;
|
||||
syscall WRITE term $7 $8; // print prompt
|
||||
syscall WRITE in_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
|
||||
syscall READ in_term user_string $8; // read in max 32 byte string
|
||||
|
||||
call pln user_string;
|
||||
nat_to_string b -> $4;
|
||||
|
|
|
|||
|
|
@ -3,23 +3,23 @@ global str prompt = "Enter a string:";
|
|||
global str new_line = "\n";
|
||||
|
||||
function main ()
|
||||
int mode $11;
|
||||
str term $10;
|
||||
int in_mode $11;
|
||||
str in_term $10;
|
||||
|
||||
load_immediate terminal_namespace -> term;
|
||||
load_immediate 0 -> mode;
|
||||
syscall OPEN term mode -> term; // Terminal term = open("/dev/term/0", 0);
|
||||
load_address terminal_namespace -> in_term;
|
||||
load_immediate 0 -> in_mode;
|
||||
syscall OPEN in_term in_mode -> in_term; // Terminal term = open("/dev/term/0", 0);
|
||||
|
||||
load_immediate prompt -> $7;
|
||||
load_address prompt -> $7;
|
||||
string_length $7 -> $8;
|
||||
syscall WRITE term $7 $8; // print prompt
|
||||
syscall WRITE in_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
|
||||
syscall READ in_term user_string $8; // read in max 32 byte string
|
||||
|
||||
call pln user_string -> void;
|
||||
call pln user_string;
|
||||
exit 0;
|
||||
|
||||
function pln (str message $0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue