home .. forth .. colorforth mail list archive ..

Re: [colorforth] DOES> How is colorForth different from other Forths?


Hello Robert,

The best use for DOES> that I use is when coding an assembler. For
example, some sample code for an ARM assembler:

: simple ( opc <name> -- )
  CONSTANT DOES> ( rm rd -- )
    @ >R SWAP 3 LSHIFT + R> + op, ;
                
\ simple alu instructions
$4140 simple adc,
$4000 simple and,
$4380 simple bic,
$42c0 simple cmn,
$4040 simple eor,
$4340 simple mul,
$43c0 simple mvn,
$4240 simple neg,
$4300 simple orr,
$41c0 simple ror,
$4180 simple sbc,
$4200 simple tst,

Also, in an interpreter I have, I use DOES> along with the above
assembler to create CODE words:

: T_CODE ( <name> -- )
  HERE CONSTANT DOES> ( -- )
    @ [ASSEMBLE bl, ASSEMBLE] ;

While I know these are easy to reproduce without using DOES> it does
make it easier, especially if I were to have a bug in "simple" or
"T_CODE".

Jeff

Saturday, December 13, 2003, 10:35:27 AM, you wrote:

Please Post  DOES>>  words that are useful to you and we will  try to post
RP> solutions in ColorForth.

RP> ----- Original Message ----- 
RP> From: "Jeffrey Massung" <jma@xxxxxxxxx>
RP> To: <colorforth@xxxxxxxxxxxxxxxxxx>
RP> Sent: Friday, December 12, 2003 1:37 PM
RP> Subject: Re: [Re: [colorforth] (state) How is colorForth different from
RP> other Forths? / reply II private]


RP> If anyone with significant experience with colorForth could cover a specific
RP> topic, I'd love one done on DOES> . While I haven't programmed in colorForth
RP> yet, and perhaps won't, I do enjoy the theory behind it and Machine Forth.

DOES>> is a word that I use throughout my Forth code and I feel is one of the
RP> most powerful aspects of the language. colorForth doesn't have it, but
RP> perhaps
RP> something equally as powerful?



---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com