Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

x86 16bit...32?

Gregry2Gregry2 Posts: 607Member
Thats a bad title...well there.

Can someone clear up the difference between realmode and
protected please? Thats it i guess.

{2}rIng
Honto no kimochi kitsukanai furishite
Totsuzen futari koi ni ochitano...

eh...sorry.

Comments

  • shaolin007shaolin007 Posts: 1,018Member
    : Thats a bad title...well there.
    :
    : Can someone clear up the difference between realmode and
    : protected please? Thats it i guess.
    :
    : {2}rIng
    : Honto no kimochi kitsukanai furishite
    : Totsuzen futari koi ni ochitano...
    :
    : eh...sorry.
    :
    :

    [green]
    Real mode is the old mode in which you could only access 1mb of memory. This mode had no limits to what you could do at the low level. It was strictly 16bit mode and had different memory models for which you could program for. One was the flat real mode which the code, data, and stack were compacted into one 64k segment. The other well known model is the segmented model which had seperate code, data, and stack segments allowing more flexability. Each segment had to be aligned on a 16k page and segments can overlap. In this mode, you accessed memory by specifying the segment:offset.

    Protected mode comes with the ability to access 4GB of memory and is 32bit. Protected comes from the fact that you don't have the flexability you had in real mode with accessing memory especially lower memory. If you ever ran a program that had the error pop up saying "Access Violation" then your program tried to access memory that was out of it's alotted part.
    [/green]

  • jeffleydajeffleyda Posts: 390Member
    : Thats a bad title...well there.
    :
    : Can someone clear up the difference between realmode and
    : protected please? Thats it i guess.
    :

    Try this:
    http://en.wikipedia.org/wiki/Protected_mode

    There are lots of links for more information, and it's pretty clearly explained. Don't fall for the myth that real mode means only 16bit processing, it's not true.

    mov eax,12345678h works just fine in real mode. (on a 386 or higher)

    -jeff!
  • shaolin007shaolin007 Posts: 1,018Member
    : : Thats a bad title...well there.
    : :
    : : Can someone clear up the difference between realmode and
    : : protected please? Thats it i guess.
    : :
    :
    : Try this:
    : http://en.wikipedia.org/wiki/Protected_mode
    :
    : There are lots of links for more information, and it's pretty clearly explained. Don't fall for the myth that real mode means only 16bit processing, it's not true.
    :
    : mov eax,12345678h works just fine in real mode. (on a 386 or higher)
    :
    : -jeff!
    :
    [green]
    Yea your right, but isn't that more or less a type of trick due to the fact that the upper 16bits are just hidden and are still accessable on 386 and higher and that real mode by definition is only able to access up to 1MB or memory? I just didn't want to confuse this person with that though.
    [/green]


  • jeffleydajeffleyda Posts: 390Member
    : : mov eax,12345678h works just fine in real mode. (on a 386 or higher)
    : :
    : : -jeff!
    : :
    : [green]
    : Yea your right, but isn't that more or less a type of trick due to the fact that the upper 16bits are just hidden and are still accessable on 386 and higher and that real mode by definition is only able to access up to 1MB or memory? I just didn't want to confuse this person with that though.
    : [/green]

    I'm not sure if it's really a trick or not; you can do 32bit multiply and divides in real mode too, so it's not just me using spare bits-the CPU accesses them too when told to.

    Memory is indeed limited to 1mb in real mode, which is why I personally like "unreal" (flat) mode for full access to the hardware and 4gig of memory access. Too bad no one uses DOS anymore to get to these modes. sigh.

    -jeff!




  • Gregry2Gregry2 Posts: 607Member
    [b][red]This message was edited by Gregry2 at 2005-9-22 6:35:43[/red][/b][hr]
    I Already looked at an article, but the extra info cleared up a little.

    Also, does that mean that its not the operating system that controls the differemt processes and threads? If the OS itself runs in protected mode, it cant overlook them, can it?

    Or am i worng and just wait a while and read more, and the answer will come up one day, err, plz tell

    Thank you

    {2}rIng


  • shaolin007shaolin007 Posts: 1,018Member
    : [b][red]This message was edited by Gregry2 at 2005-9-22 6:35:43[/red][/b][hr]
    : I Already looked at an article, but the extra info cleared up a little.
    :
    : Also, does that mean that its not the operating system that controls the differemt processes and threads? If the OS itself runs in protected mode, it cant overlook them, can it?
    :
    : Or am i worng and just wait a while and read more, and the answer will come up one day, err, plz tell
    :
    : Thank you
    :
    : {2}rIng
    :
    [green]
    I'm not a genius when it comes to how protected mode works entirely and I'm sure there are more qualified people that could give you more details than I could. With that said, take Windows NT, 2000, ect., when you turn on your PC, the PC initializes to real mode for compatibility reasons, right. Then once Windows starts kicking up, Windows initializes protected mode. When in protected mode there are 4 rings that a program can run in. Ring 0 is is mainly for OS and usually off limits to applications. Ring 1-3 are more or less accessable through the OS. Bottom line, you have to go through Windows OS to do ANYTHING. Thats a condensed explanation of it if anything. If you want to get into the nitty gritty of it then I would suggest downloading [b]Intels Software Developers Manual IA32 Vol. 3[/b]. This volume deals with system programming which will explain all the in's and outs of the different modes you can put the processor in.
    [/green]


  • AsmGuru62AsmGuru62 Posts: 6,519Member
    [blue]
    Shaolin was talking about the accessing memory.
    This one:

    mov eax, 12345678h

    is not accessing memory.

    try this:

    mov esi, 00400000h
    mov eax, [esi]

    in REAL mode and see if it will work.
    [/blue]
  • Gregry2Gregry2 Posts: 607Member
    accessing memory is what i was really what i was questioned about...er but thanx

    thanx all, il come again

Sign In or Register to comment.