diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-11-19 23:27:08 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-11-19 23:28:18 -0500 |
commit | dfd06106983d7a512f0e8aa3da2084f85f2261e5 (patch) | |
tree | bd135ead950650a44aff4c9f8bdb8ef412dea317 /04b/in04b | |
parent | 9760d898b7f3e4b43337bac18c842d95c9f3ea6c (diff) |
mork work on 04b compiler
Diffstat (limited to '04b/in04b')
-rw-r--r-- | 04b/in04b | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -52,38 +52,49 @@ global char x global short y ;123 global long z -function strlen(*char s) +:strlen +function + argument *char s local long len local char c len = 0 - :strlen.loop + :strlen_loop c = s[len] - if c == 0 goto strlen.loop_end + if c == 0 goto strlen_loop_end len += 1 - goto strlen.loop - :strlen.loop_end + goto strlen_loop + :strlen_loop_end return len -function putc(char c) - local char *p +:putc +function + argument char c + local *char p p = &c syscall(1, 1, p, 1, 0, 0, 0, 0) return -function puts(*char s) +:puts +function + argument *char s local long len len = strlen(s) syscall(1, 1, s, len, 0, 0, 0, 0) return -function main() +:main +function local *char hello hello = `Hello, world! ` puts(hello) syscall(0x3c, 0, 0, 0, 0, 0, 0, 0) -function f(*long x, *long y) + +:f +function + argument *long x + argument *long y local long v local *long p v = *x |