Added .equiv directives. Need to fix runtime exceptions

This commit is contained in:
Sanjar Ahmadov
2021-05-02 10:24:15 -04:00
parent c0e7c2a878
commit 3c4eeb2fdc
2 changed files with 7 additions and 17 deletions
+6 -2
View File
@@ -56,8 +56,12 @@ public class CodeGenImpl extends CodeGenBase
/** A code generator emitting instructions to BACKEND. */
public CodeGenImpl(RiscVBackend backend)
{
super(backend);
backend.defineSym("listHeaderWords", "4");
backend.defineSym("strHeaderWords", "4");
backend.defineSym("bool.True", "const_1");
backend.defineSym("bool.False", "const_0");
}
@@ -76,6 +80,7 @@ public class CodeGenImpl extends CodeGenBase
*/
protected void emitTopLevel(List<Stmt> statements)
{
StmtAnalyzer stmtAnalyzer = new StmtAnalyzer(null);
backend.emitADDI(SP, SP, -2 * backend.getWordSize(), "Saved FP and saved RA (unused at top level).");
backend.emitSW(ZERO, SP, 0, "Top saved FP is 0.");
@@ -848,7 +853,6 @@ public class CodeGenImpl extends CodeGenBase
* to out-of-bounds error and abort");
*/
protected void emitCustomCode() {
emitStdFunc("concat");
emitStdFunc("conslist");
emitStdFunc("strcat");