EEC V file conversion

All hardware related, disassembly / programming and code discussions belong here.
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 is an argument related question, I can not figure out how to define the args in this subroutine. Should they be byte, word then byte values? if so, how would I put that into my DIR file properly? thanks
Sorry for the side track, LOL

Code: Select all

8ad5d: 10,09              rombk 9
8ad5f: ef,33,7e           call  92b95            Sxx92B95_RZA96CB3_36.6.4.1_SUBSTITUTE (
8ad62: 2e,00                    #arg 1              TEMP5L,
8ad64: 70,10                    #arg 2              1070,
8ad66: 01                       #arg 3              1,
8ad67: 08                       #arg 4              8,
8ad68: 0b                       #arg 5              b );
8ad69: 38,2e,05           jb    B0,R2e,8ad71     if (B0_TEMP5L = 0)  {
8ad6c: 71,fe,6b           an2b  R6b,fe           SS1_COM_LST_?? = 0;
8ad6f: 20,03              sjmp  8ad74            goto 8ad74; }

8ad71: 91,01,6b           orb   R6b,1            SS1_COM_LST_?? = 1;
8ad74: 10,09              rombk 9
8ad76: ef,1c,7e           call  92b95            Sxx92B95_RZA96CB3_36.6.4.1_SUBSTITUTE (
8ad79: 2e,00                    #arg 1              TEMP5L,
8ad7b: 70,10                    #arg 2              1070,
8ad7d: 02                       #arg 3              2,
8ad7e: 04                       #arg 4              4,
8ad7f: 0c                       #arg 5              c );

Code: Select all

    flg_ss_1_tmp = substitute ( 11, flg_ss_1_tmp ) ;  /* Check output state control override. */
                                      flg_ss_1 = flg_ss_1_tmp ;
                                      flg_ss_2_tmp = substitute ( 12, flg_ss_2_tmp ) ;  /* Check output state control override. */
                                      flg_ss_2 = flg_ss_2_tmp ;
   END_IF
Here is how SAD grabbed them...

Code: Select all

args    8ad62 8ad68: UW N : UW N : O 2 UY : UY 
args    8ad79 8ad7f: UW N : UW N : O 2 UY : UY 
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 »

LST and/or strategy, do whatever works you.

Use a spreadsheet then, easy enough to export later if need be.

Have a look at the math in a few definition files.
Defition files typically need enough resolution to show a 1 bit change in real world units.

I was talking about you not knowing how the lookup worked in relation to the sign flag. That info was printed in the rzasa lst when you have cmt enabled. If you put the same comments in crai8, you won't need rzasa open to see it.

The cmt entries for the lookups are subroutine specific.
Subs are not required in a definition, so I'm not thinking about those as part of a database. SAD has signatures baked into the EXE to recognise subs like lookup. I have previously mentioned to TVRfan that a user editable external signature file would be a better solution to avoid a new SAD version for every signature change. A signature file and sub database could be one and the same thing.
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 »

Args, the short non answer is follow the code, use a spreadsheet similar to those I've previously posted.
If you find encoded args, try the encode options for sub or arg commands. If that doesn't cover it, look for the 'exploding args' example for how I've dealt with it using cmt.

Yes I'm ducking doing a decode of those args in detail right now.

You could work on lookups while waiting for TVRfan to weave some arg magic or me to do another arg decode work sheet.
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 »

LST and/or strategy, do whatever works you
I was more asking what you meant by Strategy? Is there another sort of LST DIR type file you are referring to?
Use a spreadsheet then, easy enough to export later if need be
Ok. I will start one soon. Is there a particular layout, or order that would be preferable?
I was talking about you not knowing how the lookup worked in relation to the sign flag. That info was printed in the rzasa lst when you have cmt enabled. If you put the same comments in crai8, you won't need rzasa open to see it.
Ok. Do I copy directly over and just change addressing, line numbers to correspond to CRAI8?

While we are on the topic of comment files, I have a question, or issue rather with the CMT file I have going for CRAI8.. It is not printing the comments where I have addressed them. I will post up the newest CMT and DIR file. The comments I am referring to are in Sxx923D2. Please tell me what I am doing wrong here? Thanks

LOL, I will worry about those ARGS later. They are still a little over my head I think. I will look over the previous spreadsheets and examples and see what I can do with them, but I am still a bit confused there. Thanks
Attachments
CRAI8_AOL1_20241116.zip
(180.92 KiB) Downloaded 220 times
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 »

I meant the strategy document from openeec on github for CRAI8. No secret herbs and spices, lol.

No preference for the data at the moment.

Yes copy, paste and tweak to suit CRAI8.

There are print bugs in various versions of SAD. Try a different version see it it changes your results? I'll have a look later.

Yeah, you need to get a handle on following the code, like the function example, before going further down the rabbit hole for args.
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 »

Your CMT

Code: Select all

923D1 \n\n # L_923D2 SCALL FROM Sxx925CF L_9278C 
Gives

Code: Select all

923d1: f0                 ret                    return;


 # L_923D2 SCALL FROM Sxx925CF L_9278C 
   Sxx923D2_RZA086BD_33.2.2.1_EPC_ENGMT_STALL:
923d2: a3,e4,90,26        ldw   R26,[Re4+90]     TEMP1L = NEBART;
Works as expected.
Post an example of how you want it to look.
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 »

Code: Select all

92572: 98,41,00           cmpb  R0,R41           
92575: df,03              je    9257a            if (TMP7H != ZERO)  {
92577: ad,ff,40           ldzbw R40,ff           TMP7L = ff; } } }
9257a: 11,3c              clrb  R3c              TMP5L = 0;
9257c: 35,b3,0e           jnb   B5,Rb3,9258d     if (FLG_ENG_IN = 1)  {            # /* engagment in progress */  # tempreg2_tmp  =  TVEMAX
 #L_92409  - JUMP FROM L_923E6 BECAUSE (FLG_ENG_TV = 0)/* NOT AN ENGAGEMENT SITUATION */#  /*  moderate speed vehicle */ JUMP TO L_92444  # /* moderated engine speed */ NEBART OK TO 
                                                                                   USE TVEMOD - JUMP TO L_9244B   # /* high engine speed */ JUMP TO L_9244B
 #L_92444 JUMP FROM L_92434 BECAUSE /*  moderate speed vehicle */
 #L_9244B JUMP FROM L_92442 BECAUSE /* high engine speed */                        #L_9244B JUMP FROM L_9243B BECAUSE /* moderated engine speed */ NEBART OK TO USE TVEMOD
9257f: 9b,fd,b1,10,00     cmpb  R0,[Rfc+10b1]    
92584: d7,07              jne   9258d            if (SW_STALTV = ZERO)  {          # /* not forcing Stall EPC */
92586: 9b,fd,b2,10,00     cmpb  R0,[Rfc+10b2]    
9258b: d7,1d              jne   925aa            if (FN616_SW != ZERO) goto 925aa; } }  # IF ( FN616_SW   == 1 ) goto 925aa /* FN616 selection switch *//* do not consider FN616 
                                                                                   during engagement */
