[Coco] replicating bitwise operators in BASIC

Dave Philipsen dave at davebiz.com
Fri Sep 9 08:14:48 EDT 2016


Actually the XOR could be constructed out of just AND and NOT.




On 9/8/2016 11:09 PM, Barry Nelson wrote:
> The operators AND, OR, and NOT work fine.
>
> Example
>
> PRINT 3 AND 2
>
> outputs 2
> and
>
> PRINT 1 OR 2
>
> outputs 3
>
> The XOR operator can be constructed out of AND, OR, and NOT.
>
>> Brett Gordon beretta42 at gmail.com
>> Thu Sep 8 23:54:22 EDT 2016
>> BASIC gurus:
>>
>> In noodling with Jim's test code for the CoCoNIC, I realized the lack of
>> bitwise AND, XOR, OR, etc. in coco BASIC.  What's the orthodox way of
>> replicating these operators that are so customary in other languages?  I
>> remember loads of head scratching in Lua, which like our BASIC, also lacks
>> basic bitwise functions and converts all numbers to floats.
>>
>> brett
>



More information about the Coco mailing list