summaryrefslogtreecommitdiff
path: root/src/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.go')
-rw-r--r--src/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.go b/src/main.go
index 636b90f..19332c9 100644
--- a/src/main.go
+++ b/src/main.go
@@ -218,7 +218,7 @@ func X86_64map(op Operation) string{
case "done":
return fmt.Sprintf("\tjmp %s\n%s:\n", op.crosslabel, op.label)
case "string":
- /*TODO: add string*/
+ return fmt.Sprintf("\tpush %d\n\tpush %s\n", op.intData, op.label)
case "number":
return fmt.Sprintf("\tpush %d\n", op.intData)
case "syscall":
@@ -236,6 +236,10 @@ func compileX86_64(ops[] Operation) {
for i := 0; i < len(ops); i++ {
fmt.Printf("\t;; %s\n", ops[i].name)
fmt.Printf(X86_64map(ops[i]))
+ if (ops[i].name == "string") {
+ strings = append(strings, [2]string{ops[i].strData, ops[i].label})
+ }
+
}
print(" ;; EXIT")