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

Stack of instructions application_part2

Hi Everyone
Maybe previous a question to application external memory has confused, let me repost sample question about stack of instructions.

The assembler code is push register R0,R1 onto stack and pop register R0,R1from stack. So how to write a C51 program like this function or have any instructions?

PUSH 0 ; register R0
PUSH 1 ; register R1
.
.
.
.
POP 1 ; register R0
POP 0 ; register R1

Parents Reply Children
  • Hi Erik

    I am not directly push and pop register, it's contents.
    I want to know that have any instructions of C51 like it or create and use a write to store data at same function?

    For explam:

    MOV R0,#00 ;1 line
    CALL aa
    ;-----------
    aa:
    PUSH 0
    Mov R0,#ff ;2 line
    .
    .
    POP R0
    RET
    ;-----------

    I want to keep 1 line register(R0) of content
    when excuted 2 line progeame.

  • I want to know that have any instructions of C51 like it or create and use a write to store data at same function?

    The problem with this question which we've all been trying to point out to you is that it's the wrong question to ask yourself. The answer, once you knew it, would not help you in any noticeable way. It'd only make the confusion that's already in your mind worse.

    What you're trying to do here doesn't need to be done by you. The C compiler takes care of all these details for you --- that's exactly its job. Don't mess with it.