SetSource sets the source on jump and ALU operations. Returns InvalidOpCode if op is of the wrong class.
(source Source)
| 223 | // |
| 224 | // Returns InvalidOpCode if op is of the wrong class. |
| 225 | func (op OpCode) SetSource(source Source) OpCode { |
| 226 | if !op.Class().isJumpOrALU() || !valid(OpCode(source), sourceMask) { |
| 227 | return InvalidOpCode |
| 228 | } |
| 229 | return (op & ^sourceMask) | OpCode(source) |
| 230 | } |
| 231 | |
| 232 | // SetALUOp sets the ALUOp on ALU operations. |
| 233 | // |