summaryrefslogtreecommitdiff
path: root/boot/stage12.elna
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-09-23 22:22:38 +0200
committerEugen Wissner <belka@caraus.de>2025-09-23 22:22:38 +0200
commit0cc41f2d838630f5117d57e1491ffd4a6d613832 (patch)
tree119f3f76ca5c6a0cdd817575e8df565519fd6a9c /boot/stage12.elna
parent6e9086aa26a37ef8d89dd54b773e614a80efe720 (diff)
downloadelna-0cc41f2d838630f5117d57e1491ffd4a6d613832.tar.gz
Implement elsif for if-statements
Diffstat (limited to 'boot/stage12.elna')
-rw-r--r--boot/stage12.elna13
1 files changed, 10 insertions, 3 deletions
diff --git a/boot/stage12.elna b/boot/stage12.elna
index 68f5592..1cf4969 100644
--- a/boot/stage12.elna
+++ b/boot/stage12.elna
@@ -109,7 +109,7 @@ end;
(* Returns the amount of bytes written in a0. *)
proc _read_file(v88: Word, v84: Word);
begin
- _syscall(0, v88, v84, 0, 0, 0, 63);
+ return _syscall(0, v88, v84, 0, 0, 0, 63)
end;
(* Writes to the standard output. *)
@@ -610,7 +610,7 @@ begin
_compile_binary_rhs();
(* Execute the operation. *)
- _write_z("\tslt t0, t1, t0\n\0");
+ _write_z("\tslt t0, t0, t1\n\0");
goto .compile_expression_end;
end;
@@ -1929,8 +1929,15 @@ begin
_symbol_table_build();
(* Read the source from the standard input. *)
+ v4 := @source_code;
+
+ .start_read;
(* Second argument is buffer size. Modifying update the source_code definition. *)
- _read_file(@source_code, 81920);
+ v0 := _read_file(v4, 81920);
+ if v0 > 0 then
+ v4 := v4 + v0;
+ goto .start_read;
+ end;
_compile();
_exit(0);