I am writing a processor module for the Oki6620* architecture. Like ARM's Thumb mode or m7700's M flag, this architecture has a special flag that affects instruction decoding, named DD (Data Descriptor).
For a POC, I have a global flag to my IDA processor definition, and change the DD flag depending on the instruction analysed. However, due to IDA's multithreading when analysing/decoding instructions (notify_ana/notify_emu/etc), this clearly doesn't work well.
Even worse, when clicking around in IDA on random instructions, said instructions sometimes get changed randomly because the current DD flag's value is different from when the instruction was first analysed.
My two main questions are:
- m7700 and ARM both have an option to set the flag from the interface (Alt+G, if I'm not mistaken), and I'm looking for a way to implement this in my module too. Does anybody know how to do that ?
- Also, I'd be interested in input on how one would handle correctly this DD flag depending on the thread actually running (keep DD values in an array, for each block of code between two DD-value-changing instruction ? things like that)
Thank you very much in advance.