EEC V file conversion

All hardware related, disassembly / programming and code discussions belong here.
BOOSTEDEVERYTHING
Posts: 215
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Ok. I will finish up with the sca commands first. I started a bare dir file and started just inputting the sca commands that I needed to get the Bin to disassemble completely. Still not all the wat through with that. I will look into the lookup subs. Hopefully It will get me further along. I posted the bin and dir file in a post above but I will post it again later this evening after I get the dir file cleaned up a bit more. Should be a couple more hoirs and should be able to post a fairly cleaned up dir file to go with the bin file. Thanks again for all the advice and help!!! I really can not thank you enough!!
BOOSTEDEVERYTHING
Posts: 215
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

This is the latest I have.
Attachments
Stock_EKO2_256k.zip
(346.92 KiB) Downloaded 1 time
jsa
Posts: 259
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: EEC V file conversion

Unread post by jsa »

Thanks for the latest.

DO NOT;
* Command scan on the DATA in bank 1. Bank 1 is primarily data. Scan is for code.
* Command code on the DATA in bank 1. Bank 1 is primarily data. Code is for code.
* Leave latent scan and code commands in your DIR. Delete them if they do not produce valid code.
* Copy and paste duplicates into your DIR.

Put aside your current DIR's and start from a blank empty DIR.txt file. Too many errors added.

Search the LST for ??? to find undisassembled binary.
Add the LU subs outlined below. See if they work before proceeding.
Add scan commands for Banks 0, 8 & 9. Confirm they all work, giving valid code.
Post that DIR, don't add anything else yet.

Lots of scan commands required, do you think it would be easier if you could scan a range that automatically restarted the scan after each return?


This is the first lookup from MSG, SAD has overlooked a number of them.

Code: Select all

sub  82895  "UUYFuncLU_82895"   $ F uuyflu 36
I referred you to the RZASA DIR posted in this thread previously, these are the lookups you can match up with OMAE2.
You can also look at what I did for your EQE3 DIR VS RZASA.

Code: Select all

##### Function Lookup Subroutines: R36 Fn_Addr Reg, R38 Input Reg, R3C output Reg
SUB 92A2E "SLU92A2E_SUYFn"   $ F suyflu 36      # Undiscovered by SAD4.07.16
SUB 92A6C "SLU92A6C_SSYFn"   $ F ssyflu 36      # Undiscovered by SAD4.07.16
SUB 92AAA "SLU92AAA_USYFn"   $ F usyflu 36      # Undiscovered by SAD4.07.16
SUB 92AE8 "SLU92AE8_UUYFn"   $ F uuyflu 36      # Undiscovered by SAD4.07.16
#
SUB 92B26 "SLU92B26_SUWFn"   $ F suwflu 36      # Undiscovered by SAD4.07.16
SUB 92B62 "SLU92B62_SSWFn"   $ F sswflu 36      # Undiscovered by SAD4.07.16
SUB 92B9E "SLU92B9E_USWFn"   $ F uswflu 36      # Undiscovered by SAD4.07.16
SUB 92BDA "SLU92BDA_UUWFn"   $ F uuwflu 36      # Undiscovered by SAD4.07.16
#
SUB 92C16 "SLU92C16_**YFn"   $ F uuyflu 36      # Un/Signed In, Un/Signed Out
#
SUB 92C62 "SLU92C62_**WFn"   $ F uuwflu 36      # Un/Signed In, Un/Signed Out


###### Byte Table Lookup Subroutines: R3C Tb_Addr Reg, R34 Column Input Reg, R36 Row Input Reg
######    R38 Column Quantity Input Reg, R3C Unrounded Output Reg, R3E Rounded Output Reg
SUB 92D8E "SLU92D8E_Y16SYTb"   $F sytlu 3C 38              # Byte Inputs *16, Signed Word Out
SUB 92D93 "SLU92D93_Y16UYTb"   $F uytlu 3C 38              # Byte Inputs *16, Unsigned Word Out
SUB 92DA0 "SLU92DA0_WSYTb"     $F sytlu 3C 38              # Word Inputs, Signed Word Out
SUB 92DA5 "SLU92DA5_WUYTb"     $F uytlu 3C 38              # Word Inputs, Unsigned Word Out
#
SUB 92DF3 "SLU92DF3_yTb.Interpolate"          # Interpolate 4 byte cells to find Control Value Pass 1 & 2
SUB 92DF7 "SLU92DF7_yTb.Interpolate"          # Interpolate 4 byte cells to find Control Value Pass 3


###### Word Table Lookup Subroutines: R3C Tb_Addr Reg, R34 Column Input Reg, R36 Row Input Reg
######    R38 Column Quantity Input Reg, R3E Output Reg
SUB 92E33 "SLU92E33_Y16SWTb"   $F swtlu 3C 38              # Byte Inputs *16, Signed Word Out
SUB 92E38 "SLU92E38_Y16UWTb"   $F uwtlu 3C 38              # Byte Inputs *16, Unsigned Word Out
SUB 92E45 "SLU92E45_WSWTb"     $F swtlu 3C 38              # Word Inputs, Signed Word Out
SUB 92E4A "SLU92E4A_WUWTb"     $F uwtlu 3C 38              # Word Inputs, Unsigned Word Out
#
SUB 92E8E "SLU92E8E_wTb.Interpolate"           # Interpolate 4 word cells to find Control Value
From this screen grab, you can see they match off RZASA 92a2e <> OMAE2 826AD.
Put the lookup subs in OMAE2 dir and change/rename the addresses.
LUs.PNG

