From: Alan Cox Date: Fri, 16 Jan 2015 15:51:59 +0000 (+0000) Subject: 6502: syscall return helper so we can set up errno correctly X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6f2ed105732d11d3c9713d534e1d9c26c7ed92a0;p=FUZIX.git 6502: syscall return helper so we can set up errno correctly --- diff --git a/Library/libs/fuzix6502/syscall.s b/Library/libs/fuzix6502/syscall.s new file mode 100644 index 00000000..53e3eab7 --- /dev/null +++ b/Library/libs/fuzix6502/syscall.s @@ -0,0 +1,18 @@ + .export __syscall + .import _errno + +.proc __syscall + jsr callfe + bne error + tya ; x,a form the return code + rts +error: + sta _errno + ldx #0 + stx _errno+1 + dex ; Return $FFFF (-1) + txa + rts +callfe: jmp ($fe) + +.endproc