From 8f57dce451257c2260f5a3512e6fe90d575b929a Mon Sep 17 00:00:00 2001 From: bd-912 Date: Tue, 7 May 2024 15:03:44 -0600 Subject: Some additional broken VBuiltIn additions to Condense --- condense/CondenseVisitor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/condense/CondenseVisitor.java b/condense/CondenseVisitor.java index b296f4c..0894a9f 100644 --- a/condense/CondenseVisitor.java +++ b/condense/CondenseVisitor.java @@ -151,7 +151,7 @@ public class CondenseVisitor extends VInstr.Visitor{ /////////////////////////////////////////////////////////////// // treat the arguments (place all in temp registers) - String[] ts = new String[] { "$t9", "$v1"}; + String[] ts = new String[] { "$a0", "$t9"}; for (int i = 0; i < n.args.length; ++i) { if (this.isNumeric(n.args[i].toString())) this.addMIPS(String.format(" li %s %s", @@ -176,16 +176,16 @@ public class CondenseVisitor extends VInstr.Visitor{ else if (op.equals("Lt")) ; else if (op.equals("LtS")) - ; + ret += " slti"; else if (op.equals("PrintIntS")) - ; + ret += " jal _print"; else if (op.equals("HeapAllocZ")) - ; + ret += " jal _heapAlloc"; else if (op.equals("Error")) - ; + ret += " la $a0 _str0\n j _error"; if (n.dest != null) - ret += String.format(" %s", + ret += String.format(" $%s", ((VVarRef.Register) n.dest).ident); for (int i = 0; i < n.args.length; ++i) ret += String.format(" %s", -- cgit v1.2.3