Open hippietrail opened 4 years ago
6809 is not in 9.1.2. You should be fine copying the 6805 directory out of master into your install, or building from master.
@mumbel Ah yes that worked. I see the 6809 support isn't complete. For instance I'm seeing STD ,X++
when it should be std $81,x
for ED 81
etc (according to another 6809 disassembler at least). I'm assuming this is known and doesn't require reporting issues?
Hi, I'd be curious to know what other disassembler you were using to disassemble that. The Motorola 6809 datasheet I have shows that 0xED is the opcode for an indexed STD, and that a postbyte of 0x81 (being 0b10000001 in binary for reference) does indicate a non-indirect double increment of register 00, which is X. As far as I can tell, STD ,X++ should be correct.
Ah that's good to hear. I did try to verify but found that I'm not great at reading CPU datasheets and I'm too unfamiliar with 6809. It's a little Python disassembler called "udis": https://github.com/jefftranter/udis
I took a look, and it looks like they haven't finished their indexed addressing modes, so they're using that output as a placeholder. I think Ghidra's output is right (at least in that case).
I started a refactor so split out the H6309 and MC6809. There are other variants too. The 6805 isn't compatible with the 6809, they are similar. The addressing modes for the 6809 are all there, just the H6309 aren't. I have seen binaries in the wild that just you the 6309 extended addressing modes but not any additional instructions from the H6309 line. But I am by no means an expert in this processor.
What is the current status? @hippietrail have you been able to use Ghidra to reverse engineer 6809 binaries?
@djmips I didn't continue playing with retrocomputer file formats for much longer. My old comment from 2 years ago is probably as far as I got with 6809 sorry.
Describe the bug The "Select Language and Compiler Specification" dialog lists the 6805 but not the 6809, but the source code directory for the 6805 support includes 6809 support.
To Reproduce Steps to reproduce the behavior:
Expected behavior "6809" should be listed as an option right after "6805"
Screenshots
Attachments If applicable, please attach any files that caused problems or log files generated by the software.
Environment (please complete the following information):
Additional context I also tried using the 6809 in Loader module code, which resulted in this stack trace:
Error importing file: Donkey King (1982)(Microdeal)[!][Black].cas ghidra.program.model.lang.LanguageNotFoundException: Language not found for '6809:BE:16:default' at ghidra.program.util.DefaultLanguageService.getLanguage(DefaultLanguageService.java:109) at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:332) at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:83) at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:112) at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:401) at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:351) at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:90) at ghidra.util.task.Task.monitoredRun(Task.java:126) at ghidra.util.task.TaskRunner.lambda$startTaskThread$1(TaskRunner.java:94) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:835)
Build Date: 2020-Feb-12 1149 EST Ghidra Version: 9.1.2 Java Home: C:\Users\User\tools\jdk\jdk-12.0.2 JVM Version: Oracle Corporation 12.0.2 OS: Windows 10 10.0 amd64 Workstation: HP-ProBook-430-G2