C# Class Mosa.Platform.x86.MachineCodeEmitter

An x86 machine code emitter.
Inheritance: Mosa.Compiler.Framework.BaseCodeEmitter, IDisposable
Show file Open project: tgiphil/MOSA-Project Class Usage Examples

Public Methods

Method Description
Emit ( Mosa.Platform.x86.OpCode opCode ) : void

Emits the specified op code.

Emit ( Mosa.Platform.x86.OpCode opCode, Operand dest ) : void

Emits the specified op code.

Emit ( Mosa.Platform.x86.OpCode opCode, Operand dest, Operand src ) : void

Emits the given code.

Emit ( Mosa.Platform.x86.OpCode opCode, Operand dest, Operand src, Operand third ) : void

Emits the given code.

EmitCallSite ( Operand symbolOperand ) : void

Calls the specified target.

EmitFarJumpToNextInstruction ( ) : void

Emits a far jump to next instruction.

EmitRelativeBranch ( byte code, int dest ) : void

Emits relative branch code.

ResolvePatches ( ) : void

Private Methods

Method Description
CalculateModRM ( byte regField, Operand op1, Operand op2 ) : byte?

Calculates the value of the modR/M byte and SIB bytes.

EmitRelativeBranchTarget ( int label ) : void

Emits the relative branch target.

WriteDisplacement ( Operand displacement ) : void

Emits the displacement operand.

WriteImmediate ( Operand op ) : void

Emits an immediate operand.

Method Details

Emit() public method

Emits the specified op code.
public Emit ( Mosa.Platform.x86.OpCode opCode ) : void
opCode Mosa.Platform.x86.OpCode The op code.
return void

Emit() public method

Emits the specified op code.
public Emit ( Mosa.Platform.x86.OpCode opCode, Operand dest ) : void
opCode Mosa.Platform.x86.OpCode The op code.
dest Mosa.Compiler.Framework.Operand The destination operand.
return void

Emit() public method

Emits the given code.
public Emit ( Mosa.Platform.x86.OpCode opCode, Operand dest, Operand src ) : void
opCode Mosa.Platform.x86.OpCode The op code.
dest Mosa.Compiler.Framework.Operand The destination operand.
src Mosa.Compiler.Framework.Operand The source operand.
return void

Emit() public method

Emits the given code.
public Emit ( Mosa.Platform.x86.OpCode opCode, Operand dest, Operand src, Operand third ) : void
opCode Mosa.Platform.x86.OpCode The op code.
dest Mosa.Compiler.Framework.Operand The dest.
src Mosa.Compiler.Framework.Operand The source.
third Mosa.Compiler.Framework.Operand The third.
return void

EmitCallSite() public method

Calls the specified target.
public EmitCallSite ( Operand symbolOperand ) : void
symbolOperand Mosa.Compiler.Framework.Operand The symbol operand.
return void

EmitFarJumpToNextInstruction() public method

Emits a far jump to next instruction.
public EmitFarJumpToNextInstruction ( ) : void
return void

EmitRelativeBranch() public method

Emits relative branch code.
public EmitRelativeBranch ( byte code, int dest ) : void
code byte The branch instruction code.
dest int The destination label.
return void

ResolvePatches() public method

public ResolvePatches ( ) : void
return void