Why auto disassembly is tough

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, Jon 94GT, 2Shaker

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

Re: Why auto disassembly is tough

Post by jsa » Sat Apr 14, 2018 5:22 pm

tvrfan wrote:
Fri Apr 13, 2018 7:37 pm
Thanks jsa - you spot the details I miss !!
I can honestly say I completely missed INC and DEC as possibly being used with carry ... DUH ! Stupid error.
No worries, It is used sparingly, and I know how easy it is to overlook errors having worked on something for a period. Who knows what other little tricks are being used that have yet to be noticed.

Flag/bit names - again another slight catch 22 here - and an idea...

For scratch registers (typically R30 - R40 seem to be used a lot), sometimes it's several flags at once,
and sometimes its a genuine number mask (like for example A/D reads are only 10 bits). So where the AND and OR is done
with an immediate value, SAD looks for any bit names.
I was wondering whether to have a TYPE of variable as 'FLAGS' to define this behaviour, but it still wouldn't work for scratch/temp registers.
A 'FLAGS' type seems like a very good idea to cover BITS in addition to the bytes and words.

In the small number of bins I have looked at, the flags seem to be given pride of place below 0xff, so address range seems viable.

Yeah, scratch registers are unruly beasts, chopping and changing between bits, bytes and words.
Really need to define multiple subr address ranges where the scratch has a particular purpose for each range.

BUT also have in the background the idea that you can declare data types and they would be tracked/transferable.....
- i.e Types
Plain Word, Byte, Flags (word,byte) Nothing. perhaps signed/unsigned ?
I don't follow how this would differ from adding BITS to bytes and words.
IOtime (word/byte. long?) autoconvert to millisecs, but would require clock speed, unless I can spot a way to get it from code. (Timers subroutine?)
I think it would be possible to deduce clock speed from the code.

Code: Select all

