Results 1 to 10 of 10

Thread: Deciphering Chrysler 68RFE Code

  1. #1
    Banned
    Join Date
    Jan 2018
    Location
    Everywhere
    Posts
    1,772

    Deciphering Chrysler 68RFE Code

    So I have been putting in some time lately learning code and deciphering bits of the Chrysler code for the 68RFE. And it is no easy task. I'll show a little snip of code here to show what it looks like for those that go through this stuff to build software like the VCM editor, figuring things out and mapping things out so people can have a way to tune their vehicles.

    I may be a bit off on some of this...

    89 6f 85 e7 lbz r11,-0x7a19(r15)
    38 a0 00 00 li r5,0x0
    7d 6b 58 f8 nor r11,r11,r11
    55 6b 06 b5 rlwinm. r11,r11,0x0,0x1a,0x1a
    40 82 00 0c bne LAB_002c5b2c
    88 ae 93 82 lbz r5,-0x6c7e(r14)
    48 00 00 64 b LAB_002c5b8c


    The above snip of code is checking to see if the TCC lockup is commanded and if it is commanded, set the max allowed line pressure for while the TCC in lockup. If TCC lock is not commanded, branch to another set of instructions.

    Lets break this down.

    89 6f 85 e7 lbz r11,-0x7a19(r15)
    This line here is pointing to an address in volatile memory where the TCC lockup status is stored. It takes the byte sized value stored at that location in memory and loads it into register 11 (r11) then zero's out all other bits in that register. A byte is 8 bits while a register is 32 bits. The value that will be stored at the location in the volatile memory can be either 0x20 (TCC lockup not commanded) or it can 0x40 (TCC lockup commanded).

    The end result stored in r11 if TCC lockup is not commanded would look like this: 00000000000000000000000000100000 (0x20)
    The end result stored in r11 if TCC lockup is commanded would look like this: 00000000000000000000000001000000 (0x40)

    38 a0 00 00 li r5,0x0
    Here it is just taking the value of 0x0 and storing it into the r5 register.

    7d 6b 58 f8 nor r11,r11,r11
    This line of code is taking the stored value in r11, complimenting the bits with itself and then inverting all the bits then storing the end result back into r11. Since it is complimenting the bits with itself, we can just look at this as inverting all the bits in the stored value.

    The end result stored in r11 if TCC lockup is not commanded would look like this: 11111111111111111111111111011111 (0xFFFFFFDF)
    The end result stored in r11 if TCC lockup is commanded would look like this: 11111111111111111111111110111111 (0xFFFFFFBF)

    55 6b 06 b5 rlwinm. r11,r11,0x0,0x1a,0x1a
    This line here is a complex instruction. This is a rotate left word immediate then AND with mask instruction and because it has the . at the end of it, it also stores a value in what is called a Condition Register Field 0. The only part of this I have figured out is how it calculates the value to be stored in the Condition Register Field 0 and what it does with it once it is in there.

    But ultimately what it is doing in its use here is creating a mask of bits and using it to compare against the bits of the value stored in r11 and it is only looking specificaly at bit 26 in the mask and the value stored in r11. If bit 26 in the mask and the value in r11 match, it stores a value of 0x1 back into r11. If bit 26 in each do not match, it stores a value 0x0 into r11.

    The mask would look like this: 00000000000000000000000000100000 (0x20)

    If we put the TCC lockup not commanded value on top of the mask value:

    11111111111111111111111111011111 (0xFFFFFFDF)
    00000000000000000000000000100000 (0x20)

    We can see that bit 26 does not match, this would make our result 0x0 that gets stored back into r11

    If we put the TCC lockup commanded value on top of the mask value:

    11111111111111111111111110111111 (0xFFFFFFBF)
    00000000000000000000000000100000 (0x20)

    Here we see that bit 26 does match in both values, so the result getting stored back into r11 would be 0x1

    The rlwinm. instruction gets way more complex than what it is doing here.

    40 82 00 0c bne LAB_002c5b2c
    What this line is doing is basically saying that if the above is not equal then branch off to another set of instructions.

    88 ae 93 82 lbz r5,-0x6c7e(r14)
    Here on this line, if the above was equal and it didn't branch off to another set of instructions, it pulls the stored max line pressure for TCC lockup from its location and places in into register r5.

    48 00 00 64 b LAB_002c5b8c
    It then branches off to a different set of instructions afterwards from here to load the max line pressure while TCC is in lockup in a specific address in the volatile memory block then branches off again to continue where it left off from before branching to the above set of code.


    Again, part of whats happening here I may have slightly off, specifically at the rlwinm. instruction, its a pretty complex instruction to wrap the mind around. But in a nutshell this is whats happening while the ecm code is deciding what to set the max allowable line pressure to be. Now if you could imagine the extra work a person would need to go through to determine what this bit of code is without knowing any of the parameters at all. I know that this piece of code is for the max line pressure while TCC is in lockup because this bit, -0x6c7e(r14), points directly to the parameter for the max line pressure while in TCC lockup.
    Last edited by Jim P; 12-14-2022 at 11:21 AM.

  2. #2
    Banned
    Join Date
    Jan 2018
    Location
    Everywhere
    Posts
    1,772
    Here is the pseudocode for all the above:

    uVar1 = 0;
    if ((~*(byte *)(unaff__r15 + -0x7a19) & 0x20) == 0) {
    uVar2 = *(undefined *)(unaff__r14 + -0x6c7e);
    }
    else if


    To put into simpler words:

    Max allowed line pressure = 0
    If bit 26 from TCC lockup commanded value IS EQUAL to 0
    Get max line pressure while TCC lockup value from its location
    Otherwise do...
    Last edited by Jim P; 12-13-2022 at 09:43 PM.

  3. #3
    I always appreciate the knowledge that you share Jim and thank you for sharing this bit of assembly logic that you have been figuring out. Do you know what ISA Chrysler is using for the 68RFE controller? I believe you have stated that Cummins uses PowerPC ISA for their controllers.

    I do have one question on the result byte nomenclature. I thought when leading a byte value with 0x that means it is hexadecimal format. You are using 0x followed by the raw bits. I can be totally wrong about this as I have not spent much time studying hex or various ISA's.

    If you are a Medium subscriber, I would recommend you check out the author Erik Engheim. He writes a lot about different ISA's and how they work. He has also created his own ISA for teaching others how logic works.

    Again, thank you for sharing all the hard work you do!
    2019 CCSB Bighorn - Excited HP Tuners finally supported Cummins CM2350&2450 platforms

  4. #4
    Banned
    Join Date
    Jan 2018
    Location
    Everywhere
    Posts
    1,772
    Quote Originally Posted by jfreemanak View Post
    I always appreciate the knowledge that you share Jim and thank you for sharing this bit of assembly logic that you have been figuring out. Do you know what ISA Chrysler is using for the 68RFE controller? I believe you have stated that Cummins uses PowerPC ISA for their controllers.

    I do have one question on the result byte nomenclature. I thought when leading a byte value with 0x that means it is hexadecimal format. You are using 0x followed by the raw bits. I can be totally wrong about this as I have not spent much time studying hex or various ISA's.

    If you are a Medium subscriber, I would recommend you check out the author Erik Engheim. He writes a lot about different ISA's and how they work. He has also created his own ISA for teaching others how logic works.

    Again, thank you for sharing all the hard work you do!
    Corrected the bits and hex format. Yes PowerPC is used as the ISA.

  5. #5
    nice work sir,let me know when and where class is for in-person training lol
    love the info and detail you always post
    2010 F-350 03 5.9/848ecm, built 5R110, 30% over sticks, 10mm pump, 64mm Stealth Turbo
    2008 F-350 03 5.9
    Fumminstuning.com

  6. #6
    Banned
    Join Date
    Jan 2018
    Location
    Everywhere
    Posts
    1,772
    Lol I dunno if I?m the guy to really go as far teaching programming language and stuff. It?s not an easy subject lol. But I wanted to showcase a bit what it looks like for someone to be going through figuring out what is what in these things. It?s pretty complex and there is a lot of weird stuff going on in there and I won?t be covering things like how it is that I know that the -0x6c7e(r14) mentioned above is the TCC max lockup line pressure and that it points to that parameter.

  7. #7
    Potential Tuner
    Join Date
    Nov 2023
    Posts
    2
    ����

  8. #8
    All I see is a bunch of question marks inside a black diamond or something

  9. #9
    Me too. I am assuming those are emoji's that aren't recognized by Chromium.
    2019 CCSB Bighorn - Excited HP Tuners finally supported Cummins CM2350&2450 platforms

  10. #10
    Maybe