EEC V file conversion

All hardware related, disassembly / programming and code discussions belong here.
wwhite
Posts: 401
Joined: 2021 Feb 16, 15:53
Location: Victoria, BC, Canada
Vehicle Information: 1994 Flarside, XLT, 351w E4OD
SD48b, Quarter Horse, Burn2

Re: EEC V file conversion

Unread post by wwhite »

BOOSTEDEVERYTHING wrote: 2024 Dec 10, 12:53 Also, Question about the LST file. Is there a way to make the font on certain items stick out more, bold, underline, larger font, anything like that? It would be a huge help for me if it would make the font larger and bold for the subroutine labels. Just to make it easier to tell where the routine is starting and ending. Thanks
What editor are you using?

I use Visual Code, and in the lower corner, it is usually Plain Text, and by selecting Assembly or similar, code syntax highlighting works, ...somewhat.
wwhite
Posts: 401
Joined: 2021 Feb 16, 15:53
Location: Victoria, BC, Canada
Vehicle Information: 1994 Flarside, XLT, 351w E4OD
SD48b, Quarter Horse, Burn2

Re: EEC V file conversion

Unread post by wwhite »

decipha wrote: 2024 Dec 10, 12:50 the problem you run in to is that not all functions and tables exist in all strats and sometimes the normalizers are different

and an even bigger problem is that they arent in the same order so now having to rearrange and reorder is more time consuming than just typing it in.
Many, many pivot tables, maybe.
jsa
Posts: 437
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 »

BOOSTEDEVERYTHING wrote: 2024 Dec 10, 12:45 Here is a very quick start to my spreadsheet to build the database from. Possibly???? Let me know if you think I need to make any changes to the format or data in the sheet.
You have almost built a BE definition file. Have a look at Section 7.
http://www.eecanalyzer.net/dl/BE2012/He ... 20Help.pdf
and GUFB as an example definition file
http://www.eecanalyzer.net/strategies?v ... fileId=553

TP is very similar but storing it in an XML style text file.
download/file.php?id=5463

Also, if anyone could help with formulas to auto complete any of the data, that would be awesome. I was thinking it would be nice to enter the size from the docs and the start address and it could compute the hex value to add to start address, end address, byte size , etc.... If it isn't too complicated that is
Look at the hextodec and dectohex functions in excel. The process is convert the start address to dec, add 80-1 for FN1315 then convert back to hex for end address. You already have that data in DIR, import data from DIR to excel. Excel has an Import Data from Text file menu option or you could copy and paste a DIR section to excel then do Text to Columns.

Code: Select all

 ROM table_type FN1315;
                          /* An 10x8 table which gives injector delay as a function of engine speed and load. 
                          Resolution: 4.000000                 Units: Degrees    Table Size: 10X8
                          Min. Value: 0.000000                 Max. Value: 720.000000
                          X Input: RPM - FN070                 X Normalizing Fcn: FN070 
                          Y Input: LOAD - FN085                Y Normalizing Fcn: FN085*/
Was thinking, most tables and functions show up like this in the docs, so if I could grab the whole section of the single function and copy it and bring it over to the spreadsheet and it could possibly auto-populate the fields.... maybe too much to ask?

Easier to import the data from DIR.
If the strategy doc is consistent a lookup/substitute formula could be built to do it...maybe.

Also as far as the address in the strategy goes, I was thinking that may require multiple databases, one for each strategy.
One for each strategy file is a DIR or definition, only difference is it is in your particular format.

Use this as a template and as you disassemble the code you could search for the parameter, table, etc... and just enter the address into the sheet, then maybe there would be a way for SAD to use the sheet, maybe in the future, to label all of the addresses in the LST file? maybe stretching here. But a big template that is already made with all of the labels as per the docs may simplify building def files for tuning software and standardizing things, so to speak.
This sounds more like a single file, that you filter on PID, say FN1315. The single file holds multiple entries for FN1315 if they differ across strategies. Fields for strategy names, geographic region, year, 8061/8065, bank count and other relevant fields would be included to help filter the data set.

Some addresses repeat across strategies, but the majority don't. Agree it will help build out a definition file in conjunction with the DIR file.

