From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26504 invoked by alias); 30 Aug 2002 19:10:52 -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 26497 invoked from network); 30 Aug 2002 19:10:51 -0000 Received: from unknown (HELO freya.inter.net.il) (192.114.186.14) by sources.redhat.com with SMTP; 30 Aug 2002 19:10:51 -0000 Received: from Zaretsky ([80.230.2.40]) by freya.inter.net.il (Mirapoint Messaging Server MOS 3.1.0.58-GA) with ESMTP id BSH47668; Fri, 30 Aug 2002 22:09:51 +0300 (IDT) Date: Fri, 30 Aug 2002 12:31:00 -0000 From: "Eli Zaretskii" To: drow@mvista.com Message-Id: <2950-Fri30Aug2002221152+0300-eliz@is.elta.co.il> CC: ac131313@ges.redhat.com, gdb-patches@sources.redhat.com In-reply-to: <20020829213653.GA24048@nevyn.them.org> (message from Daniel Jacobowitz on Thu, 29 Aug 2002 17:36:53 -0400) Subject: Re: [rfc] 16 bit real-mode for the i386 Reply-to: Eli Zaretskii References: <3D6E8453.5080306@ges.redhat.com> <20020829213653.GA24048@nevyn.them.org> X-SW-Source: 2002-08/txt/msg01042.txt.bz2 > Date: Thu, 29 Aug 2002 17:36:53 -0400 > From: Daniel Jacobowitz > > > +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. It's true that PC can be more than 4 bits, but the code above is still correct. That's why real mode can only access 20 bit addresses: 16+4=20. You can look at this issue this way: for each linear 2-bit address, there are many CS:PC combination that all point to that address.