]> git.sur5r.net Git - cc65/commitdiff
Save a few bytes and cycles.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 4 Jun 2010 09:38:35 +0000 (09:38 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 4 Jun 2010 09:38:35 +0000 (09:38 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4707 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/oserrcheck.s

index bd5fa98a860b8740e227e05b6c1b9cf7f0a72335..b891e75f1d5c74782b9f68b6c008db519776daaf 100644 (file)
 .proc   oserrcheck
 
         sta     __oserror               ; Store the error code
-        tay                             ; Did we have an error?
+        tax                             ; Did we have an error?
         beq     ok                      ; Branch if no
         jsr     __osmaperrno            ; Map os error into errno code
-        sta     __errno
-        stx     __errno+1               ; Save in errno
+        jsr     __seterrno              ; Save in errno
         lda     #$FF                    ; Return -1
-
-; Error free, A contains zero
-
-ok:     tax                             ; Make high byte also zero
-        rts
+        tax                             ; Make high byte also zero
+ok:     rts
 
 .endproc