First of all, if the value always matches 0xFF0 then the "lower 12 bits" are that value, not the lower 3.
As for why this happens, you're reading a variable that you haven't initialized. That's undefined behavior, and anything could have happened when you tried to do this, from a crash to a pizza getting delivered.
But what actually happens is this: the location that x references has some data that it held previously. Chances are that on your setup, that variable happens to contain data whose lower twelve bits are 0xFF0; in which case it's most likely data associated a previous system call, during processing work done by the system before your main
is called.
To make a long story short: initialize your variables before using them and don't ask why the uninitialized ones have the value they do.