ADvalue (word),   auto convert to volts 0-5
I don't know that 0-5 really gives anything more. The final units by way of divisor or formula seems like the goal to me.
RPM (word) auto convert (divide by 4) all are x4 as far as I can see. seems to be a standard
In CARD I have x/4, x*8, x*16, x*32 & x*64
Temp ? trickier, as Euro tend to use C and US ones use F (well, A9L does, don't know if later ones went metric)
Yeah, needs a formula. I have CARD (Euro) pegged at Fº, but converted to Cº would be best.

After that so far I see other variables don't have a common calibration, but perhaps could declare them .
or perhaps allow the idea of a divisor/multiplier factor on all SYM (only on tables/funcs to 3.05) which get used in print phase ?

The the idea that when you do R34 = R36, or R34 = [1234] the TYPE (or divisor) of the variable gets transferred to R34 as well as its value.
Yes SYM would work mostly. Could do with formulas and more than two decimal places for divisors, for all of S F T.

Yes tracking it through makes sense.

But then I can't decide if it's too complex....what if two different types get added ?
Do they though? Are you aware of any instances where it happens? I am not, but have I been paying enough attention!

Thank you for the Flag examples, I shall add some later today.
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Sat Apr 14, 2018 6:02 pm

tvrfan wrote:
Sat Apr 14, 2018 3:34 pm
motorhead1991 wrote:
Sat Apr 14, 2018 12:19 am
So uh, I did a thing.... Testing it here in a second
The image is blurry AF, stupid Linux. Anyways, tvrfan your code is so good it's portable to Android.
Well, from what techie stuff I read, Android is supposed to have a Linux kernel/core !
I am trying to keep the code 'clean' C/C++, so a certified compiler should make it runnable on any environment which has the standard 'C' libraries.
Code does expect at least a 32 bit compiler and environment.
As per Github, I use exactly the same code for Win32 and Linux 64.

Good to know though ..... see the advert .....!!! SAD NOW RUNS ON MOBILE DEVICES !!!
That's exactly right, but it's not identical. I'm looking into adapting it to the Android C libraries and shells. It also takes some special permissions and other nonsense, since read/writing to the SD card is privileged.
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

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

Re: Why auto disassembly is tough

Post by jsa » Sat Apr 14, 2018 6:05 pm

motorhead1991 wrote:
Sat Apr 14, 2018 12:19 am
tvrfan your code is so good it's portable to Android.
Niiiiiice, what are you using to build it?
Would you put it on the play store?
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Sat Apr 14, 2018 6:11 pm

jsa wrote:
Sat Apr 14, 2018 6:05 pm
motorhead1991 wrote:
Sat Apr 14, 2018 12:19 am
tvrfan your code is so good it's portable to Android.
Niiiiiice, what are you using to build it?
Would you put it on the play store?
Right now, it's just a binary, so you'd run it from a command terminal (not something the average Android user does). Eventually, I'd like to design a UI for it and make a release candidate, but I'll need to figure out how to bind it to the binary.

I built it within the Android build system, with only a couple edits to the source material (available on OpenEEC)
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

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

Re: Why auto disassembly is tough

Post by tvrfan » Sat Apr 14, 2018 6:52 pm

Motorhead
Does Android provide for calling a console prog from the GUI ? if it's Linux based you should be able to.
This way the actual SAD code stays identical and the GUI is a separate wrapper (which is what I did for Win32).
[which reminds me, must look at a Linux GUI / Xwin wrapper ]

glad that SAD works anyway - extra validation my code is clean!

jsa - 3.06 I have now changed for prints to be 3 decimal places in floats as per request. I want to stay fixed number of digits so it makes table and func layout easier to control (i.e. in neat columns) The command read in 3.05 is already (or should be) a full float, so can use more digits. Can't remember for sure if std C library rounds the floats (I think it does).


timel is a Timer list structure. half developed - may work, works on AA and A9L, but not on multibanks. Should have dropped this command off !!

Allowing divisor/multiplier on all variables (via SYM) so that user can calibrate whatever makes sense to him/her.
The types idea was really just a kind of predefined way of specifying that divisor anyway.

[edit] Oops ! when I check the code, 3.05 should ALREADY allow divisors ( :V) on all word and byte cmds - not tested, but should work as I use a generic print routine for all data. Will add to SYM as well for 3.06

Will put these in 3.06 to assess also

:B (:F ?) for flags word/byte to force individual bits to be displayed with AND and OR

See if i can come up with a simpler rule for the example PUSH(R34) to generate a SCAN....
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Sat Apr 14, 2018 8:20 pm

tvrfan wrote:
Sat Apr 14, 2018 6:52 pm
Motorhead
Does Android provide for calling a console prog from the GUI ? if it's Linux based you should be able to.
This way the actual SAD code stays identical and the GUI is a separate wrapper (which is what I did for Win32).
[which reminds me, must look at a Linux GUI / Xwin wrapper ]

glad that SAD works anyway - extra validation my code is clean!

jsa - 3.06 I have now changed for prints to be 3 decimal places in floats as per request. I want to stay fixed number of digits so it makes table and func layout easier to control (i.e. in neat columns) The command read in 3.05 is already (or should be) a full float, so can use more digits. Can't remember for sure if std C library rounds the floats (I think it does).


timel is a Timer list structure. half developed - may work, works on AA and A9L, but not on multibanks. Should have dropped this command off !!

Allowing divisor/multiplier on all variables (via SYM) so that user can calibrate whatever makes sense to him/her.
The types idea was really just a kind of predefined way of specifying that divisor anyway.

[edit] Oops ! when I check the code, 3.05 should ALREADY allow divisors ( :V) on all word and byte cmds - not tested, but should work as I use a generic print routine for all data. Will add to SYM as well for 3.06

Will put these in 3.06 to assess also

:B (:F ?) for flags word/byte to force individual bits to be displayed with AND and OR

See if i can come up with a simpler rule for the example PUSH(R34) to generate a SCAN....
I'd probably build an app out of it, actually. The JNI in Android makes that easier.

EDIT:
Hey, while I'm staring at this, I'm tempted to fix this "cmdline" error. What are you ascertaining from pathchar? I'm trying to determine the android equivalent.
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

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

Re: Why auto disassembly is tough

Post by jsa » Sat Apr 14, 2018 11:39 pm

tvrfan wrote:
Sat Apr 14, 2018 6:52 pm
jsa - 3.06 I have now changed for prints to be 3 decimal places in floats as per request. I want to stay fixed number of digits so it makes table and func layout easier to control (i.e. in neat columns) The command read in 3.05 is already (or should be) a full float, so can use more digits.
It was the command read that I had issue with, but then it was a V0.5 era, so likely invalid issue now.
timel is a Timer list structure. half developed - may work, works on AA and A9L, but not on multibanks. Should have dropped this command off !!
On the surface at least, it seems to work automatically. I have not pasted the MSG command to DIR.
Leave it in please, it does some good.
[edit] Oops ! when I check the code, 3.05 should ALREADY allow divisors ( :V) on all word and byte cmds - not tested, but should work as I use a generic print routine for all data. Will add to SYM as well for 3.06
Ok cool, I only have it in DIR for Func and Table, at the moment.
Will put these in 3.06 to assess also
:B (:F ?) for flags word/byte to force individual bits to be displayed with AND and OR
See if i can come up with a simpler rule for the example PUSH(R34) to generate a SCAN....
Capitol B is Byte in geek speak, so maybe I ....... bYte....bIt. Don't want to change F's purpose.

There are a few subr that are called by pushes, so yeah if something comes to mind, all good.

At this point I have nothing else for you and won't get a chance until next week to look further. So load up 3.06 when you like.
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Sun Apr 15, 2018 11:22 pm

Darn it... These dos/Unix differences are messing up my modifications... Guess I'll have to fix them again...

(Don't merge those pull requests 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

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

Re: Why auto disassembly is tough

Post by tvrfan » Mon Apr 16, 2018 2:24 pm

motorhead1991 wrote:
Sun Apr 15, 2018 11:22 pm
Darn it... These dos/Unix differences are messing up my modifications... Guess I'll have to fix them again...

(Don't merge those pull requests yet)
Like what ? Not used Android, but I only have a couple of DEFINES in SAD for the differences between DOS and UNIX, which are

1. File access - DOS + Win requires an extra letter in the open mode for 'Text'.
2. Case insensitive string match has different names in some versions of stdlib (but Codelite and Code:Blocks use the same name)

Can I help, or are you going for a more Android centric solution ??
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Mon Apr 16, 2018 3:39 pm

tvrfan wrote:
Mon Apr 16, 2018 2:24 pm
motorhead1991 wrote:
Sun Apr 15, 2018 11:22 pm
Darn it... These dos/Unix differences are messing up my modifications... Guess I'll have to fix them again...

(Don't merge those pull requests yet)
Like what ? Not used Android, but I only have a couple of DEFINES in SAD for the differences between DOS and UNIX, which are

1. File access - DOS + Win requires an extra letter in the open mode for 'Text'.
2. Case insensitive string match has different names in some versions of stdlib (but Codelite and Code:Blocks use the same name)

Can I help, or are you going for a more Android centric solution ??
You're more than welcome to help. I was more griping about Linux' sensitivity to dos' lack of caring for newline markers.

My terminal setup isn't 100% yet either so it's all goofy. I'll have to redo it on the other machine (with an established OS.)
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

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

Re: Why auto disassembly is tough

Post by tvrfan » Mon Apr 16, 2018 5:19 pm

Ah right......understand.

Just in case it helps ......

I agree there is some weird combination of the two characters CR and LF at the end of each line.
Dos and Linux do seem to deal with these differently (can't remember, but I think DOS always inserts a CR ? or other way round ? Um...)

Anyway, I typically search for both both CR '\r' and LF '\n' separately to check the end of each input line, then any comment char,
then do the processing... so both cases catered for. But as for Android... no idea....
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Mon Apr 16, 2018 6:27 pm

I'm seeing more ^M than anything, and lots of magically appearing spaces 😆
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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Mon Apr 16, 2018 9:12 pm

Updated the OpenEEC source, so I need the Windows guys to give it a run and make sure I didn't break anything.
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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Tue Apr 17, 2018 11:37 am

tvrfan wrote:
Mon Apr 16, 2018 2:24 pm
motorhead1991 wrote:
Sun Apr 15, 2018 11:22 pm
Darn it... These dos/Unix differences are messing up my modifications... Guess I'll have to fix them again...

(Don't merge those pull requests yet)
Like what ? Not used Android, but I only have a couple of DEFINES in SAD for the differences between DOS and UNIX, which are

1. File access - DOS + Win requires an extra letter in the open mode for 'Text'.
2. Case insensitive string match has different names in some versions of stdlib (but Codelite and Code:Blocks use the same name)

Can I help, or are you going for a more Android centric solution ??
I don't think I mentioned this, but you can leave comments on code through github, so if you have any pointers or recognize a subroutine that isn't labeled, you can point it out (or push the change yourself).
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

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

SAD 3.06 released

Post by tvrfan » Tue Apr 17, 2018 6:11 pm

I was planning to make some more changes, but in the process found and fixed quite a few little bugs, so have decided to release as 3.06
See 'versions.txt' for all the fixes.
Have gone to jsa's suggested idea of 'LR' for long register (and so on).

--------------------------------------------

Also - got straight in my head the idea of a 'type' or 'class' of object.

WHY? - a LOT of symbols are just ways of defining a min or max value etc. in a human readable way, like say "TPS_MIN_0.0065V"

So - if SAD has the idea of a 'class', for example "TPS_Raw" as an A/D voltage, whenever the code sees an immediate value, or
indexed direct (i.e. always resolves to a 'fixed' address) it can automatically convert that value to a matching type to the AD_raw value.
this would save a lot of symbols, and might help understand stuff quicker.

code examples from AA

Code: Select all

31e8: db,03               jc    31ed             if ((uns) TPS_val < TPS_Min )  {
31ea: a0,ec,c8            ldw   Rc8,Rec          TPS_Min = TPS_val; }
31ed: 48,c8,8c,aa         sb3w  Raa,R8c,Rc8      TPS_Posn = TPS_raw - TPS_Min;
31f1: d9,02               jgtu  31f5             if ((uns) TPS_Posn <= 0)  {
31f3: 01,aa               clrw  Raa              TPS_Posn = 0; }                   # Throttle must be closed if equal/lower

### Throttle closed ###
31f5: 8b,01,48,24,aa      cmpw  Raa,[R0+2448]    
31fa: d9,08               jgtu  3204             if ((uns) TPS_Posn <= 0.065V)  {
31fc: 91,03,20            orb   R20,3            TPS_Closed = 1;
                                                 TPS_TClosed = 1;                  # TPS_TClosed used in test (STI) sequence
31ff: 71,fb,20            an2b  R20,fb           TPS_Wide = 0;
3202: 20,12               sjmp  3216             goto 3216; }

### Part throttle, small difference  (< 3.25v) ###
3204: 8b,01,4a,24,aa      cmpw  Raa,[R0+244a]    
3209: d9,05               jgtu  3210             if ((uns) TPS_Posn <= 3.25V)  {
320b: 71,f8,20            an2b  R20,f8           TPS_Closed = 0;
                                                 TPS_TClosed = 0;
                                                 TPS_Wide = 0;
320e: 20,06               sjmp  3216             goto 3216; }
At the moment, '0.0065V' and 3.25V' are symbols ( at 2448 and 244a) -
but there's enough here to say "if TPS_raw is an AD voltage, then so is TPS_posn.
TPS_posn is a AD voltage, so [2448] and [244a] are ALSO AD voltages....and can be converted automatically to a voltage.
so defining a class with the symbol TPS_Raw might be a neat trick....

also RPM.
Think what this could do for the timing stuff, which is everywhere.....and would spot stuff otherwise missed....

to make this portable, a class would define a divisor , and perhaps a trailing char or three (for 'V' or 'mS' or 'RPM')

Anyway - thoughts welcome.
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Tue Apr 17, 2018 10:07 pm

So, here's an strace dump of the segmentation fault:
SAD for Android #1

I've tried a couple different configurations so far, and they all segfault in the same spot

If either of you more experienced C programmers can see anything, that'd be dandy :biggrin:
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

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

Re: Why auto disassembly is tough

Post by tvrfan » Tue Apr 17, 2018 11:44 pm

A suggestion - I wouldn't be surprised if I've forgotten to fully check if a file is correctly opened/created.

I note in the dump there is a 'file not found' in a few places....
typically it does segv as the file handle (a pointer) will be zero (or -1)
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Wed Apr 18, 2018 12:29 am

tvrfan wrote:
Tue Apr 17, 2018 11:44 pm
A suggestion - I wouldn't be surprised if I've forgotten to fully check if a file is correctly opened/created.

I note in the dump there is a 'file not found' in a few places....
typically it does segv as the file handle (a pointer) will be zero (or -1)
I actually picked up on that correlation as well. I added Androids "string.h" to Core to add some more defines, though it might take an ifneq or two to narrow things down.
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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Mon Apr 23, 2018 9:54 pm

tvrfan wrote:
Tue Apr 17, 2018 11:44 pm
A suggestion - I wouldn't be surprised if I've forgotten to fully check if a file is correctly opened/created.

I note in the dump there is a 'file not found' in a few places....
typically it does segv as the file handle (a pointer) will be zero (or -1)
Hey tvr... 3.06 Windows doesn't seem to like single bank binaries anymore. FLH2 disassembles fine.

EDIT:
Gimme a few, I think my binary is actually corrupt.
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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Mon Apr 23, 2018 10:13 pm

And we have a winner! Welcome to Android, tvrfan 😁
Screenshot_ConnectBot_20180423-211219.png
Screenshot_ConnectBot_20180423-211219.png (102.6 KiB) Viewed 4315 times
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

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

Re: Why auto disassembly is tough

Post by motorhead1991 » Thu Apr 26, 2018 10:15 am

motorhead1991 wrote:
Mon Apr 23, 2018 10:13 pm
And we have a winner! Welcome to Android, tvrfan 😁
Screenshot_ConnectBot_20180423-211219.png
So, I've noticed something about interfacing with the binary:

On Linux, you can

Code: Select all

SADX ./binary.bin
and it works fine

But, on both android and Windows, this results in a "file not found or file error" message. Android is usually pretty good at absolute paths, so I don't know what the deal is.

According to strace, Linux is using the "open" C command, while Android is using "openat".
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

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

Re: Why auto disassembly is tough

Post by tvrfan » Thu Apr 26, 2018 5:00 pm

found THIS at https://linux.die.net/man/2/openat.

"Description

The openat() system call operates in exactly the same way as open(2), except for the differences described in this manual page.

If the pathname given in pathname is relative, then it is interpreted relative to the directory referred to by the file descriptor dirfd (rather than relative to the current working directory of the calling process, as is done by open(2) for a relative pathname).

If pathname is relative and dirfd is the special value AT_FDCWD, then pathname is interpreted relative to the current working directory of the calling process (like open(2)).

If pathname is absolute, then dirfd is ignored. "

so looks like you can make openat work just like open ?

-------------------- LA3 bin --------------------
In la3, there is a table of addresses at 6e56, which I think is for checksum....

this covers the ROM in segments from 0x2000 to 0x9fff, which would tie up with binary being a 32K, not a 56K....
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

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

Re: Why auto disassembly is tough

Post by jsa » Thu Apr 26, 2018 7:06 pm

For LA3, the value at 0x200c is A000.

Previous copies I acquired from the web are 32k.
Cheers

John

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

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

Re: SAD 3.06 released

Post by jsa » Sat Apr 28, 2018 2:53 am

tvrfan wrote:
Tue Apr 17, 2018 6:11 pm
I was planning to make some more changes, but in the process found and fixed quite a few little bugs, so have decided to release as 3.06
See 'versions.txt' for all the fixes.
Have gone to jsa's suggested idea of 'LR' for long register (and so on).
Finally got a chance to give 3.06 a longer run. The abbreviated hints are good.
Thanks for the fixes.

I see a few orb and an2b now have something like b0_R99=1 and b0_R99=0. It seems to be limited to a small number of orb and an2b?
Also - got straight in my head the idea of a 'type' or 'class' of object.
.
.
Anyway - thoughts welcome.
That sounds good. My scalar names have the value and units at the end of the name to make it easier to follow code.
Having the info filter through would be a good thing.
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by jsa » Mon Apr 30, 2018 5:36 am

Working with some start up structures tonight, I can see how type or class would be so much easier. The SYM name and its associated value/units would show up for each item in a structure range. Easier than defining a structure for each pair of bytes.

Of note the value, that is loaded to an address, is showing as hex for a STRCT xxxx xxxx : Y N :Y command. Somewhat un3.06 like.
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by tvrfan » Mon Apr 30, 2018 2:45 pm

OR and AND will show the B6_Rx style if it's an immediate opcode value and if there's at least one bit of register declared as a symbol.
Or that was my intent anyway. (which links into the idea of declaring a FLAG type byte instead.)

Structs - they should default to decimal - I did wonder if I should make it consistent and default it to Hex as everything else is,
but I didn't do it, so It's probably a bug I introduced. If you specify it in a command you can add an X (prt in decimal) in each level.
I should really change that X to something else, but wanted to keep it backwards compatible.

I'll double check these issues.

Other - Well, my idea to make if-then-else work and while{ } for loops totally failed.
Was trying out for 3.07. (which was on the path to partial emulation for the argument detection, and signed/unsigned funcs.)
Some of the bits of code are so interwoven with gotos I can't see how to get the logic to work correctly to untie the knots.

Bugger. On to the next idea.
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

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

Re: Why auto disassembly is tough

Post by jsa » Mon Apr 30, 2018 6:22 pm

Ok bits are most likely working as intended then.

Sorry, my mistake, I left the opts :X off, after an edit some time ago.
Yes, keeping it backwards compatible is best.

Yes I will need to add divisors etc. on a byte pair basis, one structure line at a time.

How much of the emulation approach relies on knowing the initialisation values?
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by jsa » Mon Apr 30, 2018 7:09 pm

What are your thoughts on displaying the value of a Struct that is loading a word one byte at a time?

The word is 4CC0 for a decimal result of 19648

Code: Select all

bf5e: 10,c0   struct            110, c0
bf60: 11,4c   struct            111, 4c
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by jsa » Mon Apr 30, 2018 10:13 pm

From your A9L, is the Q redundant?
I might be blind in one eye, but can't see out the other, as I did not spot it in the help pdf!


Edit: Sorry found Q in V3.06 Help file

Code: Select all

strct 225f 2283 :Q Y P 3 :W N P 4
'Types' could be fun with structures loading a byte at a time for a word or just the high byte of a word.......
Last edited by jsa on Sat May 05, 2018 5:54 pm, edited 1 time in total.
Cheers

John

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

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

Re: Why auto disassembly is tough

Post by tvrfan » Tue May 01, 2018 2:49 pm

My original idea was to show a whole ENTRY (or CELL) as one printed row, which matches my IT programming view. This matches up with a TABLE which is a 2D structure with rows and columns.

For a command , you specify one entry of a struct and then SAD then fills in the following entries automatically until END address. Seems logical to me, but then I admit my strong IT bias. Not sure how one on each line would identify it as a structure, but I'm open to ideas.

'Q' means there is a 'QUIT' byte at the end of the structure (typically a zero or -1, 0xff). This is used in timer struct, for example, and also where there is a list of different stuff of arbitrary length (like the initialise list for registers). So it's not redundant, but not used very often. Can appear anywhere, but typically in first level.

Did I miss that in the doc ? OK.....
TVR, Triumph (cars), kit cars, classics. Ex IT geek, development and databases.

https://github.com/tvrfan/EEC-IV-disassembler

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests