Files
subcoding/vm/instruction.go

22 lines
324 B
Go
Raw Normal View History

2021-11-15 20:44:26 -10:00
package vm
type Instruction struct {
OpCode OpCodeType
Reserved [4]byte
2021-11-20 09:46:51 -10:00
Operands [2]*Operand
2021-11-15 20:44:26 -10:00
2021-11-16 15:27:30 -10:00
opHandler opHandler `struc:"skip"`
2021-11-15 20:44:26 -10:00
}
func (instr *Instruction) Copy() *Instruction {
ret := &Instruction{
OpCode: instr.OpCode,
}
for i, opr := range instr.Operands {
ret.Operands[i] = opr.Copy()
}
return ret
}