]> git.sur5r.net Git - cc65/commitdiff
Squeezed a few bytes out of open()
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 3 Apr 2005 18:04:53 +0000 (18:04 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 3 Apr 2005 18:04:53 +0000 (18:04 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3452 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/cbm/open.s

index 8e001131bed9be0f8537be538e321936c7396388..8678d358281b877410f132c1698ceebbc7d1a801 100644 (file)
@@ -57,13 +57,14 @@ next:   dex
 
 .proc   _open
 
-       cpy     #4              ; correct # of arguments (bytes)?
-       beq     parmok          ; parameter count ok
-       tya                     ; parm count < 4 shouldn't be needed to be...
-               sec                     ; ...checked (it generates a c compiler warning)
-       sbc     #4
-       tay
-       jsr     addysp          ; fix stack, throw away unused parameters
+; Throw away any additional parameters passed through the ellipsis
+
+               dey                     ; Parm count < 4 shouldn't be needed to be...
+               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
 
 ; Parameters ok. Pop the flags and save them into tmp3