Host Transport Protocol “TAP” (General File Transfer)

This DDE transport protocol exchanges one or more files between the Host and PC in either direction in a single session. The exchange is controlled by the Host.

Protocol Syntax

  1. The Host activates DDE by sending the Title frame:
    PIC X(4)VALUE “TAP ”
    PIC X(42 max)Optional. You may present the first parameter frame here (in which case skip to step 3).
  2. Either the Host sends the next Parameter frame:
    PIC XXTransfer Type:
    VALUE “XR” if sending a file to the PC and the PC should rename any previous version as .BAK,
    VALUE “XA” if sending a file to the PC and the PC should first delete any previous version,
    VALUE “XW” if requesting a file or file group from the PC.
    PIC X(40 max)Filespec of file or file group on the PC (variable length string).

    Type XR is fail-safe because a .TMP workfile holds the new version until the transfer is complete. Type XA is not fail safe but maximises available space on the target media. A filespec comprises a filename optionally preceded by its MS-DOS directory “path”. A file group is defined by including “wildcard” characters * and or ? within the filename.

    or the Host sends an empty frame (go to step 5).
  3. Either the PC sends GS if it is ready to receive the next data frame (go either to step 4 or, if the Host last sent an empty frame, to step 2),
    or the PC sends a Data frame containing the next File Header:
    PIC XFrame Type: VALUE "H"
    PIC X(12 max)Filename (excluding the MS-DOS directory "path").
    or the PC sends a Data frame containing the next File Record:
    PIC XFrame Type: VALUE "R"
    PIC X(var)Printable content.

    The PC sends a File Header for each file (if any) matching filespec in the Parameter frame. Each File Header is followed by the sequence of File Records (if any) within that file. The Host must send a Proceed condition code after every data frame from the PC. Within the PC source file, File Records are terminated by ASCII byte CR (0Dhex); all other non-printable bytes are discarded except HT (09hex) which is replaced by SP (20hex). When there are no more data frames the PC sends GS and goes to step 2.

    or the PC sends US if it did not receive the previous frame correctly (Host must repeat previous frame and return to step 3),
    or the PC sends ESC (program discards the current file transfer and terminates DDE).
  4. Either the Host sends the next data frame if any (go to step 3),

    The PC adds the frame to the received file, appending the two ASCII bytes CR LF (0Dhex 0Ahex) and separating any fields within the frame with the single byte HT (09hex). Therefore, each data frame should contain a single record.

    or the Host sends a Condition Code (see below) (go to step 3).
  5. Either the PC sends US if it did not receive the previous frame correctly (Host must repeat previous frame and return to step 5),
    or the PC sends ESC (the program terminates DDE).

Condition Codes (Host to PC)

End of File.

 (this is an empty frame)

Indicates that the Host has sent all the data frames for the current file.

Proceed.

 (this is an empty frame)

Indicates that the Host is ready to receive the next Data Frame.

Cancel.

PIC XXVALUE "ZC"

Indicates that the Host requests PC to close the current file immediately. If the PC accepts this request it sends the Header for the next file, or GS if there are no further files, at step 3.

Disengage.

PIC XXVALUE "ZD"

Indicates that the Host requests PC to terminate DDE immediately. If the PC accepts this request it sends ESC at step 3.

The Protocol Handbook