diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-05-07 18:43:51 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-05-07 18:43:51 -0600 |
commit | aaafaee0d5f8eafff3680f5443e6e8a66d7a2545 (patch) | |
tree | a1870830f4555227536330387e5ae856cec49e2d /condense/CondenseVisitor.java | |
parent | 9a025aeaeb4104d6a66baaa575c669231d5d76bc (diff) |
Fix calling Labels Condense
Diffstat (limited to 'condense/CondenseVisitor.java')
-rw-r--r-- | condense/CondenseVisitor.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/condense/CondenseVisitor.java b/condense/CondenseVisitor.java index 5713ded..3ded2e8 100644 --- a/condense/CondenseVisitor.java +++ b/condense/CondenseVisitor.java @@ -141,8 +141,12 @@ public class CondenseVisitor extends VInstr.Visitor<RuntimeException>{ n.getClass().getSimpleName(), n.sourcePos.toString())); /////////////////////////////////////////////////////////////// - this.addMIPS(String.format(" jalr $%s", - n.addr.toString().substring(1))); + if (n.addr.toString().contains(":")) + this.addMIPS(String.format(" jal %s", + n.addr.toString().substring(1))); + else + this.addMIPS(String.format(" jalr %s", + n.addr.toString())); /////////////////////////////////////////////////////////////// MinimalLogger.info(String.format("<-%s (%s)", n.getClass().getSimpleName(), |