Make word "." a bit more compact

This commit is contained in:
Virgil Dupras 2021-01-02 16:04:36 -05:00
parent ac3629b817
commit 7dff93f2ff
2 changed files with 5 additions and 11 deletions

16
blk.fs
View File

@ -1944,22 +1944,16 @@ SYSVARS 0x36 + :** BLK!*
: COPY ( src dst -- ) : COPY ( src dst -- )
FLUSH SWAP BLK@ BLK> ! BLK! ; FLUSH SWAP BLK@ BLK> ! BLK! ;
( ----- 375 ) ( ----- 375 )
: _
999 SWAP ( stop indicator )
BEGIN
?DUP NOT IF EXIT THEN
10 /MOD ( r q )
SWAP '0' + SWAP ( d q )
AGAIN ;
: . ( n -- ) : . ( n -- )
?DUP NOT IF '0' EMIT EXIT THEN ( 0 is a special case ) ?DUP NOT IF '0' EMIT EXIT THEN ( 0 is a special case )
( handle negative ) ( handle negative )
DUP 0< IF '-' EMIT -1 * THEN DUP 0< IF '-' EMIT -1 * THEN
_ 999 SWAP ( stop indicator )
BEGIN BEGIN
DUP '9' > IF DROP EXIT THEN ( stop indicator ) 10 /MOD ( r q )
EMIT SWAP '0' + SWAP ( d q )
AGAIN ; ?DUP NOT UNTIL
BEGIN EMIT DUP '9' > UNTIL DROP ( drop stop ) ;
( ----- 376 ) ( ----- 376 )
: ? @ . ; : ? @ . ;
: _ : _

Binary file not shown.