Top Description Fields Constructors Methods
com.kenai.jnr.x86asm

public final Class Assembler

extends Serializer
Class Inheritance
Annotations
@Deprecated
Imports
java.nio.ByteBuffer, java.util.LinkedList, .List

Deprecated

Low level code generation.

Field Summary

Modifier and TypeField and Description
private final CodeBuffer
_buffer

Deprecated as a consequence of CodeBuffer being deprecated.
private final Logger
_logger

Deprecated as a consequence of Logger being deprecated.
private int
private final List<RelocData>
pack-priv int
_trampolineSize

Size of possible trampolines.

private final CPU
cpu

Deprecated as a consequence of CPU being deprecated.
private final CpuInfo
cpuInfo

Deprecated as a consequence of CpuInfo being deprecated.
public static final CPU
I386

Deprecated as a consequence of CPU being deprecated.
private static final int[]
private static final int[]
private static final int[]
private static final int[]
private static final int[]
private static final int[]
private static final int[]
private static final int[]
private static final int[]
private static final int[]
private static final int[]
public static final CPU
X86_64

Deprecated as a consequence of CPU being deprecated.

Constructor Summary

AccessConstructor and Description
public
Assembler(CPU cpu)

Deprecated as a consequence of CPU being deprecated.

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
_emitByte(int x)

Emit Byte to internal buffer.

pack-priv LinkData
_emitDisplacement(Label label, long inlinedDisplacement, int size)

Deprecated as a consequence of Label and LinkData being deprecated.
pack-priv final void
_emitDWord(int x)

Emit DWord (4 bytes) to internal buffer.

pack-priv void
_emitFpu(int opCode)

pack-priv void
_emitFpuMEM(int opCode, int opReg, Mem mem)

Deprecated as a consequence of Mem being deprecated.
pack-priv void
_emitFpuSTI(int opCode, int sti)

pack-priv void
_emitImmediate(Immediate imm, int size)

Deprecated as a consequence of Immediate being deprecated.
pack-priv final void
_emitInt32(int x)

Emit Int32 (4 bytes) to internal buffer.

pack-priv void
_emitJmpOrCallReloc(InstructionGroup instruction, long target)

Deprecated as a consequence of InstructionGroup being deprecated.
pack-priv void
_emitMmu(int opCode, int rexw, int opReg, Operand src, int immSize)

Deprecated as a consequence of Operand being deprecated.
pack-priv void
_emitMod(int m, int o, int r)

Emit MODR/M byte.

pack-priv void
_emitModM(int opReg, Mem mem, int immSize)

Deprecated as a consequence of Mem being deprecated.
pack-priv void
_emitModR(int opReg, int r)

Emit Register / Register - calls _emitMod(3, opReg, r)

pack-priv void
_emitModR(int opReg, BaseReg r)

Deprecated as a consequence of BaseReg being deprecated.
Emit Register / Register - calls _emitMod(3, opReg, r.code())
pack-priv void
_emitModRM(int opReg, Operand op, int immSize)

Deprecated as a consequence of Operand being deprecated.
pack-priv final void
_emitOpCode(int opCode)

pack-priv final void
_emitQWord(long x)

Emit QWord (8 bytes) to internal buffer.

pack-priv void
_emitRexR(int w, int opReg, int regCode)

Emit REX prefix (64 bit mode only).

pack-priv void
_emitRexR(boolean w, int opReg, int regCode)

pack-priv void
_emitRexRM(int w, int opReg, Operand rm)

Deprecated as a consequence of Operand being deprecated.
Emit REX prefix (64 bit mode only).
pack-priv void
_emitRexRM(boolean w, int opReg, Operand rm)

Deprecated as a consequence of Operand being deprecated.
pack-priv void
_emitSegmentPrefix(Operand rm)

Deprecated as a consequence of Operand being deprecated.
pack-priv void
_emitSib(int s, int i, int b)

Emit SIB byte.

pack-priv final void
_emitSysInt(long x)

Emit system signed integer (4 or 8 bytes) to internal buffer.

pack-priv final void
_emitWord(int x)

Emit Word (2 bytes) to internal buffer.

pack-priv void
_emitX86(INST_CODE code, Operand o1, Operand o2, Operand o3)

Implements abstract com.kenai.jnr.x86asm.SerializerCore._emitX86.

Deprecated as a consequence of INST_CODE and Operand being deprecated.
pack-priv void
_emitX86Inl(int opCode, boolean i16bit, boolean rexw, int reg)

pack-priv void
_emitX86Inl(int opCode, boolean i16bit, int rexw, int reg)

pack-priv void
_emitX86RM(int opCode, boolean i16bit, boolean rexw, int o, Operand op, int immSize)

