Variable length encoding of address modes and operands #7091
Replies: 1 comment 1 reply
-
It's absolutely possible, although it might be complicated if the second gdest scenario has non-contiguous bytes, but that can be dealt with as well. I would suggest looking at the m68000 module's addressing modes, or x86's memory operands. Essentially, what you need is ellipses. Imagine you have a add instruction with an opcode of 0x4. So you might have |
Beta Was this translation helpful? Give feedback.
-
There's still a few things in Sleigh that I don't grasp after reading the docs a few times, looking at the
slaspec
of CPUs I have some familiarity with, and hands-on experimentation with my own processor definition.The language I'm working on has an operand type the manual refers to as
gdest
which works like this:So far I've just been making a new entry in my
slaspec
for each combination of opcode and addressing mode as I run into them in the sample binaries I'm disassembling.But it's getting unwieldy, especially when some opcodes can take two
gdest
operands.I feel like there must be a way to define this
gdest
once that can handle all three lengths, that I can refer to from any opcode as needed.But I'm stuck with where to look to proceed. The closest I can think of is opcodes involving a prefix byte on some CPUs, but that seems too different.
Is it even possible?
Beta Was this translation helpful? Give feedback.
All reactions