figForth Word - NUMBER

  Some parts of this page/site are currently incomplete & will be updated asap
  Other parts will change continually so use “Refresh” in your browser !!
  There is extensive use of “Tooltips” text to support learning which do not seem to render on a Smartphone. This site is best viewed via a computer’s HD monitor


NUMBER addr — d Convert a character string left at addr with a preceeding count, to a signed .double number, using the current numeric base. If a decimal point is encountered in the text, its position will be given in DPL, but no other effect occurs. If numeric conversion is not possible, an error message will be given

DH Note: “Character string must end in SP (20H) or else error !!”

NFA:    006E74 86              DB   86H
        006E75 4E554D42 45     DB   "NUMBE"
        006E7A D2              DB   'R'+80H
LFA:    006E7B 276E            DW   PNUMB-11
CFA:    006E7D 3C28      NUMB: DW   DOCOL
PFA:    006E7F BF67            DW   ZERO,ZERO	    ;   0 0
        006E83 B569            DW   ROT             ;   ROT
        006E85 0B27            DW   DUP             ;   DUP
        006E87 D368            DW   ONEP            ;   1+
        006E89 B627            DW   CAT             ;   C@
        006E8B 0621 2D00       DW   LIT,2DH         ;   2DH
        006E8F 5969            DW   EQUAL           ;   =
        006E91 0B27            DW   DUP             ;   DUP
        006E93 8525            DW   TOR             ;   >R
        006E95 1226            DW   PLUS            ;   +
        006E97 BB67            DW   MONE            ;  -1
        006E99          NUMB1:                      ;  BEGIN
        006E99 8A68            DW   DPL             ;   DPL
        006E9B F027            DW   STORE           ;   !
        006E9D 326E            DW   PNUMB           ;   (NUMBER)
        006E9F 0B27            DW   DUP             ;   DUP
        006EA1 B627            DW   CAT             ;   C@
        006EA3 F067            DW   BL              ;   BL
        006EA5 4B69            DW   SUBB            ;   -
        006EA7 DA21 1600       DW   ZBRAN,NUMB2-$   ;  WHILE
        006EAB 0B27            DW   DUP             ;   DUP
        006EAD B627            DW   CAT             ;   C@
        006EAF 0621 2E00       DW   LIT,2EH         ;   2EH
        006EB3 4B69            DW   SUBB            ;   -
        006EB5 BF67            DW   ZERO            ;   0
        006EB7 936A            DW   QERR            ;   ?ERROR
        006EB9 BF67            DW   ZERO            ;   0
        006EBB C221 DCFF       DW   BRAN,NUMB1-$    ;  REPEAT
        006EBF CC26     NUMB2: DW   DROP            ;   DROP
        006EC1 C925            DW   FROMR           ;   R>
        006EC3 DA21 0400       DW   ZBRAN,NUMB3-$   ;  IF
        006EC7 9F26            DW   DMINUS          ;   DMINUS
        006EC9          NUMB3:                      ;  THEN
        006EC9 1725            DW   SEMIS           ;   ;S

zsddvxxx

NFA:    006E27 88               DB   88H
        006E28 284E554D 424552  DB   "(NUMBER"
        006E2F A9               DB   ')'+80H
LFA:    006E30 EC6D             DW   WORD-7
CFA:    006E32 3C28      PNUMB: DW   DOCOL
PFA:    006E34           PNUM1:                                 ;   BEGIN
        006E34 D368             DW	ONEP            ; 1+
        006E36 0B27             DW	DUP             ; DUP
        006E38 8525             DW	TOR             ; >R
        006E3A B627             DW	CAT             ; C@
        006E3C 8168             DW	BASE            ; BASE
        006E3E 8F27             DW	AT              ; @
        006E40 7522             DW	DIGIT           ; DIGIT
        006E42 DA21 2C00        DW   ZBRAN,PNUM2-$  ; WHILE
        006E46 E826             DW   SWAP           ; SWAP
        006E48 8168             DW   BASE           ; BASE
        006E4A 8F27             DW   AT             ; @
        006E4C C823             DW   USTAR          ; U*
        006E4E CC26             DW   DROP           ; DROP
        006E50 B569             DW   ROT            ; ROT
        006E52 8168             DW   BASE           ; BASE
        006E54 8F27             DW   AT             ; @
        006E56 C823             DW   USTAR          ; U*
        006E58 1F26             DW   DPLUS          ; D+
        006E5A 8A68             DW   DPL            ; DPL
        006E5C 8F27             DW   AT             ; @
        006E5E D368             DW   ONEP           ; 1+
        006E60 DA21 0800        DW   ZBRAN,PNUM3-$  ; IF
        006E64 C367             DW   ONE            ; 1
        006E66 8A68             DW   DPL            ; DPL
        006E68 2727             DW   PSTOR          ; +!
        006E6A           PNUM3:                     ; THEN
        006E6A C925             DW   FROMR          ; R>
        006E6C C221 C6FF        DW   BRAN,PNUM1-$   ; REPEAT
        006E70 C925      PNUM2: DW   FROMR          ; R>
        006E72 1725             DW   SEMIS          ; ;S

The Meaning of the Dictionary Fields:

NFALFACFAPFA


Updated: 28th August 2022 by David Husband
© 2021 David Husband, a.k.a. Baremetal Engineer Extraordinaire
All Rights Reserved – All Trademarks & Copyrights Acknowledged
All personal information is subject to the Data Protection Act 2018 & the UK GDPR
“ad auxilium aliis ad auxilium sibi”