This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ljmp syntax question
- From: "Smith, Stephen \(SWCOE\)" <Stephen dot Smith at honeywell dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Wed, 21 Mar 2007 13:18:09 -0700
- Subject: ljmp syntax question
- References: <D54AC102-676C-46C4-A2E6-82FA54BC8B75@monami-software.com> <45D2D66A.8090605@redhat.com> <22E7A5AF-8D62-427A-9CBE-8E1E406FA9B3@monami-software.com> <45D33D6A.70808@redhat.com> <DD1844E2-79FB-4D10-930C-8E9A244CB084@monami-software.com> <45D47C48.1040404@redhat.com> <EF244E26469B2C42B2B72AC465843D6B048130A4@AZ18EV808.global.ds.honeywell.com>
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?