summaryrefslogtreecommitdiff
path: root/tnslc/simple.tnsl
diff options
context:
space:
mode:
Diffstat (limited to 'tnslc/simple.tnsl')
-rw-r--r--tnslc/simple.tnsl20
1 files changed, 13 insertions, 7 deletions
diff --git a/tnslc/simple.tnsl b/tnslc/simple.tnsl
index d996c1b..9e0f700 100644
--- a/tnslc/simple.tnsl
+++ b/tnslc/simple.tnsl
@@ -11,8 +11,8 @@ struct Test {
int i, j, k
}
-/; call_me [int]
- return 4
+/; call_me (int i) [int]
+ return i + 1
;/
/; main (int argc, ~~uint argv) [int]
@@ -20,17 +20,23 @@ struct Test {
# update their positions here or else tnsl will have garbage values in r8 and r9
asm "mov r8, rcx"
asm "mov r9, rdx"
+
# If on linux, you would use rdi and rsi instead of rcx and rdx, respectively
+ # simply comment out the bove asm, and uncomment the below lines
+ # asm "mov r8, rdi"
+ # asm "mov r9, rsi"
+
Test m
- ~int i = ~m.i
- i{1} = 3
+ ~int j = ~m.i
+ ~~int i = ~j
+ i{0}{1} = 3
/; if (argc > 8)
argc = 90
;/
-
- call_me()
- # return the number of arguments
+ m.j = call_me(m.j)
+
+ # return 3
return m.j
;/