Moved two errno helper functions into separate files.
Only the function that actually is needed will be linked. It is very useful for targets that do not have file-system I/O.
This commit is contained in:
27
libsrc/common/_directerrno.s
Normal file
27
libsrc/common/_directerrno.s
Normal file
@@ -0,0 +1,27 @@
|
||||
;
|
||||
; 2003-08-12, Ullrich von Bassewitz
|
||||
; 2015-09-24, Greg King
|
||||
;
|
||||
; Helper function for several high-level file functions.
|
||||
;
|
||||
|
||||
.include "errno.inc"
|
||||
|
||||
.macpack cpu
|
||||
|
||||
; ----------------------------------------------------------------------------
|
||||
; int __fastcall__ _directerrno (unsigned char code);
|
||||
; /* Set errno to a specific error code, clear _oserror, and return -1. Used
|
||||
; ** by the library.
|
||||
; */
|
||||
|
||||
__directerrno:
|
||||
jsr __seterrno ; Set errno (returns with .A = 0)
|
||||
sta __oserror ; Clear __oserror
|
||||
.if (.cpu .bitand CPU_ISET_65SC02)
|
||||
dec a
|
||||
.else
|
||||
lda #$FF ; Return -1
|
||||
.endif
|
||||
tax
|
||||
rts
|
||||
Reference in New Issue
Block a user