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?
It takes no longer to type politely than to shout.
You want this for free - the least you can do is to ask nicely!
If you won't do that, I won't reply.
"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.
I HAVE GOT 2 HOURS LEFT TO DO THIS
DOES ANYONE KNOW THE ANSWER?
I TRY GOOGLE AND MICROSOFT BUT CANNOT FIND ANY CODE THAT WORKS
He does not know what BCD is, he insist on shouting, he wants to get a diploma.
I hope anyone trying to 'help' him will end up sitting at the desk next to his when he 'get' his diploma and get hired.
I, am perfectly willing, as we all should be, to help anyone trying to get through school, but 'helping' someone get thought school without having even an inkling of understanding of the subject is very counterproductive.
I, once, was given (by a HR that did not believe in engineers interviewing candidates) an assistant that as the first thing he did put up his freshly minted PhD diploma on his office wall. I gave him a piece of code to look at (saying this is the style we use here) and his first question (1/2 hour later) was "does db mean 'double byte'". The 'ad' for the job specified, among other things, "fluent in '51 assembler" and HR assured me that he was (they read what his diploma supposedly ment).
Erik
"DOES ANYONE KNOW THE ANSWER?"
Yes, I'm pretty sure we all do. Microsoft probably isn't the place to search. Have you actually typed the three characters 'B', 'C', and 'D' into Google's search text entry box?
"I TRY GOOGLE AND MICROSOFT BUT CANNOT FIND ANY CODE THAT WORKS"
Hmmm ...
Not sure about Google code, but I have sometimes found myself wondering if Microsoft code works!
Oh yes ... a hint to the screamer
I think you mean packed BCD - Try a search for that!
"I HAVE GOT 2 HOURS LEFT TO DO THIS"
A pity -- time is running out. But look at it this way, after time has run out and you fail, you'll have time to reflect on this experience, reread posts, and realize "If I hadn't solicited all those wasted replies simply on the topic of SHOUTING, I might have gotten a legitimate reply on my topic exactly or have been given guidance on how to use Google to effectively search for solutions to my problem. Dang it, I only I had listened and acted accordingly..."
Erik,
I know this is nothing to do with the screamers problem but as I read your text it reminded me of a situation that used to exist at our place.
To be a member of development, you had to hold a degree - The subject of that degree didn't matter - Just that you had a degree.
So ... We ended up with one guy who had a degree in journalism writing 8051 assembler.
The text in the files may have been succinct and well formed - But the code was not!
I SEARCH FOR PACKED BCD BUT GOT NO WORKING CODE
HELP NOW PLEASE?
"HELP NOW PLEASE?"
Sorry - No can do!
You are not expected to find working code!
You are expected to find some very good explanations of what packed BCD is.
After spending 10-20 minutes reading about packed BCD (the explanations really are good, and I have already mentioned a good search string for Google), it should then be trivial to write your own code to do the exercise.
I know that the above suggestion isn't popular. It has the very bad side effect that you may actually learn something. I clearly understand that this can be traumatic for you.
LOL
Stop reading and repsonding to the joker-poster already. Some of you say how busy you are, yet have no problem posting something to make you *feel* smart about yourself.
Is this a forum about Keil, or your own personal circle jerk forum?
Close and lock the thread.
"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...?