Fix LOADIND and STOREIND

master
kolaente 4 years ago
parent ad4fa21f7e
commit f29bcbb2ae
Signed by: kolaente
GPG Key ID: F40E70337AB24C9B
  1. 4
      hal/instructions.go

@ -226,7 +226,7 @@ var InstructionDiv = newMathInstruction("DIV", divInstr)
var InstructionLoadInd = &Instruction{
Name: "LOADIND",
ExecuteWithOperand: func(module *Module, operand float64) error {
module.mmu.Read(Address(operand))
module.mmu.Read(Address(module.register[int(operand)]))
return nil
},
}
@ -234,7 +234,7 @@ var InstructionLoadInd = &Instruction{
var InstructionStoreInd = &Instruction{
Name: "STOREIND",
ExecuteWithOperand: func(module *Module, operand float64) error {
module.mmu.Write(Address(operand), module.accumulator)
module.mmu.Write(Address(module.register[int(operand)]), module.accumulator)
return nil
},
}

Loading…
Cancel
Save