Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Aug 2017 03:00:42 +0200
From:      cpghost <cpghost@cordula.ws>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD System Calls in Assembly
Message-ID:  <92ddcdcb-5033-73ec-0551-3bc26e5680f2@cordula.ws>
In-Reply-To: <CACAG1gq7LuvJu5LtWCwfM91YcxWrs2u1J9WzuNu7gGmj2%2BGmDg@mail.gmail.com>
References:  <CACAG1gq7LuvJu5LtWCwfM91YcxWrs2u1J9WzuNu7gGmj2%2BGmDg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 07/31/17 21:59, Makketron wrote:
> Hello,
> It seems that the  documentation here doesn't apply for 64-bits.
> 
> https://www.freebsd.org/doc/en/books/developers-handbook/x86.html
> 
> I asked a question on stackoverflow. I thought I should ask it here too
> https://stackoverflow.com/questions/45423987/freebsd-64bits-convention-call-documentation
> 
> I am running FreeBSD 11.0.
> 
> The following from the FreeBSD manual does NOT print the "Hello, World!"
> message:

[snip]

https://farid.hajji.org/en/blog/29-hello-world-in-freebsd-assembly
https://farid.hajji.org/en/blog/32-return-values-of-freebsd-syscalls-in-assembly

Basically, in i386, you pass function values on the stack,
and on amd64 via registers.

The amd64 ABI calling convention, shared by common Unices:

https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI

Just remember that the list of syscalls and therefore the
syscall ID differs across the various Unix variants...

-cpghost.

> Thank you.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?92ddcdcb-5033-73ec-0551-3bc26e5680f2>