Printing a negative value as 32 bits (or 8 nibbles in hex) is an artifact of how the Print object prints a 'char' when you specify a base. There is no "Print::print(char c, int base)" so the 'char' gets promoted to an 'int' (with the requisite sign extension) and the call is made to:
size_t Print::print(int n, int base)
{
return print((long) n, base);
}
When the 'int' is cast to 'long' the sign extension is extended to 32 bits.
If you cast your char to 'unsigned char' (a.k.a. 'byte') before you print it as binary or hex you will get the proper effect.
What they can add to eliminate this confusing artifact is:
size_t Print::print(char c, int base)
{
if (base == 10)
return print((long) c, base);
else
return print((unsigned long) (unsigned char) c, base); // Prevent sign extension for binary and hex
}
and
size_t Print::print(int n, int base)
{
if (base == 10)
return print((long) n, base);
else
return print((unsigned long) (unsigned int) n, base); // Prevent sign extension for binary and hex
}