|
|
@ -820,6 +820,7 @@ T{ GS4 123 456
|
|
|
|
|
|
|
|
|
|
|
|
\ \ ------------------------------------------------------------------------
|
|
|
|
\ \ ------------------------------------------------------------------------
|
|
|
|
\ TESTING <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL
|
|
|
|
\ TESTING <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL
|
|
|
|
|
|
|
|
." TESTING BASE >NUMBER HEX DEMICAL" CR
|
|
|
|
\
|
|
|
|
\
|
|
|
|
\ : S= \ ( ADDR1 C1 ADDR2 C2 -- T/F ) COMPARE TWO STRINGS.
|
|
|
|
\ : S= \ ( ADDR1 C1 ADDR2 C2 -- T/F ) COMPARE TWO STRINGS.
|
|
|
|
\ >R SWAP R@ = IF \ MAKE SURE STRINGS HAVE SAME LENGTH
|
|
|
|
\ >R SWAP R@ = IF \ MAKE SURE STRINGS HAVE SAME LENGTH
|
|
|
@ -845,12 +846,12 @@ T{ GS4 123 456
|
|
|
|
\
|
|
|
|
\
|
|
|
|
\ : GP4 <# 1 0 #S #> S" 1" S= ;
|
|
|
|
\ : GP4 <# 1 0 #S #> S" 1" S= ;
|
|
|
|
\ T{ GP4 -> <TRUE> }T
|
|
|
|
\ T{ GP4 -> <TRUE> }T
|
|
|
|
\
|
|
|
|
|
|
|
|
\ 24 CONSTANT MAX-BASE \ BASE 2 .. 36
|
|
|
|
24 CONSTANT MAX-BASE \ BASE 2 .. 36
|
|
|
|
\ : COUNT-BITS
|
|
|
|
: COUNT-BITS
|
|
|
|
\ 0 0 INVERT BEGIN DUP WHILE >R 1+ R> 2* REPEAT DROP ;
|
|
|
|
0 0 INVERT BEGIN DUP WHILE >R 1+ R> 2* REPEAT DROP ;
|
|
|
|
\ COUNT-BITS 2* CONSTANT #BITS-UD \ NUMBER OF BITS IN UD
|
|
|
|
COUNT-BITS 2* CONSTANT #BITS-UD \ NUMBER OF BITS IN UD
|
|
|
|
\
|
|
|
|
|
|
|
|
\ : GP5
|
|
|
|
\ : GP5
|
|
|
|
\ BASE @ <TRUE>
|
|
|
|
\ BASE @ <TRUE>
|
|
|
|
\ MAX-BASE 1+ 2 DO \ FOR EACH POSSIBLE BASE
|
|
|
|
\ MAX-BASE 1+ 2 DO \ FOR EACH POSSIBLE BASE
|
|
|
@ -885,30 +886,30 @@ T{ GS4 123 456
|
|
|
|
\ R> BASE ! ;
|
|
|
|
\ R> BASE ! ;
|
|
|
|
\
|
|
|
|
\
|
|
|
|
\ T{ GP7 -> <TRUE> }T
|
|
|
|
\ T{ GP7 -> <TRUE> }T
|
|
|
|
\
|
|
|
|
|
|
|
|
\ \ >NUMBER TESTS
|
|
|
|
\ >NUMBER TESTS
|
|
|
|
\ CREATE GN-BUF 0 C,
|
|
|
|
CREATE GN-BUF 0 C,
|
|
|
|
\ : GN-STRING GN-BUF 1 ;
|
|
|
|
: GN-STRING GN-BUF 1 ;
|
|
|
|
\ : GN-CONSUMED GN-BUF CHAR+ 0 ;
|
|
|
|
: GN-CONSUMED GN-BUF CHAR+ 0 ;
|
|
|
|
\ : GN' [CHAR] ' WORD CHAR+ C@ GN-BUF C! GN-STRING ;
|
|
|
|
: GN' [CHAR] ' WORD CHAR+ C@ GN-BUF C! GN-STRING ;
|
|
|
|
\
|
|
|
|
|
|
|
|
\ T{ 0 0 GN' 0' >NUMBER -> 0 0 GN-CONSUMED }T
|
|
|
|
T{ 0 0 GN' 0' >NUMBER -> 0 0 GN-CONSUMED }T
|
|
|
|
\ T{ 0 0 GN' 1' >NUMBER -> 1 0 GN-CONSUMED }T
|
|
|
|
T{ 0 0 GN' 1' >NUMBER -> 1 0 GN-CONSUMED }T
|
|
|
|
\ T{ 1 0 GN' 1' >NUMBER -> BASE @ 1+ 0 GN-CONSUMED }T
|
|
|
|
T{ 1 0 GN' 1' >NUMBER -> BASE @ 1+ 0 GN-CONSUMED }T
|
|
|
|
\ T{ 0 0 GN' -' >NUMBER -> 0 0 GN-STRING }T \ SHOULD FAIL TO CONVERT THESE
|
|
|
|
T{ 0 0 GN' -' >NUMBER -> 0 0 GN-STRING }T \ SHOULD FAIL TO CONVERT THESE
|
|
|
|
\ T{ 0 0 GN' +' >NUMBER -> 0 0 GN-STRING }T
|
|
|
|
T{ 0 0 GN' +' >NUMBER -> 0 0 GN-STRING }T
|
|
|
|
\ T{ 0 0 GN' .' >NUMBER -> 0 0 GN-STRING }T
|
|
|
|
T{ 0 0 GN' .' >NUMBER -> 0 0 GN-STRING }T
|
|
|
|
\
|
|
|
|
|
|
|
|
\ : >NUMBER-BASED
|
|
|
|
: >NUMBER-BASED
|
|
|
|
\ BASE @ >R BASE ! >NUMBER R> BASE ! ;
|
|
|
|
BASE @ >R BASE ! >NUMBER R> BASE ! ;
|
|
|
|
\
|
|
|
|
|
|
|
|
\ T{ 0 0 GN' 2' 10 >NUMBER-BASED -> 2 0 GN-CONSUMED }T
|
|
|
|
T{ 0 0 GN' 2' 10 >NUMBER-BASED -> 2 0 GN-CONSUMED }T
|
|
|
|
\ T{ 0 0 GN' 2' 2 >NUMBER-BASED -> 0 0 GN-STRING }T
|
|
|
|
T{ 0 0 GN' 2' 2 >NUMBER-BASED -> 0 0 GN-STRING }T
|
|
|
|
\ T{ 0 0 GN' F' 10 >NUMBER-BASED -> F 0 GN-CONSUMED }T
|
|
|
|
T{ 0 0 GN' F' 10 >NUMBER-BASED -> F 0 GN-CONSUMED }T
|
|
|
|
\ T{ 0 0 GN' G' 10 >NUMBER-BASED -> 0 0 GN-STRING }T
|
|
|
|
T{ 0 0 GN' G' 10 >NUMBER-BASED -> 0 0 GN-STRING }T
|
|
|
|
\ T{ 0 0 GN' G' MAX-BASE >NUMBER-BASED -> 10 0 GN-CONSUMED }T
|
|
|
|
T{ 0 0 GN' G' MAX-BASE >NUMBER-BASED -> 10 0 GN-CONSUMED }T
|
|
|
|
\ T{ 0 0 GN' Z' MAX-BASE >NUMBER-BASED -> 23 0 GN-CONSUMED }T
|
|
|
|
T{ 0 0 GN' Z' MAX-BASE >NUMBER-BASED -> 23 0 GN-CONSUMED }T
|
|
|
|
\
|
|
|
|
|
|
|
|
\ : GN1 \ ( UD BASE -- UD' LEN ) UD SHOULD EQUAL UD' AND LEN SHOULD BE ZERO.
|
|
|
|
\ : GN1 \ ( UD BASE -- UD' LEN ) UD SHOULD EQUAL UD' AND LEN SHOULD BE ZERO.
|
|
|
|
\ BASE @ >R BASE !
|
|
|
|
\ BASE @ >R BASE !
|
|
|
|
\ <# #S #>
|
|
|
|
\ <# #S #>
|
|
|
@ -920,11 +921,11 @@ T{ GS4 123 456
|
|
|
|
\ T{ 0 0 MAX-BASE GN1 -> 0 0 0 }T
|
|
|
|
\ T{ 0 0 MAX-BASE GN1 -> 0 0 0 }T
|
|
|
|
\ T{ MAX-UINT 0 MAX-BASE GN1 -> MAX-UINT 0 0 }T
|
|
|
|
\ T{ MAX-UINT 0 MAX-BASE GN1 -> MAX-UINT 0 0 }T
|
|
|
|
\ T{ MAX-UINT DUP MAX-BASE GN1 -> MAX-UINT DUP 0 }T
|
|
|
|
\ T{ MAX-UINT DUP MAX-BASE GN1 -> MAX-UINT DUP 0 }T
|
|
|
|
\
|
|
|
|
|
|
|
|
\ : GN2 \ ( -- 16 10 )
|
|
|
|
: GN2 \ ( -- 16 10 )
|
|
|
|
\ BASE @ >R HEX BASE @ DECIMAL BASE @ R> BASE ! ;
|
|
|
|
BASE @ >R HEX BASE @ DECIMAL BASE @ R> BASE ! ;
|
|
|
|
\ T{ GN2 -> 10 A }T
|
|
|
|
T{ GN2 -> 10 A }T
|
|
|
|
\
|
|
|
|
|
|
|
|
\ ------------------------------------------------------------------------
|
|
|
|
\ ------------------------------------------------------------------------
|
|
|
|
." TESTING FILL MOVE" CR
|
|
|
|
." TESTING FILL MOVE" CR
|
|
|
|
|
|
|
|
|
|
|
|