Re: Prefix 0x0F is used in 16 Bit

From: Bjarni Juliusson (bjarni.ferret_at_update.ferret.uu.se_remove_the_animal)
Date: 06/05/04


Date: Sat, 5 Jun 2004 19:25:42 +0000 (UTC)

arargh405NOSPAM@NOW.AT.arargh.com wrote:
> On Sat, 5 Jun 2004 04:38:56 +0000 (UTC), Bjarni Juliusson
> <bjarni.ferret@update.ferret.uu.se_remove_the_animal> wrote:
>
>>MSDOS always runs in 16 bit real mode, and a far jmp takes a segment and
>>an offset as target. In 16 bit real mode code, that's 32 bits of data,
>>but the target address is of course 20 bits after translation.
>
> Doesn't EMM386 put the cpu into V86 mode?

Well... yes, but the point was that MSDOS uses the real mode memory model.

>>Segments are normally 64Kb in real mode.
>
> Segments can only be 64Kb in real mode(or V86 mode), unless you run
> off the end of memory, and in that case you would probably wrap around
> anyway.

No, I think you can go to protected mode, set up the segments to be
longer than 64k, and drop back to real mode without losing the long
segments. The segment settings are not updated until a segment register
is loaded, IIRC. Correct me if I'm wrong, but I think this trick has
actually been used by various demos that wanted the simplicity of
running in real mode combined with the simplicity of 32 bit flat pointers.

Bjarni

-- 
                        INFORMATION WANTS TO BE FREE


Relevant Pages

  • x86 Assembly Language FAQ - General Part II
    ... Accessing 4 Gigs of Memory in Real Mode ... GB of memory, ... Changing the value of a segment register results in that segment's entry ... In protected mode, the value in the ...
    (comp.lang.asm.x86)
  • Frequently Asked Questions (1/6)
    ... Accessing 4 Gigs of Memory in Real Mode ... GB of memory, ... Changing the value of a segment register results in that segment's entry ...
    (comp.lang.asm.x86)
  • Re: Calling convention odd?
    ... mov ds,ax on a 386 is only 2 clocks in real mode, 18 in PM. ... For later CPUs individual instruction timings depend more on the ... The segment load was executed from zero to ten ...
    (comp.lang.asm.x86)
  • Re: Seeing VERSIONINFO under Vista?
    ... Different sources refer to "1 GB virtual memory" of 80286. ... Swapping was supposed done at segment basis. ... Restart to real mode was later implemented through a triple fault. ... the 286, for example, its virtual memory map had problems, and in an era ...
    (microsoft.public.vc.mfc)
  • Re: Using SS for non-stack operations?
    ... > third segment register as two data sources combine to affect a third. ... Well, if you're real mode DOS, and you need an extra data segment, the ... So long as you can put the third area in the code or stack ...
    (comp.lang.asm.x86)