linux - leave instruction returns a seg fault -


I have a regular caller who regularly calls, where the value in the ebp register is expected I change it several times in routine. So, I can not: mov ebp, esp at the top of the code. I tried to save the esp address to another and before that leave instructions this address was placed in ebp but now I There is also a sectional mistake

How can this be decided?

The code is too big (to post here, but I can post if needed), but this idea is something like this:

 ; Several arguments are passed in Stack Foo: X-ray ebayx, ebx mnx xx, ASP loop 0: all adx, 1gje and; Etc. MOV EX, [ESP + EBX] MOE EBP, EX Call RTINET etc.; ..; ... mov ebp, edx call printx add ebx, 4 jmp loop 0 end: mov ebp, ecx leave ret   

I hope this code is enough for you to consider this .. Also like an explanation.

what leave is:

  MOV esp, ebp pop ebp   

If you want to use it and want to work it out, you can

  EBP Move EBP, ECX Lodge Press   

at the end of your function. Of course, if you do this, you can use leave completely:

  mov esp, ecx ret   

Using ecx as your frame indicator.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -