Move more common code into rwcommon.s.
Move declaration of __errno into errno.inc. git-svn-id: svn://svn.cc65.org/cc65/trunk@1552 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
.import popax
|
||||
.importzp ptr1, ptr2, ptr3, tmp2
|
||||
|
||||
.include "errno.inc"
|
||||
.include "filedes.inc"
|
||||
|
||||
|
||||
@@ -36,11 +37,19 @@
|
||||
sta ptr3+1 ; Clear ptr3
|
||||
|
||||
jsr popax ; Get the handle
|
||||
sta tmp2
|
||||
cpx #$01
|
||||
bcs inv
|
||||
bcs invhandle
|
||||
cmp #MAX_FDS
|
||||
inv: rts
|
||||
bcs invhandle
|
||||
sta tmp2
|
||||
rts ; Return with carry clear
|
||||
|
||||
invhandle:
|
||||
lda #EINVAL
|
||||
sta __errno
|
||||
lda #0
|
||||
sta __errno+1
|
||||
rts ; Return with carry set
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user