Difference between revisions of "GeneveOS Device Operation"
Line 65: | Line 65: | ||
| colspan="3" | Character count | | colspan="3" | Character count | ||
| Status byte | | Status byte | ||
| Name length | |||
| Name | |||
|- | |||
|} | |||
After the operation, the PAB contains information about the results of the operation. | |||
== Operations == | |||
=== OPEN === | |||
Open a record-oriented file. A file must be opened before it can be read from or written to. This operation is not required for flat memory image files. | |||
The PAB must be set up prior to invoking the operation: | |||
'''IN''' | |||
{| class="plainc" style="margin-left:1%" | |||
|- | |||
! width="4%" | 00 | |||
! width="4%" | 01 | |||
! width="4%" | 02 | |||
! width="4%" | 03 | |||
! width="4%" | 04 | |||
! width="4%" | 05 | |||
! width="4%" | 06 | |||
! width="4%" | 07 | |||
! width="4%" | 08 | |||
! width="4%" | 09 | |||
! width="4%" | 0A | |||
! width="4%" | 0B | |||
! width="4%" | 0C | |||
! width="4%" | 0D | |||
! width="4%" | 0E | |||
! width="4%" | 0F | |||
! width="4%" | 10 ... | |||
|- | |||
| '''00''' | |||
| Mode | |||
| - | |||
| colspan="3" | - | |||
| colspan="2" | Records to reserve | |||
| colspan="2" | File record length | |||
| - | |||
| colspan="3" | - | |||
| - | |||
| Name length | |||
| Name | |||
|- | |||
|} | |||
After the OPEN operation has completed, the PAB delivers information about the result: | |||
'''OUT''' | |||
{| class="plainc" style="margin-left:1%" | |||
|- | |||
! width="4%" | 00 | |||
! width="4%" | 01 | |||
! width="4%" | 02 | |||
! width="4%" | 03 | |||
! width="4%" | 04 | |||
! width="4%" | 05 | |||
! width="4%" | 06 | |||
! width="4%" | 07 | |||
! width="4%" | 08 | |||
! width="4%" | 09 | |||
! width="4%" | 0A | |||
! width="4%" | 0B | |||
! width="4%" | 0C | |||
! width="4%" | 0D | |||
! width="4%" | 0E | |||
! width="4%" | 0F | |||
! width="4%" | 10 ... | |||
|- | |||
| - | |||
| - | |||
| Error code | |||
| colspan="3" | - | |||
| colspan="2" | - | |||
| colspan="2" | Actual record length | |||
| - | |||
| colspan="3" | True record length | |||
| - | |||
| Name length | | Name length | ||
| Name | | Name | ||
|- | |- | ||
|} | |} |
Revision as of 18:24, 22 July 2016
Accessing devices (floppy disk, hard disk, serial connector, printer) is possible in GeneveOS via XOP calls.
User-task XOPs
User-task XOPs are available for use in application programs. Here is a typical example:
PABADD EQU >F180 FILE DATA 8 ... LI R0,PABADD XOP @FILE,0 MOVB @PABADD+2,R0 JNE ERROR ...
Similar as with the TI-99/4A device service routine concept (DSR), a Peripheral Access Block (PAB) must be set up prior to invoking the XOP.
Device Service Routine Call
Input | Output | |
---|---|---|
R0 | Pointer to PAB | - |
The actual operation is contained in the Peripheral Access Block (PAB).
Peripheral Access Block
While the TI-99/4A DSRs expect the PAB to be stored in VDP RAM, the Geneve OS DSRs use CPU RAM for the PAB, which means the PAB need not be copied to the video RAM before use. Also, you can choose to have the I/O buffers in VDP or CPU RAM.
The general layout of the PAB is as follows:
00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F | 10 ... |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Opcode | Mode | Error code | Buffer address | Record number | Record length | Memory type | Character count | Status byte | Name length | Name |
After the operation, the PAB contains information about the results of the operation.
Operations
OPEN
Open a record-oriented file. A file must be opened before it can be read from or written to. This operation is not required for flat memory image files.
The PAB must be set up prior to invoking the operation:
IN
00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F | 10 ... |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00 | Mode | - | - | Records to reserve | File record length | - | - | - | Name length | Name |
After the OPEN operation has completed, the PAB delivers information about the result:
OUT
00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F | 10 ... |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- | - | Error code | - | - | Actual record length | - | True record length | - | Name length | Name |