From: Daniel Jacobowitz <drow@mvista.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfc] 16 bit real-mode for the i386
Date: Thu, 29 Aug 2002 14:52:00 -0000 [thread overview]
Message-ID: <20020829215240.GB24578@nevyn.them.org> (raw)
In-Reply-To: <1020829214304.ZM24768@localhost.localdomain>
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
next prev parent reply other threads:[~2002-08-29 21:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-29 13:33 Andrew Cagney
2002-08-29 14:37 ` Daniel Jacobowitz
2002-08-29 14:46 ` Andrew Cagney
2002-08-29 14:46 ` Kevin Buettner
2002-08-29 14:52 ` Daniel Jacobowitz [this message]
2002-08-30 12:31 ` Eli Zaretskii
2002-08-29 15:36 ` Mark Kettenis
2002-08-30 12:47 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020829215240.GB24578@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox