aboutsummaryrefslogtreecommitdiff
path: root/putstr.lang
diff options
context:
space:
mode:
Diffstat (limited to 'putstr.lang')
-rw-r--r--putstr.lang43
1 files changed, 43 insertions, 0 deletions
diff --git a/putstr.lang b/putstr.lang
new file mode 100644
index 0000000..b13e2c5
--- /dev/null
+++ b/putstr.lang
@@ -0,0 +1,43 @@
+func putstr(char[] str) {
+ int i := 0;
+ while (str[i] != '\0') {
+ putc(str[i]);
+ i = i + 1;
+ }
+}
+
+func int main() {return 0;}
+
+
+
+/*
+irfunc putstr(char[] str)
+ {{{(0)
+ mov t5Q <- 0Q
+ jmp 7
+ }}}
+ {{{(7)
+ mov t15Q <- t5Q
+ add t15Q, 8Q
+ mov t13Q <- astrQ
+ add t13Q, t15Q
+ load t16B <- *t13Q
+ neq t16B, 0B
+ jne t16B, 0Q -> 9 | 6
+ }}}
+ {{{(9)
+ mov t25Q <- t5Q
+ add t25Q, 8Q
+ mov t23Q <- astrQ
+ add t23Q, t25Q
+ load t26B <- *t23Q
+ call putc (t26B)
+ mov t30Q <- t5Q
+ add t30Q, 1Q
+ mov t5Q <- t30Q
+ jmp 7
+ }}}
+ {{{(6)
+ ret
+ }}}
+*/