2 ; Ullrich von Bassewitz, 17.05.2000
4 ; int __fastcall__ _osmaperrno (unsigned char oserror);
13 : cmp ErrTab-2,x ; Search for the error code
14 beq :+ ; Jump if found
19 ; Code not found, return EUNKNOWN
26 ldx #$00 ; High byte always zero
31 ErrTab: .byte $01, ENOSYS ; Invalid MLI function code number
32 .byte $04, EINVAL ; Incorrect parameter count
33 .byte $25, ENOMEM ; Interrupt table full
34 .byte $27, EIO ; I/O error
35 .byte $28, ENODEV ; No device connected
36 .byte $2B, EACCES ; Write protected
37 ; .byte $2E, EUNKNOWN ; Disk switched
38 .byte $2F, ENODEV ; No disk in drive
39 .byte $40, EINVAL ; Invalid pathname syntax
40 .byte $42, EMFILE ; Too many files open
41 .byte $43, EINVAL ; Bad reference number
42 .byte $44, ENOENT ; Bad pathname
43 .byte $45, ENOENT ; Volume not mounted
44 .byte $46, ENOENT ; File not found
45 .byte $47, EEXIST ; File already exists
46 .byte $48, ENOSPC ; Disk full
47 .byte $49, ENOSPC ; Directory full
48 ; .byte $4A, EUNKNOWN ; Incompatible ProDOS version
49 .byte $4B, EINVAL ; Unsupported storage type
50 ; .byte $4C, EUNKNOWN ; End of file
51 .byte $4D, ESPIPE ; Position past EOF
52 .byte $4E, EACCES ; Access denied
53 .byte $50, EINVAL ; File already open
54 ; .byte $51, EUNKNOWN ; File count bad
55 .byte $52, ENODEV ; Not a ProDOS disk
56 .byte $53, ERANGE ; Parameter out of range
57 .byte $55, EMFILE ; Too many devices mounted
58 .byte $56, EINVAL ; Bad buffer address
59 ; .byte $57, EUNKNOWN ; Duplicate volume name
60 ; .byte $5A, EUNKNOWN ; Damaged disk free space bit map
62 ErrTabSize = (* - ErrTab)