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:
29
libsrc/atari/write.s
Normal file
29
libsrc/atari/write.s
Normal file
@@ -0,0 +1,29 @@
|
||||
;
|
||||
; write(iocb, buf, nbytes)->nbytes written
|
||||
;
|
||||
.include "atari.inc"
|
||||
.import __rwsetup,__do_oserror,__inviocb,__oserror
|
||||
.export _write
|
||||
_write:
|
||||
jsr __rwsetup ; do common setup
|
||||
beq write9 ; if size 0, it's a no-op
|
||||
cpx #$FF ; invalid iocb?
|
||||
beq _inviocb
|
||||
lda #PUTCHR
|
||||
sta ICCOM,x
|
||||
jsr CIOV
|
||||
bpl write9
|
||||
jmp __do_oserror ; update errno
|
||||
|
||||
write9:
|
||||
lda ICBLL,x ; get buf len lo
|
||||
pha
|
||||
lda ICBLH,x ; buf len hi
|
||||
tax
|
||||
lda #0
|
||||
sta __oserror ; clear system dependend error code
|
||||
pla
|
||||
rts
|
||||
|
||||
_inviocb:
|
||||
jmp __inviocb
|
||||
Reference in New Issue
Block a user