SAD needs to match code patterns to PID's which is a different challenge. Code patterns could be included in the database for each instance of a PID. It's a challenge getting all version of code identified without false positives. For table lookup there's at least 6 different code sets with differences of varying complexity. Yes a suitable database can assist SAD with disassembly but it's unlikely to be 100% automatic any time soon. Maybe AI could do it but then a training set is needed in advance.
jsa
Posts: 437
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 »

BOOSTEDEVERYTHING wrote: 2024 Dec 10, 12:58 I was thinking the order could be changed in the sheet pretty easily by sorting them by starting address. Also, a good reason why each strat would have to have its own database, normalizers could be changed in the sheet to match the strategy. And extra tables, etc, could be added if needed, and if there was not a start address in the cell, maybe SAD could just skip the entry all together. Then the extra functions and labels could be added to the master template spreadsheet or database. Could have a note section for entries to note that certain things are present in RZASA as opposed to CRAi8, and so on. Again, I am so new to all of this and you guys are way more versed in how all of this works...So just point out if I am being stupid. LOL
This describes both a data source and a template.
The data source stores all the versions of PID and required fields.
A template describes which data to take and convert to an output file. The output file could be DIR or definition or whatever.
Filter the versions of a PID and select one, add an address and hey presto!
If used to build a DIR on every change save, no longer edit the DIR, just save out a TXT file in DIR format the run SAD again.
BOOSTEDEVERYTHING
Posts: 427
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 »

jsa wrote: 2024 Dec 10, 17:44
BOOSTEDEVERYTHING wrote: 2024 Dec 10, 12:58 I was thinking the order could be changed in the sheet pretty easily by sorting them by starting address. Also, a good reason why each strat would have to have its own database, normalizers could be changed in the sheet to match the strategy. And extra tables, etc, could be added if needed, and if there was not a start address in the cell, maybe SAD could just skip the entry all together. Then the extra functions and labels could be added to the master template spreadsheet or database. Could have a note section for entries to note that certain things are present in RZASA as opposed to CRAi8, and so on. Again, I am so new to all of this and you guys are way more versed in how all of this works...So just point out if I am being stupid. LOL
This describes both a data source and a template.
The data source stores all the versions of PID and required fields.
A template describes which data to take and convert to an output file. The output file could be DIR or definition or whatever.
Filter the versions of a PID and select one, add an address and hey presto!
If used to build a DIR on every change save, no longer edit the DIR, just save out a TXT file in DIR format the run SAD again.
Kind of what I was trying to say, except, maybe SAD could use this as a DIR file and as you fill in the start address SAD could pick that up and use the label already in the master template. If it sees an address in the sheet it could label it in the LST file. Also, on tables and functions, I have already defined the ones I put in the sheet, so I do have all the info, but it would make it easy if I could find the start address in the LST file and just input that and the sheet could auto fill the end address based on the size of the function provided in the "template" file. I am horrible at determining end addresses of functions, so I was thinking it may be helpful. And if it wasn't correct after you define it, the size could be changed or you could second guess yourself and make extra sure you are looking at the correct table or function.
What editor are you using?

I use Visual Code, and in the lower corner, it is usually Plain Text, and by selecting Assembly or similar, code syntax highlighting works, ...somewhat.
I just use notepad. The old version. It is free and that's what I have been using so I am used to it. But I could get used to something else if it would make things easier. Is visual code open source or paid? I also have notepad++ for editing columns and stuff, but I just can not get my eyes used to comparing things in that program. LOL
BOOSTEDEVERYTHING
Posts: 427
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 »

Also as far as the address in the strategy goes, I was thinking that may require multiple databases, one for each strategy.
One for each strategy file is a DIR or definition, only difference is it is in your particular format.
This I was thinking could start as a single "template" file, so to speak, and you just fill in the addresses for the labels that are already provided. This way the labels all stay the same throughout everything. Also should be in a format that can be converted easily across all platforms. Or at least the most used platforms.
BOOSTEDEVERYTHING
Posts: 427
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 »

jsa wrote: 2024 Dec 10, 15:55 Assuming your flag naming is correct I've made changes to CMT and DIR as follows.

CMT; insert in sequence with existing comments.

Code: Select all

