From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18390 invoked by alias); 29 Aug 2002 21:43:15 -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 18383 invoked from network); 29 Aug 2002 21:43:14 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 29 Aug 2002 21:43:14 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g7TLRxl04322 for ; Thu, 29 Aug 2002 17:28:00 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g7TLh7u13415; Thu, 29 Aug 2002 17:43:07 -0400 Received: from romulus.sfbay.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g7TLh6e26766; Thu, 29 Aug 2002 14:43:06 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g7TLh4F24769; Thu, 29 Aug 2002 14:43:04 -0700 Date: Thu, 29 Aug 2002 14:46:00 -0000 From: Kevin Buettner Message-Id: <1020829214304.ZM24768@localhost.localdomain> In-Reply-To: Daniel Jacobowitz "Re: [rfc] 16 bit real-mode for the i386" (Aug 29, 5:36pm) References: <3D6E8453.5080306@ges.redhat.com> <20020829213653.GA24048@nevyn.them.org> To: Daniel Jacobowitz Subject: Re: [rfc] 16 bit real-mode for the i386 Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg01002.txt.bz2 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. Kevin