Jon Relay's Apple II Info Archives

ProDOS MLI Calls

In the parameter lists that follow, (Res) is used to denote a value that the MLI call returns, (Val) is used to denote a value passed to the MLI routine, and (Ptr) is used to denote a pointer (address) of a string, buffer, or routine.

Path names are stored in memory as Pascal strings (that is, a count byte followed by the actual path name). For the RENAME command, both path names must be identical except for the last name.

A Unit Number is a byte of the form DSSSLLLL, where D is the drive number (0 for drive 1 or 1 for drive 2), SSS is the slot number, and LLLL is the length of the name. For the ONLINE command, you can specify 0 as the Unit Number to return the names of all the drives.

A Storage Type is a byte with the length of the file name in the lower nybble and the storage type (0 for an inactive file, 1 for a seedling, 2 for a sapling, 3 for a tree, $D for a directory) in the upper nybble.

A date is stored in the format MMMDDDDD YYYYYYYM.

A time is stored with the minute in the first byte and the hour (in 24-hour format) in the second byte.

An Access Code is a byte of the format DRBXXXWR. In order, the bits mean: file can be deleted, file can be renamed, file hasn't been backed up, reserved, reserved, reserved, file can be written to, and file can be read.

The Enable Mask is the AND mask used to compare the data in the file to the new line character. If it is 0, no character is used as the new line character.

Request Count is the number of bytes to be read or written to a file. Transfer Count is the number of bytes that were actually read or written.

File Types and Aux Types can be found here.

Interrupt Code must be a number between 1 and 4.

All Reserved parameters should be left set at 0.

After a GET TIME call, or any call for that matter, the hour is stored in address $BF93 (49043 decimal) and the minute is stored in address $BF92 (49042 decimal).

$40 ALLOC INTERRUPT - Parameters: 2

   Interrupt Number (Res) - 1 Byte
   Interrupt Code (Ptr) - 2 Bytes

$41 DEALLOC INTERRUPT - Parameters: 1

   Interrupt Number (Val) - 1 Byte

$65 QUIT - Parameters: 4

   Reserved (Val) - 1 Byte
   Reserved (Ptr) - 2 Bytes
   Reserved (Val) - 1 Byte
   Reserved (Ptr) - 2 Bytes

$80 READ BLOCK - Parameters: 3

   Unit Number (Val) - 1 Byte
   Data Buffer (Ptr) - 2 Bytes
   Block Number (Val) - 2 Bytes

$81 WRITE BLOCK - Parameters: 3

   Unit Number (Val) - 1 Byte
   Data Buffer (Ptr) - 2 Bytes
   Block Number (Val) - 2 Bytes

$82 GET TIME - Parameters: 0

$C0 CREATE - Parameters: 7

   Path Name (Ptr) - 2 Bytes
   Access Code (Val) - 1 Byte
   File Type (Val) - 1 Byte
   Aux Type (Val) - 2 Bytes
   Storage Type (Val) - 1 Byte
   Creation Date (Val) - 2 Bytes
   Creation Time (Val) - 2 Bytes

$C1 DESTROY - Parameters: 1

   Path Name (Ptr) - 2 Bytes

$C2 RENAME - Parameters: 2

   Path Name (Ptr) - 2 Bytes
   New Path Name (Ptr) - 2 Bytes

$C3 SET FILE INFO - Parameters: 7

   Path Name (Ptr) - 2 Bytes
   Access Code (Val) - 1 Byte
   File Type (Val) - 1 Byte
   Aux Type (Val) - 2 Bytes
   Reserved (Val) - 3 Bytes
   Modification Date (Val) - 2 Bytes
   Modification Time (Val) - 2 Bytes

$C4 GET FILE INFO - Parameters: 10 ($A)

   Path Name (Ptr) - 2 Bytes
   Access Code (Res) - 1 Byte
   File Type (Res) - 1 Byte
   Aux Type (Res) - 2 Bytes
   Storage Type (Res) - 1 Byte
   Blocks Used (Res) - 2 Bytes
   Modification Date (Res) - 2 Bytes
   Modification Time (Res) - 2 Bytes
   Creation Date (Res) - 2 Bytes
   Creation Time (Res) - 2 Bytes

$C5 ONLINE - Parameters: 2

   Unit Number (Val) - 1 Byte
   Data Buffer (Ptr) - 2 Bytes

$C6 SET PREFIX - Parameters: 1

   Path Name (Ptr) - 2 Bytes

$C7 GET PREFIX - Parameters: 1

   Data Buffer (Ptr) - 2 Bytes

$C8 OPEN - Parameters: 3

   Path Name (Ptr) - 2 Bytes
   I/O Buffer (Ptr) - 2 Bytes
   Reference Number (Res) - 1 Byte

$C9 NEW LINE - Parameters: 3

   Reference Number (Val) - 1 Byte
   Enable Mask (Val) - 1 Byte
   New Line Character (Val) - 1 Byte

$CA READ - Parameters: 4

   Reference Number (Val) - 1 Byte
   Data Buffer (Ptr) - 2 Bytes
   Request Count (Val) - 2 Bytes
   Transfer Count (Res) - 2 Bytes

$CB WRITE - Parameters: 4

   Reference Number (Val) - 1 Byte
   Data Buffer (Ptr) - 2 Bytes
   Request Count (Val) - 2 Bytes
   Transfer Count (Res) - 2 Bytes

$CC CLOSE - Parameters: 1

   Reference Number (Val) - 1 Byte

$CD FLUSH - Parameters: 1

   Reference Number (Val) - 1 Byte

$CE SET MARK - Parameters: 2

   Reference Number (Val) - 1 Byte
   Position in File (Val) - 3 Bytes

$CF GET MARK - Parameters: 2

   Reference Number (Val) - 1 Byte
   Position in File (Res) - 3 Bytes

$D0 SET EOF - Parameters: 2

   Reference Number (Val) - 1 Byte
   End of File (Val) - 3 Bytes

$D1 GET EOF - Parameters: 2

   Reference Number (Val) - 1 Byte
   End of File (Res) - 3 Bytes

$D2 SET BUFFER - Parameters: 2

   Reference Number (Val) - 1 Byte
   I/O Buffer (Ptr) - 2 Bytes

$D3 GET BUFFER - Parameters: 2

   Reference Number (Val) - 1 Byte
   I/O Buffer (Ptr) - 2 Bytes

Return to Index