2 ; Christian Groessler, May-2000
4 ; os specific error code mapping
5 ; int __fastcall__ _osmaperrno (unsigned char oserror);
8 .include "../common/errno.inc"
13 cmp #$80 ; error or success
14 bcs errcode ; error, jump
16 lda #0 ; no error, return 0
20 errcode:and #$7f ; create index from error number
22 cpx #MAX_OSERR_VAL ; valid number?
29 inverr: lda #<EUNKNOWN
38 .byte EINTR ;BRKABT = 128 ;($80) BREAK key abort
39 .byte EBUSY ;PRVOPN = 129 ;($81) IOCB already open error
40 .byte ENODEV ;NONDEV = 130 ;($82) nonexistent device error
41 .byte EACCES ;WRONLY = 131 ;($83) IOCB opened for write only error
42 .byte ENOSYS ;NVALID = 132 ;($84) invalid command error
43 .byte EINVAL ;NOTOPN = 133 ;($85) device/file not open error
44 .byte EINVAL ;BADIOC = 134 ;($86) invalid IOCB index error
45 .byte EACCES ;RDONLY = 135 ;($87) IOCB opened for read only error
46 .byte EINVAL ;EOFERR = 136 ;($88) end of file error (should never come,
47 ; specially handled by read.s)
48 .byte EIO ;TRNRCD = 137 ;($89) truncated record error
49 .byte EIO ;TIMOUT = 138 ;($8A) peripheral device timeout error
50 .byte EIO ;DNACK = 139 ;($8B) device does not acknowledge command
51 .byte EIO ;FRMERR = 140 ;($8C) serial bus framing error
52 .byte EINVAL ;CRSROR = 141 ;($8D) cursor overrange error
53 .byte EIO ;OVRRUN = 142 ;($8E) serial bus data overrun error
54 .byte EIO ;CHKERR = 143 ;($8F) serial bus checksum error
55 .byte EIO ;DERROR = 144 ;($90) device done (operation incomplete)
56 .byte EINVAL ;BADMOD = 145 ;($91) bad screen mode number error
57 .byte ENOSYS ;FNCNOT = 146 ;($92) function not implemented in handler
58 .byte ENOMEM ;SCRMEM = 147 ;($93) insufficient memory for screen mode
59 ; codes below taken from "Mein Atari Computer" (german version of "Your Atari Computer")
60 .byte EUNKNOWN ; 148 - haven't found documentation
61 .byte EUNKNOWN ; 149 - haven't found documentation
62 .byte EBUSY ; 150 - serial port already open
63 .byte EACCES ; 151 - concurrent mode I/O not enabled (serial)
64 .byte EINVAL ; 152 - invalid buffer address for concurrent mode
65 .byte EAGAIN ; 153 - concurrent mode enabled (and another access tried)
66 .byte EACCES ; 154 - concurrent mode I/O not active (serial)
67 .byte EUNKNOWN ; 155 - haven't found documentation
68 .byte EUNKNOWN ; 156 - haven't found documentation
69 .byte EUNKNOWN ; 157 - haven't found documentation
70 .byte EUNKNOWN ; 158 - haven't found documentation
71 .byte EUNKNOWN ; 159 - haven't found documentation
72 .byte ENOENT ; 160 - drive number error (DOS)
73 .byte EMFILE ; 161 - too many open files
74 .byte ENOSPC ; 162 - disk full
75 .byte EIO ; 163 - unrecoverable system data I/O error
76 .byte ESPIPE ; 164 - file number mismatch (inv. seek or disk data strucs damaged)
77 .byte ENOENT ; 165 - invalid file name (e.g. lowercase)
78 .byte ESPIPE ; 166 - point data length error
79 .byte EACCES ; 167 - file locked (read-only)
80 .byte ENOSYS ; 168 - command invalid
81 .byte ENOSPC ; 169 - directory full
82 .byte ENOENT ; 170 - file not found
83 .byte ESPIPE ; 171 - point command invalid
85 MAX_OSERR_VAL = (* - maptable)