Compare commits

...
Author SHA1 Message Date
sebastianting 98a17eb931 inital setup 2026-05-22 12:40:39 -05:00
5 changed files with 71 additions and 0 deletions

No files matched your search

@@ -0,0 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" then
return
end
tup.rule("wasm_cli.asm", "fasm %f %o", "wasm.kex")
--tup.rule("wasm_runtime.asm", "fasm %f %o", "wasm_runtime.obj")
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
fasm wasm_cli.asm wasm.kex && echo "Built $(wc -c <wasm.kex) bytes"
@@ -0,0 +1,6 @@
#!/bin/bash
# mount share.dmg, drop in the .kex, unmount
hdiutil attach share.dmg -mountpoint /Volumes/KolibriShare
cp wasm.kex /Volumes/KolibriShare/
hdiutil detach /Volumes/KolibriShare
@@ -0,0 +1,49 @@
format binary as 'kex'
use32
org 0x0
db 'MENUET01' ; header
dd 0x01
dd START ; entry point
dd IM_END
dd I_END + 0x1000
dd I_END + 0x1000
dd PARAM
dd 0x00
include 'wasm_parser.inc'
START:
mov esi, PARAM
call print_string
movzx eax, byte [PARAM]
sub eax, '0'
call add_one
add eax, '0'
mov [result_buf], al
mov esi, result_buf
call print_string
mov eax, -1
int 0x40
print_string:
mov al, [esi]
test al, al
jz .done
mov ebx, 1
mov ecx, eax
mov eax, 63
int 0x40
inc esi
jmp print_string
.done:
ret
result_buf db 0, 10, 0
IM_END:
PARAM rb 1024
I_END:
@@ -0,0 +1,9 @@
; parser
; palceholder increment eax
add_one:
inc eax
ret