unit sio

Serial Input/Ouput interface library.

author: bocianu bocianu@gmail.com


Set of useful constants, and structures to work with ATARI OS SIO procedures.
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs

Constants:

name:value:description:
_R$40Read - predefined values for data transfer direction (to be set in DSTATS)
_W$80Write
_RW$C0Read and Write
_NO$00No data transfer
JSIOINT$E459SIO OS procedure vector

Types:

name:type:description:
DCB_structrecord
  • DDEVIC : byte; // Device Id
  • DUNIT : byte; // Unit number
  • DCMND : byte; // Command
  • DSTATS : byte; // Transfer direction on Input. Status on Output
  • DBUFA : word; // Buffer address
  • DTIMLO : byte; // Timeout in seconds
  • DUNUSE : byte; // Unused
  • DBYT : word; // Data length
  • DAUX1 : byte; // Auxiliary bytes
  • DAUX2 : byte;

end;
Device Control Block structure definition

Register Variables:

name:address:type:description:
DCB$300DCB_structDevice Control Block variable
PACTL$D302bytePort A Control Register
PBCTL$D303bytePort A Control Register
VPRCED$0202wordPeripheral Proceed IRQ vector
VINTER$0204wordPeripheral interrupt IRQ vector
sioStatus$303bytecontains last SIO operation result, returned in DSTATS register. 1 is returned if operation was sucessfull, otherwise contains error code

Global Variables:

name:type:description:
sioResultbytecontains last SIO operation result, returned in Y register. 1 is returned if operation was sucessfull, otherwise contains error code

Interface:

name:description:
ExecSIO

procedure ExecSIO; assembler;


Executes SIO operation defined by DCB block. On exit it returns status of operation in sioResult and/or sioStatus. 1 is returned if operation was sucessfull, otherwise variable contains error code.