]> git.sur5r.net Git - cc65/blob - libsrc/apple2/dosdetect.s
New code from Oliver Schmidt
[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         .constructor    initdostype
23         .export         __dos_type
24
25         .include        "apple2.inc"
26
27 ; Identify DOS version according to:
28 ; - "Beneath Apple ProDOS", chapter 6-63
29 ; - "Apple II ProDOS 8 TechNote #023: ProDOS 8 Changes and Minutia"
30 ; - ProDOS TechRefMan, chapter 5.2.4
31
32 initdostype:
33         lda     MLI
34         cmp     #$4C            ; Is MLI present? (JMP opcode)
35         bne     done
36         lda     $BFFF           ; ProDOS KVERSION
37         cmp     #$10
38         bcs     :+
39         ora     #$10            ; Make high nibble match major version
40 :       sta     __dos_type
41 done:   rts
42
43         .bss
44
45 __dos_type:     .res    1