X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Ftelestrat%2Fopen.s;h=f59d3d31a126320c716f6aa178cc18e819d3d0e0;hb=58484449b4842517d09618bc1c5dad59373250ef;hp=b3b390003222c9cfc9e970ee991bddad48c4ec18;hpb=d9778994fab808b829cc15dd612fd48a18271c0f;p=cc65 diff --git a/libsrc/telestrat/open.s b/libsrc/telestrat/open.s index b3b390003..f59d3d31a 100644 --- a/libsrc/telestrat/open.s +++ b/libsrc/telestrat/open.s @@ -1,11 +1,13 @@ - .export _open - .import addysp,popax - .importzp sp,tmp2,tmp3,tmp1 - - + .export _open + + .import addysp,popax + + .importzp sp,tmp2,tmp3,tmp1 + + .include "telestrat.inc" .include "errno.inc" - .include "fcntl.inc" + .include "fcntl.inc" ; int open (const char* name, int flags, ...); /* May take a mode argument */ .proc _open @@ -15,18 +17,17 @@ dey ; ...checked (it generates a c compiler warning) dey dey - beq parmok ; Branch if parameter count ok - jsr addysp ; Fix stack, throw away unused parameters + beq parmok ; Branch if parameter count ok + jsr addysp ; Fix stack, throw away unused parameters ; Parameters ok. Pop the flags and save them into tmp3 -parmok: jsr popax ; Get flagss - sta tmp3 ; save flags +parmok: + jsr popax ; Get flagss + sta tmp3 ; save flags ; Get the filename from stack and parse it. Bail out if is not ok - jsr popax ; Get name - ldy tmp3 ; Get flags again - BRK_TELEMON XOPEN ; launch primitive ROM + jsr popax ; Get name + ldy tmp3 ; Get flags again + BRK_TELEMON XOPEN ; launch primitive ROM rts .endproc - - \ No newline at end of file