Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 May 2000 23:34:44 -0600
From:      Wes Peters <wes@softweyr.com>
To:        "G. Adam Stanislav" <adam@whizkidtech.net>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: APJ Article
Message-ID:  <3913AEF4.4CDA1097@softweyr.com>
References:  <20000505160736.A228@whizkidtech.net>

next in thread | previous in thread | raw e-mail | index | archive | help
"G. Adam Stanislav" wrote:
> 
> As a die-hard assembly language programmer, I was very pleased when recently
> someone posted a link to his Hello, World assembly language code here.
> 
> I played with his code a bit, then wrote a very simple filter in assembly
> language. I then converted it to an article on System Calls in FreeBSD,
> and submitted it to Assembly Programming Journal, which is a bi-monthly
> on-line magazine.
> 
> If anyone is interested, the text of the article (includes the code for
> the filter) is at http://www.whizkidtech.net/syscall.txt
> 
> I pose a question in it (where can an assembly language program find its
> command line): If anyone knows the answer, I'd love to hear it!

The simplest way is to write an _main function in assembler, linking
it with the C runtime startup, and get argc, argv in the traditional
manner.

The other route would be to peruse the sources in /usr/src/lib/csu and
see how the C runtime functions go about building the argument list
for main.

-- 
            "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                         Softweyr LLC
wes@softweyr.com                                           http://softweyr.com/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3913AEF4.4CDA1097>