]> git.sur5r.net Git - cc65/commitdiff
Fixed a bug: Closing all files on exit did not work
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 9 Aug 2004 10:38:12 +0000 (10:38 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 9 Aug 2004 10:38:12 +0000 (10:38 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3175 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/cbm/open.s

index a08bb31aa6bcde0b1e32dad34cda730e8d99596f..8e001131bed9be0f8537be538e321936c7396388 100644 (file)
@@ -30,8 +30,8 @@
 
 .proc   closeallfiles
 
-        ldx     #MAX_FDS
-loop:   lda     fdtab-1,x
+        ldx     #MAX_FDS-1
+loop:   lda     fdtab,x
         beq     next            ; Skip unused entries
 
 ; Close this file
@@ -46,7 +46,7 @@ loop:   lda     fdtab-1,x
 ; Next file
 
 next:   dex
-        bne     loop
+        bpl     loop
 
         rts