Questo è il mio codice livello di assieme ...Che cos'è _start globale nel linguaggio assembly?
section .text
global _start
_start: mov eax, 4
mov ebx, 1
mov ecx, mesg
mov edx, size
int 0x80
exit: mov eax, 1
int 0x80
section .data
mesg db 'KingKong',0xa
size equ $-mesg
uscita:
[email protected]:~/Arena# nasm -f elf a.asm -o a.o
[email protected]:~/Arena# ld -o out a.o
[email protected]:~/Arena# ./out
KingKong
La mia domanda è Qual è la _start globale utilizzato per? Ho provato la fortuna con Mr.Google e ho scoperto che è usato per dire il punto di partenza del mio programma. Perchè non ci resta che il _start
dire dove si avvia il programma come quello indicato di seguito che produce un avvertimento pò sullo schermo
section .text
_start: mov eax, 4
mov ebx, 1
mov ecx, mesg
mov edx, size
int 0x80
exit: mov eax, 1
int 0x80
section .data
mesg db 'KingKong',0xa
size equ $-mesg
[email protected]:~/Arena# nasm -f elf a.asm
[email protected]:~/Arena# ld -e _start -o out a.o
ld: warning: cannot find entry symbol _start; defaulting to 0000000008048080
[email protected]:~/Arena# ld -o out a.o
ld: warning: cannot find entry symbol _start; defaulting to 0000000008048080
possibile duplicato di ["global main" in Assembly] (http://stackoverflow.com/questions/17882936/global-main-in-assembly) –