From: Greg King Date: Sat, 18 Jul 2015 22:23:08 +0000 (-0400) Subject: Added _directerrno() to the sim6502/sim65c02 libraries. X-Git-Tag: V2.16~247^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a9982de475a04568542683b197539a075dee9384;p=cc65 Added _directerrno() to the sim6502/sim65c02 libraries. --- diff --git a/libsrc/sim6502/errno.s b/libsrc/sim6502/errno.s index e6c2422c1..d9f7e397e 100644 --- a/libsrc/sim6502/errno.s +++ b/libsrc/sim6502/errno.s @@ -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: