Jump to content
Sign in to follow this  
danwinslow

Sending data back to Atari Basic in an INPUT command

Recommended Posts

Totally. I didn't realize that that 10,000 byte buffer request would be fulfilled by the OS calling get one byte 10,000 times if the handler chose to allow it. Makes sense, though.

Share this post


Link to post
Share on other sites

Totally. I didn't realize that that 10,000 byte buffer request would be fulfilled by the OS calling get one byte 10,000 times if the handler chose to allow it. Makes sense, though.

yes, at least there's a fairly simple way around it.

Share this post


Link to post
Share on other sites

Yes, indeed it does seem to be inherent. I think for my purposes, this is fine. A conversational transaction in TCP or UDP in BASIC would be fine at the given speeds. I already have XIO calls to do direct buffer fills and things like that for stuff that needs high speed, but I wanted to get as much compatibility as possible, so I wanted to make sure that the INPUT and PRINT commands would work at least sort of as expected.

Share this post


Link to post
Share on other sites

Yes, indeed it does seem to be inherent. I think for my purposes, this is fine. A conversational transaction in TCP or UDP in BASIC would be fine at the given speeds. I already have XIO calls to do direct buffer fills and things like that for stuff that needs high speed, but I wanted to get as much compatibility as possible, so I wanted to make sure that the INPUT and PRINT commands would work at least sort of as expected.

you don't need to implement separate commands for buffer filling though. If BASIC calls the CIO asking for one byte, then that's a separate issue, but if the IOCB gets a request for multiple bytes to be received or sent, then the handler can do burst I/O, as phaeron described.

Share this post


Link to post
Share on other sites

Yes, I'm aware. I still want the separate commands, though, it lets me short circuit quite a bit, and the focus is not really on basic in particular.

Share this post


Link to post
Share on other sites

you don't need to implement separate commands for buffer filling though. If BASIC calls the CIO asking for one byte, then that's a separate issue, but if the IOCB gets a request for multiple bytes to be received or sent, then the handler can do burst I/O, as phaeron described.

 

At this point, please let's forget about bursting. The Put-byte routine receives a single byte in A and has to put it onto the device. The Get-byte routine reads a single byte from the device and returns it in A.

 

Bursting is more complicated. Especially with BASIC, because Basic does not send bytes through CIO but through the handler vector directly, which *also* implies that you cannot burst if the call comes from Basic. Which again means that a handler needs to be able to detect whether a call comes from Basic or CIO, and only enable bursting in the latter. (Os++ has better means for that, but not for the traditional Os).

 

So, once again: Avoid bursting at this time, and just write an implementation that receives and transmits single bytes a time, through the A register.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...