]> git.sur5r.net Git - cc65/blob - libsrc/cbm/scratch.s
Fix ftell() on Apple II to return the correct value.
[cc65] / libsrc / cbm / scratch.s
1 ;
2 ; Ullrich von Bassewitz, 2002-11-16, 2009-02-22
3 ;
4 ; Scratch a file on disk
5 ;
6
7         .export         scratch
8         .import         opencmdchannel, closecmdchannel, writefndiskcmd
9         .import         fnunit, fncmd
10
11         .include        "cbm.inc"
12
13 ;--------------------------------------------------------------------------
14 ; scratch: Scratch a file on disk. Expects the name of the file to be already
15 ; parsed. Returns an error code in A, which may either be the code read from
16 ; the command channel, or another error when accessing the command channel
17 ; failed.
18
19 .proc   scratch
20
21         ldx     fnunit
22         jsr     opencmdchannel
23         bne     done
24
25         lda     #'s'            ; Scratch command
26         sta     fncmd
27         jsr     writefndiskcmd
28
29         pha
30         ldx     fnunit
31         jsr     closecmdchannel
32         pla
33
34 done:   rts
35
36 .endproc
37
38