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

Re: [colorforth] Strage ColorForth results


On Tuesday 24 February 2004 03:31 am, Roman Pavlyuk \(personal\) wrote:
> Since in CF IF and -IF are implemented as jz and jnc opcodes
> that check values of Z and C flags respectively.
>
> Try inserting '?' after the literal -- it compiles into test eax, eax,
> which should set Z flag (C flag is zeroed, but plz check with Inter's
> manual)

? takes an argument.  You'll want to say this instead:

> : 0? ? drop if 0 ; then 1 ;

: 0? -1 ? drop if 0 ; then 1 ;

? compiles a TEST EAX,nnn instruction.

--
Samuel A. Falvo II


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