1. I thought that "@" usually proceeds "one line of assembly code"?
It does, and that's what it is.
But he had the value stored in a specific location in an array, so you should just forget that part and make it ...
Knots VAR WORD
R0 and R2 are two of PBP's system variables.
When you do a multiplication (Knots * 9881), R2 has the low word of the result which also gets copied to Dec_speed.
And R0 has the High Word of the result, the same as if you did a Knots ** 9881, without having to do the multiplication a second time.
So yes, the second Dec_speed does "negate" the first one, but the result is still in R0 and R2 so it doesn't matter.
MPH = Knots * 1.150779
And 9881 / 65536 = 0.150772, which is as close as we can get with integer math. That's the decimal part.
The integer part is 1, so just adding Knots to the final result is the same thing.
R2.15 is the highest bit in the low word, so it indicates if the high word should be rounded up or down.
So all together, the multiplication does (Knots * 0.150772), the result is in R0, Round up if R2.15=1, then add Knots (knots * 1).
Clear as mud.
<br>
Bookmarks