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 | $40 | Read - predefined values for data transfer direction (to be set in DSTATS) |
_W | $80 | Write |
_RW | $C0 | Read and Write |
_NO | $00 | No data transfer |
JSIOINT | $E459 | SIO OS procedure vector |
Types:
name: | type: | description: |
DCB_struct | record- DDEVIC : byte;
- DUNIT : byte;
- DCMND : byte;
- DSTATS : byte;
- DBUFA : word;
- DTIMLO : byte;
- DUNUSE : byte;
- DBYT : word;
- DAUX1 : byte;
- DAUX2 : byte;
end; | Device Control Block structure definition |
Register Variables:
name: | address: | type: | description: |
DCB | $300 | DCB_struct | Device Control Block variable |
PACTL | $D302 | byte | Port A Control Register |
PBCTL | $D303 | byte | Port A Control Register |
VPRCED | $0202 | word | Peripheral Proceed IRQ vector |
VINTER | $0204 | word | Peripheral interrupt IRQ vector |
sioStatus | $303 | byte | contains last SIO operation result, returned in DSTATS register. 1 is returned if operation was sucessfull, otherwise contains error code |
Global Variables:
name: | type: | description: |
sioResult | byte | contains 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.
|