Looking at your previous example and the comments from the rzasa LU dir commands above;

Code: Select all

07bc2: a1,ae,54,36        ldw   R36,54ae         TMP2L = FN070C;                  # Function address R36
07bc6: a0,95,38           ldw   R38,R194         TMP3L = N_RPM;                   # Input Reg R38
07bc9: 10,08              rombk 8
07bcb: ef,8b,ac           call  82859            Sub_82859 ();                    # Fn Lookup Subroutine
07bce: a0,3c,34           ldw   R34,R3c          TMP1L = TMP5L;                   # Table column input R34 = Function Out R3C
07bd1: af,e8,60,2a        ldzbw R2a,[Re8+60]     TEMP3L = ACPRES;
07bd5: a1,20,94,36        ldw   R36,9420         TMP2L = 9420;                    # Function address R36
07bd9: a0,2a,38           ldw   R38,R2a          TMP3L = TEMP3L;                  # Input Reg R38 = ACPRES
07bdc: 10,08              rombk 8
07bde: ef,78,ac           call  82859            Sub_82859 ();                    # Fn Lookup Subroutine
07be1: c0,36,3c           stw   R3c,R36          TMP2L = TMP5L;                   # Table row input R36 = Function Out R3C
07be4: ad,06,38           ldzbw R38,6            TMP3L = 6;                       # Table column count
07be7: 45,b4,10,fe,3c     ad3w  R3c,Rfe,10b4     TMP5L = Table_193fc;             # Table address
07bec: 10,08              rombk 8
07bee: ef,31,ae           call  82a22            UYTabLU_82a22 ();                # Tb Lookup Subroutine
07bf1: 08,02,3c           shrw  R3c,2            TMP5L >>= 2; }                   # Unrounded table output R3C>>=2
07bf4: c3,e2,64,3c        stw   R3c,[Re2+64]     [112e4] = TMP5L;                 # Store result to RAM
Ponder the above, we can get deeper into how Fn and Tb sizes can be worked out after you do the scan and LU DIR.
BOOSTEDEVERYTHING
Posts: 215
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Lots of scan commands required, do you think it would be easier if you could scan a range that automatically restarted the scan after each return?
ABSOLUTELY!!!!! I am still adding SCAN commands that I am finding as I go. I will start another DIR file as instructed. Thanks for the advice. Maybe I got a little distracted because I started with an existing DIR file for an older version of SAD. Makes sense to start new.

I have a side questions that probably won't matter too much anymore, but I used SADX to disassemble the BIN and added the struct and function commands to my dir file and got a weird error that I can not find a solution for in the DOCS.. Can you please elaborate, for future use if needed? Thanks

Code: Select all

struct 125c3 25c3 :Y X << Warning - Radix missing, Hex assumed

What is Radix?
BOOSTEDEVERYTHING
Posts: 215
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Here is my Dir file with Sca commands and Subroutines done. I think?????? LOL
Attachments
EKO2_Start_over.zip
(305.95 KiB) Downloaded 1 time
jsa
Posts: 259
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: EEC V file conversion

Unread post by jsa »

Thanks.

Love your enthusiasm, jumping at structures before the code is even sorted. Don't put it in your DIR at this point.
Why do you want to define a 1 byte structure?

Radix is number system base.
RTFM wrote: X <D> 2,10,16 Print radix = bin, decimal, hex X <D>.<D> for decimal places

Now for the minority part of Bank 1, what do you make of this and why?

Code: Select all

1db53: f2,98,74,00,d7,16,a0,ed,48,64,48,48,d3,03,bd,ff  ???  
1db63: 48,88,93,48,d1,06,c0,93,48,91,10,5b,f3,f0  ???  
BOOSTEDEVERYTHING
Posts: 215
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Looks to be a Subroutine to me. It starts with f2, which is the opcode for push(psw), and ends with f0, which is the opcode for return.

The structure I posted was generated by SADX. I ran the Bin in SADX without a dir file hoping it would pull out some things that SAD may have missed. I transfered them over to my previous dir file and that was just one of them. All of them I transfered had the same error. So I was curious what was "wrong" with the structure commands from SADX that SAD did not like.
jsa
Posts: 259
Joined: 2021 Feb 16, 15:46
Location: Australia
Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV

Binary Editor
ForDiag

Re: EEC V file conversion

Unread post by jsa »

You have noted in DIR that this is suss, but left the command SCA 8f8d8 in place.

Code: Select all

8f8d6: ad,08              word    8ad

8f8d8: ad,08,5a           ldzbw R5a,8            wR5a = 8;
8f8db: 11,b8              clrb  Rb8              Rb8 = 0;
8f8dd: 22,5a              sjmp  8fb39            goto 8fb39;

8f8df: 11                 ???   
Why do you think it more likely to be code than more words?

Have you searched for 8f8d6 and f8d6 to find the code referencing the word and determine if it might reference subsequent words?
BOOSTEDEVERYTHING
Posts: 215
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

You have noted in DIR that this is suss, but left the command SCA 8f8d8 in place.
I did. I did all of the SCA commands and then went through and found the Subroutines. Should I have gone through and deleted the SCA commands that happened to land on a defined Subroutine?
BOOSTEDEVERYTHING
Posts: 215
Joined: 2023 Sep 06, 13:11
Location: Charlotte NC , USA
Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100

Re: EEC V file conversion

Unread post by BOOSTEDEVERYTHING »

Sorry, I misunderstood, the word suss. Now I see what you are saying. I have not yet searched for a reference for it. That makes sense now that you say it out loud that, that would be the next step.
Post Reply