Code question: airflow, $A9, $AA, etc.

Eric Stage I

TurboTweak Guy
Joined
May 25, 2001
For anyone thats studied the MAF code:

See here,

3A00: CE 00 50 LDX #$0050 X = Address of ReferencePACount
3A03: 96 A9 LDAA $A9 A = Unscaled MAF Table Result
3A05: BD FC 85 JSR $FC85 ; D = ReferencePACount * Unscaled MAF Table Result
3A08: DD 83 STD $83 InjectorPW = D



Ok, fine, so $A9 is unscaled airflow, great.
And later on we see that $AA is the maf table scalar.


Now, here's my quandary. In the rom, there is some code for max airflow. It looks at the max airflow vs. rpm table, compares it to the actual airflow, and limits max airflow if necessary. If the table is used, the lookup is done and the result is in acc A. Then here's what happens:


EE7E: 5F CLRB
EE7F: DD AB STD $AB
EE81: C6 FF LDAB #$FF
EE83: D7 A9 STAB $A9
EE85: 97 AA STAA $AA


Here, it appears to me that $A9 is the table scalar and $AA is unscaled airflow. Is this an error?

Earlier $A9 is unscaled airflow, now $A9 is the scalar. Same deal with $AA.

Am I misinterpreting something?

Sorry for all the mumbo jumbo, but I though I'd throw this out there and see if anyone has a thought.

Regards,
Eric
 
First, the comment at:
EE85: 97 AA STAA $AA $AA = #$FF
from the ecm listing at gnttype is wrong because here A is the max airflow from the table lookup, not $FF so $AA is set to the max airflow, not $FF. However, I agree that it looks like something is wrong here but haven't figured out what yet. Dennis, any ideas? Also, add this comment error to your up-to-date listing :).
 
Looks to me that since it has fudged the airflow ($AB) to the max, that it is also fudging the unscaled airflow. That keeps things consistant ($AB ~= $A9 * $AA / 256). I used approximately equal because 255/256 is only close to 1 and once other minor corrections are done, $AB offten varies from the strict unscaled to scaled calculation anyway.

Not sure why they chose to put the max as the scaler and the unscaled to $FF, but $AA does get manipulated earlier and at $3EEE it does use $AA without $A9. Makes me wonder if changing the table scalars while tuning the MAF tables is a good idea.

Tom
 
Originally posted by tminer
Makes me wonder if changing the table scalars while tuning the MAF tables is a good idea.

Dont know if this helps, but I've done alot of work changing scalers.
Just seems to lose resolution.
In an open loop application.

I limited the max GM/Sec table and then used the MAT input for a boost compensation, and since that MAT MAF correction was a multiplier made for a nice change, ie boost referening the airflow.
 
Top