Files
subcoding/vm/instruction.go
2021-11-22 22:19:38 -08:00

22 lines
324 B
Go

package vm
type Instruction struct {
OpCode OpCodeType
Reserved [4]byte
Operands [2]*Operand
opHandler opHandler `struc:"skip"`
}
func (instr *Instruction) Copy() *Instruction {
ret := &Instruction{
OpCode: instr.OpCode,
}
for i, opr := range instr.Operands {
ret.Operands[i] = opr.Copy()
}
return ret
}