Add printc and exit builtin functions

This commit is contained in:
2024-10-04 18:26:10 +02:00
parent fdf56ce9d0
commit 35742aa525
20 changed files with 139 additions and 53 deletions

View File

@@ -36,6 +36,8 @@ allocate MachineConfiguration{..} = fmap function
SubtractionQuadruple (operand operand1) (operand operand2) (Store temporaryRegister)
quadruple (NegationQuadruple operand1 _) =
NegationQuadruple (operand operand1) (Store temporaryRegister)
quadruple (ProductQuadruple operand1 operand2 _) =
ProductQuadruple (operand operand1) (operand operand2) (Store temporaryRegister)
operand :: Operand Variable -> Operand (Store r)
operand (IntOperand x) = IntOperand x
operand (VariableOperand _) = VariableOperand (Store temporaryRegister)