EEC V file conversion

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

B302 is good.

# leave out that line.
jsa wrote: 2024 May 12, 01:17 V4.012 DIR for RZASA consolidated from various sources.
Details in header of DIR file.
Read the details in the header for {?}.
BOOSTEDEVERYTHING
Posts: 435
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 »

Read the details in the header for {?}.
I apologize, I missed the correlation of the data sources to the line numbers. I thought you were just numbering the data sources in list format. I feel stupid now, LOL. Thanks
B302 is good.
Great, thanks for verifying that for me. I will add that in as an Rbase value. I am surprised that SAD missed that one as it seems to be in the code very frequently.
BOOSTEDEVERYTHING
Posts: 435
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 there is a section in both OMAE2 and RZASA that I am hoping you can take a look at and see if you can figure them out. Both look very similar and neither are disassembled very well but both look very similar...

OMAE2 about line 1A1FE may start sooner and RZASA line 19C99, also may start sooner. and it goes for a good little while matching up pretty close. Can not figure out if they are functions, tables, or structures, or maybe something else. Little above my knowledge base. Thanks

Also I think the below may be tables, could you confirm for me please???

Code: Select all

OMAE2 code line  -  ADDR pointer
L_99DBC          -  1873E
L_99E0D          -  18806
L_99E5E          -  188CE
Of course now that I am looking at it closer they may be functions and swTb34EPPH in RZASA also looks like it should be a function???
jsa
Posts: 445
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 »

For RZASA L19C99 I've given it a structure command and ?? in its comment because it's wasn't clear at the time.
What code have you got from LST that accesses L19C99?
BOOSTEDEVERYTHING
Posts: 435
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 »

I don’t have any code specifically for 19c99. Just a pattern I noticed in both lst files. I’ll do some more research on it and hopefully I can find something that calls for an actual address. Wasn’t sure if the areas in the lst files were just needing to be defined as something to show up somewhere.
jsa
Posts: 445
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 »

Needs some time spent on it to work out the contents of various temporary registers and the purpose of the sub.
RZASA

Code: Select all

0803b: b3,41,99,9c,40     ldb   R40,[R40+9c99]   TMP7L = [TMP7L+19c99];
0807d: b3,45,99,9c,44     ldb   R44,[R44+9c99]   TMP9L = [TMP9L+19c99];
080d3: b3,3d,99,9c,3c     ldb   R3c,[R3c+9c99]   TMP5L = [TMP5L+19c99];
OMAE2 L1a1fe does look like the start of the equivalent structure.
OMAE2

Code: Select all

0b8fd: b3,41,fe,a1,40     ldb   R40,[R40+a1fe]   R40 = [R40+1a1fe];
0b93f: b3,45,fe,a1,44     ldb   R44,[R44+a1fe]   R44 = [R44+1a1fe];
0b995: b3,3d,fe,a1,3c     ldb   R3c,[R3c+a1fe]   R3c = [R3c+1a1fe];
Solve one...both solved.



Yes these are tables.
1873E
18806
188CE

From the comments in DIR for LU Subs, tells you what the registers hold for table lookups.
###### Word Table Lookup Subroutines: R3C Tb_Addr Reg, R34 Column Input Reg, R36 Row Input Reg
###### R38 Column Quantity Input Reg, R3E Output Reg
The table address is loaded into R3C before a table lookup sub call.

swTb34EPPH is a table.

Code: Select all

09756: a1,1c,5d,36        ldw   R36,5d1c         TMP2L = uuyFn.0x15d1c;
0975a: b3,01,93,f3,38     ldb   R38,[R0+f393]    TMP3L = VS_U4_DELTA;
0975f: 10,09              rombk 9
09761: ef,84,93           call  92ae8            SLU92AE8_UUYFn ();
09764: ac,3c,34           ldzbw R34,R3c          TMP1L = TMP5L;
09767: a1,2c,5d,36        ldw   R36,5d2c         TMP2L = uuyFn.0x15d2c;
0976b: b3,e4,fd,38        ldb   R38,[Re4+fd]     TMP3L = VSBART_RT;
0976f: 10,09              rombk 9
09771: ef,74,93           call  92ae8            SLU92AE8_UUYFn ();
09774: ac,3c,36           ldzbw R36,R3c          TMP2L = TMP5L;
09777: ad,08,38           ldzbw R38,8            TMP3L = 8;
0977a: a1,3c,5d,3c        ldw   R3c,5d3c         TMP5L = swTb34EPPH;   <<<<<<<<<<<<<<<<<<<<<<<<
0977e: 10,09              rombk 9
09780: ef,b0,96           call  92e33            SLU92E33_Y16SWTb ();  <<<<<<<<<<<<<<<<<<<<<<<<
09783: a0,3e,3c           ldw   R3c,R3e          TMP5L = TMP6L;
BOOSTEDEVERYTHING
Posts: 435
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 »

