41 MCODE - Floating FIX Mode (Fix ALL)
|
02-15-2015, 01:59 PM
(This post was last modified: 02-15-2015 02:05 PM by Ángel Martin.)
Post: #1
|
|||
|
|||
41 MCODE - Floating FIX Mode (Fix ALL)
Floating FIX Mode
As discussed in a forum thread, it's often valuable to see the maximum number of digits with a meaningful contribution to the result value. The idea for the 41 was to use the I/O_SVC interrupt polling point to adjust the FIX setting in a dynamic fashion, depending on the value stored in the stack register X. Some folks call this a FIX ALL mode, but I favor the Floating FIX terminology - after all a fix ALL would always be a static FIX_9, for it isn't about ALL digits but ALL NEEDED ones. Bur semantics aside, the code below shows the core of the routine, i.e. the actual determination of the FIX settings. The formulas used are as follows: Let x be represented by the following convention used in the 41 platform, with one digit for the mantissa sign, 10 digits for the mantissa, one for the exponent sign and two for the exponent. This enables a numeric range between +/-9,999999999 E99, with a "whole" around zero defined by the interval +/-1E-99. Then the fix setting to use is a function of the number in X , represented as follows: " s|abcdefghij|xyz " 1. If number >=1 (or x="0") let z# = number of mantissa digits equal to zero, starting from the most significant one (i.e. from PT= 3 to PT=12), and XP = value of exponent (yz). Then we have: FIX = max { 0 , [(9-z#) + XP } 2. if number < 1 (or x="9") let |XP| = 100 - xyz, and z# as defined above. Then we have: FIX = min { 9 , [(9-z#) + |XP| } And here is the code to be executed by the OS upon each qualifying I/O_SVC event: Code:
"To live or die by your own sword one must first learn to wield it aptly." |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
41 MCODE - Floating FIX Mode (Fix ALL) - Ángel Martin - 02-15-2015 01:59 PM
RE: 41 MCODE - Floating FIX Mode (Fix ALL) - Ángel Martin - 02-15-2015, 06:42 PM
|
User(s) browsing this thread: 1 Guest(s)