小编AYC*_*CKS的帖子

为什么在移动堆栈指针时出现分段错误?

使用汇编代码,想知道为什么我的subl $ 8,%esp指令出现段错误?

        pushl %ebp
    movl %esp, %ebp

        movl 16(%ebp), %esi
        movl 12(%ebp), %edi
        movl 8(%ebp), %eax
        movl $0, %ebx
        subl $8, %esp
        jmp .LL1

.LL1:
        cmpl %ebx, %esi
        je .LL2
        movl %ebx, 4(%esp)
        movl %eax, (%esp)
        addl $1, %ebx
        jmp .LL1

.LL2:
    popl %ebp
    ret
Run Code Online (Sandbox Code Playgroud)

在subl $ 8上出现segfault,%esp

x86 assembly segmentation-fault att stack-pointer

2
推荐指数
1
解决办法
63
查看次数

标签 统计

assembly ×1

att ×1

segmentation-fault ×1

stack-pointer ×1

x86 ×1