Jump to content
IGNORED

Where to find BASIC COMMAND status in ASM?


Marius

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...