This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches. git-svn-id: svn://svn.cc65.org/cc65/trunk@3 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
36
libsrc/atari/close.s
Normal file
36
libsrc/atari/close.s
Normal file
@@ -0,0 +1,36 @@
|
||||
;
|
||||
; Christian Groessler, May-2000
|
||||
;
|
||||
; int close(int fd);
|
||||
;
|
||||
|
||||
.include "atari.inc"
|
||||
.export _close
|
||||
.import __do_oserror,popax,__oserror
|
||||
.import fdtoiocb_down,__inviocb
|
||||
|
||||
.proc _close
|
||||
jsr popax
|
||||
jsr fdtoiocb_down ; get iocb index into X and decr. usage count
|
||||
bmi inverr
|
||||
bne ok ; not last one -> don't close yet
|
||||
; asl a
|
||||
; asl a
|
||||
; asl a
|
||||
; asl a
|
||||
; tax
|
||||
lda #CLOSE
|
||||
sta ICCOM,x
|
||||
jsr CIOV
|
||||
bpl ok
|
||||
jmp __do_oserror
|
||||
|
||||
ok: ldx #0
|
||||
stx __oserror ; clear system specific error code
|
||||
txa
|
||||
rts
|
||||
|
||||
inverr: jmp __inviocb
|
||||
|
||||
.endproc
|
||||
|
||||
Reference in New Issue
Block a user