[Coco] variable sized GETlike operation in basic 09?

L. Curtis Boyle curtisboyle at sasktel.net
Tue Jan 5 21:03:06 EST 2010


Syscall doesn't add a lot of overhead as long as it is loaded in  
memory (it should actually be a command in BASIC09/RUNB itself, in my  
opinion.... it is far too useful to make a separate module). If you  
look at the disassembly  of syscall, there isn't much to it except  
mapping the passing registers on the stack and calling the system  
call. Make sure it is merged in with RUNB to save an 8K block, giving  
that for your BASIC09 program or data area.
Syscall is very useful for a lot of things, with a few exceptions  
(usually calls that are duplicated in BASIC09 itself). Using I$Write  
to do windowing commands is another example, rather than making  
strings of specific lengths to handle commands, or worse yet, the  
SHELL "DISPLAY XX XX..." that I used to see a lot in BASIC09 source  
code PRINT somewhat worked, but some control characters get mangled,  
so I always used either PUT, if I only had 2 or 2 string lengths of  
display commands to worry about, or syscall/I$Write if I had more than  
2.

Sent from my iPhone
L. Curtis Boyle


On Jan 5, 2010, at 7:33 PM, Aaron Wolfe <aawolfe at gmail.com> wrote:

> On Tue, Jan 5, 2010 at 8:23 PM, L. Curtis Boyle <curtisboyle at sasktel.net 
> > wrote:
>> Best is to use the I$Read or I$ReadLn SYSCALL functions... Just set  
>> the Y
>> register to the # of bytes you want to read for each call. You can  
>> vary it
>> for every read, if you want.
>
> Thanks.  This is how I've been doing it in asm, just wondered if I was
> missing some easy way to do it in basic09.  As a general rule, is it
> pretty efficient to use SYSCALL?
>
> I have it loaded in memory and use one SYSCALL in HTTPD now (to
> display memory used by the HTTPD process in the web page footer).
> This didn't add any measurable time to the speed of serving pages, but
> I wondered about efficiency when using it many times repeatedly.  The
> improvements in speed over single byte reads almost certainly outweigh
> any lost cycles in using SYSCALL over a native OS9 command (if there
> are any).
>
>
>
>>
>> Sent from my iPhone
>> L. Curtis Boyle
>>
>>
>> On Jan 5, 2010, at 6:17 PM, Aaron Wolfe <aawolfe at gmail.com> wrote:
>>
>>> Does anyone know if its possible to do a GET for changing amounts of
>>> data? Or another fast way to read changing sized 'records'?  GETting
>>> one byte at a time is very slow compared to getting several in the
>>> HTTPD program.  Right now I GET a 32 byte array at a time out of  
>>> files
>>> and just try to make sure files are sized a multiple of 32, but  
>>> thats
>>> no good.  I also pad out all the headers coming in from the client  
>>> to
>>> a standard length so GET can work there, also not great.
>>>
>>> I think I could use SYSCALL and I$Read, but this seems wasteful,  
>>> maybe
>>> not?  Maybe I'm missing something in B09?  It seems GET only reads  
>>> the
>>> size of the variable(s) specified, and you cannot reDIM or change  
>>> the
>>> size of the variables in any way.
>>>
>>> Thanks for any clues
>>> -Aaron
>>>
>>> --
>>> Coco mailing list
>>> Coco at maltedmedia.com
>>> http://five.pairlist.net/mailman/listinfo/coco
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco



More information about the Coco mailing list