Package ru.ispras.microtesk.model.memory
Class Location
- java.lang.Object
-
- ru.ispras.microtesk.model.memory.Location
-
- All Implemented Interfaces:
LocationAccessor
public final class Location extends java.lang.Object implements LocationAccessor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Location
assign(Location source)
Location
bitField(int index)
Location
bitField(int start, int end)
Location
bitField(Data index)
Location
bitField(Data start, Data end)
Location
castTo(TypeId typeId)
static Location
concat(Location... locations)
Concatenates the specified locations.int
getBitSize()
Returns the size of the location in bits.Type
getType()
java.math.BigInteger
getValue()
Returns the value stored in the location packed in a BigInteger object.boolean
isInitialized()
Data
load()
static Location
newLocationForAtom(Type type, ru.ispras.microtesk.model.memory.LocationAtom atom)
static Location
newLocationForConst(Data data)
Location
setAddressingMode(AddressingMode addressingMode)
void
setValue(java.math.BigInteger value)
Sets the value of the specified location.void
store(Data data)
void
store(Location source)
java.lang.String
toBinString()
Returns textual representation of stored data (a string of 0 and 1 characters).ru.ispras.fortress.data.types.bitvector.BitVector
toBitVector()
Returns stored data in the form of a bit vector.java.lang.String
toHexString()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Location
public Location(Data data)
-
-
Method Detail
-
newLocationForAtom
public static Location newLocationForAtom(Type type, ru.ispras.microtesk.model.memory.LocationAtom atom)
-
setAddressingMode
public Location setAddressingMode(AddressingMode addressingMode)
-
getType
public Type getType()
-
isInitialized
public boolean isInitialized()
-
load
public Data load()
-
store
public void store(Data data)
-
store
public void store(Location source)
-
bitField
public Location bitField(int start, int end)
-
bitField
public Location bitField(int index)
-
concat
public static Location concat(Location... locations)
Concatenates the specified locations.- Parameters:
locations
- Locations, format is [high, ..., low].- Returns:
- Concatenated location.
-
getBitSize
public int getBitSize()
Description copied from interface:LocationAccessor
Returns the size of the location in bits.- Specified by:
getBitSize
in interfaceLocationAccessor
- Returns:
- Size in bits.
-
toBitVector
public ru.ispras.fortress.data.types.bitvector.BitVector toBitVector()
Description copied from interface:LocationAccessor
Returns stored data in the form of a bit vector.- Specified by:
toBitVector
in interfaceLocationAccessor
- Returns:
- Bit vector.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toBinString
public java.lang.String toBinString()
Description copied from interface:LocationAccessor
Returns textual representation of stored data (a string of 0 and 1 characters).- Specified by:
toBinString
in interfaceLocationAccessor
- Returns:
- Binary string.
-
toHexString
public java.lang.String toHexString()
-
getValue
public java.math.BigInteger getValue()
Description copied from interface:LocationAccessor
Returns the value stored in the location packed in a BigInteger object.- Specified by:
getValue
in interfaceLocationAccessor
- Returns:
- Binary data packed in a BigInteger object.
-
setValue
public void setValue(java.math.BigInteger value)
Description copied from interface:LocationAccessor
Sets the value of the specified location.- Specified by:
setValue
in interfaceLocationAccessor
- Parameters:
value
- Binary data packed in a BigInteger object.
-
-