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 ; Bad system call number
32 .byte $04, EINVAL ; Bad system call 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 ; Disk write protected
37 ; .byte $2E, EUNKNOWN ; Disk switched
38 .byte $2F, ENODEV ; Device off-line
39 .byte $40, EINVAL ; Invalid pathname
40 .byte $42, EMFILE ; Maximum number of files open
41 .byte $43, EINVAL ; Invalid reference number
42 .byte $44, ENOENT ; Directory not found
43 .byte $45, ENOENT ; Volume not found
44 .byte $46, ENOENT ; File not found
45 .byte $47, EEXIST ; Duplicate filename
46 .byte $48, ENOSPC ; Volume full
47 .byte $49, ENOSPC ; Volume directory full
48 ; .byte $4A, EUNKNOWN ; Incompatible file format
49 .byte $4B, EINVAL ; Unsupported storage_type
50 ; .byte $4C, EUNKNOWN ; End of file encountered
51 .byte $4D, ESPIPE ; Position out of range
52 .byte $4E, EACCES ; File access error
53 .byte $50, EINVAL ; File is open
54 ; .byte $51, EUNKNOWN ; Directory structure damaged
55 .byte $52, ENODEV ; Not a ProDOS volume
56 .byte $53, ERANGE ; Invalid system call parameter
57 .byte $55, EMFILE ; Volume Control Block table full
58 .byte $56, EINVAL ; Bad buffer address
59 ; .byte $57, EUNKNOWN ; Duplicate volume
60 ; .byte $5A, EUNKNOWN ; File structure damaged
62 ErrTabSize = (* - ErrTab)