Yes these are tables.
1873E
18806
188CE
Is there a way to define a table without knowing the exact size and purpose of the table? If so, could you please give me an example of how the best way of doing so would look? Thanks again for all of the help, this new DIR file has helped me find a good bit more in the OMAE2 code. Going to switch back to the READ0 code soon and see what else I can find there to get me further along to the path of building a good DEF file for my dads truck.
I have also found some of the fan code in the OMAE2 code. Hopefully I can make all of that work on my truck when I get it back up and running again. Also may give me something to transfer over to the READ0 code to use on my dads truck. I am also going to start building an "adapter" harness for my dads truck to hook up a second pcm to try the fan code with. I may hook up some leds for a visual indication the the fan code is working as designed before I go to an actual fan. Thoughts?
jsa
Posts: 445
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 »

Yes. There are examples of tables in RZASA defined without a known purpose. Row and column count needs to be known. Have a look at the RZASA lst with cmt file and check out the table lookup subs.

LEDS, yeah why not.
jsa
Posts: 445
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 »

After looking at the info I've guided you to review, paste up the line of code that sets the column count for swTb34EPPH.
BOOSTEDEVERYTHING
Posts: 435
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 »

Wow!!!! I do not understand this as well as I thought I did. The table lookups are a bit confusing now that I am looking at the big picture of how the table actually functions. I think this is the code you are referring to?

Code: Select all

09777: ad,08,38           ldzbw R38,8            TMP3L = 8;        = (Table Width) 8 COLUMNS
After looking at all of this, I just want to make sure I am viewing it correctly?

Code: Select all

ROUTINE FOR swTb34EPPH

09756: a1,1c,5d,36        ldw   R36,5d1c         TMP2L = uuyFn.0x15d1c;
0975a: b3,01,93,f3,38     ldb   R38,[R0+f393]    TMP3L = VS_U4_DELTA;
0975f: 10,09              rombk 9
09761: ef,84,93           call  92ae8            SLU92AE8_UUYFn ();
09764: ac,3c,34           ldzbw R34,R3c          TMP1L = TMP5L;


09767: a1,2c,5d,36        ldw   R36,5d2c         TMP2L = uuyFn.0x15d2c;
0976b: b3,e4,fd,38        ldb   R38,[Re4+fd]     TMP3L = VSBART_RT;
0976f: 10,09              rombk 9
09771: ef,74,93           call  92ae8            SLU92AE8_UUYFn ();
09774: ac,3c,36           ldzbw R36,R3c          TMP2L = TMP5L;


09777: ad,08,38           ldzbw R38,8            TMP3L = 8;        = (Table Width) 8 COLUMNS
0977a: a1,3c,5d,3c        ldw   R3c,5d3c         TMP5L = swTb34EPPH;
0977e: 10,09              rombk 9
09780: ef,b0,96           call  92e33            SLU92E33_Y16SWTb ();
CONTINUED BELOW

# 
#################################################################################
# Word Table Lookup with 4 Cell Interpolate. Signed and Unsigned Word Output.
# 
# Byte size PVC column and PVR row values are multiplied by 16 on entry.
# 
# PVC Process Value Column is Unsigned Byte or Word.
# PVR Process Value Row is Unsigned Byte or Word.
# Tb.CV Control Value is Signed when TblSflg is Set 1
# 
# Input: R34 PVC Column to look up.                              = TMP1L
# Input: R36 PVR Row to look up.                                 = TMP5L
# Input: R38 Cq Quantity of Columns in Table (Table Width)       = 8 AS PER LINE 09777 ABOVE
# Input: R3C Tb_Addr Table Address                               = swTb34EPPH  (0x15d3c)
# Output: R3E Tb.CV Control Value (Lookup result Output Value)   = TMP6L  
##################################################################################

