|
|
|
@ -631,12 +631,13 @@ public class CodeGenImpl extends CodeGenBase
|
|
|
|
|
{
|
|
|
|
|
backend.emitADDI(Register.A0,Register.A0, 1, "Increment by 1");
|
|
|
|
|
backend.emitSLT(Register.A0, Register.A0, Register.T0, comment);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* Maybe NA
|
|
|
|
|
else if(operator.equals("is"))
|
|
|
|
|
{
|
|
|
|
|
backend.emitXOR(Register.A0, Register.A0, Register.T0, comment);
|
|
|
|
|
backend.emitSEQZ(Register.A0, Register.A0, "Result is True if XOR equals 0");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
backend.emitJAL(errorNI, "Operator not implemented for integer operands");
|
|
|
|
@ -695,12 +696,13 @@ public class CodeGenImpl extends CodeGenBase
|
|
|
|
|
backend.emitLW(Register.T0, Register.FP, -sp_off*wordSize, "Pop stack slot "+sp_off);
|
|
|
|
|
backend.emitOR(Register.A0, Register.A0, Register.T0, "OR operation");
|
|
|
|
|
backend.emitLocalLabel(label, "Next step after OR");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*Maybe NA
|
|
|
|
|
else if(operator.equals("is"))
|
|
|
|
|
{
|
|
|
|
|
backend.emitXOR(Register.A0, Register.A0, Register.T0, comment);
|
|
|
|
|
backend.emitSEQZ(Register.A0, Register.A0, "Result is True if XOR equals 0");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
backend.emitJAL(errorNI, "Operator not implemented for boolean operands");
|
|
|
|
@ -727,6 +729,7 @@ public class CodeGenImpl extends CodeGenBase
|
|
|
|
|
sp_off -= 2;
|
|
|
|
|
backend.emitADDI(SP, FP, -sp_off*wordSize, "restore sp");
|
|
|
|
|
}
|
|
|
|
|
// TODO: Implement "is" for objects
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
backend.emitJAL(errorNI, "Operator not implemented");
|
|
|
|
|