SAD disassembler progress

This is where the BIN Hackers and definition junkies discuss the inner workings of the EEC code and hardware. General tuning questions do not go here. Only technical/hardware-specific/code questions and discussions belong here.

Moderators: cgrey8, EDS50, 2Shaker, Jon 94GT

jsa
Tuning Addict
Posts: 698
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: SAD disassembler progress

Post by jsa » Sun Feb 02, 2020 4:31 am

DIR

Code: Select all

WORD 8C62 8C6D
LST 4.04

Code: Select all

8c61: ff,fa               word   faff
8c63: 02,fc               word   fc02    
8c65: 01,7d               word   7d01  
8c67: 01,80               word   8001  
8c69: f0,55               word   55f0       
8c6b: a0,40               word   40a0         
8c6d: 78                  byte     78

LST 3.08

Code: Select all

8c61: ff                  ???   
8c62: fa,02               word    2fa 
8c64: fc,01               word    1fc 
8c66: 7d,01               word    17d  
8c68: 80,f0               word   f080     
8c6a: 55,a0               word   a055   
8c6c: 40,78               word   7840 
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

jsa
Tuning Addict
Posts: 698
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: SAD disassembler progress

Post by jsa » Sun Feb 02, 2020 4:46 am

DIR

Code: Select all

rbase f6 cf34
4.04 LST 4b

Code: Select all

b1ec: 9b,f6,4b,be         cmpb  Rbe,[Rf6+4b]     
b1f0: d9,0b               jgtu  b1fd             if (ATMR1 > 4b) goto b1fd;
3.08 LST cf7f

Code: Select all

b1ec: 9b,f6,4b,be         cmpb  Rbe,[Rf6+4b]     
b1f0: d9,0b               jgtu  b1fd             if (ATMR1 > [cf7f]) goto b1fd;
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

jsa
Tuning Addict
Posts: 698
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: SAD disassembler progress

Post by jsa » Sun Feb 02, 2020 5:02 am

DIR

Code: Select all

timer BA73 BBA6 : W N
4.04 LST null

Code: Select all

b999: a1,73,ba,30         ldw   R30,ba73         R30 = @(null);
3.08

Code: Select all

b999: a1,73,ba,30         ldw   R30,ba73         R30 = ba73;
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

jsa
Tuning Addict
Posts: 698
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: SAD disassembler progress

Post by jsa » Fri Feb 07, 2020 5:09 am

I ran 4.04 on DADS.bin which is an old 32kb bin for the Mk5/6 Escort RS2000.

From a cold start it has disassembled the filler and strategy description at the end of the bin as a Table.
Attachments
DADS.zip
(21.82 KiB) Downloaded 6 times
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

User avatar
tvrfan
Tuning Addict
Posts: 482
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

Re: SAD disassembler progress

Post by tvrfan » Fri Feb 07, 2020 2:25 pm

Thanks John,

At the moment, I am looking at ways to
1. Expand the ends of the 1D functions correctly. Easy if end rows are not all zero.
2. Find a better way to get rows x cols for 2D tables. Trying out a 'least differences' approach which seems to have promise.
Have noted that SAD sometimes gets the tables sizes wrong. (4.0.x actually WORSE than 3.x here. Getting variable arguments to work has affected a lot of other things). This will lead to -
3. Try to sort out remaining data structs like the injection table automatically too.

Some good bugs there to look at. Thanks. I take it they are on CARD ??

NB. There can often be 'phantom' addresses, because a LDW, 2644; could be the address of a data structure, or a mask value, or a multiplier, etc.
Compared to LDX, [R0+2345] ; which is easy, it's always an address. So there are often implied WORD 2644 2645 commands which are deleted internally later, but not always. This is why incorrect WORD, BYTE items sometimes pop up. A TABLE as you described would mean it's picked up a faulty address from somewhere..... This is one of a few 'uncertain' bits in a disassembly, which I think will always be a 'best guess'

I'll copy your posted bin and have a look.

The csv looks doable. I'll get a full BE def and have a look. Of course the descriptions etc are in my comments file, but still OK.


Have spotted a listing bug in indexed opcode printouts in 4.0.4. This sometimes drops the register off the [Rx + 2222] type instructions, and can also mess up any symbols associated. Fixed this in next version.
TVR, kit cars, classic cars. Ex IT geek, development and databases.
https://github.com/tvrfan/EEC-IV-disassembler

jsa
Tuning Addict
Posts: 698
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: SAD disassembler progress

Post by jsa » Fri Feb 07, 2020 5:43 pm

Yes CARD bugs prior to the DADS post.

Yes, I hear you on LDW.

