Ich versuche, in einige X86 Assembly-Programmierung auf meinem Mac zu tauchen, habe aber Probleme beim Erstellen einer ausführbaren Datei. Das Problem scheint in der Verknüpfungsphase zu liegen.Hallo Welt mit x86 Assembler auf Mac 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
das Programm zusammenbauen:
as -o helloWorld.o helloWorld.s
Verknüpfen Sie die Objektdatei:
ld -o helloWorld helloWorld.o
Der Fehler, den ich an dieser Stelle zu bekommen ist:
ld: could not find entry point "start" (perhaps missing crt1.o) for inferred architecture x86_64
Jeder Ratschlag, was ich falsch mache/vermisse, wäre sehr hilfreich. Danke
Ich weiß, ich bin ein bisschen spät, aber Sie müssen '_start' zu' Starten' ändern. – sidyll