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