Fix LOADIND and STOREIND

master
kolaente 5 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{ var InstructionLoadInd = &Instruction{
Name: "LOADIND", Name: "LOADIND",
ExecuteWithOperand: func(module *Module, operand float64) error { ExecuteWithOperand: func(module *Module, operand float64) error {
module.mmu.Read(Address(operand)) module.mmu.Read(Address(module.register[int(operand)]))
return nil return nil
}, },
} }
@ -234,7 +234,7 @@ var InstructionLoadInd = &Instruction{
var InstructionStoreInd = &Instruction{ var InstructionStoreInd = &Instruction{
Name: "STOREIND", Name: "STOREIND",
ExecuteWithOperand: func(module *Module, operand float64) error { 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 return nil
}, },
} }

Loading…
Cancel
Save