Elf/Os API

Function Version Notes
0306h 0.1 OPEN - Open file
Args: RF = Pointer to pathname
RD = Pointer to file descriptor, DTA must be pre-filled
R7 = Flags
    1 Create if file does not exist
    2 Truncate file on open
    4 Open for append (moves pointer to eof)
Args: RD = File descriptor
Returns: DF=0 - Success
    RD - File descriptor
DF=1 - Error
    D - Error Code
0312h 0.1 CLOSE - Close file
Args: RD = File descriptor
Returns: DF=0 - Success
DF=1 - Error
    D - Error Code
030Ch 0.1 WRITE - Write to file
Args: RD = File descriptor
RF = Pointer to bytes to write
RC = Count of bytes to write
Returns: RC = Count of bytes written
DF=0 - Success
DF=1 - Error
    D - Error Code
0309h 0.1 READ - Read from file
Args: RD = File descriptor
RF = Pointer to buffer
RC = Count of bytes to read
Returns: RC = Count of bytes read
DF=0 - Success
DF=1 - Error
    D - Error Code
030Fh 0.1 SEEK - Change file position
Args: R8 = High word of seek address
R7 = Low word of seek address
RD = File descriptor
RC = Seek from:
    0 Beginning of file
    1 Current position
    2 End of file
Returns: R8 = High word of current file pointer
R7 = Low word of current file pointer
DF=0 - Success
DF=1 - Error
    D - Error Code
031Bh 0.1 RENAME - Rename a file
Args: RF = Source filename
RC = Destination filename
Returns: DF=0 - Success
DF=1 - Error
    D - Error Code
0318h 0.1 DELETE - Delete a file
Args: RF = Filename
Returns: DF=0 - Success
DF=1 - Error
    D - Error Code
031Eh 0.1 EXEC - Execute a program
Args: RF = Command line
Returns: DF=0 - Success
DF=1 - Error
    D - Error Code
0315h 0.1 OPENDIR - Open directory for reading
Args: RF = Pathname
Returns: RD - File descriptor
DF=0 - Success
DF=1 - Error
    D - Error Code
0321h 0.2 MKDIR - Make directory
Args: RF = Pathname
Returns: DF=0 - Success
DF=1 - Error
    D - Error Code
0324h 0.2 CHDIR - Change/Show current directory
Args: RF = Pathname or buffer to place current path
Returns: DF=0 - Success
DF=1 - Error
    D - Error Code
0327h 0.2 RMDIR - Remove directory (must be empty)
Args: RF = Pathname
Returns: DF=0 - Success
DF=1 - Error
    D - Error Code