0629C \n\n###### Do \s100E
062A1 # [ 100E]
062A4 \n\n###### Do \s1146
062AD # [ 1146]
062B0 \n\n###### Do \s101D
062DD # [ 101D]
062E0 \n\n###### Do \s101E
0631B # [ 101E]
0631E \n\n###### Do \s10ED
0633F # [ 10ED]
06345 # [ 10ED]
0634C # [ 10ED]
0634F   \n###### Do \s12FF
0635C # [ 12FF]
0635F \n\n###### Do \s10ED
06373 # [ 10ED]
0637A # [ 10ED]
06380 # [ 10ED]
06387 # [ 10ED]
0638F   \n###### Do \s2FC
0639F # [  2FC]
063A5 # [  2FC]
063A8   \n###### Do \s17C2
063D7 # [ 17C2] 
063DB \n\n###### Do \s17C3
063E8 # [ 17C3]
063EC \n\n###### Do \s1021
06413 # [ 1021]
06416 \n\n###### Do \s1022
06429 # [ 1022]
0642C \n\n###### Do \s1023
06462 # [ 1023]
06465 \n\n###### Do \s1024
06480 # [ 1024]
06483 \n\n###### Do \s17B8
0649E # [ 17B8]
064A2 \n\n###### Do \s17B9
064F5 # [ 17B9]
064F9 \n\n###### Do \s17BA
0651A # [ 17BA]
0651E \n\n###### Do \s17BB
06539 # [ 17BB]
0653D \n\n###### Do \s17BC
06568 # [ 17BC]
0656C \n\n###### Do \s14FE
06583 # [ 14FE]
06586 \n\n###### Do \s101F
0659B # [ 101F]
0659E \n\n###### Do \s1114
065AC # [ 1114]
065AF \n\n###### Do \s17BD
065E2 # [ 17BD]
065E6 \n\n###### Do \s17BE
0661D # [ 17BE]
06621 \n\n###### Do \s17BF
0664C # [ 17BF]
06650 \n\n###### Do \s17C0
06663 # [ 17C0]
06667 \n\n###### Do \s17C1
0667C # [ 17C1]
0668E # [ 178A]
06693 # [ 178B]
066A0 # [ 178C]
066B0 # [ 10F0]
066BF # [ 10EE]
DIR; insert in sequence with existing commands

Code: Select all

#      70                                                               #L065CA {0}
SYM    70 "HEDF_STATUS"             :B2                                 #L0662A CRAI8 5-256 (0)
SYM    70 "IMRC_FAULT"              :B3                                 #L06646 CRAI8 5-256 (0)
SYM    71 "TCC_FAULT"               :B5                                 #L06676 CRAI8 5-257 (0)
SYM    72 "CANP_FAULT"              :B4                                 #L0663A  CRAI8 5-256 (0)
SYM    75 "EVR_SHORT"               :B4                                 #CRAI8 5-255 {0}
SYM    75 "EVR_OPEN"                :B5                                 #CRAI8 5-255 {0}
SYM    80 "HEGO_FDBACK"             :B1                                 #closed loop CRAI8 5-253 {0}
SYM    80 "OL_DRIVE"                :B2                                 #open loop due to driving conditions  CRAI8 5-253 {0}
SYM    80 "HEGO_FAULT"              :B4                                 #closed loop with HEGO fault CRAI8 5-253 {0}
SYM    96 "ACSW"                    :B3                                 #A/C clutch Demand Switch {0}
SYM    A6 "SCP_UP"                  :B5                                 # {0}
SYM    C6 "FP_2SPD_ERROR?"          :B1                                 # L06613 CRAI8 5-255 {0}
SYM  101F "bitmap_mon_1"            #[UY]                               #Bitmap flage CRAI8 5-255 {0}
SYM  1021 "scpbitmap_1"             #[UY]                               #Bitmap flags CRAI8 5-252 {0}
SYM  1022 "scpbitmap_2"             #[UY]                               #Bitmap flags CRAI8 5-252 {0}
SYM  1023 "scpbitmap_3"             #[UY]                               #Bitmap flags CRAI8 5-252 {0}
SYM  1024 "scpbitmap_4"             #[UY]                               #Bitmap flags CRAI8 5-252 {0}
#    1114                                                               # L065AC {0}
SYM  1146 "J1979_01_1E"             #[UY]                               #Flags Bitmap CRAI8 5-250 {0}
SYM  14FE "pid_316dd_d"             #[UY]                               #Bitmap flags CRAI8 5-254 {0}
SYM  17B8 "scpbitmap_5"             #[UY]                               #Bitmap Flags CRAI8 5-253 {0}
SYM  17B9 "scpbitmap_6"             #[UY]                               #Bitmap Flags CRAI8 5-253 {0}
SYM  17BA "scpbitmap_7"             #[UY]                               #Bitmap Flags CRAI8 5-253 {0}
SYM  17BB "scpbitmap_10"            #[UY]                               #Bitmap Flags CRAI8 5-254 {0}
#    17BC                                                               # L06568 {0}
#    17BD                                                               # L065B0 {0}
SYM  17BE "bitmap_ofd_2"            #[UY]                               #Bitmap flags CRAI8 5-255 {0}
SYM  17BF "bitmap_ofd_3"            #[UY]                               #Bitmap flags CRAI8 5-256 {0}
#    17C0                                                               # L06663 {0}
SYM  17C1 "bitmap_ofd_5"            #[UY]                               #Bitmap flags CRAI8 5-257 {0}
SYM  17C2 "bitmap_fmem3"            #[UY]                               #Bitmap Flags CRAI8 5-251 {0}
SYM 17764 "PGM_SELECT"              #[UY]                #Sw            # L06630 Canister Purge hardware present CRAI8 5-256 {0}
SYM 9FF00 "IDBLOCK"                 #                    #              #256Byte EEPROM ID block CRAI8 5-238 {0}
SYM 9FF13 "IDBLOCK_FMT"             #[UY]                #              #CRAI8 5-238 {0}
BYT 9FF13 9FF13                                                          # {0}
I have most of the DIR file entries already, but I am 1 off on a lot of them. Not quite sure how I could have done that. Also I am having an issue with another section of code. It looks like one of my RBASE entries may be 1 off, but just for a small section of code. Is that a possibility?

