Hello Matthias,
Matthias Trute <mt...@we...> writes:
> Hi Enoch,
>
>> Isn't the following more sensible?
>>
>> : is_low? ( pinmask portaddr -- f)
>> - c@ invert and
>> + c@ and 0=
>> ;
>>
>> : is_high? ( pinmask portaddr -- f)
>> - c@ and
>> + c@ and 0>
>> ;
>>
>> Thanks, Enoch.
>>
>> 1) the writeup says they return "true if..." which means return -1 and
>> not a bitmask.
>
> technically only FALSE is specified: 0. TRUE is everything else. But
> I agree, that a flag should be wellformed. Do your changes work in all
> cases?
Yes, so far :-)
According to "Forth 2012 RC1" 3.1.3.1 Flags, standard words should
return -1 or 0 only. I was surprised to find that emit? returns the
bitmask 32 rather than -1 (what caused me trouble with bitnames.frt
implementation).
Thanks, Enoch.
|