flat assembler
Message board for the users of flat assembler.

Index > OS Construction > can we use protect mode in 16-bit code?

Author
Thread Post new topic Reply to topic
jensy1



Joined: 20 Mar 2004
Posts: 4
jensy1 21 Mar 2004, 01:26
anybody can tell me?

as we know,we can use protect mode in 32-bit code.Is there
protect mode in 16-bit code?

I'm puzzled.

help me.
Post 21 Mar 2004, 01:26
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 21 Mar 2004, 10:41
What do you mean?

The CPU has an internal flag (in CR0 register) that tells it if it's in real mode or in protected mode. CPU starts in real mode... but OS will normally switch it to protected mode in initializations phase.

This switch towards protected mode is done for the advantages of the larger memory model and protection schemes.

In real mode you can still use 32 bits instructions (with some address limitation) but they will have a 66h prefix in front.

Same goes for 32 bits: you can still use 16 bits instructions but again there will be a 66h prefix.

Also there is an "unreal mode" (of little use today) that was obtained by a brief switch into protected mode changing the selector registers and the returning fast to real mode. This was a subtle "mixed" mode that somehow allowed access to a larger memory range while still in real mode.

As you can see 32bits and 16bits in not exactly the same as real mode and protected mode, there are some subtle differences.
Post 21 Mar 2004, 10:41
View user's profile Send private message Visit poster's website Reply with quote
jensy1



Joined: 20 Mar 2004
Posts: 4
jensy1 21 Mar 2004, 15:17
bogdanontanu wrote:
What do you mean?

The CPU has an internal flag (in CR0 register) that tells it if it's in real mode or in protected mode. CPU starts in real mode... but OS will normally switch it to protected mode in initializations phase.

This switch towards protected mode is done for the advantages of the larger memory model and protection schemes.

In real mode you can still use 32 bits instructions (with some address limitation) but they will have a 66h prefix in front.

Same goes for 32 bits: you can still use 16 bits instructions but again there will be a 66h prefix.

Also there is an "unreal mode" (of little use today) that was obtained by a brief switch into protected mode changing the selector registers and the returning fast to real mode. This was a subtle "mixed" mode that somehow allowed access to a larger memory range while still in real mode.

As you can see 32bits and 16bits in not exactly the same as real mode and protected mode, there are some subtle differences.


I think it's the answer I want.
thank you very much.

_________________
Regards,
Jensy.
Post 21 Mar 2004, 15:17
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.