From owner-freebsd-hackers Fri May 5 22:33:36 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from obie.softweyr.com (obie.softweyr.com [204.68.178.33]) by hub.freebsd.org (Postfix) with ESMTP id BDC8E37BABC for ; Fri, 5 May 2000 22:33:31 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from softweyr.com (Foolstrustident!@homer.softweyr.com [204.68.178.39]) by obie.softweyr.com (8.8.8/8.8.8) with ESMTP id XAA09977; Fri, 5 May 2000 23:33:27 -0600 (MDT) (envelope-from wes@softweyr.com) Message-ID: <3913AEF4.4CDA1097@softweyr.com> Date: Fri, 05 May 2000 23:34:44 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 4.0-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: "G. Adam Stanislav" Cc: hackers@FreeBSD.ORG Subject: Re: APJ Article References: <20000505160736.A228@whizkidtech.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "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