|
|
@ -56,6 +56,8 @@ var instructions = []*Instruction{ |
|
|
|
InstructionSub, |
|
|
|
InstructionSub, |
|
|
|
InstructionMul, |
|
|
|
InstructionMul, |
|
|
|
InstructionDiv, |
|
|
|
InstructionDiv, |
|
|
|
|
|
|
|
InstructionLoadInd, |
|
|
|
|
|
|
|
InstructionStoreInd, |
|
|
|
InstructionDumpReg, |
|
|
|
InstructionDumpReg, |
|
|
|
InstructionDumpProg, |
|
|
|
InstructionDumpProg, |
|
|
|
} |
|
|
|
} |
|
|
@ -221,6 +223,22 @@ 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 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var InstructionDumpReg = &Instruction{ |
|
|
|
var InstructionDumpReg = &Instruction{ |
|
|
|
Name: "DUMPREG", |
|
|
|
Name: "DUMPREG", |
|
|
|
Execute: func(module *Module) error { |
|
|
|
Execute: func(module *Module) error { |
|
|
|