summaryrefslogtreecommitdiff
path: root/tnslc/compile/compile.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-10-09 01:47:02 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-10-09 01:47:02 -0400
commit82bddb5aa27873695d22a5af9150a6c763c6351b (patch)
tree8ee0e7ecd1c7499c3f27ffa9d951df7f53775dcd /tnslc/compile/compile.tnsl
parent34bfedcd1e5e67b630fb7648cf7709d4a400abc5 (diff)
Registry name generation
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
+ ;/
+ ;/
;/