Need help getting simple context-dependent instruction working #7002
Replies: 2 comments 1 reply
-
I'll have to look closer at the sleigh code you've provided to solve the issue, but we do have a script that could help in Ghidra. Put the cursor on the first byte of the instruction you're interested in debugging and open the script menu. The script you want to run is |
Beta Was this translation helpful? Give feedback.
-
It turns out there was more to how modal/context works, and I have it working now by adding
|
Beta Was this translation helpful? Give feedback.
-
I'm implementing a processor for a 40-year old bytecode interpreter (GPL for the TI-99/4A) which has two modes and I'm struggling to implement the modal part. It's much simpler than the example in the Sleigh documentation and I'm unclear as to what to leave out to adapt to my case. Here's the relevant parts of my
.slaspec
Of course the
FMT
instruction appears in the disassembly but theFEND
andROW
instructions etc are never recognized.If I add test instructions with the same opcode but don't check
in_fmt
then that gets recognized instead, which makes it seem thatin_fmt
is not getting set to1
as intended, or it's getting reset back to0
somehow. I don't know how to check/debug that case.I tried making
in_fmt
bigger and incrementing and decrementing it insideFMT
andFEND
but that made no difference. (When I make it 32-bit the loader gets stuck in an infinite loop.)What am I missing / doing wrong here?
Beta Was this translation helpful? Give feedback.
All reactions