From owner-freebsd-hackers Mon Sep 21 13:00:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA22682 for freebsd-hackers-outgoing; Mon, 21 Sep 1998 13:00:39 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ceia.nordier.com (m1-24-dbn.dial-up.net [196.34.155.24]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA22659 for ; Mon, 21 Sep 1998 13:00:29 -0700 (PDT) (envelope-from rnordier@nordier.com) Received: (from rnordier@localhost) by ceia.nordier.com (8.8.7/8.6.12) id VAA01318; Mon, 21 Sep 1998 21:52:27 +0200 (SAT) From: Robert Nordier Message-Id: <199809211952.VAA01318@ceia.nordier.com> Subject: Re: PC memory usage (what is PIC?) In-Reply-To: from Charles Youse at "Sep 21, 98 09:18:06 am" To: cyouse@artemis.syncom.net (Charles Youse) Date: Mon, 21 Sep 1998 21:51:18 +0200 (SAT) Cc: rnordier@nordier.com, bf20761@binghamton.edu, freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Charles Youse wrote: > > Writing truly IP-independent i386 assembly code by hand (and the initial > > portion is pure assembly code), requires completely unnatural practices. > > Actually, I'm not even sure that it's possible. i86-derived architectures > have relied on segmentation to provide such position independence. Well, maybe "not possible" is rather strong, though I'd go along with "not particularly idiomatic": main: call .+0x5 popl %ebp subl $0x5,%ebp pushl $msg.1-msg leal msg-main(%ebp),%eax pushl %eax pushl $0x1 movl $0x4,%eax call .+0x5 lcall $0x7,$0x0 pushl $0x0 movl $0x1,%eax call .+0x5 lcall $0x7,$0x0 msg: .ascii "hello, world!\n" msg.1: -- Robert Nordier To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message