From 9468b052314880fc04e21141880f358872f31699 Mon Sep 17 00:00:00 2001 From: cuz Date: Sat, 24 Jun 2000 09:10:16 +0000 Subject: [PATCH] Separated _maperrno and _errno git-svn-id: svn://svn.cc65.org/cc65/trunk@121 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/Makefile | 2 +- libsrc/common/errno.s | 20 -------------------- libsrc/common/maperrno.s | 27 +++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 libsrc/common/maperrno.s diff --git a/libsrc/common/Makefile b/libsrc/common/Makefile index fe1f6edbb..bce9f6884 100644 --- a/libsrc/common/Makefile +++ b/libsrc/common/Makefile @@ -28,7 +28,7 @@ S_OBJS = isalpha.o isdigit.o _file.o fmisc.o strlower.o strchr.o tolower.o\ longjmp.o rand.o atexit.o memset.o memcpy.o memchr.o memcmp.o\ ltoa.o strcspn.o strncat.o strpbrk.o strspn.o abs.o labs.o jmpvec.o\ _fdesc.o stkcheck.o zerobss.o copydata.o _swap.o strstr.o strcoll.o\ - _sys.o getcpu.o _oserror.o strerror.o iscntrl.o + _sys.o getcpu.o _oserror.o strerror.o iscntrl.o maperrno.o all: $(C_OBJS) $(S_OBJS) diff --git a/libsrc/common/errno.s b/libsrc/common/errno.s index 1ab845397..a07b60c0a 100644 --- a/libsrc/common/errno.s +++ b/libsrc/common/errno.s @@ -2,29 +2,9 @@ ; Ullrich von Bassewitz, 06.06.1998 ; ; int _errno; -; -; void _maperrno(void); -; /* Map an OS error to a system independent error code */ ; - .export __maperrno .export __errno - .import __oserror - .import __osmaperrno - - -.code - -__maperrno: - lda __oserror ; Get the error code - beq @L1 ; Jump if no error - ldx #$00 ; Clear error - stx __oserror - jsr __osmaperrno ; Map the code - sta __errno - stx __errno+1 -@L1: rts - .bss diff --git a/libsrc/common/maperrno.s b/libsrc/common/maperrno.s new file mode 100644 index 000000000..8cac3f1e5 --- /dev/null +++ b/libsrc/common/maperrno.s @@ -0,0 +1,27 @@ +; +; Ullrich von Bassewitz, 24.06.2000 +; +; void _maperrno(void); +; /* Map an OS error to a system independent error code */ +; + + .export __maperrno + .import __errno + .import __oserror + .import __osmaperrno + + +.code + +__maperrno: + lda __oserror ; Get the error code + beq @L1 ; Jump if no error + ldx #$00 ; Clear error + stx __oserror + jsr __osmaperrno ; Map the code + sta __errno + stx __errno+1 +@L1: rts + + + -- 2.39.5