diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-03-26 16:08:16 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-03-26 16:08:16 -0400 |
commit | 217f4b1ab43b9fda34512261659d368e6c682b8d (patch) | |
tree | f5f49347d5bf25470920eb72945c905bcefb03a8 /tnslc/simple.tnsl | |
parent | 6e5d990783caf5630fe75d847b8f7f5559bf5e94 (diff) |
Initual function calling
Diffstat (limited to 'tnslc/simple.tnsl')
-rw-r--r-- | tnslc/simple.tnsl | 20 |
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 ;/ |