Jump to content
IGNORED

Floating with XFORTH for the ATARI800XL


Recommended Posts

HEX

D4 CONSTANT FR0
E0 CONSTANT FR1
E6 CONSTANT FR2
FC CONSTANT FLPTR
F3 CONSTANT INBUF
F2 CONSTANT CIX

D800 CONSTANT AFP
D8E6 CONSTANT FASC
D9AA CONSTANT IFP
D9D2 CONSTANT FPI

DA44 CONSTANT ZFR0
DA46 CONSTANT ZFR1
DD8D CONSTANT FLD0P
DD9C CONSTANT FLD1P
DDAB CONSTANT FST0P
DDB6 CONSTANT FMOVE

DA60 CONSTANT FSUB
DA66 CONSTANT FADD
DADB CONSTANT FMUL
DB28 CONSTANT FDIV
DD40 CONSTANT FPLYEVL
DDC0 CONSTANT FEXP
DDCC CONSTANT FEXP10
DECD CONSTANT FLOG
DED1 CONSTANT FLOG10

00 VARIABLE FR3 6 ALLOT

: F. (  Print Floating )
 FASC  CALL
 BEGIN
       INBUF @ C@ DUP 7F AND EMIT
       1 INBUF +!
 80 > UNTIL
 SPACE ;

: F0 ( Type : F0 345.443 Return)
 BL WORD 1+  INBUF ! 0 CIX C! AFP CALL ;

: F1 ( Type : F1 345.443 Return)
 FR0 FR3 6 CMOVE
 BL WORD 1+  INBUF ! 0 CIX C! AFP CALL
 FMOVE CALL
 FR3 FR0 6 CMOVE ;

: F2  ( Type : F2 345.443 Return )
 FR0 FR3 6 CMOVE
 BL WORD 1+  INBUF ! 0 CIX C! AFP CALL
 FR0 FR2 6 CMOVE
 FR3 FR0 6 CMOVE ;

: F0-F1  ( F0 to F1 )
 FR0 FR1 6 CMOVE ;

: F0-F2 ( F0 to F2 )
 FR0 FR2 6 CMOVE ;

: F1-F0 ( F1 to F0 )
 FR1 FR0 6 CMOVE ;

: F2-F0 ( F2 to F0 )
 FR2 FR0 6 CMOVE ;

: F1-F2 ( F1 to F2 )
 FR1 FR2 6 CMOVE ;

: F2-F1 ( F2 to F1 )
 FR2 FR1 6 CMOVE ;

: F- ( Demo : F0 345.556 F1 4555.444 F- F. )
 FSUB CALL ;

: F+
 FADD CALL ;

: F*
 FMUL CALL ;

: F/
 FDIV CALL ;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...