public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
baf929c
)
6502: syscall return helper so we can set up errno correctly
author
Alan Cox
<alan@linux.intel.com>
Fri, 16 Jan 2015 15:51:59 +0000
(15:51 +0000)
committer
Alan Cox
<alan@linux.intel.com>
Fri, 16 Jan 2015 15:51:59 +0000
(15:51 +0000)
Library/libs/fuzix6502/syscall.s
[new file with mode: 0644]
patch
|
blob
diff --git a/Library/libs/fuzix6502/syscall.s
b/Library/libs/fuzix6502/syscall.s
new file mode 100644
(file)
index 0000000..
53e3eab
--- /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