What is the x86 “ret” instruction equivalent to?

前端 未结 5 1950
独厮守ぢ
独厮守ぢ 2020-12-08 16:27

Say I\'m writing a routine in x86 assembly, like, \"add\" which adds two numbers passed as arguments.

For the most part this is a very simple method:



        
5条回答
  •  孤街浪徒
    2020-12-08 17:01

    Haven't tested, but you may be able to do a ret without using a GPR like this:

    add esp,4
    jmp dword ptr [esp-4]
    

提交回复
热议问题