3 .importzp sp,tmp2,tmp3,tmp1
4 ; int open (const char* name, int flags, ...); /* May take a mode argument */
5 .include "telemon30.inc"
10 ; Throw away any additional parameters passed through the ellipsis
12 dey ; Parm count < 4 shouldn't be needed to be...
13 dey ; ...checked (it generates a c compiler warning)
16 beq parmok ; Branch if parameter count ok
17 jsr addysp ; Fix stack, throw away unused parameters
19 ; Parameters ok. Pop the flags and save them into tmp3
21 parmok: jsr popax ; Get flagss
40 ; Get the filename from stack and parse it. Bail out if is not ok
50 ; jsr fnparse ; Parse it
52 ;bne oserror ; Bail out if problem with name
54 ; Get a free file handle and remember it in tmp2
57 ;lda #EMFILE ; Load error code
58 ;bcs seterrno ; Jump in case of errors