linux - How do i start to learn asm (gas)? -
linux - How do i start to learn asm (gas)? -
i found "hello world" , wrote it. nano hello.s
this code
.data msg: .string "hello, world!\n" len = . - msg .text global _start _start: movl $len,%edx movl $msg,%ecx movl $1,%ebx movl $4,%eax int $0x80 movl $0,%ebx movl $1,%eax int $0x80
i've done as -o hello.o hello.s
i've given error
hello.s:6: error: no such instruction: global _start delete global _start.
i've done
ld -s -o hello.o hello* error ld: hello: no such file: no such file or directory
where mistaking?
p/s debian, amd64.
try .globl _start
or .global _start
.
you may seek ununderscored start
in case run problem entry point.
finally, if you're making 64-bit executable, need utilize different scheme phone call interface, not int 0x80
syscall
. more on here.
linux assembly x86-64 gas
Comments
Post a Comment