mirror of
https://github.com/forth-ev/VolksForth.git
synced 2024-10-31 19:04:43 +00:00
36 lines
796 B
Forth
36 lines
796 B
Forth
( ----- 000 )
|
|
\\ Circular String Buffer cas 27jul20
|
|
Wil Baden, Costa Mesa, California
|
|
Forth Dimensions July 1996
|
|
( ----- 001 )
|
|
\ CSB load screen cas 27jul20
|
|
|
|
1 3 +thru
|
|
|
|
|
|
.( Circular Ring Buffer loaded. )
|
|
( ----- 002 )
|
|
\ Get-Buf >PAD cas 27jul20
|
|
|
|
1000 CONSTANT /CSB
|
|
CREATE CSB 0 , /CSB ALLOT
|
|
|
|
: GET-BUF ( n -- c_addr )
|
|
DUP CSB @ > IF /CSB CSB ! THEN
|
|
NEGATE CSB +!
|
|
CSB 2+ CSB @ + ;
|
|
|
|
: >PAD ( a u -- 'a u )
|
|
DUP GET-BUF SWAP
|
|
2DUP >R >R MOVE R> R> ;
|
|
( ----- 003 )
|
|
\ S" cas 27jul20
|
|
|
|
: S" ( "ccc<quote>" -- | c_addr u )
|
|
ASCII " PARSE
|
|
STATE @ IF
|
|
POSTPONE SLITERAL
|
|
ELSE
|
|
>PAD
|
|
THEN ; IMMEDIATE
|