Re: USRx() and adding more parameters?

Bill Gunshannon via Coco <coco-uNHYcr1XS/wmlAP/[email protected]>
Newsgroups gmane.comp.hardware.tandy.coco
Message-ID <LV8P221MB1469ECAC3C2CF173C9BA0579EDC5A@LV8P221MB1469.NAMP221.PROD.OUTLOOK.COM>

On 11/5/2025 1:13 PM, Sean Conner via Coco wrote:
> It was thus said that the Great Allen Huffman via Coco once stated:
>> The BASIC ROM has the USR function:
>>
>> DEF USR0=&H3F00
>>
>> A=USR0(42)
>>
>> It accepts one parameter.
>>
>> Since it jumps from BASIC into the USR assembly, couldn’t that code just
>> parse a “,” and more numbers, allowing it to accept whatever needed to be
>> passed in?
>>
>> A=USR0(1,2,3,4)
> 
>    Attached is another proof-of-concept.  This implements a USRn function
> that draws a pattern (8x8, based on early Mac background patterns) on the
> screen in a given area, and cycles through 38 such patterns when you hit a
> key.  It works best in PMODEs 0, 2 or 4.  The critical line is:
> 
> 	110 X=USR0(P),(65,49)-(190,142)
> 
> The first parameter is the pattern #, then a comma, then the upper left
> corner, then the lower right corner of the area to draw the pattern, using
> the code BASIC uses to parse the LINE command.  Looks weird, but it works.
> 

Wouldn't it just be easier to pass an address as that  one argument and 
have it point to a block containing as many parameters as you want?

bill


-- 
Coco mailing list
[email protected]
https://pairlist5.pair.net/mailman/listinfo/coco
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.