]> git.sur5r.net Git - cc65/commitdiff
Added _directerrno() to the sim6502/sim65c02 libraries. 180/head
authorGreg King <gregdk@users.sf.net>
Sat, 18 Jul 2015 22:23:08 +0000 (18:23 -0400)
committerGreg King <gregdk@users.sf.net>
Sat, 18 Jul 2015 22:23:08 +0000 (18:23 -0400)
libsrc/sim6502/errno.s

index e6c2422c126eab3019f81e3657c427623f31e6a8..d9f7e397ec07fabd12653965c439749c316da2d0 100644 (file)
@@ -1,11 +1,29 @@
 ;
-; Oliver Schmidt, 2013-05-16
+; 2013-05-16, Oliver Schmidt
+; 2015-07-18, Greg King
 ;
-; extern int errno;
+; Helper functions for several high-level functions.
 ;
 
         .include        "errno.inc"
 
+; ----------------------------------------------------------------------------
+; int __fastcall__ _directerrno (unsigned char code);
+; /* Set errno to a specific error code; and, return -1. Used
+; ** by the library.
+; */
+
+__directerrno:
+        jsr     __seterrno              ; Save in errno
+fail:   lda     #$FF                    ; Return -1
+        tax
+ok:     rts
+
+
+; ----------------------------------------------------------------------------
+;
+; extern int _errno;
+;
         .bss
 
 __errno: