Looking for a disassembler (68030+68882).

Atari talk, or the life and the universe and things. Just keep it clean!
czietz
Posts: 306
Joined: Sun Jan 14, 2018 1:02 pm

Re: Looking for a disassembler (68030+68882).

Post by czietz » Wed May 06, 2020 6:03 pm

I also find it disassembles really well with Ghidra.

Find my project here: https://ocean.czietz.de/index.php/s/gnPECUEkRf1sCbc. You can import it via "File -> Restore project". I added some labels based on my initial analysis. One particularly interesting function is (what I called) print_registers(). It prints register addresses (virtual and physical) and therefore gives you a rough memory map.

czietz
Posts: 306
Joined: Sun Jan 14, 2018 1:02 pm

Re: Looking for a disassembler (68030+68882).

Post by czietz » Wed May 06, 2020 6:07 pm

mrbombermillzy wrote:
Wed May 06, 2020 6:00 pm
Im not one for wearing tin foil hats, but I draw a line with my lack of paranoia when it comes to downloading NSA warez.
It was a while ago now, so I may be mistaken, but I believe the demo version doesnt include the full available CPU ranges, but it does have 68k as one of the freebies.
Are you maybe mixing up some things?

IDA is a commercial tool, in no way affiliated with the NSA. The "demo" version (IDA Free) only includes x86 and is therefore not helpful for the task at hand. There's is a planned (not yet released) IDA Home version, where you would pay 365$ per year per CPU family, e.g. 68k.

In contrast, Ghidra is a NSA tool, but in no way "warez". They released it as open-source about a year ago. Ghidra includes support for 68k (and a lot of other CPUs, as well).

czietz
Posts: 306
Joined: Sun Jan 14, 2018 1:02 pm

Re: Looking for a disassembler (68030+68882).

Post by czietz » Wed May 06, 2020 6:09 pm

stephen_usher wrote:
Wed May 06, 2020 5:44 pm
I may be getting somewhere with Ghidra, as long as I ignore a lot of the first code which deals with the address translation tables. which the C decompiler barfs on.
The decompiler is only a help, albeit a very powerful one. Don't expect it to produce perfect C code. Look at the disassembly, if in doubt.

stephen_usher
Trusted Guru
Trusted Guru
Posts: 711
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Looking for a disassembler (68030+68882).

Post by stephen_usher » Wed May 06, 2020 6:17 pm

@czietz thanks!

I'll take a look at your project this evening. Initially I'm just worried about the 8530 SCC test and initialisation as if I can get that functionality replicated I'll be able to get to the point where the machine should get to the point where it can run diagnostics and tell me what's missing.

It may be that eventually I have a hydrid where I merely replace the broken functionality and let the original chip continue to do the rest.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.

User avatar
mrbombermillzy
Posts: 121
Joined: Sun Jun 03, 2018 7:37 pm

Re: Looking for a disassembler (68030+68882).

Post by mrbombermillzy » Wed May 06, 2020 6:41 pm

czietz wrote:
Wed May 06, 2020 6:07 pm
mrbombermillzy wrote:
Wed May 06, 2020 6:00 pm
Im not one for wearing tin foil hats, but I draw a line with my lack of paranoia when it comes to downloading NSA warez.
It was a while ago now, so I may be mistaken, but I believe the demo version doesnt include the full available CPU ranges, but it does have 68k as one of the freebies.
Are you maybe mixing up some things?
Perhaps. It was a while ago now! Oops! :D

Although in my defence, the manual does state it is used by government three letter agencies, and I would still be paranoid to download an illegal copy of ANY of these products from some warez site.

stephen_usher
Trusted Guru
Trusted Guru
Posts: 711
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Looking for a disassembler (68030+68882).

Post by stephen_usher » Wed May 06, 2020 9:03 pm

Thanks for the help. I'm now getting somewhere, at least on the programmatic side.

I've trying to work out using the MAME/MESS sun3x.cpp how the 8350 SCC is mapped and controlled but I can't make head nor tail of the C++ code in MAME with regards to that driver. As the chip doesn't have an address bus it's got to be controlled by support chips but I can't see how the code is defining them.

I see that there are four addresses being used by the ROM code, maybe they are register read/write data read/write, which then merely control the D/C and A/B lines? Oh well, I've got a head ache now so I'll stop for the evening.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.

stephen_usher
Trusted Guru
Trusted Guru
Posts: 711
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Looking for a disassembler (68030+68882).

Post by stephen_usher » Wed May 06, 2020 11:10 pm

OK, all good, I've worked it out, with the help of the Sun 3/60 schematics which has a very similar "DECODE1" type chip. This one's a 20L8 PAL running a state machine, so it's quite possible that a 22V10 GAL will do the job. The state machine is for the timing when talking to the SCC.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.

czietz
Posts: 306
Joined: Sun Jan 14, 2018 1:02 pm

Re: Looking for a disassembler (68030+68882).

Post by czietz » Thu May 07, 2020 7:45 am

Just by looking at the disassembly (didn't check any schematic), I would say 0x62002004 is the address of the control register (for one channel of the SCC) and 0x62002006 is the corresponding data register. Look at the ROM at approx. 0xfefeb5e2. You can see how it tests for Tx buffer empty...

Code: Select all

btst.b     0x2 ,(DAT_62002004 ).l
... before putting characters into 0x62002006. A bit further down, it checks for Rx data available...

Code: Select all

        fefeb62a 1c  39  62       move.b     (DAT_62002004 ).l,D6b                            = ??
                 00  20  04
        fefeb630 08  06  00  00    btst.l     0x0 ,D6
... reads data and checks for keys 'q' or 'Esc':

Code: Select all

        fefeb642 1c  39  62       move.b     (DAT_62002006 ).l,D6b                            = ??
                 00  20  06
        fefeb648 0c  06  00  71    cmpi.b     #0x71 ,D6b
        fefeb64c 67  00  ff  3e    beq.w      LAB_fefeb58c
        fefeb650 0c  06  00  1b    cmpi.b     #0x1b ,D6b
        fefeb654 66  00  00  12    bne.w      LAB_fefeb668

stephen_usher
Trusted Guru
Trusted Guru
Posts: 711
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: Looking for a disassembler (68030+68882).

Post by stephen_usher » Thu May 07, 2020 10:08 am

Yeah, this seems quite different from the 3/60 where the /AB /DC lines are linked directly to a couple of address lines.

With regards to addresses, there are a few other addresses being accessing in that range. During first initialisation it's using 0x62002000 and 0x62002002. I'm guessing that these are the other channel on the serial chip.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.

User avatar
thorsten.otto
Posts: 85
Joined: Mon Nov 04, 2019 2:20 am

Re: Looking for a disassembler (68030+68882).

Post by thorsten.otto » Thu May 07, 2020 10:57 am

Maybe already solved, but attached is another output. Unlike ghidra, that tool does not attempt to analyze the code, and just dissasmbles anything (including data). It is however capable of detecting some jump tables. Maybe it will be helpful, too.
Attachments
sun_3.80V2.9.2-disasm.zip
(245.51 KiB) Downloaded 18 times

Post Reply

Return to “CHAT FORUM”