Working on the CBM file functions

git-svn-id: svn://svn.cc65.org/cc65/trunk@1533 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-11-17 22:45:55 +00:00
parent 43d5800702
commit 544ff5b900
11 changed files with 377 additions and 229 deletions

View File

@@ -5,8 +5,9 @@
;
.export scratch
.import readdiskerror
.import opencmdchannel, closecmdchannel, writediskcmd
.import fnunit, fnlen, fncmd
.importzp ptr1
.include "cbm.inc"
@@ -18,28 +19,27 @@
.proc scratch
lda #15 ; Command channel
ldx fnunit ; Unit
tay ; Secondary address
jsr SETLFS
ldx fnunit
jsr opencmdchannel
bne done
lda #'s' ; Scratch command
sta fncmd
lda #<fncmd
sta ptr1
lda #>fncmd
sta ptr1+1
ldx fnlen
inx ; Account for "S"
txa ; Length of name into A
ldx #<fncmd
ldy #>fncmd
jsr SETNAM
jsr OPEN
bcs done
jsr readdiskerror ; Read the command channel
ldx fnunit ; Unit
jsr writediskcmd
pha
lda #15
jsr CLOSE
ldx fnunit
jsr closecmdchannel
pla
done: rts