This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simulator issue with printf?

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);
    }
}

Parents
  • 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!

Reply
  • 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!

Children
  • 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.

  • 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.

  • 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?

    "the joker-poster" just might understand that to get a diploma you need to do some work and his friend may learn that to get a diploma your code needs to work.

    While the likelyhood of sucn an event may be small, it is still worth the effort.

    Is this a forum about Keil yes it is and part of what it requires to use Keil (study, work) has been discussed in detail above.

    jerk forum? absolutely not, however, if someone seeking advice consider "you must do some work" as coming from a jerk, that is not the "jerk"s problem.

    erik

  • Check in other threads.

    Reasonable questions are always answered with reasonable answers.

    However, people comming with unreasonable requests - or as in this case ordering us to supply turn-key solutions to school work - will have to settle for answers about methodology.

    No, I do not *feel* smart about myself, talking about encoding or decoding BCD numbers just as I'm not *feeling* smart about being able tie my shoe laces either.

    I know that the net is full of trolls and intentionally irritating people. However, I have no good means to separate trolls from people actually wanting help. As long as a thread doesn't diverge into a constant series of invectives, I always try to suggest a suitable next step for solving a problem. If it's a troll, then the step isn't needed. If it's a fool, the step may be ignored. Now and then, the suggesition may be picked up and acted upton.

    In the end, I don't care too much if a suggestion is acted upon or not. People who want advice will get it. People who want to ignore advice are free to ignore them. That is life.

  • The Circle Jerks are a hardcore punk band formed circa 1979 in Hermosa Beach, California.

    I can not even imagine that you refer to the other definition.

    Now, for something even more interesting, please provide a link to anywhere YOU have actually provided help to anyone in this forum. If you see no reason to provide help, you have no right to criticize the help given whether you like it or not. That you decide to hide behind the name of a clothing company i.e. make jerking anonymous really show how much a man you are.

    Erik

  • Author
    Per Westermark

    I like this guy.

  • I like this guy.

    then why do you call him a moron? to feel related to him?

    Erik

  • Do you mean like how your mom and dad are related...?

  • related as in similar.Your question proves you are a moron. Get your head out of the gutter .... naah keep it there and stop throwing your trash here.

    If you think this it the last time I reply to your insane babbles you are right.

    Erik

    PS To Per: I hope my post that this moron misunderstood, was clear enough that you, who have sense, could see that nothing was directed towards you.