]> git.sur5r.net Git - cc65/blobdiff - libsrc/apple2/syschdir.s
don't use constructor to setup runtime stack
[cc65] / libsrc / apple2 / syschdir.s
index 48bbc2eed60e30f3f7a538418caa4d7df87de273..7eb67e1abd895fd975394941f85025bcb3ccfb69 100644 (file)
@@ -6,7 +6,7 @@
 
         .export         __syschdir
         .import                pushname, popname
-       .import         __cwd
+       .import         initcwd
 
        .include        "zeropage.inc"
        .include        "mli.inc"
@@ -28,12 +28,8 @@ __syschdir:
         jsr    callmli
        bcs     cleanup
 
-       ldy     #$01
-:      lda     (sp),y
-       sta     __cwd-1,y
-       beq     cleanup
-       iny
-       bne     :-              ; Branch always
+       ; Update current working directory
+       jsr     initcwd         ; Returns with A = 0
 
         ; Cleanup name
 cleanup:jsr    popname         ; Preserves A