base:kernal_floating_point_mathematics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
base:kernal_floating_point_mathematics [2019-10-14 07:59] – error/typo corrected silverdr | base:kernal_floating_point_mathematics [2019-10-14 10:07] – [2.4 Division] silverdr | ||
---|---|---|---|
Line 41: | Line 41: | ||
**$68** is used during normalisation, | **$68** is used during normalisation, | ||
- | **$6f** holds the sign result of arithmetic operations. This byte is set when FAC2 is loaded, not when FAC1 is loaded. FAC2 should be loaded after FAC1 before addition, or multiplication. | + | **$6f** holds the sign result of arithmetic operations. This byte is set when FAC2 is loaded, not when FAC1 is loaded. FAC2 should be loaded after FAC1 before addition, or multiplication. |
**$70** is the low order rounding byte for FAC1, essentially an extension of the mantissa. It is cleared whenever a variable is loaded into FAC1. Storing 0 here after obtaining a result can speed execution (at the cost of accuracy) by avoiding the rounding routines. | **$70** is the low order rounding byte for FAC1, essentially an extension of the mantissa. It is cleared whenever a variable is loaded into FAC1. Storing 0 here after obtaining a result can speed execution (at the cost of accuracy) by avoiding the rounding routines. | ||
Line 68: | Line 68: | ||
---- | ---- | ||
- | |||
====== The Floating Point Routines ====== | ====== The Floating Point Routines ====== | ||
Line 130: | Line 129: | ||
**$bb0f** = Divide the memory contents pointed to by A/Y (low/high) by FAC1.\\ | **$bb0f** = Divide the memory contents pointed to by A/Y (low/high) by FAC1.\\ | ||
- | **$bb12** = Entry if FAC2 already loaded. Accumulator must load FAC1 exponent ($61) beforehand to set the zero flag. | + | **$bb12** = Entry if FAC2 already loaded. Accumulator must load FAC1 exponent ($61) beforehand to set the zero flag. Sign comparison is not performed and ARISGN byte at $6f is not set, which has to be accounted for when using this entry point. Hard to debug sign errors may occur otherwise. |
Divides FAC2 by FAC1, leaving the quotient in FAC1, and the remainder in FAC2. | Divides FAC2 by FAC1, leaving the quotient in FAC1, and the remainder in FAC2. |
base/kernal_floating_point_mathematics.txt · Last modified: 2020-12-06 20:48 by pararaum