STDLib work

something
able 2023-09-07 14:18:47 -05:00
parent 53a26e32e7
commit 1ba21b6f33
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,20 @@
var (error,warn,info,debug,trace) = io.log.(error,warn,info,debug,trace);
// TODO: define and add in IDL shenanigans for a proper IPC Protocol
func make_ipc_buffer(bounded: bool, length: u64) {
match bounded{
true -> match length {
0 -> error("Bound array has length of zero")
}
}
asm {
li r254, bounded
li r253, length
}
// Return a pointer to a memory address with `length`
return (123, 456);
}

View File

@ -1,4 +1,6 @@
var io = include "io";
var math = include "math";
var ecalls = include "ecalls";
var print = io.print;

View File

@ -0,0 +1,20 @@
var ecalls = include "ecalls";
var make_ipc_buffer = ecalls.make_ipc_buffer;
var terminal;
terminal.init = terminal_init;
terminal.write = terminal_write;
func terminal_init(){
// setup a buffer with the TextIO protocol
var buffer = make_ipc_buffer(false, 0);
terminal.buffer = buffer;
}
func terminal_write(value: String){
// TODO: write value into buffer according to TextIO protocol
}