Handling banked ROM #6651
-
Hi, I'm trying to work on a system (based on an Hitachi HD6305Y2 MCU, basically a CMOS 6805 with a different memory map) where the ROM gets split in two banks mapped on addresses 0x01FF-0x3FFF and 0x41FF-0x7FFF selected by toggling a single bit in a register. The issue is that Ghidra obviously doesn't recognize the existence of two banks, so a lot of jump/branch addresses are completely wrong; what I was wondering is: is there any way (maybe by modifying the Sleigh spec) of making Ghidra recognize the different bank and recognize that the two instructions |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The easiest fix is to add a bank select context register value
then specific constructors for
You'll need to modify the addressing modes to account for the bit, as an example:
but there's more accesses that need to be done. You would want to make sure that you only update the addressing modes for instructions that use the paging. I haven't verified any of that, but this should at least address the jump instructions however. |
Beta Was this translation helpful? Give feedback.
The easiest fix is to add a bank select context register value
then specific constructors for
BSET
andBCLR
for setting it:You'll need to modify the addressing modes to account for the bit, as an example: