EEC V file conversion

All hardware related, disassembly / programming and code discussions belong here.
BOOSTEDEVERYTHING
Posts: 234
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

0231d: ac,67,52           ldzbw R52,R67          wR52 = yR67;

0236c: 17,52              incb  R52              R52++;

0236e: 99,05,52           cmpb  R52,5            
02371: d3,02              jnc   02375            if (R52 >= 5)  {
02373: 11,52              clrb  R52              R52 = 0; }

02375: c4,67,52           stb   R52,R67          R67 = R52;

0237b: d7,a0              jne   0231d            if (R52 != 5) goto 0231d;
First off 6E1A is between 0x0000 & 0x7FFF so it is a positive value.
Ok, I think I am finally starting to get the signed/unsigned numbers, sort of, lol. Still some confusion here, I will elaborate later when I can find a good example. I get the 0x0000-0x7fff is positive and anything over that is negative? How about a 2 digit number? say 0x6f? That may not even be a thing, and I am overthinking it again.

[/quote]Line 02373 sets R52 = 0, so we are starting at [0+6E1A], add the data bank prefix, = 0x16E1A.[/quote]
So if it is greater than or equal to 5 it clears R52 and sets back to zero?

[/quote]Line 0263C increments R52 by 1 on each loop.[/quote]
I think I understand this.

[/quote]Line 02371 skips Line 02373 while R52 = 0 through 4.[/quote]
This one confuses me a little, This line reads, to me, if R52 is greater than or equal to 5 it skips 02375, I was not understanding the {} on different lines until this explanation, Does that indicate that the code continues to the lines within the {} when the "if" is false? I think I am confusing myself even more, If I read this like above then the code would indicate if it is greater then or equal to 5 clear the register(or set it to 0) as per the command within the {}. If that (R52>=5) is false then perform the command on the same line?

[/quote]Line 02375 stores the current value of R52 so that it can be loaded back at Line 0231D.[/quote]
I understand this one as well.

[/quote]Line 0237B loops back to Line 0231D until R52 = 5, that is the loop stop. R52 = 0 through 4 will be processed.[/quote]
I think I read that the "!" means stop, is that correct? So I should read this line as " If R52 is equal to a 5, then stop the loop, if it is anything under 5, keep looping"?
tvrfan
Posts: 86
Joined: 2023 Oct 22, 22:13
Location: New Zealand
Vehicle Information: Several Kit cars, Ford (Europe), EEC-IV, TVR Vixen, Tasmin (a.k.a Wedge),
Engine - Cologne 2.8 V6 (Europe) catch code 'AA'.

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

Re: EEC V file conversion

Unread post by tvrfan »

You don't have to use minimum 3 letters for commands, So if you wish, you can make it more readable as you learn with -

Code: Select all

RBASE    52 00 0230E 02382                  #   # Temp Rbase for Sub 0230E

BYTE     16E14 16E23                             # Sub 0230E data
and commands are case insensitive and you can have multiple spaces etc for readability.
jsa
Posts: 274
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 »

0x6f is positive.

if >= 5, reset to zero.

>= 5 it continues on L02373, not past it. The code between {} is executed.
Jump compare verses jump not compare does the opposite logic. Just follow the logic SAD displays.
When <5 it jumps to L02375.

!= means Not Equal 5 jump to 0231d for another loop.
jsa
Posts: 274
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: Comments

Unread post by jsa »

Add this to EQE3 DIR

Code: Select all

SYM    C1 "Flags_RC1"
SYM    C1 "SPI_ENTRY"                     :B2 #
SYM    C1 "DARC_INIT_FLG"                 :B3 #
Add this to EQE3 CMT

Code: Select all

0230D \n\n     # CALL  from L026B6  \t83\s026AE

0231C \n\n     # JB    from L02312 \sC1:3 = 1 \t83\s0230E
0231C   \n     # JNE   from L0237B until 5 passes completed \t83\s0230E

0231F \n\n     # JB    from L02362 \sC1:2 = 1 \t83\s0230E

02320 # [16E1A] 0xFE Loop 0\n
02320 # [16E1B] 0xFD Loop 1\n
02320 # [16E1C] 0xFB Loop 2\n
02320 # [16E1D] 0xF7 Loop 3\n
02320 # [16E1E] 0x7F Loop 4

0232E # [16E14] 0xCC Loop 0\n
0232E # [16E15] 0xCC Loop 1\n
0232E # [16E16] 0xDF Loop 2\n
0232E # [16E17] 0xFE Loop 3\n
0232E # [16E18] 0xFF Loop 4

02337 \n\n     # JB    from L0233D Loop until B3_[R48+8A] = 1 \t83\s0230E

02345 # [16E1F] 0x01 Loop 0\n
02345 # [16E20] 0x02 Loop 1\n
02345 # [16E21] 0x04 Loop 2\n
02345 # [16E22] 0x08 Loop 3\n
02345 # [16E23] 0x80 Loop 4

0235E \n\n     # JB    from L02357 B2_[R48+8A] = 1 \t83\s0230E

02364 \n\n     # JE    from L0235D [R48+82] = R6B & [16E14] \t83\s0230E

0236B \n\n     # JB    from L0234F \sC1:3 = 1 \t83\s0230E

02374 \n\n     # Cont  from L02373 5 Loops completed \t83\s0230E
02374   \n     # JNC   from L02371 Less than 5 Loops completed \t83\s0230E

0237D \n\n     # JB    from L0231A B0_[R48+8A] = 1 \t83\s0230E
LST will look like this

Code: Select all

     # CALL  from L026B6                                                           Sub_026ae
   Sub_0230e:
0230e: a1,00,0c,48        ldw   R48,c00          R48 = c00;
02312: 3b,c1,08           jb    B3,Rc1,0231d     if (DARC_INIT_FLG = 0)  {
02315: b3,49,8a,00,4a     ldb   R4a,[R48+8a]     R4a = [R48+8a];
0231a: 38,4a,61           jb    B0,R4a,0237e     if (B0_R4a = 1) goto 0237e; }

     # JB    from L02312 DARC_INIT_FLG = 1                                         Sub_0230e
     # JNE   from L0237B until 5 passes completed                                  Sub_0230e
0231d: ac,67,52           ldzbw R52,R67          wR52 = SPI_Index;

     # JB    from L02362 SPI_ENTRY = 1                                             Sub_0230e
02320: b3,53,1a,6e,4c     ldb   R4c,[R52+6e1a]   R4c = [16e1a];                    # [16E1A] 0xFE Loop 0
                                                                                   # [16E1B] 0xFD Loop 1
                                                                                   # [16E1C] 0xFB Loop 2
                                                                                   # [16E1D] 0xF7 Loop 3
                                                                                   # [16E1E] 0x7F Loop 4
02325: c7,49,8b,00,4c     stb   R4c,[R48+8b]     [R48+8b] = R4c;
0232a: af,52,6b,4e        ldzbw R4e,[R52+6b]     wR4e = R6b;
0232e: 73,53,14,6e,4e     an2b  R4e,[R52+6e14]   R4e &= [16e14];                   # [16E14] 0xCC Loop 0
                                                                                   # [16E15] 0xCC Loop 1
                                                                                   # [16E16] 0xDF Loop 2
                                                                                   # [16E17] 0xFE Loop 3
                                                                                   # [16E18] 0xFF Loop 4
02333: c3,49,82,00,4e     stw   R4e,[R48+82]     [R48+82] = R4e;

     # JB    from L0233D Loop until B3_[R48+8A] = 1                                Sub_0230e
02338: b3,49,8a,00,4a     ldb   R4a,[R48+8a]     R4a = [R48+8a];
0233d: 3b,4a,f8           jb    B3,R4a,02338     if (B3_R4a = 1) goto 02338;
02340: b3,49,8b,00,4c     ldb   R4c,[R48+8b]     R4c = [R48+8b];
02345: 93,53,1f,6e,4c     orb   R4c,[R52+6e1f]   R4c |= [16e1f];                   # [16E1F] 0x01 Loop 0
                                                                                   # [16E20] 0x02 Loop 1
                                                                                   # [16E21] 0x04 Loop 2
                                                                                   # [16E22] 0x08 Loop 3
                                                                                   # [16E23] 0x80 Loop 4
0234a: c7,49,8b,00,4c     stb   R4c,[R48+8b]     [R48+8b] = R4c;
0234f: 3b,c1,1a           jb    B3,Rc1,0236c     if (DARC_INIT_FLG = 0)  {
02352: a3,49,82,00,50     ldw   R50,[R48+82]     R50 = [R48+82];
02357: 3a,4a,05           jb    B2,R4a,0235f     if (B2_R4a = 0)  {
0235a: 88,4e,50           cmpw  R50,R4e          
0235d: df,06              je    02365            if (R50 = R4e) goto 02365; }

     # JB    from L02357 B2_[R48+8A] = 1                                           Sub_0230e
0235f: 95,04,c1           xorb  Rc1,4            SPI_ENTRY ^= 1;
02362: 3a,c1,bb           jb    B2,Rc1,02320     if (SPI_ENTRY = 1) goto 02320; }

     # JE    from L0235D [R48+82] = R6B & [16E14]                                  Sub_0230e
02365: c7,52,70,51        stb   R51,[R52+70]     R70 = R51;
02369: 71,fb,c1           an2b  Rc1,fb           SPI_ENTRY = 0; }

     # JB    from L0234F DARC_INIT_FLG = 1                                         Sub_0230e
0236c: 17,52              incb  R52              R52++;
0236e: 99,05,52           cmpb  R52,5            
02371: d3,02              jnc   02375            if (R52 >= 5)  {
02373: 11,52              clrb  R52              R52 = 0; }

     # Cont  from L02373 5 Loops completed                                         Sub_0230e
     # JNC   from L02371 Less than 5 Loops completed                               Sub_0230e
02375: c4,67,52           stb   R52,R67          SPI_Index = R52;
02378: 33,c1,03           jnb   B3,Rc1,0237e     if (DARC_INIT_FLG = 1)  {
0237b: d7,a0              jne   0231d            if (R52 != 5) goto 0231d;
0237d: f0                 ret                    return; } }


     # JB    from L0231A B0_[R48+8A] = 1                                           Sub_0230e
0237e: 32,63,02           jnb   B2,R63,02383     if (B2_R63 = 1)  {
02381: 20,f9              sjmp  0247c            goto Sub_0247c; }

BOOSTEDEVERYTHING
Posts: 234
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 »

So does “>=“ mean greater than or equal to, or am I reading that wrong?
jsa
Posts: 274
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: 2023 Nov 03, 11:08 greater than or equal to
jsa
Posts: 274
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: 2023 Oct 30, 15:24

Code: Select all

BYT  792D  << Error - Invalid bank
BYT  792D  << Error - Invalid bank
BYT  792E  << Error - Invalid bank

Which code Are you referring to?
EQE3

Code: Select all

04c7a: a1,2e,79,3c        ldw   R3c,792e         R3c = 792e;
04c7e: 69,2d,79,3c        sb2w  R3c,792d         R3c -= 792d;

04ca4: 89,2d,79,38        cmpw  R38,792d

04cb3: a1,2d,79,38        ldw   R38,792d         R38 = 792d;
04cb7: b2,39,3b           ldb   R3b,[R38++]      R3b = [R38++];

04cbf: 89,2e,79,38        cmpw  R38,792e

05b53: a1,2d,79,3c        ldw   R3c,792d         R3c = 792d;
05b57: 69,2d,79,3c        sb2w  R3c,792d         R3c -= 792d;

