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.