You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I wanted to find instructions with all inputs as Immediate values, using the ghidra.program.model.lang.OperandType.isImmediate(int) method for each operand's type. When it didn't work as expected, I searched the sources for where OperandType.IMMEDIATE was used to set the OperandType and can't find any such use. I would expect it to be used in SleighInstructionPrototype.java.
OperandType.SCALAR is implemented and seems to be set for (some) operands that use the "const" space, but doesn't seem to cover all operands for reasons I don't understand.
I wish the documentation explained what the different types are and how they are determined. If isImmediate is not expected to be usable, perhaps the references to it and OperandType.IMMEDIATE should be removed from the documentation.
I am working with an unsupported cpu, but the example below is for a cpu distributed with Ghidra.
Get instruction info at 0xD10C (instruction 0x69 0x1f: ADC #0x1f)
Operand: #0x1f
Labeled: #0x1f
Type: DYN
Scalar:
Address:
Register:
Op-Objects: const:0x1f
Operand Mask: 00000000 11111111
Masked Value: 00000000 00011111
Expected behavior
The OperandType should be Immediate (vs Dynamic).
Note that for a X86-64 cpu, the second operand of AND BH, 0x8 is typed as a Scalar. I don't know why the difference between Dynamic and Scalar for the two operands, both in "const" space.
Attachments
None
Environment:
OS: macOS 15.2
Java Version: 21.0.5
Ghidra Version: 11.3.1
Ghidra Origin: official GitHub distro
Additional context
None
The text was updated successfully, but these errors were encountered:
IMMEDIATE is probably not the only operand type to have issues. For instance "QUADWORD" is only found in OperandType.java. (I looked at it because it is documented as "Bit set if the operand is a 8 byte value", which is confusing if a processor has a 4-byte word.)
Describe the bug
I wanted to find instructions with all inputs as Immediate values, using the ghidra.program.model.lang.OperandType.isImmediate(int) method for each operand's type. When it didn't work as expected, I searched the sources for where OperandType.IMMEDIATE was used to set the OperandType and can't find any such use. I would expect it to be used in SleighInstructionPrototype.java.
OperandType.SCALAR is implemented and seems to be set for (some) operands that use the "const" space, but doesn't seem to cover all operands for reasons I don't understand.
I wish the documentation explained what the different types are and how they are determined. If isImmediate is not expected to be usable, perhaps the references to it and OperandType.IMMEDIATE should be removed from the documentation.
I am working with an unsupported cpu, but the example below is for a cpu distributed with Ghidra.
To Reproduce
Steps to reproduce the behavior:
Operand: #0x1f
Labeled: #0x1f
Type: DYN
Scalar:
Address:
Register:
Op-Objects: const:0x1f
Operand Mask: 00000000 11111111
Masked Value: 00000000 00011111
Expected behavior
The OperandType should be Immediate (vs Dynamic).
Note that for a X86-64 cpu, the second operand of AND BH, 0x8 is typed as a Scalar. I don't know why the difference between Dynamic and Scalar for the two operands, both in "const" space.
Attachments
None
Environment:
Additional context
None
The text was updated successfully, but these errors were encountered: