Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ref:zmodem [2020/11/28 16:32] – [ZMODEM Frame] Clarify HEX frames digital man | ref:zmodem [2025/09/26 14:13] (current) – [ZMODEM Frame] Mention the Tera Term 0x8D 0x8A oddity digital man | ||
|---|---|---|---|
| Line 67: | Line 67: | ||
| ==== ZMODEM Frame ==== | ==== ZMODEM Frame ==== | ||
| - | There 2 classes of ZMODEM Frames: | + | There are 2 classes of ZMODEM Frames: |
| - | | + | |
| - | | + | |
| === HEX Frame === | === HEX Frame === | ||
| <frame header> [CR] LF [XON] | <frame header> [CR] LF [XON] | ||
| - | HEX frames are terminated with an ASCII linefeed character. | + | HEX frames are terminated with an ASCII linefeed character. A carriage-return (CR) character may precede the linefeed (LF) character. |
| + | |||
| + | Some ZMODEM implementations send this terminating LF with the high bit set (0x8A, that's ASCII-LF with an even-parity bit set). Some ZMODEM implementations (e.g. Tera Term) inexplicably send **both** CR and LF characters with the parity bit set (i.e. 0x8D 0x8A). | ||
| + | |||
| + | Also, for some HEX frame types, the frame terminator may be followed by an XON (0x11) character (" | ||
| === Binary Frame === | === Binary Frame === | ||
| Line 82: | Line 86: | ||
| ==== Frame Header ==== | ==== Frame Header ==== | ||
| - | <frame encoding> | + | <frame encoding> |
| - | **Frame Encoding** (single byte): | + | **Frame Encoding** (single byte): |
| - | All frames sent by the " | + | |
| - | **Frame Type** (single byte): ZDATA, ZRPOS, ZACK, ZEOF, etc. | + | The //Frame Encoding// is also sometimes called the "Frame Style". |
| - | **Frame Info**: Up to 15 bytes (but typically 4) of frame type-specific information. Note that later claims of //16// bytes of possible frame header data include the //Frame Type// byte. | + | ^ Style ^ AKA ^ Value ^ Frame Contents |
| + | | HEX | ZHEX | ASCII ''' | ||
| + | | BIN16 | ZBIN | ASCII ''' | ||
| + | | BIN32 | ZBIN32 | ASCII ''' | ||
| + | |||
| + | Notes: | ||
| + | * All frames sent by the " | ||
| + | |||
| + | **Frame Type** (single byte): | ||
| + | |||
| + | ^ Type ^ Value ^ TX((from sender))^ RX((from receiver)) ^ Info ^ Data Subpkt | ||
| + | | ZRQINIT | ||
| + | | ZRINIT | ||
| + | | ZSINIT | ||
| + | | ZACK | 0x03 | Y | ||
| + | | ZFILE | 0x04 | Y | ||
| + | | ZSKIP | 0x05 | - | ||
| + | | ZNAK | 0x06 | Y | ||
| + | | ZABORT | ||
| + | | ZFIN | 0x08 | Y | ||
| + | | ZRPOS | 0x09 | - | ||
| + | | ZDATA | 0x0A | Y | ||
| + | | ZEOF | 0x0B | Y | ||
| + | | ZFERROR | ||
| + | | ZCRC | 0x0D | Y | ||
| + | | ZFREECNT | 0x11 | Y | ||
| + | |||
| + | **Frame Info**: Up to 15 bytes (but typically 4) of frame type-specific information.\\ | ||
| + | Note that later claims of //16// bytes of possible frame header data include the //Frame Type// byte. | ||
| **Frame Header Integrity**: | **Frame Header Integrity**: | ||
| Line 95: | Line 126: | ||
| ==== Data Subpacket ==== | ==== Data Subpacket ==== | ||
| < | < | ||
| - | |||
| - | Data Subpackets may contain up to 1024 bytes of //data// (special octet values are transposed and escaped with //ZLDE//). | ||
| **ZDLE** is the ZMODEM Data-link-escape character ('' | **ZDLE** is the ZMODEM Data-link-escape character ('' | ||
| + | |||
| + | === Data Subpacket Length === | ||
| + | |||
| + | * Data Subpackets may contain up to **1024** bytes of //data// (special octet values are transposed and escaped with //ZDLE//) | ||
| + | * The Data Subpacket Length is also sometimes referred to as the transmit "block size" | ||
| + | * The Data Subpacket Length can be dynamically adjusted by the sender during the transfer of a file, e.g. in response to errors reported by the receiver | ||
| + | * Some ZMODEM implementations (e.g. " | ||
| === Data Subpacket Types === | === Data Subpacket Types === | ||
| The Data Subpacket Type is encoded in a single byte. | The Data Subpacket Type is encoded in a single byte. | ||
| - | ^ Type ^ ZACK/ZRPOS expected ^ End-of-Frame ^ Meaning ^ | + | ^ Type ^ ZACK/ZRPOS expected ^ End-of-Frame ^ Meaning |
| - | | ZCRCW | Yes (synchronous) | + | | ZCRCW | Yes (synchronous) |
| - | | ZCRCE | Only errors | + | | ZCRCE | Only errors |
| - | | ZCRCQ | Yes (asynchronous) | + | | ZCRCQ | Yes (asynchronous) |
| - | | ZCRCG | Only errors | + | | ZCRCG | Only errors |
| === Data Subpacket Integrity === | === Data Subpacket Integrity === | ||
| Line 649: | Line 685: | ||
| The pathname (conventionally, | The pathname (conventionally, | ||
| null terminated ASCII string. | null terminated ASCII string. | ||
| - | No spaces are included in the pathname. | + | No spaces are included in the pathname. |
| Filename Considerations | Filename Considerations | ||