I am new to ARM world. In the ARM Cortex-A series : Programmer's guide (page 71), there is an example for BIC instruction :
BIC R0, R0, #0x800
As per the text, this basically clears the bit 11 in R0. I understand that the BIC works like R0 = R0 & (~val) here (please correct me). But what I don't understand here is that how #0x800 was taken as-is and gets translated to 1000 0000 0000 literally. Instead, it should have been split into 4-bit:8-bit part as per immediate encoding rules.
And as per my understanding of ARM encoding for constants:
0x800 = 0000 1000 0000 0000
Out of these bits, we consider only last 12 bits for encoding and out of these 12 bits - first 4 bits decide the right-rotation in steps of 2 and the last 8 bits is the number right-rotated (considering it as 32bit). So in this case, since last 8 bits are all zeros, I should have got FFFF 0000 after 2*8 right-rotations.
And for the complete BIC instruction above, it should have then treated as :
R0 = R0 & (0000 FFFF)
I know I am wrong somewhere. Can someone please correct me.