1792d: 29                 byte     29
1792e: b9                 byte     b9
jsa
Posts: 274
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: 2023 Oct 30, 15:24

Code: Select all

EQE3                                 RZASA
--------------------------------------------------------------
Rd4+4b				FLAG_EXT1
RZASA

Code: Select all

83287: b3,e2,f4,46        ldb   R46,[Re2+f4]     TMP0L = FLAG_EXT1;
EQE3

Code: Select all

07ee9: b3,d4,4b,46        ldb   R46,[Rd4+4b]     R46 = R2cb;
Search RZASA DIR for FLAG_EXT1, you should find;

Code: Select all

SYM  1174 "FLAG_EXT1"                 #UY
SYM  1174 "SAF_MOD_FLG"               :B0 
SYM  1174 "ADAP_TD_FLG1"              :B1 
SYM  1174 "EGR_INIT_FLG"              :B2 
SYM  1174 "TRNS_DTC_FLG"              :B3 
SYM  1174 "EGR_RETRY"                 :B4 
SYM  1174 "FFG_EGR_LST"               :B5 
SYM  1174 "EGR_EFM_FLG"               :B6 
SYM  1174 "DEMAND_LAST"               :B7 
RZASA Rbase E2 = 0x1180
Look up the opcode B3 and you should find the offset value F4 is signed.
You should know signed F4 is going to be negative.

Ues the TVRfan method for a negative;
0x1180+ (0x4f-0x100) = 0x1174 which matches the DIR entry for RZASA.

EQE3 Rbase D4 = 0x280
Look up the opcode B3 and you should find the offset value 4B is signed.
You should know signed 4B is going to be positive.

0x280 + 0x4B = 0x2CB which matches SAD output.


Add this to EQE3 CMT

Code: Select all

0230D \n##################################################################################
0230D \n#  Similar to RZASA Sub 02739

07EE7 \n##################################################################################
07EE7 \n#  Similar to RZASA Sub 8327C
07EE7 \n#  EGR SYSTEM INITIALIZATION CDAN2 12-2

07EE9 # [2CB]
07EED # \s2CB:0
07EF0 # \s2CB:0
07F00 # \s2CB:3
07F08 # \s2CB:3
07F0F # [838]
07F20 # [16BB] EGR shut timer.
07F27 # [173D] Time since EPTZER updated.
07F2F # [8CA]
07F33 # [8CC]
07F37 # [8CE]
07F3F # [8D0]
07F47 # [8D2]
07F4B # [8D4]
07F4F # [6DC]
07F53 # [6DA]

Edit / Add this to EQE3 DIR

Code: Select all

SYM   1A4 "iEGR"                          #UW # Unfiltered EPT sensor analog channel reading. CDAN 12-2
SYM   198 "EPTBAR"                        #UW # Filtered EGR sensor reading, counts. CDAN2 12-2

SYM   2CB "FLAG_EXT1"                     # Y # From RZASA L83287
SYM   2CB "EGR_INIT_FLG"                  :B0 # Flag to indicate EGR parameters have been initialized. CDAN2 12-2
SYM   2CB "EGR_RETRY"                     :B3 # Flag to indicate EGR monitor is on second pass. CDAN2 12-2

SYM   6DA "EGR_TCL_CNT?"                  # W # Maybe EGR_OFF_TMR?
SYM   6DC "EPTBAR_HOSE"                   # W #

SYM   838 "EPTZER"                        #UW # Learned EGR valve position sensor zero reading, counts. CDAN2 12-2

SYM   8CA "DELPR_FLW"                     # W # Filtered DELPR during test for mode 06 reporting, in H2O.CDAN2 12-27
SYM   8CC "DELPR_HOSE"                    # W # Filtered DELPR during test for mode 06 reporting, in H2O. CADN2 12-27
SYM   8CE "EGRDC_FLW"                     # W # Filtered EGRDC during test for mode 06 reporting. CDAN 12-27
SYM   8D0 "EPTBAR_OPN"                    # W # Filtered EPTBAR during test for mode 06 reporting. CDAN2 12-27
SYM   8D2 "EPT_OPN_MAX"                   # W # EPTZER_OFF + EPT_VOPN_IDL stored failure condition for mode 06. CDAN 5-117
SYM   8D4 "MIN_DELPR_FL"                  # W # Filtered MIN_delpr during test for mode 06  reporting, "H2O.

