]> git.sur5r.net Git - cc65/blob - libsrc/apple2/dosdetect.s
Add new maintainer
[cc65] / libsrc / apple2 / dosdetect.s
1 ;
2 ; Oliver Schmidt, 08.03.2004
3 ;
4 ; Identify DOS version we're running on as one of these:
5 ;
6 ; AppleDOS 3.3  $00
7 ; ProDOS 1.0.1  $10
8 ; ProDOS 1.0.2  $10
9 ; ProDOS 1.1.1  $11
10 ; ProDOS 1.2    $12
11 ; ProDOS 1.3    $13
12 ; ProDOS 1.4    $14
13 ; ProDOS 1.5    $15
14 ; ProDOS 1.6    $16
15 ; ProDOS 1.7    $17
16 ; ProDOS 1.8    $18
17 ; ProDOS 1.9    $18
18 ; ProDOS 2.0.1  $21
19 ; ProDOS 2.0.2  $22
20 ; ProDOS 2.0.3  $23
21
22
23         .constructor    initdostype
24         .export         __dos_type
25
26         .include        "apple2.inc"
27
28 ; Identify DOS version according to:
29 ; - "Beneath Apple ProDOS", chapter 6-63
30 ; - "Apple II ProDOS 8 TechNote #023: ProDOS 8 Changes and Minutia"
31 ; - ProDOS TechRefMan, chapter 5.2.4
32
33 initdostype:
34         lda     MLI
35         cmp     #$4C            ; Is MLI present? (JMP opcode)
36         bne     done
37         lda     $BFFF           ; ProDOS KVERSION
38         cmp     #$10
39         bpl     L1
40         ora     #$10            ; Make high nibble match major version
41 L1:     sta     __dos_type
42 done:   rts
43
44         .bss
45
46 __dos_type:     .res    1