2 ; Ullrich von Bassewitz, 2003-08-12
4 ; Helper function for several high level file functions.
6 ; The function will store the value in A into _oserror. If the value is not
7 ; zero, it is translated into a standard error number which is then stored
8 ; into errno, and -1 is returned in a/x. If the value in A was zero, errno
9 ; is not changed, and zero is returned in a/x.
18 sta __oserror ; Store the error code
19 tay ; Did we have an error?
21 jsr __osmaperrno ; Map os error into errno code
23 stx __errno+1 ; Save in errno
26 ; Error free, A contains zero
28 ok: tax ; Make high byte also zero