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

Need to print out the register contents

I have studied the MCS-51 Instruction set (8051 instruction set summary) but I do not see how to print out the registers' contents.
Can't find anything about this in the Help either. Help!!!

Parents Reply Children
  • Jim,

    As someone who's been on the fired-at end of their remarks sometimes, I think I understand. For instance, in this case, what they're trying to avoid is answering Alice's question about how to print out the register contents only to deal the very next day with something like "Why don't the registers have the data I expect?"

  • "Why is it that the "experts" on this forum always fire back some smart-assed "why do you want to do that?" reply"

    Because very often, the question as asked makes no sense!

    In such cases, it is very often better to take a step back and ask what is actually trying to be achieved, rather than just try to debug a "solution" to an unknown problem!

    It is also common that the "solution" itself is flawed - and is the source the questioner's difficulties.

  • Ok Alice, let us use a parable:
    You say "my car makes a pinging noise"
    we reply "which make and model"
    you answer "none of your business"
    we reply "cant help you"
    you say "snobby mechanics"

    Got it?

    Erik

  • "Why is it that the "experts" on this forum always fire back some smart-assed "why do you want to do that?" reply to a honest question instead of keeping quiet when they don't have an answer?"

    If you 'phone your doctor and ask "How do I remove one of my kidneys", what would you expect his answer to be?

    1) With a knife.
    2) Why do you want to do that?

    or should he just keep quiet?

  • Like the little red hen, I answered my own question with an assembly routine. Since I knew from the disassembly listing that I hadn't lost any register contents I was interested in but R7, it was a simple thing to do.
    Other than Jim Smith, your mothers should be ashamed of you. Majoring in ridicule rather than "How do I get this done?", finding reasons NOT to answer the question that you didn't know the answer to, being a smartass....none of that is professional behavior. And I hope, other than Jim Smith, that none of you have to deal with customers, for your company's sake.

  • answer the question that you didn't know the answer to
    You have totally not grasped what this is about.

    It is NOT that we do not know the answer to your question, it is that we know too many answers. In order to give the answer applicable to your situation,we needed more info.

    Ok go to your corner and stamp your little feet, evidently you have no interest in participating in finding the best solution to your problem, just "give me an answer or I'll get mad".

    Erik

  • Alice,

    Was there something about my three-line solution in the other thread on this topic that didn't work as you expected? I gave you the code and then asked some legitimate questions. IF that code didn't work as you expected, it may give you some inkling as to why we're asking for more information. If it did work, then I'm not sure why you needed an assembly routine, or why I'm more worthy of your ire than Mr. Smith.

  • The Long answer

    8051 registors are mapped to memory locations.
    if you know wich bank you have you can just print thoose 8 bytes of RAM. (bank 0 the first 8, bank 1 the next 8, ect.) not useing any registers to do so. OR
    you can mov the registors one by one (in asm) to you print routine that does not use any registers.
    C makes heavy use of the registers so it can not be used to print them.

  • Isn't it strange:

    A first time poster appears on the forum, asks a question that demonstrates a fundamental lack of knowledge then gets upset when asked for more information.

    Then, up pops another first time poster with a supporting attack on those who have been trying to help.

    Alice Brown? Jim Smith? One and the same, I'd say.

  • "I hope, other than Jim Smith, that none of you have to deal with customers, for your company's sake."

    Big difference here: a customer would be paying!!

  • "I hope, other than Jim Smith, that none of you have to deal with customers, for your company's sake."

    Big difference here: a customer would be paying!!


    And be told that unanswered questions will raise the bill (OK if you have no answer and we need to guess and guess wrong, it will cost you)

    So we have paying people that answer questions and non-paying that refuse.

    "And I say to myself ... what a wonderful world" (hear the Louis Armstrong rendition in your head)

    Erik

  • Why is it that the "experts" on this forum always fire back some smart-assed "why do you want to do that?" reply to a honest question instead of keeping quiet when they don't have an answer?
    Because very often problem is not what the question indicates.

    Take your post for instance.
    You want to print "register content". In C that is totally irrelevant and thus
    a) you use assembler which you do not say
    or
    b) by register you mean something else than what we understand by that word.

    Erik