Code: Select all

     # JNE   from L9761B                                                           
9762a: b3,fa,06,24        ldb   R24,[Rfa+6]      TEMP0L = NUMCYL_0;
9762e: a1,34,00,2e        ldw   R2e,34           TEMP5L = 34;
97632: a1,5a,0d,28        ldw   R28,d5a          TEMP2L = V_CYL_MIS[n_tmp];
97636: fa                 di                     interrupts OFF;

     # DJNZ  loop from L97640                                                      
97637: a2,28,26           ldw   R26,[R28]        TEMP1L = [TEMP2L];
9763a: c2,29,00           stw   R0,[R28++]       [TEMP2L] = ZERO;
9763d: c2,2f,26           stw   R26,[R2e++]      [TEMP5L] = TEMP1L;
97640: e0,24,f4           djnz  R24,97637        TEMP0L--;
                                                 if (TEMP0L != 0) goto 97637;
97643: fb                 ei                     interrupts ON;
97644: 01,28              clrw  R28              TEMP2L = 0;
97646: 01,2c              clrw  R2c              TEMP4L = 0;
97648: 01,2e              clrw  R2e              TEMP5L = 0;
9764a: 01,26              clrw  R26              TEMP1L = 0;
9764c: b3,fa,06,24        ldb   R24,[Rfa+6]      TEMP0L = NUMCYL_0;
97650: 45,91,08,f4,2a     ad3w  R2a,Rf4,891      TEMP3L = 12fa3;

     # DJNZ  loop from L976A4                                                      
97655: af,26,34,32        ldzbw R32,[R26+34]     TEMP7L = [TEMP1L+34];
97659: 47,27,4a,0d,32,30  ad3w  R30,R32,[R26+d4a]  TEMP6L = TEMP7L + [TEMP1L+10d4a];
9765f: c3,27,4a,0d,30     stw   R30,[R26+d4a]    [TEMP1L+10d4a] = TEMP6L;
97664: 47,27,3a,0d,32,30  ad3w  R30,R32,[R26+d3a]  TEMP6L = TEMP7L + [TEMP1L+10d3a];
9766a: c3,27,3a,0d,30     stw   R30,[R26+d3a]    [TEMP1L+10d3a] = TEMP6L;
9766f: 74,32,28           ad2b  R28,R32          TEMP2L += TEMP7L;
97672: d3,03              jnc   97677            if (TEMP2L > ff)  {
97674: b1,ff,28           ldb   R28,ff           TEMP2L = ff; }
It is for 12FA3, I am almost certain it should point to 12FA2, the beginning of Table 1327A. Everywhere else in the code the RBASE seems correct. There is one other area in the code that points to 12FA3 that looks like it should also point to 12FA2.

Code: Select all


     # JNE   from L9785C                                                           
