Why does calling 'pop' in this piece of assembly code cause a segmentation fault?
问题 I'm playing around with x86-64 assembly on Mac OS (using NASM 2.09 and 2.13, to catch bugs caused by NASM issues). I'm trying to implement function calls at the moment, and tried using the push and pop instructions, but the pop always seems to cause a segfault: line 10: 41072 Segmentation fault: 11 ./result I've tried adjusting rsp , rbp etc manually, but the pop seems to be the issue. Any help would be appreciated! section .data default rel global start section .text start: mov r12, 4 push