Quote:
Originally Posted by RoughSilver92
I am still trudging through this code and I want to make sure i am interpreting this correctly:
Since it is little endian, 102f contains the most significant digits and 102e contains the less significant digits. So the value at 102e is inconsequential because the and will clear those bits anyways. In reality it is multiplying the value at 102f followed by 8 bits of zeros with the value at 801b followed by the value at 801a, or:
[102f][#00]
x[801b][801a]
---------------
Is this about right or do I have it backwards?
|
Yes. That is correct.
The two 16-bit values are multiplied together and the 32-bit result is put into b,a
eg. [102f][#00] x [801b][801a] = [bh][bl][ah][al]
Then the next line of code takes the most significant 16 bits of the result and stores them at [1009][1008]
Quote:
00ADD0 428D0810 sta bx, 0x1008
|
That's basically the same as dividing the result of the multiplication by 0x10000
__________________
Subaru ECU and TCU Website
1992 Alcyone SVX Version L
1992 Alcyone SVX Version L
1994 Alcyone SVX S40-II
2004 Subaru Legacy 2.5 SE Sports Tourer
1996 Subaru Legacy 2.2 GX Wagon
1988 Subaru Justy J12 SL-II