diff --git a/hal/instructions.go b/hal/instructions.go index 7e64679..afd1969 100644 --- a/hal/instructions.go +++ b/hal/instructions.go @@ -40,6 +40,7 @@ var instructions = []*Instruction{ InstructionStop, InstructionIn, InstructionOut, + InstructionAddnum, } var InstructionStart = &Instruction{ @@ -70,3 +71,10 @@ var InstructionIn = &Instruction{ // TODO implement }, } + +var InstructionAddnum = &Instruction{ + Name: "ADDNUM", + ExecuteWithOperand: func(module *Module, operand float64) { + module.accumulator = module.accumulator + operand + }, +}