A device serializes binary messages using byte escaping, a reversible replacement of reserved payload bytes with special byte sequences. Every byte below is written in hexadecimal.
The format reserves byte 7E as a message delimiter and byte 7D as an escape marker. Apply these rules to each original payload byte exactly once:
Complete the table with each escaped payload and its byte count. Enter byte sequences as two-digit hexadecimal values separated by single spaces, and counts as exact integers. Do not include message delimiters in either answer.
Unlock full course notes by signing up
Decoding counters from two byte orders
A migration tool reads unsigned 16-bit counters from two instruments. Instrument A stores counters in big-endian order, and instrument B uses little-endian order. Each byte has 8 bits. In the table, bytes are written in hexadecimal, and the first byte shown occurs first in the file. Complete the decoded decimal values using exact integers.
Publishing only complete decoded objects
A configuration decoder must preserve the current configuration if a serialized replacement is invalid. The fixed header contains a version and a payload length whose meaning depends on that version. The decoder's design requires header validation before length interpretation, length checks before allocation, and complete payload validation before publication. Arrange its stages in execution order. Do not publish a partly decoded object.
Auditing a C record decoder
A C decoder receives an unsigned char buffer p containing n bytes. Its first two bytes encode an unsigned 16-bit payload length in big-endian order; the payload follows immediately. Assume 8-bit bytes, an available uint32_t type, and that n and the decoded length L have type size_t. Select every portable and valid claim.