View Full Version : dot quote
What is the definition of ." in IsoMax
I have tried using standard definitions for it and have got no where. Standard definitions use (.") and I couldn't find that in isoMax for the ServoPod.
By standard definitions, I simply means the ones that I can find from Leo and fig Forth implementations.
I need this such that I can finish my command line packet interpreter.
nmitech
05-24-07, 06:07 PM
From section 1.6 String Operations in the IsoMaxGlossary.pdf file,
http://www.newmicros.com/store/product_manual/IsomaxGlossary.pdf
." Displays characters following it up to the delimiter "
Maybe I wasn't clear.
I actually need the colon definition of ." such that I can modify it for usage with the FORTH command line packet transmitter.
It is in Leo and Fig forth
: ." STATE @
IF COMPILE (.") 34 WORD HERE C@ 1+ ALLOT
ELSE 34 WORD HERE COUNT TYPE
THEN
; IMMEDIATE
I couldn't find the equivalent of (.") in IsoFORTH.
How is it implemented in IsoFORTH
RMDumse
06-01-07, 04:20 PM
I was able to explain this to GATJR via email, and suggest another way of approaching it, however for the sake of keeping the forum here useful, the answer to the question asked here goes like this:
This is how the string words are defined internally. The big differences are
(a) 83-standard WORD returns an address, so you don't use WORD HERE, and (b) strings are stored in Program space, so you use PCOUNT PTYPE etc.
: (.") R> PCOUNT 2DUP + ALIGN >R PTYPE ;
: STRING>P ( adr -- ) DUP COUNT + SWAP DO I C@ PC, LOOP ;
: STRING ( -- ) PARSE HERE STRING>P ;
HEX
: ." STATE @ 0= IF 22 WORD COUNT TYPE
ELSE COMPILE (.") 22 STRING
THEN ;
PARSE is a fairly complicated kernel primitive which is a subfactor of WORD.
The main difference is that it doesn't strip leading delimiters. For end users I would define STRING as
: STRING ( -- ) WORD STRING>P ;
ALIGN has a null definition on the DSP56803, and this can be simply omitted where it appears above:
: ALIGN ( a -- a' ) ;
vBulletin v3.0.7, Copyright ©2000-2008, Jelsoft Enterprises Ltd.