]> git.sur5r.net Git - cc65/blob - libsrc/apple2/dioopen.s
Fixed gcc compiler warning (#867)
[cc65] / libsrc / apple2 / dioopen.s
1 ;
2 ; Oliver Schmidt, 24.03.2005
3 ;
4 ; dhandle_t __fastcall__ dio_open (unsigned char device);
5 ;
6
7         .export         _dio_open
8         .import         return0, __dos_type, isdevice
9
10         .include        "errno.inc"
11         .include        "mli.inc"
12
13 _dio_open:
14         ; Check for ProDOS 8
15         ldx     __dos_type
16         bne     :+
17         lda     #$01            ; "Bad system call number"
18         bne     oserr           ; Branch always
19
20         ; Check for valid device
21 :       tax
22         jsr     isdevice
23         beq     :+
24         lda     #$28            ; "No device connected"
25
26         ; Return oserror
27 oserr:  sta     __oserror
28         jmp     return0
29
30         ; Return success
31 :       txa
32         asl
33         asl
34         asl
35         asl
36         ldx     #$00
37         stx     __oserror
38         rts