1. 汇编
#hello.s
.section .data,
.section .text,
.globl _start
_start:
movl $1, %eax
movl $4, %ebx
int $0x80
as hello.s -o hello.o -arch i386
ld hello.o -e _start -o hello
echo $?
总算是能编译通过了, 就是echo的值等于188,跟预期结果不一样(4).
2. 编译
g++ main.m -framework foundation