@ -7,7 +7,7 @@ import (
type ProgrammedInstruction struct {
Instruction *Instruction
Operand int64
Operand float64
}
func (pi *ProgrammedInstruction) Execute(module *Module) error {
@ -23,7 +23,7 @@ func (pi *ProgrammedInstruction) Execute(module *Module) error {
type Instruction struct {
Name string
ExecuteWithOperand func(module *Module, operand int64)
ExecuteWithOperand func(module *Module, operand float64)
Execute func(module *Module)
@ -34,7 +34,7 @@ func parseInstruction(input string) (*hal.ProgrammedInstruction, error) {
Instruction: instruction,
if len(args) == 1 {
operand, err := strconv.ParseInt(args[1], 10, 64)
operand, err := strconv.ParseFloat(args[1], 64)
if err != nil {
return nil, fmt.Errorf("error while parsing operand for instruction '%s': %v", input, err)