[Coco] replicating bitwise operators in BASIC

William Astle lost at l-w.ca
Fri Sep 9 16:23:43 EDT 2016


Not off hand. Basically, you end up having to parse the bits that come 
after the USR() bit.

Basically, when your USR() routine starts, you have the parameter for 
USR in the main floating point accumlator and the input pointer for the 
interpreter is set up so you can parse the bits following the USR() 
invocation. I think the input pointer will be pointing to the character 
after USR(). If you take a look at various routines in the ROM that 
handle parsing command parameters, it might give you a clue how to 
implement it.

On 2016-09-09 02:09 PM, Barry Nelson wrote:
> Do you happen to have an example that would show how to do a usr function that can be called with a syntax like C=USR0(A),B ?
>
>
>
>>        William Astle lost at l-w.ca
>
>>        Fri Sep 9 15:53:06 EDT
>
>
>
>>        Color basic only allows a single parameter inside the parens for USR()
>
>>        functions and you cannot use them as operators (standard infix style
>
>>        like +, -, etc.) That's not to say it wouldn't be more convenient if you
>
>>        were doing a lot of xors or what have you.
>
>
>
>>        You could do something that results in syntax like "Q = USR(A),B" with
>
>>        some careful coding.
>
>
>
>



More information about the Coco mailing list