A1C XDF Additions

A1C calibration can be modified and configured to operate all EFI-SD4x ECUs in 4 cylinder, 6 cylinder and 8 cylinder configurations.
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: A1C XDF Additions

Unread post by wwhite »

efloth wrote: 2025 Jan 16, 16:13 NVM Grock figured it out for me:
GROK? like Llama?

SWEET.. I've been generating agents at work all year.
efloth
Posts: 399
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: A1C XDF Additions

Unread post by efloth »

decipha wrote: 2025 Jan 16, 16:35 its not rolling over to b3dd ?

open calculator in windows

click view >> programmer
click hex
click word

then just type it in

b480+ff5d == b3dd
Yeah that works nice! I didn't know the standard practice of ff being signed or that selecting word in windows calculator rolled it over for you :). I let grok know that it was wrong and here was the reply.
Unsigned Hex Addition:
0xB480 + 0xFF5D = 0xB3DD because:
0xB480 in decimal is 46208
0xFF5D in decimal is 65373
46208 + 65373 = 111581
111581 mod 65536 (for 16-bit address space) = 46077 which is 0xB3DD in hex.

If you're getting 0xB3DD, then your calculator is likely treating ff5d as an unsigned value. If you intended for ff5d to be treated as a signed number -163, you would need to check if your calculator has an option to switch between signed and unsigned arithmetic or if there's a way to indicate signed operations.
efloth
Posts: 399
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: A1C XDF Additions

Unread post by efloth »

wwhite wrote: 2025 Jan 16, 16:41
efloth wrote: 2025 Jan 16, 16:13 NVM Grock figured it out for me:
GROK? like Llama?

SWEET.. I've been generating agents at work all year.
Yeah I just can't spell lol
efloth
Posts: 399
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: A1C XDF Additions

Unread post by efloth »

Looks like the static values are stored at and around b3fd and the address is modified by GR_CM:

Code: Select all

76d7: c3,e8,b8,00         stw   R0,[Re8+b8]      [338] = 0;
76db: 6c,38,14            ml2w  R14,R38          lR14 *= R38;
76de: 0d,01,14            shldw R14,1            lR14 <<= 1;
76e1: c3,e8,ba,16         stw   R16,[Re8+ba]     [33a] = R16;
76e5: 45,4f,00,fc,14      ad3w  R14,Rfc,4f       R14 = b3fd;
76ea: ac,da,1a            ldzbw R1a,Rda          wR1a = yRda;
76ed: 64,1a,14            ad2w  R14,R1a          R14 += R1a;
76f0: 69,02,00,14         sb2w  R14,2            R14 -= 2;
76f4: ae,15,18            ldzbw R18,[R14++]      wR18 = [R14++];
76f7: 6c,16,18            ml2w  R18,R16          lR18 *= R16;
76fa: 0d,02,18            shldw R18,2            lR18 <<= 2;
76fd: be,14,16            ldsbw R16,[R14]        swR16 = [R14];
7700: 64,16,1a            ad2w  R1a,R16          R1a += R16;
7703: d5,07               jnv   770c             if (R1a > ffff)  {
7705: de,08               jlt   770f             if (R1a < 0) goto 770f;
7707: b1,ff,1a            ldb   R1a,ff           R1a = ff;
770a: 20,10               sjmp  771c             goto 771c; }
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: A1C XDF Additions

Unread post by wwhite »

Just figured out this:

Code: Select all

Reg 0x33a = TQ_STAT_CAP


 DO "NON-SHIFTING STATIC TV CALCULATION"
76e5: 45,4f,00,fc,14      ad3w  R14,Rfc,4f       R14 = b3fd;
76ea: ac,da,1a            ldzbw R1a,Rda          wR1a = yRda;
76ed: 64,1a,14            ad2w  R14,R1a          R14 += R1a;
76f0: 69,02,00,14         sb2w  R14,2            R14 -= 2;
76f4: ae,15,18            ldzbw R18,[R14++]      wR18 = [R14++];
76f7: 6c,16,18            ml2w  R18,R16          lR18 *= R16;
76fa: 0d,02,18            shldw R18,2            lR18 <<= 2;                       #[ R18 *= 4] 
76fd: be,14,16            ldsbw R16,[R14]        swR16 = [R14];
7700: 64,16,1a            ad2w  R1a,R16          R1a += R16;

Code: Select all

