The structure in memory looks like this:
| 00 | 00 | 01 | .. | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| bs | relleno ... | operacion | bp | car_ascii |
And you are saving the following values:
| 00 | 00 | 01 | .. | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| bs | relleno ... | operacion | bp | car_ascii |
| 0 | 0 | 0 | .. | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
And if we group them in hexadecimal ...
| 00 | 00 | 01 | .. | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| bs | relleno ... | operacion | bp | car_ascii |
| 0 | 0 | 0 | .. | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
| 0 ... | 1 | E | C | 3 |
Where does each value come from?
- operation:
0x1e
is, in binary: 0001 1110
. As the field where the value is stored occupies 5 bits, the 3 with the highest weight are discarded, remaining 1 1110
- parity bit:
1
. There is not much to explain
- car_ascii:
C
, which is translated to the number (see ASCII table) 43
in hexadecimal or, in binary, 0100 0011
. Since the field occupies 7 bits, the highest weight bit must be discarded.
This is assuming a big endian machine. In a little endian machine, the grouping of bits will be altered and the result displayed on the screen will vary.