|
|
@ -56,6 +56,8 @@ var instructions = []*Instruction{ |
|
|
|
InstructionSub, |
|
|
|
InstructionSub, |
|
|
|
InstructionMul, |
|
|
|
InstructionMul, |
|
|
|
InstructionDiv, |
|
|
|
InstructionDiv, |
|
|
|
|
|
|
|
InstructionLoadInd, |
|
|
|
|
|
|
|
InstructionStoreInd, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var InstructionStart = &Instruction{ |
|
|
|
var InstructionStart = &Instruction{ |
|
|
@ -218,3 +220,19 @@ var InstructionSub = newMathInstruction("SUB", subInstr) |
|
|
|
var InstructionMul = newMathInstruction("MUL", mulInstr) |
|
|
|
var InstructionMul = newMathInstruction("MUL", mulInstr) |
|
|
|
|
|
|
|
|
|
|
|
var InstructionDiv = newMathInstruction("DIV", divInstr) |
|
|
|
var InstructionDiv = newMathInstruction("DIV", divInstr) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var InstructionLoadInd = &Instruction{ |
|
|
|
|
|
|
|
Name: "LOADIND", |
|
|
|
|
|
|
|
ExecuteWithOperand: func(module *Module, operand float64) error { |
|
|
|
|
|
|
|
module.mmu.Read(Address(operand)) |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var InstructionStoreInd = &Instruction{ |
|
|
|
|
|
|
|
Name: "STOREIND", |
|
|
|
|
|
|
|
ExecuteWithOperand: func(module *Module, operand float64) error { |
|
|
|
|
|
|
|
module.mmu.Write(Address(operand), module.accumulator) |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|