NON-SHIFTING STATIC TV CALCULATION

      GR_CM = 1 ---------------------------| TV_STAT = (TQ_STAT_CAP * SCSLP1) +
                                           |            SCINT1
                                           |
                                           | --- ELSE ---
                                           |
      GR_CM = 2 ---------------------------| TV_STAT = (TQ_STAT_CAP * SCSLP2) +
                                           |            SCINT2
                                           |
                                           | --- ELSE ---
                                           |
      GR_CM = 3 ---------------------------| TV_STAT = (TQ_STAT_CAP * SCSLP3) +
                                           |            SCINT3
                                           |
                                           | --- ELSE ---
                                           |
                                           | TV_STAT = (TQ_STAT_CAP * SCSLP4) +
                                           |            SCINT4
efloth
Posts: 399
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: A1C XDF Additions

Unread post by efloth »

Without knowing what Rda is I am guessing but this looks likely:

Code: Select all

b3fd: 58                  byte     58 SCSLP1
b3fe: f5                  byte     f5 SCINT1
b3ff: 58                  byte     58 SCSLP2
b400: f5                  byte     f5 SCINT2
b401: 39                  byte     39 SCSLP3
b402: f5                  byte     f8 SCINT3
b403: 47                  byte     58 SCSLP4   
b404: eb                  byte     eb SCINT4

b405: ff                  byte     ff

b406: 50,00               word     50 TOTTV1
b408: a0,ff               word   ffa0 TOTTV2
b40a: 50,00               word     50 TOTTV3
b40c: a0,00               word     a0 TOTTV4
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: A1C XDF Additions

Unread post by wwhite »

Now the problem, I'm not sure if A1C has SHIFTING STATIC TV CALCULATION.
Code from A1C is 'slimmer' than KID.

What came first A1C or LHBH1, or was A1C based off LHBH0?
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: A1C XDF Additions

Unread post by wwhite »

efloth wrote: 2025 Jan 16, 18:19 Without knowing what Rda is I am guessing but this looks likely:

Code: Select all

b3fd: 58                  byte     58 SCSLP1
b3fe: f5                  byte     f5 SCINT1
b3ff: 58                  byte     58 SCSLP2
b400: f5                  byte     f5 SCINT2
b401: 39                  byte     39 SCSLP3
b402: f5                  byte     f8 SCINT3
b403: 47                  byte     58 SCSLP4   
b404: eb                  byte     eb SCINT4

b405: ff                  byte     ff

b406: 50,00               word     50 TOTTV1
b408: a0,ff               word   ffa0 TOTTV2
b40a: 50,00               word     50 TOTTV3
b40c: a0,00               word     a0 TOTTV4
I believe you are correct.

Rda should be GR_CM.
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: A1C XDF Additions

Unread post by jsa »

efloth wrote: 2025 Jan 16, 15:52 Any idea what address [Re2+ff5d] is referencing? I calculated it using wrap around but landed in code or outside the used program memory.

Code: Select all

6940: 45,d2,00,fc,e2      ad3w  Re2,Rfc,d2       Re2 = b480;
......
7551: b3,e3,5d,ff,3a      ldb   R3a,[Re2+ff5d]   R3a = [Re2+ff5d];
Why not put an rbase command in the SAD DIR and let it do the math?

Code: Select all

RBA E2 B480
efloth
Posts: 399
Joined: 2021 Feb 15, 22:12
Location: Sacramento CA
Vehicle Information: 1991 F150 4.9L J1X 80lb Injectors E85
1995 F150 5.8L MOB1

Re: A1C XDF Additions

Unread post by efloth »

jsa wrote: 2025 Jan 16, 20:34
efloth wrote: 2025 Jan 16, 15:52 Any idea what address [Re2+ff5d] is referencing? I calculated it using wrap around but landed in code or outside the used program memory.

Code: Select all

6940: 45,d2,00,fc,e2      ad3w  Re2,Rfc,d2       Re2 = b480;
......
7551: b3,e3,5d,ff,3a      ldb   R3a,[Re2+ff5d]   R3a = [Re2+ff5d];
Why not put an rbase command in the SAD DIR and let it do the math?

Code: Select all

RBA E2 B480
Is there a way to set rbase for a specific code address range? In this case re2 is changed a few times:

Code: Select all

423d: 45,e6,00,fc,e2      ad3w  Re2,Rfc,e6       Re2 = b494;
6940: 45,d2,00,fc,e2      ad3w  Re2,Rfc,d2       Re2 = b480;
878b: 45,ff,00,fe,e2      ad3w  Re2,Rfe,ff       Re2 = bd55;
Post Reply