2 ; common iocb setup routine for read, write
3 ; expects parameters (int fd,void *buf,int count)
6 .include "../common/errno.inc"
9 .import __errno,__oserror
18 jsr fdtoiocb ; convert to iocb
20 ; asl a ; iocb # --> iocb index
26 jsr ldaxysp ; get size
27 php ; save cond codes, for zero-ness
30 cpx #$80 ; iocb must be 0...7
35 ldy #3 ; get buf addr (was 2 in orig. version)
46 iocberr:jsr incsp6 ; pop args
48 ldx #$FF ; indicate error + clear ZF
53 ; this routine updates errno. do a JMP here right after calling
54 ; CIOV. we expect status in Y.
56 .export __do_oserror,__seterrno,__inviocb
58 sty __oserror ; save os dependent error code
70 ; sets EINVAL error code and returns -1
77 jmp retminus ; return -1