Intelligent File Transfer protocol

The intelligent file transfer protocol is a means of reliably exchanging binary files used by Amstrad computers. It is used by the PCW program MAIL232 (transfer 'as HEX') and, I believe, by various CPC programs. This description comes from Amstrad's CPS8256 interface manual, and is copyright © Amstrad.

The protocol for the intelligent file transfer is as follows:

Sending computer:

  1. Send STX, listen for ACK.
  2. Send 16 byte filename, 2 byte block number (first block is block 0), 1 byte block length (0-128), data (0-128 bytes), 2 byte checksum (sum of all data bytes). Zero block length means end-of-file.
  3. Listen for ETX, ACK or NAK
  4. If ETX then abort, else if NAK, goto (2) retrying same block; else if ACK goto (2) sending next block, or finish if last block.

Receiving computer:

  1. Listen for STX, respond with ACK. NOTE - This means that the receiving program should be started before the transmitting program, otherwise the initial STX might be missed.
  2. Receive filename, block number, block length, data, checksum.
  3. Check for same filename as block 1, and consecutive block numbering, if error then send ETX and abort.
  4. Check for hardware error or checksum error; if OK send ACK; else send NAK.
  5. Check block length; if zero finish, else goto (2).

(For your reference)


Additional notes (not from the manual): 2-byte words are transmitted in little-endian format, i.e., least significant byte first. The filename format is as follows:

 0  1 byte    drive: single upper-case letter or '@' to indicate default
 1  11 bytes  8-byte filename and 3-byte extension in upper-case (no dot)
12  4 bytes   four NULs (0x0)

(subject to confirmation)

A CP/M program from the same manual to transmit a file using this protocol on AUX: can be downloaded as HEX format or as a CP/M executable. Syntax: IFT FILE.TYP.

CP/M page. 1999 August 17; mail.