Package ru.ispras.microtesk.mmu.basis
Enum DataType
- java.lang.Object
-
- java.lang.Enum<DataType>
-
- ru.ispras.microtesk.mmu.basis.DataType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigInteger
align(java.math.BigInteger address)
Returns the aligned address (zero a required number of bits at the end).int
getLowerAddressBit()
Returns the lower significant bit of the address.int
getSizeInBytes()
Returns the size in bytes.boolean
isAligned(java.math.BigInteger address)
Checks whether the address is aligned (contains a sufficient number of zero bits at the end).static DataType
type(int sizeInBytes)
static DataType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DataType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BYTE
public static final DataType BYTE
The byte data type.
-
HWORD
public static final DataType HWORD
The half-word data type.
-
WORD
public static final DataType WORD
The word data type.
-
DWORD
public static final DataType DWORD
The double-word data type.
-
QWORD
public static final DataType QWORD
The quad-word data type.
-
OWORD
public static final DataType OWORD
The octo-word data type.
-
-
Method Detail
-
values
public static DataType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DataType c : DataType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
type
public static DataType type(int sizeInBytes)
-
getSizeInBytes
public int getSizeInBytes()
Returns the size in bytes.- Returns:
- the size.
-
getLowerAddressBit
public int getLowerAddressBit()
Returns the lower significant bit of the address.- Returns:
- the lower significant bit.
-
isAligned
public boolean isAligned(java.math.BigInteger address)
Checks whether the address is aligned (contains a sufficient number of zero bits at the end).- Parameters:
address
- the address to be checked.- Returns:
true
if the address is aligned;false
otherwise.
-
align
public java.math.BigInteger align(java.math.BigInteger address)
Returns the aligned address (zero a required number of bits at the end).- Parameters:
address
- the address to be aligned.- Returns:
- the aligned address.
-
-