]> git.sur5r.net Git - cc65/blob - libsrc/apple2/syschdir.s
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / libsrc / apple2 / syschdir.s
1 ;
2 ; Oliver Schmidt, 17.04.2005
3 ;
4 ; unsigned char __fastcall__ _syschdir (const char* name);
5 ;
6
7         .export         __syschdir
8         .import         pushname, popname
9         .import         initcwd
10
11         .include        "zeropage.inc"
12         .include        "mli.inc"
13
14 __syschdir:
15         ; Push name
16         jsr     pushname
17         bne     oserr
18
19         ; Set pushed name
20         lda     sp
21         ldx     sp+1
22         sta     mliparam + MLI::PREFIX::PATHNAME
23         stx     mliparam + MLI::PREFIX::PATHNAME+1
24
25         ; Change directory
26         lda     #SET_PREFIX_CALL
27         ldx     #PREFIX_COUNT
28         jsr     callmli
29         bcs     cleanup
30
31         ; Update current working directory
32         jsr     initcwd         ; Returns with A = 0
33
34         ; Cleanup name
35 cleanup:jsr     popname         ; Preserves A
36
37 oserr:  rts