]> git.sur5r.net Git - cc65/blob - libsrc/apple2/mli.s
ProDOS 8 requires an page-aligned 1kB IO-buffer for every open file. The implementati...
[cc65] / libsrc / apple2 / mli.s
1 ;
2 ; Oliver Schmidt, 30.12.2004
3 ;
4 ; Apple ProDOS 8 MLI
5 ;
6
7         .import         __dos_type
8         .import         iobuf_init, iobuf_done
9         .export         iobuf_nop
10
11         .include        "mli.inc"
12
13         .bss
14
15 mliparam:.tag   MLI
16
17         .data
18
19 callmli:
20         ; Store parameters
21         sta     call
22         stx     mliparam
23
24         ; Check for ProDOS 8
25         lda     __dos_type
26         beq     oserr
27
28         ; Call MLI and return
29         jsr     iobuf_init
30         jsr     ENTRY
31 call:   .byte   $00
32         .addr   mliparam
33         jmp     iobuf_done
34
35         ; Load oserror code and return
36 oserr:  lda     #$01            ; "Invalid MLI function code number"
37         sec
38         ; Fall through
39
40 iobuf_nop:
41         rts