[Coco] replicating bitwise operators in BASIC

Brett Gordon beretta42 at gmail.com
Sun Sep 11 00:05:32 EDT 2016


On Sep 10, 2016 11:48 PM, "Dave Philipsen" <dave at davebiz.com> wrote:
>
> One way to do it without boolean operators is to simply use a truth table
for the logic as a lookup table.  For integers large than 0-1 (single bit)
you'd have to rotate through all of the bits (up to 15).  Since ECB doesn't
have a rotate function

Dividing and multiplying by powers of 2 could be used as shifts?

and you've asked to do it without AND then you may have to extract the
individual bits through a subtraction routine.  I think it could still be
relatively quick using tables for the logic and tables for the subtraction
though definitely not as quick as having the logic operators.

Ah..look up tables.. there's an idea.


More information about the Coco mailing list