Deprecated as a consequence of Operand being deprecated.
pack-priv void
_emitX86RM(int opCode, boolean i16bit, int rexw, int o, Operand op, int immSize)

Deprecated as a consequence of Operand being deprecated.
public void
align(long m)

public final int
codeSize()

Gets the required size of memory required to store all the generated code

public final byte
getByteAt(int pos)

public final int
getDWordAt(int pos)

public final int
getInt32At(int pos)

public final long
getQWordAt(int pos)

public final short
getWordAt(int pos)

private static final int
intValue(boolean b)

pack-priv boolean
public final int
public void
relocCode(ByteBuffer buffer, long address)

public final void
setByteAt(int pos, byte x)

public final void
setDWordAt(int pos, int x)

public final void
setInt32At(int pos, long x)

public final void
setQWordAt(int pos, long x)

public final void
setVarAt(int pos, long i, boolean isUnsigned, int size)

public final void
setWordAt(int pos, short x)

pack-priv int
trampolineSize()

Return size of all possible trampolines needed to successfuly generate relative jumps to absolute addresses.

Field Detail

_bufferback to summary
private final CodeBuffer _buffer

Deprecated

as a consequence of CodeBuffer being deprecated. See corresponding docs for further information.

_loggerback to summary
private final Logger _logger

Deprecated

as a consequence of Logger being deprecated. See corresponding docs for further information.

_propertiesback to summary
private int _properties
_relocDataback to summary
private final List<RelocData> _relocData
_trampolineSizeback to summary
pack-priv int _trampolineSize

Size of possible trampolines.

cpuback to summary
private final CPU cpu

Deprecated

as a consequence of CPU being deprecated. See corresponding docs for further information.

cpuInfoback to summary
private final CpuInfo cpuInfo

Deprecated

as a consequence of CpuInfo being deprecated. See corresponding docs for further information.

I386back to summary
public static final CPU I386

Deprecated

as a consequence of CPU being deprecated. See corresponding docs for further information.

nop1back to summary
private static final int[] nop1
nop10back to summary
private static final int[] nop10
nop11back to summary
private static final int[] nop11
nop2back to summary
private static final int[] nop2
nop3back to summary
private static final int[] nop3
nop4back to summary
private static final int[] nop4
nop5back to summary
private static final int[] nop5
nop6back to summary
private static final int[] nop6
nop7back to summary
private static final int[] nop7
nop8back to summary
private static final int[] nop8
nop9back to summary
private static final int[] nop9
X86_64back to summary
public static final CPU X86_64

Deprecated

as a consequence of CPU being deprecated. See corresponding docs for further information.

Constructor Detail

Assemblerback to summary
public Assembler(CPU cpu)

Deprecated

as a consequence of CPU being deprecated. See corresponding docs for further information.

Method Detail

_emitByteback to summary
pack-priv final void _emitByte(int x)

Emit Byte to internal buffer.

_emitDisplacementback to summary
pack-priv LinkData _emitDisplacement(Label label, long inlinedDisplacement, int size)

Deprecated

as a consequence of Label and LinkData being deprecated. See corresponding docs for further information.

_emitDWordback to summary
pack-priv final void _emitDWord(int x)

Emit DWord (4 bytes) to internal buffer.

_emitFpuback to summary
pack-priv void _emitFpu(int opCode)
_emitFpuMEMback to summary
pack-priv void _emitFpuMEM(int opCode, int opReg, Mem mem)

Deprecated

as a consequence of Mem being deprecated. See corresponding docs for further information.

_emitFpuSTIback to summary
pack-priv void _emitFpuSTI(int opCode, int sti)
_emitImmediateback to summary
pack-priv void _emitImmediate(Immediate imm, int size)

Deprecated

as a consequence of Immediate being deprecated. See corresponding docs for further information.

_emitInt32back to summary
pack-priv final void _emitInt32(int x)

Emit Int32 (4 bytes) to internal buffer.

_emitJmpOrCallRelocback to summary
pack-priv void _emitJmpOrCallReloc(InstructionGroup instruction, long target)

Deprecated

as a consequence of InstructionGroup being deprecated. See corresponding docs for further information.

_emitMmuback to summary
pack-priv void _emitMmu(int opCode, int rexw, int opReg, Operand src, int immSize)

Deprecated

as a consequence of Operand being deprecated. See corresponding docs for further information.

_emitModback to summary
pack-priv void _emitMod(int m, int o, int r)

Emit MODR/M byte.

_emitModMback to summary
pack-priv void _emitModM(int opReg, Mem mem, int immSize)

Deprecated

