Puts the specified instruction onto the stream and leaves space to include a Label when fixes are done.
[Visual Basic] Overloads Overridable Public Sub Emit( _ ByVal opcode As OpCode, _ ByVal label As Label _ ) [C#] public virtual void Emit( OpCode opcode, Label label ); [C++] public: virtual void Emit( OpCode opcode, Label label ); [JScript] public function Emit( opcode : OpCode, label : Label );
The instruction values are defined in the OpCodes enumeration.
Labels are created using DefineLabel and their location within the stream is fixed by using MarkLabel. If a single-byte instruction is used, the label can represent a jump of at most 127 bytes along the stream. instruction must represent a branch instruction. Since branches are relative instructions, label will be replaced with the correct offset to branch during the fixup process.
ILGenerator Class | ILGenerator Members | System.Reflection.Emit Namespace | ILGenerator.Emit Overload List