[Coco] ML Disk Access -- Best Method
William Mikrut
wmikrut72 at gmail.com
Sat Feb 11 21:50:39 EST 2017
I have been working with reading through the DSKCON documentation in the
unraveled series and in other places as well.
I've come up with a short program to create a data file on my working disk.
Just wanted to throw this out there to see if there is a better way to
accomplish this.
ORG $1200
START PSHS CC,A,B,DP,X,Y,U
JSR CLRBUF
JSR SETNAM
LDA #01 Set the file type (ASCII)
STA #DFLTYP
LDA #$00 Set the flag (ASCII)
STA #DASCFL
LDU $C006 Set DSKCON Parms
CLRA
STA 1,U DSKCON Drive
JSR $C68C Search Directory
JSR SETNAM
JSR $C567 Set Up Directory Entry
PULS CC,A,B,DP,X,Y,U
RTS
CLRBUF LDY #DNAMBF Clear the buffer
CLRA
F001 STA ,Y+
CMPY #DNAMBF+11
BNE F001
RTS
SETNAM LDX #FILE Get/Set the File Name
LDY #DNAMBF
F002 LDA ,X+
STA ,Y+
CMPY #DNAMBF+11
BNE F002
RTS
DNAMBF EQU $094C Disk File Name Buffer
DFLTYP EQU $0957 0=Basic,1=Data,2=ML,3=Text Editor Source File
DASCFL EQU $0958 ASCII Flag: 0=Crunched or Binary, $FF=ASCII
FILE FCC "MYFILE DAT"
END START
More information about the Coco
mailing list