97871: c3,01,98,0d,00     stw   R0,[R0+d98]      [10d98] = ZERO;
97876: c3,01,9a,0d,00     stw   R0,[R0+d9a]      [10d9a] = ZERO;
9787b: b3,fa,06,46        ldb   R46,[Rfa+6]      TMP0L = NUMCYL_0;
9787f: a1,4a,0d,34        ldw   R34,d4a          TMP1L = V_MIS200_[n_tmp];
97883: 45,91,08,f4,3c     ad3w  R3c,Rf4,891      TMP5L = 12fa3;
BOOSTEDEVERYTHING
Posts: 427
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 are my most recent DIR and CMT files for reference. I have not fixed the entries that you posted yet.
Attachments
CRAI8_20241211.zip
(501.49 KiB) Downloaded 202 times
wwhite
Posts: 401
Joined: 2021 Feb 16, 15:53
Location: Victoria, BC, Canada
Vehicle Information: 1994 Flarside, XLT, 351w E4OD
SD48b, Quarter Horse, Burn2

Re: EEC V file conversion

Unread post by wwhite »

BOOSTEDEVERYTHING wrote: 2024 Dec 11, 13:51 It is for 12FA3, I am almost certain it should point to 12FA2, the beginning of Table 1327A. Everywhere else in the code the RBASE seems correct. There is one other area in the code that points to 12FA3 that looks like it should also point to 12FA2.
What is the value of Rf4?

I think all your TEMP#L variables are confusing, at least to me. R3c maybe a temp, but I missed the increment reading your code.
I'd remove all the TEMP#L.

This code snippet is easier to read, to me, and you can see that R3c = Rf4 + 0x891 = 0x2712 + 0x891 = 0x2fa3, Bank 1.
That is correct. It is not so correct that the WORD is addressed as an odd number.

Here is the same code snip without all the TEMP#L variables:

Code: Select all

9 7871: c3,01,98,0d,00       stw   [d98],0            [d98] = 0;           
9 7876: c3,01,9a,0d,00       stw   [d9a],0            [d9a] = 0;           
9 787b: b3,fa,06,46          ldb   R46,[Rfa+6]        R46 = [Rfa+6];      
9 787f: a1,4a,0d,34          ldw   R34,d4a            R34 = d4a;           
9 7883: 45,91,08,f4,3c       ad3w  R3c,Rf4,891        R3c = Bank1 2fa3;        // R3c = WORD list may be?
9 7888: 01,38                clrw  R38                R38 = 0;             
9 788a: a2,35,3a             ldw   R3a,[R34++]        R3a = [R34++];       
9 788d: 0d,01,38             shldw R38,1              R38L = R38L * 2;     
9 7890: 8f,01,38,0d,38       divw  R38,[d38]          R38 = R38L / [d38];  
9 7895: d5,03                jnv   789a               if (!OV) goto 789a;  
9 7897: bd,ff,38             ldsbw R38,ff             R38 = (sig)ff;       
9 789a: ae,3d,36             ldzbw R36,[R3c++]        R36 = (uns)[R3c++];	// increment R3c to next word in list
9 789d: 67,37,98,0d,38       ad2w  R38,[R36+d98]      R38 += [R36+d98];		// add them all up
9 78a2: c3,37,98,0d,38       stw   [R36+d98],R38      [R36+d98] = R38;		// store the word at this address
9 78a7: e0,46,de             djnz  R46,7888           R46--; if (R46 !=  0) goto 7888;	// do it again, until R46 is zero
How many words are in the list?
Figure that out, or guess.

My guess is that from 0x12f94 to 0x12faf is a WORD list, not a table.
jsa
Posts: 437
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 »

CDAN2 wrote: The FN1327 table reserves space to control up to 8 injector outputs (the zero
slot is never referenced). The actual number is determined by NUMCYL, which
is the number of cylinders in the engine. The user must fill the table
locations to match NUMCYL.

8-214
CRAI8 wrote: The FN1327A table reserves space to control up to 13 injector outputs (the zero slot is never referenced). The actual number is determined by NUMCYL_0, which is the number of cylinders in the engine. The user must fill the table locations to match NUMCYL_0.

STRATEGY FILE: FGFUL_INJ_OUTPUT_1/GEN=6

9-430
Works as described in the docs.
12FA3 is for injector 1.

Thanks for the updated files.
Post Reply