Marius Posted January 20, 2011 Share Posted January 20, 2011 Basic: Status #1,A A = represents the 'state' in a decimal value of IOCB device How do I get "A" in ASM? Is this already stored somewhere after a JSR CIOV/SIOV? Thanks Marius Quote Link to comment Share on other sites More sharing options...
Marius Posted January 20, 2011 Author Share Posted January 20, 2011 Basic: Status #1,A A = represents the 'state' in a decimal value of IOCB device How do I get "A" in ASM? Is this already stored somewhere after a JSR CIOV/SIOV? Thanks Marius Is this perhaps the CIO command #$0D? Setting IOCB vars right, iccom=$0d Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 20, 2011 Share Posted January 20, 2011 Hi, Every CIO call returns the status in the Y register. Also LDA ICSTA,X ($342,x) should contain the value for x=$00/$10/$20... Quote Link to comment Share on other sites More sharing options...
Marius Posted January 20, 2011 Author Share Posted January 20, 2011 Ok let's be more specific When you do the Status command on the R: device, you can read the amount of bytes in the buffer in 747 and 748 (decimal). I need that info, so I guess i have to do a CIO command #$0d? R: programming is rather complex (for me)... Thanks M. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 20, 2011 Share Posted January 20, 2011 First: ICSTA = $343 not $342 Second: Yes you are right. The command $0d = ICSTAT = GET STATUS is something different. The equivalent of STATUS #1,A is ldx #$10 ; Channel 1 lda #ICSTAT ;$0d jsr ciov bmi error lda ICSTA,x ;$343 a=Status of the device error: y=Error code of the CIO operation This is what CIO defines or all devices. But all device drivers, like R:, may of course extend the list of supported commands and parameters. For specifically for R:, I don't now more.. Quote Link to comment Share on other sites More sharing options...
Rybags Posted January 21, 2011 Share Posted January 21, 2011 Any SIO Status >= 128 returned to Basic in a CIO operation will generate en ERROR. So you can just use TRAP to catch extraordinary events. IIRC, CIO status is set to 2 by some device handlers when the byte received is the last one before EOF - in that case, TRAP won't work for you, but checking the IOCB yourself should. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.