summaryrefslogtreecommitdiff
path: root/tnslc/compile/compile.tnsl
diff options
context:
space:
mode:
Diffstat (limited to 'tnslc/compile/compile.tnsl')
-rw-r--r--tnslc/compile/compile.tnsl12
1 files changed, 12 insertions, 0 deletions
diff --git a/tnslc/compile/compile.tnsl b/tnslc/compile/compile.tnsl
index 80656e4..6bfa07e 100644
--- a/tnslc/compile/compile.tnsl
+++ b/tnslc/compile/compile.tnsl
@@ -15,10 +15,12 @@
#/
/; module compile
+
# :include "compile/arch/arch.tnsl"
# :include "compile/comp.tnsl"
;/
+:include "isa_x86.tnsl"
;{}{}charp COMMON_ASM = {
"\tret",
@@ -57,7 +59,17 @@
/; index_to_loc (int index, ~VTrack tab) [{}charp]
;{}charp out = ""
+ ;int stack_bytes = 0
+ ;int reg = 0
+ ;int i = 0
+ /; loop (i < index) [i++]
+ /; if (tab`.sym_types{i}._size <= 8 && reg < 7)
+ ;reg++
+ ;; else
+ ;stack_bytes = stack_bytes + tab`.sym_types{i}._size
+ ;/
+ ;/
;/