diff options
Diffstat (limited to 'subx/examples/ex5.k2')
-rw-r--r-- | subx/examples/ex5.k2 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/subx/examples/ex5.k2 b/subx/examples/ex5.k2 new file mode 100644 index 00000000..79920614 --- /dev/null +++ b/subx/examples/ex5.k2 @@ -0,0 +1,12 @@ +fn main [ + var x : char + call read 0/stdin, x, 1/size + result/EBX <- call write 1/stdout, x, 1/size + call exit-EBX +] + +# like exit, but assumes the code is already in EBX +fn exit-EBX [ + code/EAX <- copy 1/exit + syscall +] |