16 bits versus 32 bits instructions 
Author Message
 16 bits versus 32 bits instructions

The problem is, When I'm switching to Protected mode and I want to
use a dword offset, I have to put the 66h prefix before it or it will
jump exactly as in real-mode.. does anybody know how to not have to
put the prefix, once in protected mode ?

Real Mode

EA 00 60 00 10 90 90  -> JMP 1000:0600 | NOP | NOP
66 EA 00 60 00 10 90 90 -> JMP 9090:10000600 (That's what I want in pm)

Protected mode (supposed to be the reverse, 66 switch to 16bits offset)
but it produce the same as in real mode..

EA 00 06 00 10 90 90 -> JMP 1000:0600 | NOP | NOP
66 EA 00 60 00 10 90 90 -> JMP 9090:10000600

This isn't the only instruction like that, every instruction that
normally use
16 bits register inside of RM still continue to use 16 bits registers.
The
problem isn't my compiler since I'm writing code directly in hex.

Thanks in advance,



Wed, 02 Aug 2000 03:00:00 GMT  
 16 bits versus 32 bits instructions

Quote:

> The problem is, When I'm switching to Protected mode and I want to
> use a dword offset, I have to put the 66h prefix before it or it will
> jump exactly as in real-mode.. does anybody know how to not have to
> put the prefix, once in protected mode ?

- well, on the jump that sets CS you are sort of forced to use the prefix.
Once CS
is loaded with a PMOIDE segment value the meaning of the prefix depends on
the
segment characteristics.  If CS is loaded with a 32-bit selector (D bit set
in GDT, I believe)
then you will not need the prefix in front of 32-bit instructions.  If you
load CS with
a 16-bit selector, you will need the prefix in front of 32-bit
instructions.

David
---------------------------------------------------------
http://www.geocities.com/Area51/Station/5196/index.html    (home page)
http://www.geocities.com/Area51/Station/5196/treasure.html (computer page)

some people say he's dreaming, but he's not the only one.

 - the beatles



Wed, 02 Aug 2000 03:00:00 GMT  
 16 bits versus 32 bits instructions

Quote:


> > The problem is, When I'm switching to Protected mode and I want to
> > use a dword offset, I have to put the 66h prefix before it or it will
> > jump exactly as in real-mode.. does anybody know how to not have to
> > put the prefix, once in protected mode ?

> - well, on the jump that sets CS you are sort of forced to use the prefix.
> Once CS
> is loaded with a PMOIDE segment value the meaning of the prefix depends on
> the
> segment characteristics.  If CS is loaded with a 32-bit selector (D bit set
> in GDT, I believe)
> then you will not need the prefix in front of 32-bit instructions.  If you
> load CS with
> a 16-bit selector, you will need the prefix in front of 32-bit
> instructions.

Thanks, I found the answer just before your mail but you've got it.  TheD bit
in the segment descriptor wasn't set so the 16 bits register was
as default.  Thank you again!

Quote:
> David
> ---------------------------------------------------------
> http://www.geocities.com/Area51/Station/5196/index.html    (home page)
> http://www.geocities.com/Area51/Station/5196/treasure.html (computer page)


http://www.geocities.com/ResearchTriangle/Lab/1063/


Thu, 03 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 16 bits versus 32 bits instructions

2. String Instructions 16 bits or 32 bits ???

3. 16 bits vs 32 bits apps

4. 16 bits Version faster than 32 bits ?????

5. 32-bits / 32-bits

6. CW2.003 Btrive 6.15 from 16 to 32 bits

7. 16-32 bits API to retrieve PNP modem Brand on W95/98

8. 16 vs 32 bits Applications

9. 16/32 Bits apps speed.

10. Oracle accelerator and 16 bits vs 32 -- newby

11. 16-32 bits

12. calling 16-bit code from 32-bits

 

 
Powered by phpBB® Forum Software