From: cpg Date: Thu, 16 May 2002 15:28:07 +0000 (+0000) Subject: support append mode X-Git-Tag: V2.12.0~2349 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c2e2e5a9629d438fb6c82e63efb3c6dfad0d432;p=cc65 support append mode git-svn-id: svn://svn.cc65.org/cc65/trunk@1272 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/atari/open.s b/libsrc/atari/open.s index f28f8a032..2d7957a93 100644 --- a/libsrc/atari/open.s +++ b/libsrc/atari/open.s @@ -1,5 +1,5 @@ ; -; Christian Groessler, May-2000 +; Christian Groessler, May-2002 ; ; int open(const char *name,int flags,...); ; @@ -42,13 +42,33 @@ seterr: jsr __seterrno rts ; return -1 ; process the mode argument - ; @@@TODO: append not handled yet! iocbok: stx tmp4 jsr clriocb ; init with zero ldy #1 jsr ldaxysp ; get mode + ;brk ldx tmp4 + pha + and #O_APPEND + beq no_app + pla + and #15 + cmp #O_RDONLY ; DOS supports append with write-only only + beq invret + cmp #O_RDWR + beq invret + lda #OPNOT|APPEND + bne set + +.ifndef UCASE_FILENAME +invret: lda #EINVAL + jmp seterr +.endif + +no_app: pla + and #15 cmp #O_RDONLY bne l1 lda #OPNIN @@ -73,7 +93,7 @@ cont: ldy #3 jsr ucase_fn bcc ucok1 - lda #EINVAL jmp seterr ucok1: