私はMacでいくつかのx86アセンブリプログラミングを試してみたいと思っていますが、実行可能ファイルの作成には問題があります。問題はリンク段階にあるようです。Hello WorldでMacでx86アセンブラを使用する0SX
helloWorld.s:
.data
HelloWorldString:
.ascii "Hello World\n"
.text
.globl _start
_start:
# load all the arguments for write()
movl $4, %eax
movl $1, %ebx
movl $HelloWorldString, %ecx
movl $12, %edx
# raises software interrupt to call write()
int $0x80
# call exit()
movl $1, %eax
movl $0, %ebx
int $0x80
は、プログラムを組み立て:
as -o helloWorld.o helloWorld.s
リンクオブジェクトファイル:
ld -o helloWorld helloWorld.o
私はこの時点で取得するエラーは次のとおりです。
ld: could not find entry point "start" (perhaps missing crt1.o) for inferred architecture x86_64
私が間違っている/紛失していることに関する助言は非常に役に立ちます。ありがとう
のための実用的なソリューションである私は、私は少し遅れだけど、あなたはstart' 'に' _start'を変更する必要があります。 – sidyll