From 6f2ed105732d11d3c9713d534e1d9c26c7ed92a0 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 16 Jan 2015 15:51:59 +0000 Subject: [PATCH] 6502: syscall return helper so we can set up errno correctly --- Library/libs/fuzix6502/syscall.s | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Library/libs/fuzix6502/syscall.s 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 -- 2.34.1