Files
subcoding/gen/instruction.go
2021-11-20 17:59:22 -10:00

16 lines
265 B
Go

package gen
import "github.com/firestuff/subcoding/vm"
func randInstruction() *vm.Instruction {
instr := &vm.Instruction{
OpCode: randOpCode(),
}
for i, t := range vm.OperandsByOpCode[instr.OpCode] {
instr.Operands[i] = randOperand(t)
}
return instr
}