Package ghidra.program.model.lang
Class OperandType
java.lang.Object
ghidra.program.model.lang.OperandType
Helper class for testing operand related flags in an integer.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Bit set if the operand is used as an address.static final int
Bit set if the operand is a bit valuestatic final int
Bit set if the operand is a byte valuestatic final int
Bit set it the address referred to contains code.static final int
Bit set if the operand is a co-processor valuestatic final int
Bit set if the address referred to contains data.static final int
Bit set if the operand is dynamically defined given some processorContext.static final int
Bit set if the operand is a flag.static final int
Bit set if the operand is a float valuestatic final int
Bit set if operand is an immediate value.static final int
Bit set if operand is implicit.static final int
Bit set if operand is an indirect reference.static final int
Bit set if the operand is a list.static final int
Bit set if the operand is a port.static final int
Bit set if the operand is a 8 byte valuestatic final int
Bit set if operand refers to an address being readstatic final int
Bit set if the operand is a register.static final int
Bit set if operand depends on the instruction's address.static final int
Bit set if the operand is a scalar valuestatic final int
Bit set if the operand is a signed valuestatic final int
Bit set if the operand is text.static final int
Bit set if the operand is a 2 byte valuestatic final int
Bit set if operand refers to an address being written to -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
doesRead
(int operandType) check the READ flag.static boolean
doesWrite
(int operandType) check the WRITE flag.static boolean
isAddress
(int operandType) check ADDRESS flag.static boolean
isBit
(int operandType) check the BIT flag.static boolean
isByte
(int operandType) check the BYTE flag.static boolean
isCodeReference
(int operandType) check the CODE flag.static boolean
isCoProcessor
(int operandType) check the COPROCESSOR flag.static boolean
isDataReference
(int operandType) check the DATA flag.static boolean
isDynamic
(int operandType) check the DYNAMIC flag.static boolean
isFlag
(int operandType) check the CONDITION FLAG flag.static boolean
isFloat
(int operandType) check the FLOAT flag.static boolean
isImmediate
(int operandType) check the IMMEDIATE flag.static boolean
isImplicit
(int operandType) check the IMPLICIT flag.static boolean
isIndirect
(int operandType) check the INDIRECT flag.static boolean
isList
(int operandType) check the LIST flag.static boolean
isPort
(int operandType) check the PORT flag.static boolean
isQuadWord
(int operandType) check the QUADWORD flag.static boolean
isRegister
(int operandType) check the REGISTER flag.static boolean
isRelative
(int operandType) check the RELATIVE flag.static boolean
isScalar
(int operandType) check SCALAR flag.static boolean
isScalarAsAddress
(int operandType) check if both a scalar and an addressstatic boolean
isSigned
(int operandType) check the SIGNED flag.static boolean
isText
(int operandType) check the TEXT flag.static boolean
isWord
(int operandType) check the WORD flag.static String
toString
(int operandType) returns a string representation of the given operandType
-
Field Details
-
READ
public static final int READBit set if operand refers to an address being read- See Also:
-
WRITE
public static final int WRITEBit set if operand refers to an address being written to- See Also:
-
INDIRECT
public static final int INDIRECTBit set if operand is an indirect reference.- See Also:
-
IMMEDIATE
public static final int IMMEDIATEBit set if operand is an immediate value.- See Also:
-
RELATIVE
public static final int RELATIVEBit set if operand depends on the instruction's address.- See Also:
-
IMPLICIT
public static final int IMPLICITBit set if operand is implicit.- See Also:
-
CODE
public static final int CODEBit set it the address referred to contains code.- See Also:
-
DATA
public static final int DATABit set if the address referred to contains data.- See Also:
-
PORT
public static final int PORTBit set if the operand is a port.- See Also:
-
REGISTER
public static final int REGISTERBit set if the operand is a register.- See Also:
-
LIST
public static final int LISTBit set if the operand is a list.- See Also:
-
FLAG
public static final int FLAGBit set if the operand is a flag.- See Also:
-
TEXT
public static final int TEXTBit set if the operand is text.- See Also:
-
ADDRESS
public static final int ADDRESSBit set if the operand is used as an address. If this is not set, assume it is a scalar value.- See Also:
-
SCALAR
public static final int SCALARBit set if the operand is a scalar value- See Also:
-
BIT
public static final int BITBit set if the operand is a bit value- See Also:
-
BYTE
public static final int BYTEBit set if the operand is a byte value- See Also:
-
WORD
public static final int WORDBit set if the operand is a 2 byte value- See Also:
-
QUADWORD
public static final int QUADWORDBit set if the operand is a 8 byte value- See Also:
-
SIGNED
public static final int SIGNEDBit set if the operand is a signed value- See Also:
-
FLOAT
public static final int FLOATBit set if the operand is a float value- See Also:
-
COP
public static final int COPBit set if the operand is a co-processor value- See Also:
-
DYNAMIC
public static final int DYNAMICBit set if the operand is dynamically defined given some processorContext. If bit is set then the SCALAR or ADDRESS bit must be set.- See Also:
-
-
Constructor Details
-
OperandType
public OperandType()
-
-
Method Details
-
doesRead
public static boolean doesRead(int operandType) check the READ flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the READ flag is set.
-
doesWrite
public static boolean doesWrite(int operandType) check the WRITE flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the WRITE flag is set.
-
isIndirect
public static boolean isIndirect(int operandType) check the INDIRECT flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the INDIRECT flag is set.
-
isImmediate
public static boolean isImmediate(int operandType) check the IMMEDIATE flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the IMMEDIATE flag is set.
-
isRelative
public static boolean isRelative(int operandType) check the RELATIVE flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the RELATIVE flag is set.
-
isImplicit
public static boolean isImplicit(int operandType) check the IMPLICIT flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the IMPLICIT flag is set.
-
isCodeReference
public static boolean isCodeReference(int operandType) check the CODE flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the CODE flag is set.
-
isDataReference
public static boolean isDataReference(int operandType) check the DATA flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the DATA flag is set.
-
isPort
public static boolean isPort(int operandType) check the PORT flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the PORT flag is set.
-
isRegister
public static boolean isRegister(int operandType) check the REGISTER flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the REGISTER flag is set.
-
isList
public static boolean isList(int operandType) check the LIST flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the LIST flag is set.
-
isFlag
public static boolean isFlag(int operandType) check the CONDITION FLAG flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the CONDITION flag is set.
-
isText
public static boolean isText(int operandType) check the TEXT flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the TEXT flag is set.
-
isAddress
public static boolean isAddress(int operandType) check ADDRESS flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the ADDRESS flag is set
-
isScalar
public static boolean isScalar(int operandType) check SCALAR flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the SCALAR flag is set
-
isBit
public static boolean isBit(int operandType) check the BIT flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the BIT flag is set.
-
isByte
public static boolean isByte(int operandType) check the BYTE flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the BYTE flag is set.
-
isWord
public static boolean isWord(int operandType) check the WORD flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the WORD flag is set.
-
isQuadWord
public static boolean isQuadWord(int operandType) check the QUADWORD flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the QUADWORD flag is set.
-
isSigned
public static boolean isSigned(int operandType) check the SIGNED flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the SIGNED flag is set.
-
isFloat
public static boolean isFloat(int operandType) check the FLOAT flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the FLOAT flag is set.
-
isCoProcessor
public static boolean isCoProcessor(int operandType) check the COPROCESSOR flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the COPROCESSOR flag is set.
-
isDynamic
public static boolean isDynamic(int operandType) check the DYNAMIC flag.- Parameters:
operandType
- the bit field to examine.- Returns:
- true if the DYNAMIC flag is set.
-
isScalarAsAddress
public static boolean isScalarAsAddress(int operandType) check if both a scalar and an address- Parameters:
operandType
- the bit field to examine.- Returns:
- true if it is both a scalar and an address
-
toString
returns a string representation of the given operandType- Parameters:
operandType
- the operandType bits- Returns:
- the string rep
-