SUB 07EE8 "Sub07EE8_EGR_Init"                 # CDAN2 12-2

Are you able to resolve these now, or do you have specific question for each?

Code: Select all

R52+be1a				DARC_OUT_IMA_L
B1_Rbf				B1_FLAGTEMP_BG
B5_TMP9L				B5_FLAGTEMP_BG
B6_R34				EGRMON
B6_R93				SCP_TX_FLG
B7_TMP0L				B7_FLAGTEMP_BG----shows up in RZASA code as B5_FLAGTEMP
jsa
Posts: 274
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 »

Looking at the EQE3 DIR you uploaded in the post above.

Code: Select all

SYM  00C6 "FLAG_REG57"                #UY
SYM  00C6 "FFG_LAMBSE2"               :B0 
SYM  00C6 "FFG_LAMBSE1"               :B1 
SYM  00C6 "FFG_VS"                    :B2 
SYM  00C6 "FFG_TP"                    :B3 
SYM  00C6 "FFG_PIP"                   :B4 
SYM  00C6 "FFG_MAF"                   :B5 
SYM  00C6 "FFG_ECT"                   :B6 
SYM  00C6 "FFG_ACT"                   :B7 
Looking at the RZASA DIR I uploaded in an earlier post.

Code: Select all

SYM  00BA "FLAG_REG57"                #UY
SYM  00BA "FFG_LAMBSE2"               :B0 
SYM  00BA "FFG_LAMBSE1"               :B1 
SYM  00BA "FFG_VS"                    :B2 
SYM  00BA "FFG_TP"                    :B3 
SYM  00BA "FFG_PIP"                   :B4 
SYM  00BA "FFG_MAF"                   :B5 
SYM  00BA "FFG_ECT"                   :B6 
SYM  00BA "FFG_ACT"                   :B7 
Looking at the EQE3 DIR command I posted previously.

Code: Select all

SYM    C6 "Flags_C6"                      # Y #
SYM    C6 "FFG_TP"                        :B3 #
SYM    C6 "FFG_PIP?"                      :B4 #
SYM    C6 "FFG_MAF?"                      :B5 #
I've tried to compare the use of FFG_LAMBSE2 in both EQE3 and RZASA, but found no good code matches for the use of that flag.

Did you simply copy all the BA flags from RZASA and re-address them as C6 in the EQE3 DIR you uploaded?
BOOSTEDEVERYTHING
Posts: 234
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 »

Did you simply copy all the BA flags from RZASA and re-address them as C6 in the EQE3 DIR you uploaded?
I had found a few of them that were the same and assumed they all should be the same. It was my mistake to assume that. I have been going through them and deleting the entries that do not align with both lst files since I uploaded them. I’m sorry. I should not have assumed. Wishful thinking I guess.
Also the explanation above for the temp registers and the other comparisons I posted above covers my questions about those. Thank you very much. I will finish going through what I have already added this week and post a revised dir file with my mistakes and assumptions edited out. Although, it did help me to see what it would look like if I got something wrong. But I still should not have assumed like that and have since seen the error in that. Again. I am sorry about that. I will not make the same mistake twice….hopefully. lol. At least not on purpose. I just happened to see that several of the comparisons I did find lined up exactly in the RZASA dir file and assumed that that may be standard practice for ford to just put those entries in the same line up in all code just in a different location. Again, I have since seen that it simply is not like that and I need to stick to how you showed me to compare on every entry. I am very sorry to have wasted your time with my assumptions. I should have asked about that or just not tried to shortcut the process.
Post Reply