###### Entry Point for PVC & PVR Byte Input / Tb.CV Signed Word Output

     # Call  from L09780                                                           Sub_0954e
   SLU92E33_Y16SWTb:
92e33: f2                 pushp                  push(PSW);
92e34: 91,80,96           orb   R96,80           TblSflg = 1;                      # Signed Table B7 Set 1
92e37: 00                 skip                   goto 92e39;

92e39: 11,35              clrb  R35              TMP1H = 0;                        # yPVC^
92e3b: 09,04,34           shlw  R34,4            TMP1L <<= 4;                      # wPVC * 16
92e3e: 11,37              clrb  R37              TMP2H = 0;                        # yPVR^
92e40: 09,04,36           shlw  R36,4            TMP2L <<= 4;                      # wPVR * 16
92e43: 20,06              sjmp  92e4b            goto 92e4b;

92e4b: 5c,37,38,3e        ml3b  R3e,R38,R37      TMP6L = TMP3L * TMP2H;            # wR3E = Cq * PVR^
92e4f: b0,34,3a           ldb   R3a,R34          TMP4L = TMP1L;                    # yR3A = yPVC 
92e52: b0,36,3b           ldb   R3b,R36          TMP4H = TMP2L;                    # yR3B = yPVR 
92e55: ac,35,34           ldzbw R34,R35          TMP1L = TMP1H;                    # wR34 = yPVC^ 
92e58: 64,34,3e           ad2w  R3e,R34          TMP6L += TMP1L;                   # wR3E = (Cq * PVR^) + PVC^
92e5b: 09,01,3e           shlw  R3e,1            TMP6L <<= 1;                      # wR3E = ((Cq * PVR^) + PVC^) * 2
92e5e: 64,3e,3c           ad2w  R3c,R3e          Tb_Addr += TMP6L;                 # Tb_Addr = Tb_Addr + ((Cq * PVR^) + PVC^) * 2
92e61: a2,3d,34           ldw   R34,[R3c++]      TMP1L = [Tb_Addr];                # CV1 (Word Size)
92e64: a2,3c,36           ldw   R36,[R3c]        TMP2L = [Tb_Addr];                # CV2 (Word Size)
92e67: 28,25              scall 92e8e            SLU92E8E_wTb.Interpolate ();      # Pass 1
92e69: 09,01,38           shlw  R38,1            TMP3L <<= 1;                      # Cq = Cq * 2 (Word Width)
92e6c: 64,38,3c           ad2w  R3c,R38          Tb_Addr += TMP3L;                 # Tb_Addr = Tb_Addr + Cq
92e6f: a2,3c,36           ldw   R36,[R3c]        TMP2L = [Tb_Addr];                # CV4 (Word Size)
92e72: 05,3c              decw  R3c              Tb_Addr--;                        # Tb_Addr = Tb_Addr - 1
92e74: 05,3c              decw  R3c              Tb_Addr--;                        # Tb_Addr = Tb_Addr - 1
92e76: a2,3c,34           ldw   R34,[R3c]        TMP1L = [Tb_Addr];                # CV3 (Word Size)
92e79: a0,3e,38           ldw   R38,R3e          TMP3L = TMP6L;                    # R38 = wCV1|2
92e7c: 28,10              scall 92e8e            SLU92E8E_wTb.Interpolate ();      # Pass 2
92e7e: a0,3e,36           ldw   R36,R3e          TMP2L = TMP6L;                    # R36 = wCV3|4
92e81: a0,38,34           ldw   R34,R38          TMP1L = TMP3L;                    # R34 = wCV1|2
92e84: b0,3b,3a           ldb   R3a,R3b          TMP4L = TMP4H;                    # R3A = yPVR
92e87: 28,05              scall 92e8e            SLU92E8E_wTb.Interpolate ();      # Pass 3
92e89: 71,7f,96           an2b  R96,7f           TblSflg = 0;                      # Reset B7 Clear 0
92e8c: f3                 popp                   PSW = pop();
92e8d: f0                 ret                    return;

CONTINUED FROM ABOVE
09783: a0,3e,3c           ldw   R3c,R3e          TMP5L = TMP6L;   = (Lookup result Output Value) 
The code uses all of this to actually get through the table to get the end value, correct? I copied over the applicable code to a new document and will try and make some notes on it and post it back up for you to review and let me know if I am interpreting it correctly, if that is ok? One question I do need clarification on, the code uses the functions to set row and column lookup values, correct?
Post Reply