hello there i have some problem regarding the bit shifting i want to convert the some no. from Hex. to Decimal for that i am going to used the shifting. when i recived the no. in hex format then i want to other reg. ex.when i recive 0x3d then i want to move the 3 to other location(or reg) after doing some calculation now i want move the d.with ACC >>(shifting opration is fine but in which way )please help me
u want to move or 3 and d separately from 0x3d?
It is a single word or value, and , i tink its either hex ie, 0x3 , or decimal, 03d, cant be both right,
3 can be copied but d is just a suffix indicating its decimal, thats all, Is it right?
"It is a single word or value, and , i tink its either hex ie, 0x3 , or decimal, 03d, cant be both right"
No - that is completely wrong!
"0x3D" is the standard 'C' notation for the hexadecimal number "3D" (which is 61 in decimal, and 00111101 in binary).
In this case, 'C' is not case-sensitive - so "0x3D" is equivalent to "0x3d", "0X3D", etc
all this is right but what about shifting
LowNibble = Number & 0x0F; HighNibble = Number >> 4;
When you said, "i think it's fine now", I thought that meant you'd got it!
View all questions in Keil forum