summaryrefslogtreecommitdiff
path: root/tnslc/compile/compile.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-10-09 15:15:39 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-10-09 15:15:39 -0400
commit51494729997b457251a62506b87af1635cd19802 (patch)
tree37d9a669363bda813d56b93497e53c20cb17dc50 /tnslc/compile/compile.tnsl
parentb819cbb3b0ff492024b72d9ea9c9e28e1023b9c3 (diff)
Basic asm helpers
Diffstat (limited to 'tnslc/compile/compile.tnsl')
-rw-r--r--tnslc/compile/compile.tnsl28
1 files changed, 6 insertions, 22 deletions
diff --git a/tnslc/compile/compile.tnsl b/tnslc/compile/compile.tnsl
index 520ea1f..7d8f012 100644
--- a/tnslc/compile/compile.tnsl
+++ b/tnslc/compile/compile.tnsl
@@ -14,13 +14,6 @@
EXPRESS OR IMPLIED
#/
-/; module compile
-
- # :include "compile/arch/arch.tnsl"
- # :include "compile/comp.tnsl"
-;/
-
-:include "isa_x86.tnsl"
;{}{}charp COMMON_ASM = {
"\tret",
@@ -88,18 +81,6 @@
;/
;/
-/; header_guard (~VTrack tab, ~{}charp csec)
-
-;/
-
-/; ret_guard (~VTrack tab, {}charp to_ret, ~{}charp csec)
- ;tail_guard(csec)
-
-;/
-
-/; tail_guard (~{}charp csec)
-;/
-
/; compile_statement (~int cur, ~{}Token data, ~{}charp hsec, csec, dsec)
;cur`++
/; if (cur` < len data`)
@@ -115,8 +96,8 @@
/; compile_block (~int cur, ~{}Token data, ~{}charp hsec, csec, dsec)
;VTrack tab = {
- {"", "", "", "", "", "", "", ""},
- {NT, NT, NT, NT, NT, NT, NT, NT}
+ {},
+ {}
}
;{}charp name = {}
@@ -182,7 +163,7 @@
;{}charp dsec = ".data\n"
;int j = len data`
-
+ /#
/; loop (int i = 0; i < j) [i++]
/; if (string_equate(data`{i}.data`, "/;"))
;compile_block(~i, data, ~hsec, ~csec, ~dsec)
@@ -192,6 +173,9 @@
;break
;/
;/
+ #/
+ ;{}charp tmp = add_asm("%eax", "%edx")
+ ;add_strings(~csec, ~tmp)
;tnsl.io.File out = tnsl.io.writeFile(file)