Here may be a more complete answer to your question:
Here are a couple of nice threads by Darrel Taylor dealing with exploiting PBP's integer math:Code:PotValue VAR BYTE Degrees VAR WORD Minutes VAR WORD Degrees = Potvalue * 14118 ' Convert to degrees and fractional Degrees ' scaled by 10000. ' It does not matter that we assign Degrees a value before DIV32, ' since DIV32 uses only internal PBP variable in the calculation ' It is important that DIV32 follows right after the Multiply ' Degrees = DIV32 10000 ' Returns degrees Minutes = R2 ' Returns the remainder of the division, ' which is fractional degress scaled by 10000 Minutes = (Minutes * 6)/1000 ' returns minutes
Retrieving 32bit Multiply Result
Retrieving Div32 Remainder (This one explains "Minutes = R2". See the last post in the thread)
32-bit Variables and DIV32, Hourmeter 99999.9
Steve




Bookmarks