D was unhappy about being a custom_field as an immediate.
better: create SignedImmediate class deriving from ImmediateOperand
"SVyd": NonZeroOperand,
"SVzd": NonZeroOperand,
"BD": SignedOperand,
- "D": SignedOperand,
- "DQ": EXTSOperandDQ,
- "DS": EXTSOperandDS,
+ "D": SignedOperand, # TODO, make a SignedImmediate class?
"SI": SignedOperand,
"IB": SignedOperand,
"LI": SignedOperand,
"SVD": SignedOperand,
"SVDS": SignedOperand,
}
+ custom_immediates = {
+ "DQ": EXTSOperandDQ,
+ "DS": EXTSOperandDS,
+ }
operands = []
for operand in iterable:
immediate = None
if immediate is not None:
- if immediate in custom_fields:
- dynamic_cls = custom_fields[immediate]
+ if immediate in custom_immediates:
+ dynamic_cls = custom_immediates[immediate]
operands.append(dynamic_cls(name=immediate))
else:
operands.append(ImmediateOperand(name=immediate))