Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98a17eb931 |
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")
|
||||
Executable
+2
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user