N: SIO Command $FF Query for Special Command DSTATS - FujiNetWIFI/fujinet-firmware GitHub Wiki
N: SIO Command DSTATS QUERY ($FF)
This is a command for Devices $71-$78 - The N: Device (see SIO-Commands-for-Device-IDs-$71-to-$78).
Description
This command is specifically for the implementation of CIO and other DOS level handlers (e.g. SpartaDOS X Kernel Drivers), to carry back specifics of a given SPECIAL SIO command. This is currently the DSTATS value (indicating read and write), since it is assumed any special commands utilize a 256 byte buffer, unless the DSTATS=0. If The value returned here is $FF, then the command is invalid, and the handler should react appropriately.
Parameters
DCB | Value |
---|---|
DDEVIC | $71 |
DUNIT | $01 - $04 |
DCOMND | $FF |
DSTATS | $40 |
DBUF | 1 byte buffer for holding DSTATS value, e.g. DSTATS |
DTIMLO | $0F |
DBYT | 1 |
DAUX1 | Special SIO Command to ask about |
DAUX2 | 0 |
Examples
Assembler (AMAC)
SPEC .proc
; HANDLE LOCAL COMMANDS.
LDA ZICCOM
CMP #$0F ; 15 = FLUSH
BNE L1 ; NO.
JSR PFLUSH ; DO FLUSH
LDY #$01 ; SUCCESS
RTS
; HANDLE SIO COMMANDS.
; GET DSTATS FOR COMMAND
L1 LDA #DEVIDN ; $71
STA DDEVIC
LDA ZICDNO ; UNIT #
STA DUNIT
LDA #$FF ; DS INQ
STA DCOMND
LDA #DSREAD
STA DSTATS
LDA #<INQDS
STA DBUFL
LDA #>INQDS
STA DBUFH
LDA #$01
STA DBYTL
LDA #$00
STA DBYTH
STA DAUXH
LDA #$0F
STA DTIMLO
LDA ZICCOM
STA DAUXL
JSR SIOV ; DO IT...
LDA DSTATS
BPL DSOK
DSERR TAY ; RET THE ERR
RTS
; WE GOT A DSTATS INQUIRY
; IF $FF, THE COMMAND IS
; INVALID
DSOK LDA INQDS
CMP #$FF ; INVALID?
BNE DSGO ; DO THE CMD
LDY #$92 ; UNIMP CMD
TYA
RTS
DSGO LDA #DEVIDN ; $71
STA DDEVIC
LDA ZICCOM
STA DCOMND
LDA INQDS
STA DSTATS
LDA #>TBUF
STA DBUFH
LDA #$00
STA DBUFL
STA DBYTH
LDA #$0F
STA DTIMLO
LDA ZICAX1
STA DAUXL
LDA ZICAX2
STA DAUXH
JSR SIOV
LDY DSTATS
TYA
RTS
.endp
See Also
Put other related command links here.