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

[ColorForth] More newbie questions



On Friday, September 28, 2001, at 07:53 , Mark Slicker wrote:

'?' tests (and operation) the top element of the stack. For example you
could write your 'iftest' as:

: iftest -1 ? if 1 ; then 0 ;

-1 tests all the bits. Also see Kris Johnson's word list which has a lot
of words not documented on Chuck's site:

Thanks, Mark, this helps some, but not enough for my simple mind. I've been using Kris' list of commands and one of the things colorForth doesn't seem to have many of are conditionals. Since your description of what "if" needs to behave correctly on the Pentium is the indirect effect of a conditional, what's the mechanism for setting the flags? (In the working code I'm developing I do an arithmetic operation immediately before the "if", as you suggest, with the intent of branching on a zero or not zero outcome. But it appears not to effect the zero flag so the "if" is not doing what I would expect.) I expect that there are other ways to accomplish this function in colorForth that I'm not familiar with or not clever enough to have sorted out yet. Any hints are appreciated.

Mark, could you expand on what the result is of "?" testing bits? My playing with it, and Kris' description on his site suggests that it does an "and" but the result effects the value of the zero flag. Is this the preferred or recommended mechanism for growing our own conditionals? I see that Chuck uses a word "less" in some places, in a context that suggests to me that it is a conditional that effects the zero flag as well. It doesn't show up in any of the documentation nor could I find it in the code blocks, so I assume it's the conditional "less than". Is that a valid assumption based on your experience? Are you aware of others that are similar?
------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com