What is an assembly-level representation of pushl/popl %esp?

前端 未结 1 1771
挽巷
挽巷 2020-12-06 19:08

C++

ATT Assembly

I\'m trying to understand the behavior of the following two instructions:

pushl %esp


        
相关标签:
1条回答
  • 2020-12-06 19:37

    As it says about push esp in Intel® 64 and IA-32 Architectures Developer's Manual: Combined Volumes:

    The PUSH ESP instruction pushes the value of the ESP register as it existed
    before the instruction was executed. If a PUSH instruction uses a memory operand
    in which the ESP register is used for computing the operand address, the address
    of the operand is computed before the ESP register is decremented.
    

    And as regards to pop esp:

    The POP ESP instruction increments the stack pointer (ESP) before data at the old
    top of stack is written into the destination.
    
    0 讨论(0)
提交回复
热议问题