[Coco] replicating bitwise operators in BASIC

Johann Klasek johann+coco at klasek.at
Sat Sep 10 07:23:36 EDT 2016

On Fri, Sep 09, 2016 at 03:26:09PM -0500, Dave Philipsen wrote:
> And ever so slightly faster than the subtraction method is this:
> 100 IF A AND B THEN Q = 0 ELSE Q = A OR B

Oh, yes! Didn't think on the ELSE possibilty ... I'm used to
be restricted to CBM's Basic V2, where such a construction
does not exist. Forgott what comfort ECB provides :)
But even there, the optimization for AND sequences turning into
a cascade of IF-THEN-IF is not uncommon.

More information about the Coco mailing list