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

how to save 2byte code address to stack manually

Hello,
I have a function void myfunc(int){...}
I want to place the address of this function on the stack, so that later I can use RET to pop the address back.
May I know how to do this in C code?
Regards,
KC

Parents
  • I want to save the 3byte "VoidPointer" into the stack space, which is pointed to by stackPointer

    WHY, explain IN DETAIL?

    There are many ways to do what you are talking about and "saving on the stack may not be the right thing. Most cases this is an automatic compilr function, but if you are doing some fancy compiler/assmbler mix, maybe you need do something unique. Again, without knowing why - no answer.

    Erik

Reply
  • I want to save the 3byte "VoidPointer" into the stack space, which is pointed to by stackPointer

    WHY, explain IN DETAIL?

    There are many ways to do what you are talking about and "saving on the stack may not be the right thing. Most cases this is an automatic compilr function, but if you are doing some fancy compiler/assmbler mix, maybe you need do something unique. Again, without knowing why - no answer.

    Erik

Children
No data