Package org.deepjava.unsafe
Class US
- java.lang.Object
-
- org.deepjava.unsafe.US
-
-
Constructor Summary
Constructors Constructor Description US()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
ADR_OF_METHOD(String name)
Get absolute address of class methodstatic void
ASM(String instr)
Insert single machine code instructionstatic boolean
BIT(int address, int bitNr)
Read a bit at hardware address: return BIT(mem[address](byte), bitNr)static byte
GET1(int address)
Read 1 byte from hardware address: return mem[address]static short
GET2(int address)
Read 2 byte from hardware address: return mem[address]static int
GET4(int address)
Read 4 byte from hardware address: return mem[address]static long
GET8(int address)
Read 8 byte from hardware address: return mem[address]static void
PUT1(int address, int value)
Write 1 byte to hardware address: mem[address] = (byte)valuestatic void
PUT2(int address, int value)
Write 2 byte to hardware address: mem[address] = (short)valuestatic void
PUT4(int address, int value)
Write 4 byte to hardware address: mem[address] = valuestatic void
PUT8(int address, long value)
Write 8 byte to hardware address: mem[address] = valuestatic int
REF(Object ref)
Returns object reference as address
-
-
-
Method Detail
-
PUT1
public static void PUT1(int address, int value)
Write 1 byte to hardware address: mem[address] = (byte)value- Parameters:
address
- Memory address to write to.value
- Byte value.
-
PUT2
public static void PUT2(int address, int value)
Write 2 byte to hardware address: mem[address] = (short)value- Parameters:
address
- Memory address to write to.value
- Two byte value.
-
PUT4
public static void PUT4(int address, int value)
Write 4 byte to hardware address: mem[address] = value- Parameters:
address
- Memory address to write to.value
- Four byte value.
-
PUT8
public static void PUT8(int address, long value)
Write 8 byte to hardware address: mem[address] = value- Parameters:
address
- Memory address to write to.value
- Eight byte value.
-
GET1
public static byte GET1(int address)
Read 1 byte from hardware address: return mem[address]- Parameters:
address
- Memory address to read from.- Returns:
- Byte value.
-
GET2
public static short GET2(int address)
Read 2 byte from hardware address: return mem[address]- Parameters:
address
- Memory address to read from.- Returns:
- Two byte value.
-
GET4
public static int GET4(int address)
Read 4 byte from hardware address: return mem[address]- Parameters:
address
- Memory address to read from.- Returns:
- Four byte value.
-
GET8
public static long GET8(int address)
Read 8 byte from hardware address: return mem[address]- Parameters:
address
- Memory address to read from.- Returns:
- Eight byte value.
-
BIT
public static boolean BIT(int address, int bitNr)
Read a bit at hardware address: return BIT(mem[address](byte), bitNr)- Parameters:
address
- Memory address.bitNr
- Bit number (0 .. 31).- Returns:
true
if bit set.
-
ASM
public static void ASM(String instr)
Insert single machine code instruction- Parameters:
instr
- Machine instruction as string.
-
ADR_OF_METHOD
public static int ADR_OF_METHOD(String name)
Get absolute address of class method- Parameters:
name
- Name of method.- Returns:
- Memory address of method.
-
REF
public static int REF(Object ref)
Returns object reference as address- Parameters:
ref
- Object reference.- Returns:
- Memory address of object.
-
-