Eroxl's Notes
Byte Extension

Byte extension describes the process by which bytes are added when a stored values memory size needs to be increased (ie. from a byte to an int). There are two types of byte extension Signed Extension and Zero Extension. Both methods of byte extensions pad the start of the value instead of the end.

Signed Extension

Signed extension extends the bytes, with whatever the sign of the data is, (for example -11, would be padded with 1's and 11 would be padded would 0's). In C signed extension is used for all signed data types.

Example

Zero Extension

Zero extension extends the bytes, with zeroes, no matter what the sign of the data is. In C zero extension is used for all unsigned data types.

Example