[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bench tests needed...



Shannen Durphey wrote:
> 
> This has puzzled me for a long time:
> LD3B5:  ldx     #0x0037
> D3B8    ldaa    *SAC
> D3BA    jsr     8X16mult
> D3BD    std     *L0044
> 
> What is this?  SAC looks like the 8 bit spark angle, but what
> significance is 55 decimal?

"SAC" contains the angle in units of 90/256 degrees.  Just before this
code snippet, the sixteen bit angle value in the Y register was stuffed
into SAC.  (Actually, it also took the absolute value of the number and
set up a flag to distinguish advance/retard.)  Locations 0x0037:0x0038
contain the number of clock counts for 90 degrees of engine rotation. 
The 8X16mult function takes the 8 bit value in A, and the 16 bit value
pointed to by X, multiplies them, divides the result by 256, and returns
this in the D register.  The result is that if SAC contained say 128
(which means 45 degrees), then D will end up with half of the value in
0x0037:0x0038.  This is the amount of time it takes the engine to rotate
45 degrees.

-- 
Ludis Langens                               ludis (at) cruzers (dot) com
Mac, Fiero, & engine controller goodies:  http://www.cruzers.com/~ludis/

----------------------------------------------------------------------------
To unsubscribe from gmecm, send "unsubscribe gmecm" (without the quotes)
in the body of a message (not the subject) to majordomo@lists.diy-efi.org