SPLat Logo

fix

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

fix

(T=Z; Z=Y; Y=X;) X = (int)W; R = <return code>

(Convert from Floating Point to fixed point (integer))

Converts the number in floating point register W to an integer nn, Pushes the integer result to X and sets a Return Code in R.

The resulting number in X, and the result code in R, depend on the number in W

W X R
0 <= W < 256 Integer part of W 0
-256 < W < 0 Integer part of -W 1
256 <= W <= +Inf 255 2
-Inf <= W <= -256 255 3
NaN 0 4

Note that in the normal range 0 to 255 (and down to -255), the fix instruction truncates the argument. Thus 13.999 (and -13.999) gives the result 13.

Dialect restriction: The fix instruction is not implemented in boards with dialect numbers less than 6, or which do not have the FP processor.

See also float