From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20542 invoked by alias); 29 Aug 2002 21:51:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 20531 invoked from network); 29 Aug 2002 21:51:29 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 29 Aug 2002 21:51:29 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17kY8c-0006jB-00; Thu, 29 Aug 2002 17:51:42 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17kXDU-0006XO-00; Thu, 29 Aug 2002 17:52:40 -0400 Date: Thu, 29 Aug 2002 14:52:00 -0000 From: Daniel Jacobowitz To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [rfc] 16 bit real-mode for the i386 Message-ID: <20020829215240.GB24578@nevyn.them.org> Mail-Followup-To: Kevin Buettner , gdb-patches@sources.redhat.com References: <3D6E8453.5080306@ges.redhat.com> <20020829213653.GA24048@nevyn.them.org> <1020829214304.ZM24768@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1020829214304.ZM24768@localhost.localdomain> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-08/txt/msg01007.txt.bz2 On Thu, Aug 29, 2002 at 02:43:04PM -0700, Kevin Buettner wrote: > On Aug 29, 5:36pm, Daniel Jacobowitz wrote: > > > Now, my i386 knowledge is a bit rusty. But: > > > > > +static CORE_ADDR > > > +i386_read_pc (ptid_t ptid) > > > +{ > > > + CORE_ADDR pc = read_register_pid (PC_REGNUM, ptid); > > > + if (i386_real_mode_p) > > > + { > > > + CORE_ADDR cs = read_register_pid (CS_REGNUM, ptid); > > > + pc = pc + (cs << 4); > > > + } > > > + return pc; > > > +} > > > + > > > +static void > > > +i386_write_pc (CORE_ADDR pc, ptid_t ptid) > > > +{ > > > + if (i386_real_mode_p) > > > + { > > > + CORE_ADDR cs = read_register_pid (CS_REGNUM, ptid); > > > + pc = pc - (cs << 4); > > > + } > > > + write_register_pid (PC_REGNUM, pc, ptid); > > > +} > > > + > > > > Left shift of _four_? Surely the PC is more than four bits. > > I think that's right. My (hazy) recollection from my days of programming > x86 before there was an 80386 is that an address was formed by shifting > the segment registers left by four bits and adding some other sixteen bit > register to it. That's positively perverse. Thanks. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer