( FLIB - HP71 FORTH utilities) ( Tapani Tarvainen 85/11/24) " TIME" BASICF HERE BASE @ HEX : \ 0D WORD DROP ; IMMEDIATE \ ignore rest of line : ASCII ( -- c) \ Compile: c ( -- ) \ Interpret: c ( -- c) BL WORD 2+ C@ STATE @ IF [COMPILE] LITERAL THEN ; IMMEDIATE : 1UPPER ( c1 -- c2) DUP 60 > OVER 7B < AND IF 5F AND THEN ; : Y/N? ( -- ?) ." ? Y/N" CR KEY 1UPPER ASCII Y = ; : LEAP ( EXIT from DO-LOOP) R> R> 2DROP R> DROP ; : TIME " TIME" BASICF ; : .TIMED TIME X<>Y F- F. ." s " ; : DEC. ( n) BASE @ DECIMAL SWAP U. BASE ! ; : ROOM ( -- n) \ # of nibs free in dictionary SP0 @ HERE - 1CA - ; : ROOM? ROOM DEC. ." nibs free " ; : ?FORGET \ name FORGET if exists; TT 85/04/19 \ jumps into middle of FORGET - valid for FTH:1A BL WORD DUP FIND IF DROP E5214 >R ELSE 2DROP THEN ; : NTYPE ( str) \ like TYPE but clears bit 7 of last char \ and uses only 5 low bits of char count 1F AND DUP IF 1- 2DUP TYPE 2* + C@ 7F AND EMIT ELSE 2DROP THEN ; : BASICW ( str--; execute 2-part BASIC statement) ( 1st part in stack, 2nd from input stream - all of it) ( TT 85/05/16) 1 END$ ( move str to PAD, set maxlen to 80) 0D WORD ( never found so we get everything left) COUNT S<& BASICX ; ( the following are used just like in BASIC) : PURGE " PURGE" BASICW ; : COPY " COPY" BASICW ; BASE ! HERE SWAP - DEC. .( nibs ) .TIMED