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.
19 sta __oserror ; Store the error code
20 tay ; Did we have an error?
22 jsr __osmaperrno ; Map os error into errno code
24 stx __errno+1 ; Save in errno
27 ; Error free, A contains zero
29 ok: tax ; Make high byte also zero