programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

fpmath rounding

From: Bret Latshaw <bret_at_bedford.net>
Date: Sun, 22 Jun 2003 15:14:07 -0400

FYI:

>From FPMATH.F, SwiftForth 2.2.2.9

CODE ROUND 0 # EDX MOV ROUNDING JMP END-CODE
CODE FLOOR 2 # EDX MOV ROUNDING JMP END-CODE
CODE ROUND-UP 4 # EDX MOV ROUNDING JMP END-CODE
CODE TRUNCATE 6 # EDX MOV ROUNDING JMP END-CODE

CODE MAKE-ROUND
   FP-ROUND EAX ADDR
   0 [EAX] FLDCW
   FNEXT

CODE MAKE-FLOOR
   FP-ROUND EAX ADDR
   2 [EAX] FLDCW
   FNEXT

CODE MAKE-ROUND-UP
   FP-ROUND EAX ADDR
   2 [EAX] FLDCW
   FNEXT

CODE MAKE-TRUNCATE
   FP-ROUND EAX ADDR
   2 [EAX] FLDCW
   FNEXT

The constants in the last two words should be 4 and 6.

--
Bret
----------------------------------------------------------------------
sftalk_at_forth.com      The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users.  For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Sun Jun 22 2003 - 12:23:07 PDT

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:32 PST