Skip to content

N: SIO Command 'S' Status

Thomas Cherryhomes edited this page May 9, 2020 · 3 revisions

N: SIO Command READ ($53) ['S']

Description

Return the status of the currently opened protocol channel, in the following format:

Offset Description
0 LO Byte of # of bytes waiting
1 HI Byte of # of bytes waiting
2 0=Disconnected, 1=Connected
3 Extended Error code

It is expected that the buffer point to the DVSTAT location in the OS ($02EA)

Parameters

DCB Value
DDEVIC $71
DUNIT $01 - $04
DCOMND $53 'S'
DSTATS $40
DBUF DVSTAT
DTIMLO $0F
DBYT 4
DAUX1 N: Status DAUX1 Values
DAUX2 N: Status DAUX2 Values

Examples

CC65

  // Get # of bytes waiting
  OS.dcb.ddevic=0x71;
  OS.dcb.dunit=1;
  OS.dcb.dcomnd='S';
  OS.dcb.dstats=0x40;
  OS.dcb.dbuf=&status;
  OS.dcb.dtimlo=0x0f;
  OS.dcb.dbyt=4;
  OS.dcb.daux=0;
  siov();

  bw=(status[1]<<8)+status[0];
  connected=status[2];

See Also

Put other related command links here.

Clone this wiki locally