OS Equates
Operating system constants, status codes, and device names for the Atari 8-bit computers.
Device Names
| Name | Value | Description |
|---|
| SCREDT | "E" | Screen Editor |
| KBD | "K" | Keyboard |
| DISPLY | "S" | Display |
| PRINTR | "P" | Printer |
| CASSET | "C" | Cassette |
| DISK | "D" | Disk Drive |
| RS232 | "R" | RS-232 Serial Port |
Status Codes
CIO status codes returned in ICSTA or ERR().
Success
| Code | Hex | Name | Description |
|---|
| 1 | $01 | SUCCES | Success |
Non-Fatal Errors
| Code | Hex | Name | Description |
|---|
| 136 | $88 | EOFERR | End of File |
| 137 | $89 | TRNRCD | Truncated Record |
Fatal Errors
| Code | Hex | Name | Description |
|---|
| 128 | $80 | BRKABT | Break Key Abort |
| 130 | $82 | PRVOPN | IOCB Already Open |
| 130 | $82 | NONDEV | Nonexistent Device |
| 131 | $83 | WRONLY | Opened for Write Only |
| 132 | $84 | NVALID | Invalid Command |
| 133 | $85 | NOTOPN | Device or File Not Open |
| 134 | $86 | BADIOC | Invalid IOCB Number |
| 135 | $87 | RDONLY | Opened for Read Only |
| 138 | $8A | TIMOUT | Peripheral Time Out |
| 139 | $8B | DNACK | Device Does Not Acknowledge |
| 140 | $8C | FRMERR | Serial Bus Framing Error |
| 141 | $8D | CRSROR | Cursor Out of Range |
| 142 | $8E | OVRRUN | Serial Bus Data Overrun |
| 143 | $8F | CHKERR | Serial Bus Checksum Error |
| 144 | $90 | DERROR | Peripheral Device Error |
| 145 | $91 | BADMOD | Non Existent Screen Mode |
| 146 | $92 | FNCNOT | Function Not Implemented |
| 147 | $93 | SCRMEM | Not Enough Memory for Screen Mode |
CIO Command Codes
| Code | Hex | Name | Description |
|---|
| 3 | $03 | OPEN | Open channel |
| 4 | $04 | OPREAD | Open for input |
| 5 | $05 | GETREC | Get record |
| 6 | $06 | OPDIR | Open to disk directory |
| 7 | $07 | GETCHR | Get byte |
| 8 | $08 | OWRITE | Open for output |
| 9 | $09 | PUTREC | Write record |
| 9 | $09 | APPEND | Open to append to end of disk file |
| 11 | $0B | PUTCHR | Put byte |
| 12 | $0C | CLOSE | Close channel |
| 12 | $0C | OUPDAT | Open for input and output |
| 13 | $0D | STATUS | Status request |
| 14 | $0E | SPECIL | Beginning of special commands |
| 17 | $11 | DRAWLN | Screen draw |
| 18 | $12 | FILLIN | Screen fill |
| 32 | $20 | RENAME | Rename file |
| 32 | $20 | INSCLR | Open to screen but don't erase |
| 33 | $21 | DELETE | Delete file |
| 33 | $21 | DFRMAT | Format disk (RDH) |
| 35 | $23 | LOCK | Lock file |
| 36 | $24 | UNLOCK | Unlock file |
| 37 | $25 | POINT | Set file position |
| 38 | $26 | NOTE | Get file position |
| 40 | $28 | LOAD BINARY FILE | Load binary file |
| 41 | $29 | SAVE BINARY FILE | Save binary file |
| 80 | $50 | PTSECT | RDH Put Sector |
| 82 | $52 | GTSECT | RDH Get Sector |
| 83 | $53 | DSTAT | RDH Get Status |
| 87 | $57 | PSECTV | RDH Put Sector and Verify |
| 128 | $80 | NOIRG | No gap cassette mode |
IOCB Constants
| Name | Value | Description |
|---|
| IOCBSZ | $10 | IOCB size (16 bytes) |
| MAXIOC | $80 | Max IOCB block size |
| IOCBF | $FF | IOCB free |
Screen Margins
| Name | Value | Description |
|---|
| LEDGE | $02 | Default left margin (2) |
| REDGE | $27 | Default right margin (39) |
Special Characters
| Name | Value | Description |
|---|
| CR | $9B | Carriage Return (EOL) |
Usage Examples
Checking Status
OPEN #1, 4, 0, "D:FILE.TXT"
IF ERR() <> 1 THEN
? "Error: "; ERR()
IF ERR() = 136 THEN ? "End of file"
IF ERR() = 133 THEN ? "File not open"
ENDIF
Using Device Names
OPEN #1, 4, 0, "K:" ' Keyboard
OPEN #2, 8, 0, "P:" ' Printer
OPEN #3, 4, 0, "D:FILE.TXT" ' Disk file
CIO Command Codes
' These are used internally by FORGE statements
' OPEN uses command 3
' CLOSE uses command 12
' STATUS uses command 13
' XIO can use any command code
Related Topics