ljmp syntax question

Smith, Stephen (SWCOE) Stephen.Smith@honeywell.com
Wed Mar 21 20:53:00 GMT 2007


No I am not getting that error message.  My code is just ending up at
the wrong offset (I am using BOCHS to single step through it).  It
assembles just fine.

sps

-----Original Message-----
From: H. J. Lu [mailto:hjl@lucon.org] 
Sent: Wednesday, March 21, 2007 1:34 PM
To: Smith, Stephen (SWCOE)
Cc: binutils@sources.redhat.com
Subject: Re: ljmp syntax question

On Wed, Mar 21, 2007 at 01:18:09PM -0700, Smith, Stephen (SWCOE) wrote:
> I am writing a BIOS and my code is at $0xF000:$0000 (real mode x86) .
> 
> I set up my GDT and switch into protected mode and now do the
following:
> 
>     /* PROT_MODE_CSEG = 0x8, protcseg=0xFFFF0028 */
>     ljmp     $PROT_MODE_CSEG, $protcseg  
>     .code32
> protcseg:
>      movw     $PROT_MODE_DSEG, %ax
> 
> When I reach protcseg, CS=0x8, and eip=0x28 which is off by about
> 0xFFFF0000.   How should I have coded the long jump?

Are you running into this

http://sources.redhat.com/bugzilla/show_bug.cgi?id=3958


H.J.



More information about the Binutils mailing list