Files
subcoding/gen/instruction.go

16 lines
265 B
Go
Raw Normal View History

2021-11-20 17:59:22 -10:00
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
}