6.1.0050
#S
number-sign-s
CORE
(
ud
1
--
ud
2
)
Convert one digit of
ud
1
according to the rule for
#
. Continue conversion until the quotient is zero.
ud
2
is zero. An ambiguous condition exists if
#S
executes outside of a
<#
#>
delimited number conversion.
See:
6.1.0030 #
,
6.1.0040 #>
,
6.1.0490 <#
.
Testing:
:
GP4
<#
1 0
#S
#>
S"
1" S=
;
T{ GP4 -> <TRUE> }T
:
GP5
BASE
@
<TRUE>
MAX-BASE
1+
2
DO
\
FOR EACH POSSIBLE BASE
I
BASE
!
\
TBD: ASSUMES BASE WORKS
I
0
<#
#S
#>
S"
10" S=
AND
LOOP
SWAP
BASE
!
;
T{ GP5 -> <TRUE> }T
:
GP6
BASE
@
>R
2
BASE
!
MAX-UINT MAX-UINT
<#
#S
#>
\
MAXIMUM UD TO BINARY
R>
BASE
!
\
S: C-ADDR U
DUP
#BITS-UD
=
SWAP
0
DO
\
S: C-ADDR FLAG
OVER
C@
[CHAR]
1
=
AND
\
ALL ONES
>R
CHAR+
R>
LOOP
SWAP
DROP
;
T{ GP6 -> <TRUE> }T
:
GP7
BASE
@
>R
MAX-BASE
BASE
!
<TRUE>
A 0
DO
I
0
<#
#S
#>
1
=
SWAP
C@
I
30
+
=
AND
AND
LOOP
MAX-BASE A
DO
I
0
<#
#S
#>
1
=
SWAP
C@
41
I
A
-
+
=
AND
AND
LOOP
R>
BASE
!
;
T{ GP7 -> <TRUE> }T
Forth 2012
Forth 2012
Glossary
Foreword
Proposals Process
200
x
Membership
Introduction
Terms, notation, and references
Usage requirements
Documentation requirements
Compliance and labeling
Glossary
Block word set
Double-Number word set
Exception word set
Facility word set
File-Access word set
Floating-Point word set
Locals word set
Memory-Allocation word set
Programming-Tools word set
Search-Order word set
String word set
Extended-Character word set
Rationale
Bibliography
Compatibility analysis
Portability guide
Reference Implementations
Test Suite
Alphabetic list of words
#S
!
#
#>
#S
'
(
*
*/
*/MOD
+
+!
+LOOP
,
-
.
."
/
/MOD
0<
0=
1+
1-
2!
2*
2/
2@
2DROP
2DUP
2OVER
2SWAP
:
;
<
<#
=
>
>BODY
>IN
>NUMBER
>R
?DUP
@
ABORT
ABORT"
ABS
ACCEPT
ALIGN
ALIGNED
ALLOT
AND
BASE
BEGIN
BL
C!
C,
C@
CELL+
CELLS
CHAR
CHAR+
CHARS
CONSTANT
COUNT
CR
CREATE
DECIMAL
DEPTH
DO
DOES>
DROP
DUP
ELSE
EMIT
ENVIRONMENT?
EVALUATE
EXECUTE
EXIT
FILL
FIND
FM/MOD
HERE
HOLD
I
IF
IMMEDIATE
INVERT
J
KEY
LEAVE
LITERAL
LOOP
LSHIFT
M*
MAX
MIN
MOD
MOVE
NEGATE
OR
OVER
POSTPONE
QUIT
R>
R@
RECURSE
REPEAT
ROT
RSHIFT
S"
S>D
SIGN
SM/REM
SOURCE
SPACE
SPACES
STATE
SWAP
THEN
TYPE
U.
U<
UM*
UM/MOD
UNLOOP
UNTIL
VARIABLE
WHILE
WORD
XOR
[
[']
[CHAR]
]
.(
.R
0<>
0>
2>R
2R>
2R@
:NONAME
<>
?DO
ACTION-OF
AGAIN
BUFFER:
C"
CASE
COMPILE,
DEFER
DEFER!
DEFER@
ENDCASE
ENDOF
ERASE
FALSE
HEX
HOLDS
IS
MARKER
NIP
OF
PAD
PARSE
PARSE-NAME
PICK
REFILL
RESTORE-INPUT
ROLL
S\"
SAVE-INPUT
SOURCE-ID
TO
TRUE
TUCK
U.R
U>
UNUSED
VALUE
WITHIN
[COMPILE]
\