1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-29 10:29:30 +00:00
cc65/libsrc/atari/write.s
cpg 7f3ef943bd small comment change
git-svn-id: svn://svn.cc65.org/cc65/trunk@5427 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-01-26 12:25:20 +00:00

30 lines
539 B
ArmAsm

;
; int __fastcall__ write (int fd, const void* buf, unsigned count);
;
.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 low
pha
lda ICBLH,x ; buf len high
tax
lda #0
sta __oserror ; clear system dependend error code
pla
rts
_inviocb:
jmp __inviocb