This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

DOS_Write

Read bytes from a file into memory

Table of Contents

Function AddressDescription
DOS_WRITE 0115Write bytes from memory into a file

Synopsys

Write bytes from memory into a file, advancing the file pointer in the process.

Entry Parameters

Register Content
B File number 0…15
C Page number for addresses 0xC000…0xFFFF
DE Number of bytes to write. 0 means 64K
HL Address of where to read the bytes from

Exit Parameters

If OK:
Carry true
A corrupt
DE corrupt
Otherwise:
Carry false
A = Error code
DE = Number of bytes remaining unwritten
Always:
BC HL IX corrupt, all other registers preserved.

The value of C is only used when HL is within the upper 16K of memory (0xC000…0xFFFF). If HL is in this range then C is the RAM bank to use. For most purposes C should be set to 0 which is the default RAM bank mapped to that region.