Reputation: 4366
if I have a port that has only 4 bits, but I am writing 0xFF & 0xF to it. What will happen? Will it truncate the most significant 4 bits or what?
Thanks.
Upvotes: 1
Views: 2387
Reputation: 308392
Yes, that expression (masking with 0x0F) will take the bottom 4 bits from the value. Hopefully your port is connected to the 4 least significant bits of the bus - you'll need to consult the hardware documentation.
Upvotes: 1