We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
While using the simulator, the values of i in the serial window are shifted by left 8 bits.
#include "stdlib.h" #include "stdio.h" #include "reg51.h" void main (void) { unsigned char i; SCON = 0x50; TMOD |= 0x20; TH1 = 221; TR1 = 1; TI = 1; for (i = 0; i < 8; i++) { printf("%x\n", i); } }
I wonder why the text "what is bcd" is such a good search term to google on. Might it be because it tells exactly what BCD numbers are, and how they are stored, and how to convert back from BCD to either a binary number or a decimal number?
Did you get your code from a friend in the same class?
Are you expecting to send in the same solution?
Do you think your teacher likes to see two identical solutions?
Is your friend spending his time on another forum?
Doesn't it feel good after having really spent some time solving a problem?
"Is your friend spending his time on another forum?"
They're a tag-team. The friend is the one doing the coding since it requires the ability to use lowercase.
LOL
"The friend is the one doing the coding since it requires the ability to use lowercase."
In fact (s)he seems to have an equal and opposite inability to use uppercase!
Presumably, they just press the CAPS LOCK button each time they pass the keyboard over...?