9258d: 36,30,0e           jnb   B6,R30,9259e     if (B6_TEMP6L = 1)  {             # (  pdl  == 6  ) = TRUE 
92590: a1,7c,6f,36        ldw   R36,6f7c         TMP2L = uuyFn616R;
92594: b3,01,21,01,38     ldb   R38,[R0+121]     TMP3L = TP_REL_H;
92599: ef,93,21           call  9472f            SLU9472F_92AE8_UUYFn ();          # tempreg1_tmp  =  fox( &FN616R, tp_rel )  ;/* determine reverse stall TV */
9259c: 20,0c              sjmp  925aa            goto 925aa; }

 #L_925AA - (JUMP FROM L_9258D) BECAUSE (  pdl  == 6  ) = FALSE 
9259e: a1,6c,6f,36        ldw   R36,6f6c         TMP2L = uuyFn616F;
925a2: b3,01,21,01,38     ldb   R38,[R0+121]     TMP3L = TP_REL_H;
925a7: ef,85,21           call  9472f            SLU9472F_92AE8_UUYFn (); }        # tempreg1_tmp  =  fox( &FN616F, tp_rel  ) ;/* determine forward stall TV */

 #L_925AA - JUMP FROM L_9258B BECAUSE ( FN616_SW   == 1 )                          #L_925AA - JUMP FROM L_9259C
925aa: 98,3c,40           cmpb  R40,R3c          
925ad: d1,03              jleu  925b2            if (TMP7L > TMP5L)  {             # IF  (  tempreg2_tmp   >  tempreg1_tmp  ) /* choose then larger of the stall TV pressure or 
                                                                                   engagement TV pressure
925af: b0,40,3c           ldb   R3c,R40          TMP5L = TMP7L; }                  # THEN tempreg1_tmp  =  tempreg2_tmp  ;        Then put in tempreg1_tmp  */
925b2: a3,e4,e0,26        ldw   R26,[Re4+e0]     TEMP1L = TPBARTV;
925b6: 68,1f,26           sb2w  R26,R11e         TEMP1L -= TP;
925b9: db,02              jc    925bd            if (TEMP1L < 0)  {
925bb: 01,26              clrw  R26              TEMP1L = 0; }
925bd: 8b,fd,10,11,26     cmpw  R26,[Rfc+1110]   
925c2: d3,0a              jnc   925ce            if (TEMP1L >= TOTVTP)  {          # IF  (     ( (tpbartv  - tp) >=  TOTVTP )  /* high tip_out rate */
925c4: 9b,e4,2c,3c        cmpb  R3c,[Re4+2c]     
925c8: db,04              jc    925ce            if (TMP5L < TV_PRES)  {           # AND ( tv_pres  >   tempreg1_tmp )        )
925ca: b3,e4,2c,3c        ldb   R3c,[Re4+2c]     TMP5L = TV_PRES; } }              # THEN tv_pres  =  tv_pres  /* No change to TV_PRES, use last pass value to hold TV pressure on 
                                                                                   tip-out. *

