The MASM Forum

General => The Campus => Topic started by: Jokovich on December 24, 2020, 12:37:53 AM

Title: Assembly program without syscall for Linux
Post by: Jokovich on December 24, 2020, 12:37:53 AM
Hello everyone, this is my first post here.                                                                                                                            192.168.1.1 (https://routerlogin.pro/192-168-1-1)         
Is it possible to write a simple assembly program that does nothing and exits immediately, without calling syscalls in Linux?
Thank.                                                                                                                                                                                                                             
     
Title: Re: Assembly program without syscall for Linux
Post by: mineiro on December 24, 2020, 12:47:40 AM
hello sir Jokovich;
By syscall I'm suppose that you are on linux x86-64.
You can call exit function from C library, but, I suppose that internally that do a syscall to exit.
If you're assembling (main) and linking using C library you can do a simple program that have only "ret" instruction that will work, but again, I suppose that internally a syscall to exit is done.
I was thinking in kill signal, terminate process, and other things that I need learn, but, others members are better than me on linux, wait for other answers.
Title: Re: Assembly program without syscall for Linux
Post by: TouEnMasm on December 24, 2020, 03:27:37 AM
Quote
without calling syscalls in Linux?
Perhaps it's not the best forum to get an answer on linux ?.
Title: Re: Assembly program without syscall for Linux
Post by: mabdelouahab on December 24, 2020, 04:46:49 AM
.code
main proc systemv
xor eax,eax
ret
main endp
end
Title: Re: Assembly program without syscall for Linux
Post by: DebugBSD on December 24, 2020, 07:32:42 AM
Quote from: Jokovich on December 24, 2020, 12:37:53 AM
Hello everyone, this is my first post here.
Is it possible to write a simple assembly program that does nothing and exits immediately, without calling syscalls in Linux?
Thank.

Yes, it's possible, but, unless you're using masm on Linux (which it's not possible at all) or maybe Uasm? you should tell us, which kind of assembler are you using?

masm != nasm != gasm != whatever assembler tool :D
Title: Re: Assembly program without syscall for Linux
Post by: deeR44 on December 28, 2020, 07:14:29 PM
Quoteand exits immediately, without calling syscalls in Linux?
Thank.

I'll bet that you would have more luck with this on a LINUX forum somewhere else.