danwinslow #1 Posted June 15, 2005 (edited) 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 June 15, 2005 by danwinslow Quote Share this post Link to post Share on other sites
ijor #2 Posted June 16, 2005 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. Quote Share this post Link to post Share on other sites
danwinslow #3 Posted June 16, 2005 So fill out an IOCB and JSR to $E459? Quote Share this post Link to post Share on other sites
ijor #4 Posted June 16, 2005 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. Quote Share this post Link to post Share on other sites
danwinslow #5 Posted June 16, 2005 Thanks, Ijor, very good info. Also reading up on it in the refernces. Quote Share this post Link to post Share on other sites