Skip to contentSkip to conversation

i386: far jumps

DISCUSSION Emanuele Altieri 2 participants 3 messages Jul 16, 2002 – Jul 22, 2002

lore
Share & tools
lore
#0 lore raw

Greetings,

I'm doing some experiments with far jumps to different code segments. For example:

ljmp $16, $hello

where $16 is the segment selector, and "hello" is a label that I set up for testing. The code above works fine.

However, when I change the code as following:

movw $16, %dx
movw %dx, %fs
ljmp *%fs:hello

I get a general protection error. I don't understand why. I believe it's a notation error. Can anybody see it?

I'm interested in this because I need the segment argument of ljmp to be variable.

Thanks!

-Emanuele

#1 lore raw
Quoted 11 lines · On 15 Jul 2002 22:21:26 -0400 Emanuele Altieri <[email protected]> wrote:

Greetings,

I'm doing some experiments with far jumps to different code segments. For example:

ljmp *%fs:hello

I get a general protection error. I don't understand why. I believe it's a notation error. Can anybody see it?

I'm interested in this because I need the segment argument of ljmp to be

Linux?

Signature · 6 lines
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
NO abusive software patents http://petition.eurolinux.org/pr/pr17.html
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 8 lines · h-peter recktenwald
Quoted 5 lines · On 15 Jul 2002 22:21:26 -0400 Emanuele Altieri <[email protected]> wrote:

Greetings,

I'm doing some experiments with far jumps to different code segments. For example:

Quoted 8 lines
Quoted 6 lines

ljmp *%fs:hello

I get a general protection error. I don't understand why. I believe it's a notation error. Can anybody see it?

I'm interested in this because I need the segment argument of ljmp to be

Linux?

No (/ not yet). I'm just experimenting on Intel's segmentation and task support with a small OS that I created for this purpose. I'm using GCC and GAS to implement it.

By the way, I found a workaround to the ljmp problem:

pushw <segment>
pushl <offset>
lret

For example

    pushw $16
    pushl $hello
    lret

This is equivalent to "ljmp $16, $hello", but now the segment and offset arguments do not need to be constants.

-Emanuele