GUFB DEF available from BE site.

http://www.eecanalyzer.net/strategies?v ... fileId=553

Yes comments that are output to listing are in CMT file.
This is fairly typical of comments I place in DIR. These are not intended to go to LST, but provide a breif description of the SYM. Having a breif description in CMT intended for LST gets very messy where the SYM address is used multiple times.

Code: Select all

SYM BC06 "S.DC7_PRD_DT"             #W # Period in DUCE Ticks Ch7
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

User avatar
tvrfan
Tuning Addict
Posts: 482
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

Re: SAD disassembler progress

Post by tvrfan » Sat Feb 08, 2020 3:23 am

jsa,

I see that the DADS bin eludes SAD completely for data items.

I've seen this in a few places in xdt2, where several funcs are referred to via a small list with a register as an index, but DADS seems to do EVERYTHING from preset registers which are NOT setup via the 'standard' rbase mechanism.

OUCH !! That stings.....

This will take some investigation..................................later, after I finish the current batch of stuff.
TVR, kit cars, classic cars. Ex IT geek, development and databases.
https://github.com/tvrfan/EEC-IV-disassembler

jsa
Tuning Addict
Posts: 698
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: SAD disassembler progress

Post by jsa » Sat Feb 08, 2020 4:43 am

Yeah, a bit messier than my first glance.

No worries, all in good time.
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

motorhead1991
Regular
Posts: 165
Joined: Tue Nov 21, 2017 2:32 am

Re: SAD disassembler progress

Post by motorhead1991 » Thu Feb 13, 2020 2:43 am

Pym's SAD806x source is posted on OpenEEC if you want to poke through it. He's got some handy utilities built in to that tool.
1990 Ford Ranger FLH2 conversion. Ford forged/dished pistons, Total Seal file-fit rings, Clevite rod and main bearings, Clevite cam bearings, IHI turbo, Siemens Deka 60lb/hr injectors, Ford slot MAF in custom 3" housing. Moates Quarterhorse with Binary Editor, using the PAAD6 database.

OpenEEC Telegram Chat:
Telegram

User avatar
tvrfan
Tuning Addict
Posts: 482
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

Re: SAD disassembler progress

Post by tvrfan » Thu Feb 13, 2020 7:41 pm

motorhead1991 wrote:
Thu Feb 13, 2020 2:43 am
Pym's SAD806x source is posted on OpenEEC if you want to poke through it. He's got some handy utilities built in to that tool.
thanks - But now my inner dinosaur comes out... How do I compile c# on linux ?? Ummmm....... :oops: <short delay whilst frantic typing noises happen>...Damn, this stuff is all SO different from doing back end command line scripts.....

Ah... 'Mono' ..right. MonoDevelop for an IDE... OK, I'll have a look (and learn some C#). Don't want to rip off other authors work though.

As stated earlier, I've been looking at data analysis for table sizing and other things where SAD missed them, and there will ALWAYS be missed bits because of how disassembly works IMHO (like a pointer list to multiple data structures) and I don't think there's an easy way to sort that out automatically.

OTOH, I have wondered for a while if I an interactive option, notepad-ish style on the listing, would allow the user to define missing stuff in an easy manner (like select a number block, right click and select "this is a 2D table"), and rename my program to SADIE (Semi Automatic Disassembler with Interactive Extensions). 8)

The human brain is MASSIVELY better at instant pattern recognition, so a 'select and click' type interface actually DOES make sense........
and I have got FLTK stuff working and getting used to it (FLTK is an OS independent graphics lib)....................hmm..........
TVR, kit cars, classic cars. Ex IT geek, development and databases.
https://github.com/tvrfan/EEC-IV-disassembler

motorhead1991
Regular
Posts: 165
Joined: Tue Nov 21, 2017 2:32 am

Re: SAD disassembler progress

Post by motorhead1991 » Thu Feb 13, 2020 11:34 pm

tvrfan wrote:
Thu Feb 13, 2020 7:41 pm
motorhead1991 wrote:
Thu Feb 13, 2020 2:43 am
Pym's SAD806x source is posted on OpenEEC if you want to poke through it. He's got some handy utilities built in to that tool.
thanks - But now my inner dinosaur comes out... How do I compile c# on linux ?? Ummmm....... :oops: <short delay whilst frantic typing noises happen>...Damn, this stuff is all SO different from doing back end command line scripts.....

Ah... 'Mono' ..right. MonoDevelop for an IDE... OK, I'll have a look (and learn some C#). Don't want to rip off other authors work though.

