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

accessing registers

how can i obtain the current values of registers like accumulator,B,stack pointer,PSW,DPTR,etc in C??
i am currently working on a trainer/development kit for 8051..One of the commands to be executed is R<CR> Once this command is executed,the values of all the registers like A,B,SP,PSW,DPH,DPL,R0,R1,R7 should be displayed on screen...how do i retrieve these register values in C?

Parents
  • something like x=ACC should work.

    Simply by expressing that belief, you've just demonstrated how haven't got one bit closer to understanding what the real problem is than when you started this thread.

    No, that will not "work", for any meaningful interpretation of that word. Sure, you'll get what was in the accumulator as you executed that instruction --- but that will rather certainly not be what you actually wanted to get.

    You're on the wrong path, and people have been telling you that --- yet instead of turning back or at least slowing down, you're accelerating. Do you really think that's a sensible use of anyone's time?

Reply
  • something like x=ACC should work.

    Simply by expressing that belief, you've just demonstrated how haven't got one bit closer to understanding what the real problem is than when you started this thread.

    No, that will not "work", for any meaningful interpretation of that word. Sure, you'll get what was in the accumulator as you executed that instruction --- but that will rather certainly not be what you actually wanted to get.

    You're on the wrong path, and people have been telling you that --- yet instead of turning back or at least slowing down, you're accelerating. Do you really think that's a sensible use of anyone's time?

Children