int main(int argc, char* argv[])
{
return 0;
}
what's the shortest assembly example to do the same that can be compiled into an executable by gcc?
I came across this example but there're too many tags like hi_temp:,.data
etc,what's the minimal version?
.text
.align 4
.globl main
main:
pushl %ebp
movl %esp,%ebp
xorl %eax,%eax
leave
ret
To compile and run:
$ gcc -m32 asm.S
$ ./a.out
.text
.globl main
main:
xorl %eax,%eax ;return 0
ret
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With