AppleIIAsm-Collection/documentation/AppleIIAsm Library Collecti.../0.6.1/11.0 Quick_Reference_D6_MAC...

6.5 KiB

Disk 6: Apple DOS

The DOS Collection of the AppleIIAsm Library consists of macros and subroutines dedicated to interfacing with Apple DOS, providing an abstraction layer for the programmer on top of the lower level routines used by DOS such as the file manager and RWTS. All of the basic functions of DOS are available for use, save for specific macros dedicated solely to reading and writing text files. The reasoning for this is that 1) unless you are interfacing with a BASIC program or another system, text files are largely unnecessary (binary files work better), and 2) text file manipulation often requires creating a system of your own since there is no simple default way to read the end of a file. The macros and routines that do exist can be used to create your own custom system for reading and writing text files.

Of all the collections in the library, the DOS collection is perhaps the most convoluted and has the largest overhead due to the more complex nature of its functionality. There are many subroutines and macros that are meant to be used only by the collection itself, though the enterprising programmer may of course utilize them. These are described in the detailed listings.


MAC.DOSREQ.ASM

MACRO DEPENDENCY PARAMETERS ACTION DESTROYS CYCLES BYTES
FMFIL HEAD.DOS.ASM ]1 = Command
]2 = Slot
]3 = Drive
]4 = Volume
]5 = Record
Fill most common parameters of the File Manager. NZCV 603 303
FMNAM HEAD.DOS.ASM ]1 = String Address Copy a string to the file name parameter in the File Parameter List. NZCV 117 70
FRWB HEAD.DOS.ASM ]1 = Read/Write flag
]2 = Command
]3 = Slot
]4 = Drive
]5 = Volume
]6 = Record
]7 = Byte Offset
]8 = Write Byte
Read or write a byte from or to a file. Use FRWRTB and FRDB instead of this, both of which call this macro. NZCV 779 404
FWRTB HEAD.DOS.ASM ]1 = Slot
]2 = Drive
]3 = Volume
]4 = Record
]5 = Byte Offset
]6 = Write Byte
Write a byte to a file. NZCV 665 337
FRDB HEAD.DOS.ASM ]1 = Slot
]2 = Drive
]3 = Volume
]4 = Record
]5 = Byte Offset
]6 = Write Byte (always 0)
Read a byte from a file. NZCV 700 357
FRWR HEAD.DOS.ASM ]1 = Read/Write flag
]2 = Command
]3 = Slot
]4 = Drive
]5 = Volume
]6 = Record
]7 = Byte Offset
]8 = Range Address
]TEMP = Range Length
Read or write a range of bytes in a file. Use FRDR or FWRTR instead of this macro directly. NZCV 846 451
FRDR HEAD.DOS.ASM ]1 = Slot
]2 = Drive
]3 = Volume
]4 = Record
]5 = Byte Offset
]6 = Range Address
]7 = Range Length
Read a range of bytes from a file. NZCV 697 361
FWRTR HEAD.DOS.ASM ]1 = Slot
]2 = Drive
]3 = Volume
]4 = Record
]5 = Byte Offset
]6 = Range Address
]7 = Range Length
Write a range of bytes to a file. NZCV 940 509
sRWTS HEAD.DOS.ASM ]1 = Slot
]2 = Drive
]3 = Volume
]4 = Track
]5 = Sector
]6 = Buffer
]7 = Command
Set the most common RWTS parameters. NZCV 228 141
GRWTS HEAD.DOS.ASM none Execute the RWTS routine. NZCV 19 11

MAC.DOSFM.ASM

MACRO DEPENDENCY PARAMETERS ACTION DESTROYS CYCLES BYTES
FCAT HEAD.DOS.ASM ]1 = Slot
]2 = Drive
Catalog. NZCV 657 348
FULCK HEAD.DOS.ASM ]1 = Filename address
]2 = Slot
]3 = Drive
File unlock. NZCV 629 353
FLOCK HEAD.DOS.ASM ]1 = Filename address
]2 = Slot
]3 = Drive
File lock. NZCV 172 116
FDEL HEAD.DOS.ASM ]1 = Filename address
]2 = Slot
]3 = Drive
File delete. NZCV 791 412
FVFY HEAD.DOS.ASM ]1 = Filename address
]2 = Slot
]3 = Drive
File verify. NZCV 791 411
FCLOS HEAD.DOS.ASM ]1 = Filename address
]2 = Slot
]3 = Drive
File close. NZCV 797 415
FRENM HEAD.DOS.ASM ]1 = Filename address
]2 = New filename address
]3 = Slot
]4 = Drive
File rename. NZCV 927 578
FOPEN HEAD.DOS.ASM ]1 = Filename address
]2 = Slot
]3 = Drive
]4 = Volume
]5 = Record
File open. NZCV 828 433
BLOAD SUB.FBLOAD.ASM ]1 = Filename address
]2 = Load address
]3 = Slot
]4 = Drive
]5 = Volume
Load binary file. NZCV 3768 2735
BSAVE SUB.FBSAVE.ASM ]1 = Filename address
]2 = Load address
]3 = Range length
]4 = Slot
]5 = Drive
]6 = Volume
Save binary file. NZCV 5300 2758

MAC.DOSMORE.ASM

MACRO DEPENDENCY PARAMETERS ACTION DESTROYS CYCLES BYTES
DVER none none Get DOS version. NZCV 28 18
DOSIN none none Check if DOS is loaded. NZCV 17 12
ABAS none none Check if Applesoft is loaded. NZCV 40 29
IBEX none none Check if Integer Basic program is running. NZCV 17 12
ABEX none none Check if Applesoft Basic program is running. NZCV 26 18