From 694ec05bcad01fd27606aace73b49cdade16945e Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 19 Aug 2017 11:05:43 +0200 Subject: Initial --- putstr.lang | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 putstr.lang (limited to 'putstr.lang') 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 + }}} +*/ -- cgit v1.2.3-70-g09d2