Maybe it is a bug. See above... All of these are in the wrong places. I will try V5.08 and see what it does.
Edit: V5.0.8 does the same thing. I will download and try another version.
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 »

Post the CMT file entries for your example and, edit and post your example as you expect it to look.
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 »

Not a bug, well not in SAD, its a bug in your cmt file.

The hex addresses are not in order:

Code: Select all

diff --git a/CRAI8/CRAI8_AOL1_CMT.txt b/CRAI8/CRAI8_AOL1_CMT.txt
index f10533e..b75b068 100644
--- a/CRAI8/CRAI8_AOL1_CMT.txt
+++ b/CRAI8/CRAI8_AOL1_CMT.txt
@@ -347,7 +347,7 @@ OEDC8 # 0x1F = SAIR_ER_DONE
 923DC # /* direction change */ IF NOT JUMP TO L_923E6
 923E4 \n\n #L_923E6 JUMP FROM L_923DC if (FLG_FWD_REV = 0)
 923E6 # /* NOT AN ENGAGEMENT SITUATION */ JUMP TO L_92409
-9257C # /* engagment in progress */
+
 92402 # tempreg2_tmp  =  TVEMAX
 92407 \n #L_92409  - JUMP FROM L_923E6 BECAUSE (FLG_ENG_TV = 0)/* NOT AN ENGAGEMENT SITUATION */
 92418 #  /*  moderate speed vehicle */ JUMP TO L_92444
@@ -356,6 +356,8 @@ OEDC8 # 0x1F = SAIR_ER_DONE
 92442 \n #L_92444 JUMP FROM L_92434 BECAUSE /*  moderate speed vehicle */
 92449 \n #L_9244B JUMP FROM L_92442 BECAUSE /* high engine speed */
 92449  #L_9244B JUMP FROM L_9243B BECAUSE /* moderated engine speed */ NEBART OK TO USE TVEMOD
+
+9257C # /* engagment in progress */
 92584 # /* not forcing Stall EPC */
 9258B # IF ( FN616_SW   == 1 ) goto 925aa /* FN616 selection switch *//* do not consider FN616 during engagement */
 9258D # (  pdl  == 6  ) = TRUE
Simply put, I moved 9257C to after 92449.
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 Nov 15, 14:02
I can not figure out how to define the args in this subroutine.

Should they be byte, word then byte values?

Code: Select all

8ad5d: 10,09              rombk 9
8ad5f: ef,33,7e           call  92b95            Sxx92B95_RZA96CB3_36.6.4.1_SUBSTITUTE (
8ad62: 2e,00                    #arg 1              TEMP5L,
8ad64: 70,10                    #arg 2              1070,
8ad66: 01                       #arg 3              1,
8ad67: 08                       #arg 4              8,
8ad68: 0b                       #arg 5              b );
8ad69: 38,2e,05           jb    B0,R2e,8ad71     if (B0_TEMP5L = 0)  {
8ad6c: 71,fe,6b           an2b  R6b,fe           SS1_COM_LST_?? = 0;
8ad6f: 20,03              sjmp  8ad74            goto 8ad74; }

8ad71: 91,01,6b           orb   R6b,1            SS1_COM_LST_?? = 1;
8ad74: 10,09              rombk 9
8ad76: ef,1c,7e           call  92b95            Sxx92B95_RZA96CB3_36.6.4.1_SUBSTITUTE (
8ad79: 2e,00                    #arg 1              TEMP5L,
8ad7b: 70,10                    #arg 2              1070,
8ad7d: 02                       #arg 3              2,
8ad7e: 04                       #arg 4              4,
8ad7f: 0c                       #arg 5              c );
According to the subroutine, all of the args are byte values:

Code: Select all

92bcb: b2,27,36           ldb   R36,[R26++]      TMP2L = [TEMP1L];
92bce: b2,27,37           ldb   R37,[R26++]      TMP2H = [TEMP1L];
92bd1: b2,27,38           ldb   R38,[R26++]      TMP3L = [TEMP1L];
92bd4: b2,27,39           ldb   R39,[R26++]      TMP3H = [TEMP1L];
92bd7: b2,27,3a           ldb   R3a,[R26++]      TMP4L = [TEMP1L];
92bda: b2,27,3b           ldb   R3b,[R26++]      TMP4H = [TEMP1L];
92bdd: ae,27,40           ldzbw R40,[R26++]      osc_ena[channel_number_tmp] = [TEMP1L];
Now with all the TMP names, probably actual variables, looks like the subroutine could actually be called with 3 words and 1 byte.
But without further defining the TMPxx names, it is guess work.

My next step would be to define that function name and those TMPxx names to the actual names as defined in the strategy document.
Post Reply