Mail Archives: djgpp/1999/04/10/00:29:55
yjtseng wrote:
>
> Thanks for the reply.
>
> I don't think it is a privileged instruction based on the following quote
> from the Intel Architecture Software Developer's Manual page 2-13:
>
> In protected mode, the move-to-or-from-control-registers
> forms of the MOV instruction allow
> the control registers to be read (at any privilege level) or
> loaded (at privilege level 0 only). This
> restriction means that application programs (running at
> privilege levels 1, 2, or 3) are prevented
> from loading the control registers; however, application
> programs can read these registers.
Interesting. The 80386 Programmer's Reference Manual (published by
Intel) on page 17-111 describes MOV to/from special registers (CRx, DRx,
TRx), and it says:
Protected Mode Exceptions: #GP(0) [general protection fault --NE] if the
current privilege level is not 0
...
Notes: The instructions must be executed at privilege level 0 or in
real-address mode; otherwise, a protection exception will be raised.
[end of quote]
The SMSW instruction, which exists for 286 compatibility, stores the low
16 bits of CR0 in its operand, and can be executed regardless of
privilege. But that may omit some of the bits you want.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -