Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hal/instructions.go
master
Jonas Franz 4 years ago
commit d53f3674fb
  1. 18
      hal/instructions.go

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

Loading…
Cancel
Save