Push/Pop segmentation fault at Assembly x86

后端 未结 3 1019
小鲜肉
小鲜肉 2020-12-22 05:00

I\'m using elf64 to compile my assembly x86 code: I\'ve this sub-routine:

printNumber:
    mov EAX, EDX ; EDX contain some value like \"35\"         


        
3条回答
  •  星月不相逢
    2020-12-22 06:04

    Shouldn't that be "PUSH EDX" instead of "PUSH RDX"? Or perhaps a PUSH dword ptr 0/PUSH EDX combo if you really need to push 64-bits? Wondering if maybe it ends up being unaligned and doesn't like it? Prior x86 modes don't care about alignment, but perhaps it does for x64 instructions?

提交回复
热议问题