[Gmecm] VE error in $A1 hac?
rgmecm at yahoo.com
Sun Apr 23 09:36:42 CDT 2006
Thanks for the correction Gary. It was late and I thought I had something. Guess not. :)
Gary Evans <gary at garyandliz.com> wrote: Hi Ryan,
It looks to me like the calculation bottoms out at 600 rpm.
The only error I see is here:
B898 suba #0x30 ;(RPM*2)-48
B898 suba #0x30 ;(RPM*2)-1200 RPM
If the engine RPM is 800 or higher, the code will jump to B89F,
subtract 400, and do a table lookup on the location RPM-400. If, for
example, the rpm is 799, the code will multiply by two (1598),
subtract 1200 (398), and do the lookup on that result.
Any input lower than 600 is treated as 600, because 600*2-1200 = 0.
If the RPM is 599 or less, line B89C sets the result back to zero
after the subtraction yields a negative number.
The code you are looking at is only used to scale the actual RPM
value for the purposes of performing the table lookup. Below 800 rpm,
the table scaling is 1/2 that of the rest of the table. So where the
rest of the table has 400 RPM jumps between columns, the the first
column would only be a 200 RPM jump (since the lookup index is
RPM*2). Hence, I believe the label of 600 RPM for the first column is
correct. This assumption is backed up by the fact that the code will
not allow a lookup below 600 RPM anyway.
On Apr 22, 2006, at 9:44 PM, Ryan Hess wrote:
> I'm a n00b when it comes to assembly, but I was reading the 3d VE
> lookup tables in the $a1 hac, and it appears to me that if the RPM
> <800, it gets multiplied by 2, and 400rpm is subtracted. Wouldn't
> that mean the last cell would be 400 rpm? Someone check me... If
> so I need to change my definition file.
> (there's no way this is going to come out formatted right...)
> B893 LB893:cmpa
> #0x20 ;800 RPM
> B895 bhi LB89F ;BRANCH IF > 800 RPM,
> B897 lsla ;MULT * 2
> B898 suba #0x30 ;(RPM*2)-48
> B89A bcc LB89D ;BRANCH IF NO
> UNDERFLOW, ELSE
> B89C clra ;CLEAR A
> B89D LB89D:bra LB8A1 ;BRANCH
> B89F LB89F:suba #0x10 ;RPM - 400 RPM
> B8A1 LB8A1:ldx #0x8772 ;MAIN VE TABLE
> ... MAP stuff
> B8B5 LB8B5:bra LB8C3 ;GO DO TABLE LOOKUP
> B8B7 LB8B7:psha ;SAVE RPM ON STACK
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.
> Great rates starting at 1Â¢/min.
> Gmecm mailing list
> Gmecm at diy-efi.org
Gmecm mailing list
Gmecm at diy-efi.org
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
More information about the Gmecm