as a consequence of Mem being deprecated. See corresponding docs for further information.

_emitModRback to summary
pack-priv void _emitModR(int opReg, int r)

Emit Register / Register - calls _emitMod(3, opReg, r)

_emitModRback to summary
pack-priv void _emitModR(int opReg, BaseReg r)

Deprecated

as a consequence of BaseReg being deprecated. See corresponding docs for further information.

Emit Register / Register - calls _emitMod(3, opReg, r.code())

_emitModRMback to summary
pack-priv void _emitModRM(int opReg, Operand op, int immSize)

Deprecated

as a consequence of Operand being deprecated. See corresponding docs for further information.

_emitOpCodeback to summary
pack-priv final void _emitOpCode(int opCode)
_emitQWordback to summary
pack-priv final void _emitQWord(long x)

Emit QWord (8 bytes) to internal buffer.

_emitRexRback to summary
pack-priv void _emitRexR(int w, int opReg, int regCode)

Emit REX prefix (64 bit mode only).

_emitRexRback to summary
pack-priv void _emitRexR(boolean w, int opReg, int regCode)
_emitRexRMback to summary
pack-priv void _emitRexRM(int w, int opReg, Operand rm)

Deprecated

as a consequence of Operand being deprecated. See corresponding docs for further information.

Emit REX prefix (64 bit mode only).

_emitRexRMback to summary
pack-priv void _emitRexRM(boolean w, int opReg, Operand rm)

Deprecated

as a consequence of Operand being deprecated. See corresponding docs for further information.

_emitSegmentPrefixback to summary
pack-priv void _emitSegmentPrefix(Operand rm)

Deprecated

as a consequence of Operand being deprecated. See corresponding docs for further information.

_emitSibback to summary
pack-priv void _emitSib(int s, int i, int b)

Emit SIB byte.

_emitSysIntback to summary
pack-priv final void _emitSysInt(long x)

Emit system signed integer (4 or 8 bytes) to internal buffer.

_emitWordback to summary
pack-priv final void _emitWord(int x)

Emit Word (2 bytes) to internal buffer.

_emitX86back to summary
pack-priv void _emitX86(INST_CODE code, Operand o1, Operand o2, Operand o3)

Implements abstract com.kenai.jnr.x86asm.SerializerCore._emitX86.

Deprecated

as a consequence of INST_CODE and Operand being deprecated. See corresponding docs for further information.

_emitX86Inlback to summary
pack-priv void _emitX86Inl(int opCode, boolean i16bit, boolean rexw, int reg)
_emitX86Inlback to summary
pack-priv void _emitX86Inl(int opCode, boolean i16bit, int rexw, int reg)
_emitX86RMback to summary
pack-priv void _emitX86RM(int opCode, boolean i16bit, boolean rexw, int o, Operand op, int immSize)

Deprecated

as a consequence of Operand being deprecated. See corresponding docs for further information.

_emitX86RMback to summary
pack-priv void _emitX86RM(int opCode, boolean i16bit, int rexw, int o, Operand op, int immSize)

Deprecated

as a consequence of Operand being deprecated. See corresponding docs for further information.

alignback to summary
public void align(long m)
codeSizeback to summary
public final int codeSize()

Gets the required size of memory required to store all the generated code

getByteAtback to summary
public final byte getByteAt(int pos)
getDWordAtback to summary
public final int getDWordAt(int pos)
getInt32Atback to summary
public final int getInt32At(int pos)
getQWordAtback to summary
public final long getQWordAt(int pos)
getWordAtback to summary
public final short getWordAt(int pos)
intValueback to summary
private static final int intValue(boolean b)
is64back to summary
pack-priv boolean is64()

Implements abstract com.kenai.jnr.x86asm.SerializerCore.is64.

Annotations
@Override
offsetback to summary
public final int offset()
relocCodeback to summary
public void relocCode(ByteBuffer buffer, long address)
setByteAtback to summary
public final void setByteAt(int pos, byte x)
setDWordAtback to summary
public final void setDWordAt(int pos, int x)
setInt32Atback to summary
public final void setInt32At(int pos, long x)
setQWordAtback to summary
public final void setQWordAt(int pos, long x)
setVarAtback to summary
public final void setVarAt(int pos, long i, boolean isUnsigned, int size)
setWordAtback to summary
public final void setWordAt(int pos, short x)
trampolineSizeback to summary
pack-priv int trampolineSize()

Return size of all possible trampolines needed to successfuly generate relative jumps to absolute addresses. This value is only non-zero if jmp of call instructions were used with immediate operand (this means jump or call absolute address directly). Currently only _emitJmpOrCallReloc() method can increase trampoline size value.