[SOLVED] Intel x86 reference manual vs. BrokenThron.com
Posted: Wed Apr 17, 2013 7:05 am
Hi all. I found something interesting on this BrokenThorn page:
And this is what I found in Intel reference manual (Section 7.3.13.2 EFLAGS Transfer Instructions):Entering v8086 Mode
These are the same steps involved when setting up v8086 mode. v8086 mode requires a user mode task in order to enter v86 mode. Thus, by doing the above, you can enter v86 mode as well. However, there is one slight modification needed.
Recall the format of the EFLAGS register. Bit 17 (VM) is the v8086 Mode Control Flag. Because we push a value for EFLAGS on the stack when performing an IRET, in order to enter v86 mode, just set bit 17 of EFLAGS before pushing it on the stack. This will cause IRET to set the VM bit in the EFLAGS register on return.
I don't understand. Which from these is correct?:The PUSHF (push flags), PUSHFD (push flags double), POPF (pop flags), and POPFD (pop flags double) instructions
copy the flags in the EFLAGS register to and from the stack. The PUSHF instruction pushes the lower word of the
EFLAGS register onto the stack (see Figure 7-11). The PUSHFD instruction pushes the entire EFLAGS register onto
the stack (with the RF and VM flags read as clear).
- The PUSHFD reads VM bit and POPFD reads it as zero
- The PUSHFD operation doesn't read VM bit