Professional Documents
Culture Documents
Prepared by Shikha Agrawal: Initialization of 80386DX, Debugging and Virtual 8086 Mode
Prepared by Shikha Agrawal: Initialization of 80386DX, Debugging and Virtual 8086 Mode
Prepared by
Shikha Agrawal
Virtual 8086 Mode
• The 80386 supports execution of one or more 8086, 8088,
80186, or 80188 programs in an 80386 protected-mode
environment.
• An 8086 program runs in this environment as part of a V86
(virtual 8086) task. V86 tasks take advantage of the hardware
support of multitasking offered by the protected mode.
• Not only can there be multiple V86 tasks, each one executing
an 8086 program, but V86 tasks can be multi programmed
with other 80386 tasks.
• To execute an 8086 program ,a "virtual machine“ is to be
form. A complete virtual machine consists not only of 80386
hardware but also of systems software. Thus, the emulation
of an 8086 is the result of cooperation between hardware
and software
Executing 8086 Code
The processor executes in V86 mode when the VM (virtual
machine) bit in the FLAGS register is set. The processor
tests this flag under two general conditions:
1. When loading segment registers to know whether to use
8086-style address formation.
2. When decoding instructions to determine which
instructions are
sensitive to IOPL. Because IOPL field is having different
function than protected mode.
The register set available in V86 mode includes all the registers defined for the
8086 plus the new registers introduced by the 80386: FS, GS, debug registers,
control registers, and test registers.
New instructions introduced by 80386.
── LSS, LFS, LGS instructions
── Long-displacement conditional jumps
── Single-bit instructions
── Bit scan
── Double-shift instructions
── Byte set on condition
── Move with sign/zero extension
── Generalized multiply
-PUSHA
-POPA
-String I/O
Entering the mode Enter in real mode on Enter in protected If the VM bit in Eflags
power up or reset mode,when PE bit of register is set,
CR0 register set processor enter in
virtual mode.
Leaving the mode To leave the real Whenever processor The 80386 leaves the
mode and enter into wants to return to virtual mode when
protected mode the real mode the user an interrupt or
PE bit of CR0 must be can clear the PE bit in exception occurs.
set. CR0.