Arduino: why does Serial.println(int, HEX) display 4 bytes?
The Arduino print / println function casts the int to a long, which is 4 bytes long for Arduinos. See here:  https://github.com/arduino/Arduino/blob/master/hardware/arduino/cores/arduino/Print.cpp
To have more control over printing check out the C++ sprintf function. For example,
int x = 0x9876;
char buf[9];
sprintf(buf, &quot;%04x&quot;, x);
Serial.println(buf);

Will print it out correctly.
sprintf - http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/
format string reference - http://www.cplusplus.com/reference/clibrary/cstdio/printf/
Some implementations of the Print class, include printf (Like Adafruit's, see here). In that case, you just do Serial.printf(&quot;%04X&quot;, x).