The result of this code is not predictable. The initialization
char hh = 254;
Is not assured to be successful on every platform. char
may not be able to hold 254 (and it is not if your platform uses signed chars and 8 bit characters, a common choice).
Assuming that a char
can hold a value such as 254, this assignment:
eax = hh;
Will expand hh
to the size of an integer by inserting leading zeros. When you later interpret eax
(an integer) as if it were a char (which is really what you're doing with the cast), the result will depend on your machine's endianness: if it's little endian, it will read 254, otherwise, it will read 0.