Jump to content
Sign in to follow this  
danwinslow

Low level SIO commands

Recommended Posts

I would like some advice about the best way to generate custom SIO commands on the bus..ie., device/command/parm1/parm2/checksum. I was thinking that XIO could be used, but I am not really sure about that. I guess I could go find the actual IOCB and fill it out, but can I do that and JSR to some routine without messing things up? The basic thing I want to do is to be able to send custom SIO commands to arbitrary devices. Just looking for advice on the best way to approach. I am using cc65.

Edited by danwinslow

Share this post


Link to post
Share on other sites

Just use SIO ($E459), it's very simple. Or I misunderstand your question?

 

You can't use XIO and IOCB, they are CIO level stuff.

Share this post


Link to post
Share on other sites

Not IOCB. Again, IOCB is a CIO structure. SIO uses the "DCB" structure at $300. See the "Operating System's User Manual" in the Technical Notes for details. Or numerous other references.

 

But a quick info:

 

$300: Device Id

$301: Unit number

$302: Command

$303: Frame direction on Input. Status on Output

$304/5: Buffer address

$306: Timeout in seconds.

$307: Unused

$308/9: Frame length

$30A/B: Auxiliary bytes

 

I think everything if self-explanatory except:

 

$303 on input specifies if it's a read ($40), write ($80), or no data frame $(00).

The actual device id transmitted over the SIO bus is constructed by adding both values in $300 and $301 and substracting 1.

 

Unlike CIO, you don't have to setup any CPU registers before calling SIO (there is only one DCB). Status result is both in $303 and the Y 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...