summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2023-03-26 16:14:10 -0400
committerKyle Gunger <kgunger12@gmail.com>2023-03-26 16:14:10 -0400
commit5a6004920a860160cdb4550f104b7bb20a54da7f (patch)
treeef5016475e289b7f79da848877b51107dd62521f
parent217f4b1ab43b9fda34512261659d368e6c682b8d (diff)
Fixed multiple simple parameters
-rw-r--r--tnslc/simple.tnsl6
-rw-r--r--tnslc/tnslc.tnsl3
2 files changed, 6 insertions, 3 deletions
diff --git a/tnslc/simple.tnsl b/tnslc/simple.tnsl
index 9e0f700..20348c1 100644
--- a/tnslc/simple.tnsl
+++ b/tnslc/simple.tnsl
@@ -11,8 +11,8 @@ struct Test {
int i, j, k
}
-/; call_me (int i) [int]
- return i + 1
+/; call_me (int i, j) [int]
+ return i + j
;/
/; main (int argc, ~~uint argv) [int]
@@ -35,7 +35,7 @@ struct Test {
argc = 90
;/
- m.j = call_me(m.j)
+ m.j = call_me(m.j, argc)
# return 3
return m.j
diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl
index a91d273..05cbe03 100644
--- a/tnslc/tnslc.tnsl
+++ b/tnslc/tnslc.tnsl
@@ -2609,6 +2609,7 @@
"\tsub rsp, ", int_to_string(ctmp.norm_size()), "\n"
}, "")
;ctmp.set(val, out)
+ ;start = _param_end(tok, start) + 1
;; else
;regs++
;/
@@ -2638,6 +2639,7 @@
}, "")
;ctmp.set(val, out)
;regs++
+ ;start = _param_end(tok, start) + 1
;; else if (regs == 6)
;break
;/
@@ -2664,6 +2666,7 @@
"\tmov ", get_reg(reg, ctmp.norm_size()),", [rsp]\n",
"\tadd rsp, ", int_to_string(ctmp.norm_size()), "\n"
}, "")
+ ;reg++
;; else if (reg == 6)
;break
;/