Puts the specified instruction onto the stream and leaves space to include a Label when fixes are done.
Emits a switch table.
[Visual Basic] Overloads Overridable Public Sub Emit( _ ByVal opcode As OpCode, _ ByVal labels() As Label _ ) [C#] public virtual void Emit( OpCode opcode, Label[] labels ); [C++] public: virtual void Emit( OpCode opcode, Label* labels[] ); [JScript] public function Emit( opcode : OpCode, labels : Label[] );
The instruction values are defined in the OpCodes enumeration.
Labels are created using ILGenerator.CreateLabel and their location within the stream is fixed by using ILGenerator.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