The current(?) versions of IDA Pro have yet to correct a problem where the 68000 disassembler module does not reference to the program counter in some instructions, breaking bit perfect builds. A patch by drx for IDA 5.x has been released years back, but only patches some cases. A fix is provided below: FIX:
I have been meaning to release this; guess this is as good a place as any. I have come up with a better solution than drx's fix: using an idc script. Save this file as "AddrFixup.idc" somewhere you will remember; then, at any point you want (preferably before exporting to text) run the script (File -> IDC File...). The script is safe for running it multiple times in the same disassembly. My script handles all problem opcodes: Code (Text): jmp (XXX).w jmp (XXX).l jmp XXX(pc) jsr (XXX).w jsr (XXX).l jsr XXX(pc) lea XXX(pc) pea XXX(pc) As can be seen, this includes opcodes not handled by drx's hack. But eh more important part is that the script works for all future versions of IDA as well, instead of being restricted to 5.x.
<br/><br/><br/> The problem opcodes are all fixed in Ti_'s patch. drx's only fixes lea and pea. But for those who are using future versions of IDA, use flamewing's script above.
Removed the IDA 5.x fix because Retro broke the link and I lost the file. Who still uses IDA 5, anyway? EDIT: http://ralakimus.byethost31.com/Public/IDA/mc68.w32 Well, here it is. I wouldn't recommend recommend going back to IDA 5 now due to the bugfixes and many feature improvements in the UI, but the instructions are same as before. Place it where the original mc68.w32 lies (procs folder in IDA 5's Program Files directory).
I have updated the top of the post to include a newer update to the script that works in future versions of IDA starting from 6.8.
Massive bump, but I've made a small modification to flamewing's IDC script to prevent erroneous duplications (i.e. "addr(pc)" -> "addr(pc)(pc)" or "(addr).w" -> "((addr).w).w", and also pull up to date label names.