As stated earlier, I've been looking at data analysis for table sizing and other things where SAD missed them, and there will ALWAYS be missed bits because of how disassembly works IMHO (like a pointer list to multiple data structures) and I don't think there's an easy way to sort that out automatically.

OTOH, I have wondered for a while if I an interactive option, notepad-ish style on the listing, would allow the user to define missing stuff in an easy manner (like select a number block, right click and select "this is a 2D table"), and rename my program to SADIE (Semi Automatic Disassembler with Interactive Extensions). 8)

The human brain is MASSIVELY better at instant pattern recognition, so a 'select and click' type interface actually DOES make sense........
and I have got FLTK stuff working and getting used to it (FLTK is an OS independent graphics lib)....................hmm..........
The beauty of GIT is that you can give him credit while utilizing the code. Eventually, I'd like to get you all talking more readily so an exchange of ideas goes faster 😁
1990 Ford Ranger FLH2 conversion. Ford forged/dished pistons, Total Seal file-fit rings, Clevite rod and main bearings, Clevite cam bearings, IHI turbo, Siemens Deka 60lb/hr injectors, Ford slot MAF in custom 3" housing. Moates Quarterhorse with Binary Editor, using the PAAD6 database.

OpenEEC Telegram Chat:
Telegram

User avatar
tvrfan
Tuning Addict
Posts: 482
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

SAD bugs in 4.0.4

Post by tvrfan » Sat Feb 15, 2020 4:30 pm

Just a note for users of SAD -

Am working on data cleanups and table/function sizes/layouts/ends, which don't always work correctly.
I've found a couple of bugs to fix....may find some more..........

1) indexed instruction prints sometimes drop the register part of the index in the pseudo code, and also this screws up symbol names too.
The assembler print part is correct however.

2) Discovered some tables are MISSED ALTOGETHER. Not sure if this is all bins, but XDT2 and BWAK3N2 show this problem.

will fix in 4.0.5.
TVR, kit cars, classic cars. Ex IT geek, development and databases.
https://github.com/tvrfan/EEC-IV-disassembler

User avatar
tvrfan
Tuning Addict
Posts: 482
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

Re: SAD disassembler progress

Post by tvrfan » Wed Feb 19, 2020 9:31 pm

motorhead1991 wrote:
Thu Feb 13, 2020 2:43 am
Pym's SAD806x source is posted on OpenEEC if you want to poke through it. He's got some handy utilities built in to that tool.
finally managed to get Mono installed on linux (in a VM) and SAD806x actually compiles and runs, which is great.
I don't know what works on Windows, but on Linux it opens the bin, but not much else.

do I need to change something , or is it pretty much a template at the moment ??
TVR, kit cars, classic cars. Ex IT geek, development and databases.
https://github.com/tvrfan/EEC-IV-disassembler

motorhead1991
Regular
Posts: 165
Joined: Tue Nov 21, 2017 2:32 am

Re: SAD disassembler progress

Post by motorhead1991 » Thu Feb 20, 2020 1:35 am

The tool is fully functional on Windows, haven't tried it on Linux yet.
1990 Ford Ranger FLH2 conversion. Ford forged/dished pistons, Total Seal file-fit rings, Clevite rod and main bearings, Clevite cam bearings, IHI turbo, Siemens Deka 60lb/hr injectors, Ford slot MAF in custom 3" housing. Moates Quarterhorse with Binary Editor, using the PAAD6 database.

OpenEEC Telegram Chat:
Telegram

User avatar
tvrfan
Tuning Addict
Posts: 482
Joined: Sat May 14, 2011 11:41 pm
Location: New Zealand

Re: SAD disassembler progress

Post by tvrfan » Thu Feb 20, 2020 5:39 pm

motorhead1991 wrote:
Thu Feb 20, 2020 1:35 am
The tool is fully functional on Windows, haven't tried it on Linux yet.
Ah, of course I forgot, one must always use a bin which conforms to 'the rules', like the venerable A9L.
My humble AA.bin (and others) don't work of course, because it's European, or more likely because it doesn't begin with 0xff 0xfa 0x20......
OK, trying A9L instead seems to have more life.
(sarcastic ? what me ?? )

I'll have a play around with A9L.
TVR, kit cars, classic cars. Ex IT geek, development and databases.
https://github.com/tvrfan/EEC-IV-disassembler

jsa
Tuning Addict
Posts: 698
Joined: Sat Nov 23, 2013 7:28 pm
Location: 'straya

Re: SAD disassembler progress

Post by jsa » Thu Feb 20, 2020 10:36 pm

Pym is european, that is his primary use.
Cheers

John

95 Escort RS Cosworth - GHAJ0 / ANTI on a COSY box code
Moates QH & BE
ForDiag

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests