diff --git a/src/asmc/compileARM.go b/src/asmc/compileARM.go index fbf01b5..5658a91 100644 --- a/src/asmc/compileARM.go +++ b/src/asmc/compileARM.go @@ -144,16 +144,19 @@ func (c *compiler) compileARM(x asm.Instruction) { operand := c.assembler.Param.RegisterRegister[x.Index] c.append(arm.MulRegisterRegister(operand.Destination, operand.Destination, operand.Source)) case asm.TypeRegisterNumber: - panic("not implemented") + operand := c.assembler.Param.RegisterNumber[x.Index] + tmp := arm.X28 + c.append(arm.MoveRegisterNumber(tmp, operand.Number)) + c.append(arm.MulRegisterRegister(operand.Register, operand.Register, tmp)) } case asm.MODULO: switch x.Type { case asm.TypeRegisterRegister: operand := c.assembler.Param.RegisterRegister[x.Index] - quotient := arm.X28 - c.append(arm.DivSigned(quotient, operand.Destination, operand.Source)) - c.append(arm.MultiplySubtract(operand.Destination, quotient, operand.Source, operand.Destination)) + tmp := arm.X28 + c.append(arm.DivSigned(tmp, operand.Destination, operand.Source)) + c.append(arm.MultiplySubtract(operand.Destination, tmp, operand.Source, operand.Destination)) case asm.TypeRegisterNumber: panic("not implemented") }