“分段故障:11”装配错误

时间:2011-11-11 14:38:53

标签: assembly x86

section .data
        msg: db 'Hello World di Simona',10  ;the message to write
        len: equ $ - msg                    ;length of the message

section .text
        global _start
        _start:
                mov edx, len                ;save the length
                mov ecx, msg                ;save the message to display
                mov ebx, 1                  ;prepare for the system call
                mov eax, 4
                int 0x80                    ;sytem call

拳头问题:当我使用链接器时,我得到这个警告“-macosx_version_min没有具体,假设为10.7”,我该如何避免它?

第二个问题:在我运行可执行文件之前一切顺利,我收到此错误“Segmentation fault:11” 这是什么意思?这段代码有什么问题?

其他信息:我在Mac OS X下使用nasm,使用英特尔酷睿2双核处理器,今天我已经参加了大会的第一堂课,所以我对这门语言不熟悉。

1 个答案:

答案 0 :(得分:0)

Linux风格的系统调用在Mac OS X上无效,正如user786653所述。

相关问题