Could you, please, run it on your machine
and report what you can see on MessageBox.
Also, please, tell what processor do you have and what OS.
Posted on 2003-03-03 07:18:35 by The Svin
---------------------------
Error
---------------------------
SMSW eax: 0F01E0 eax = 8001003B
SMSW ax: 660F01E0 eax = 0000003B
---------------------------
OK
---------------------------


I hope this is what you're aiming for.

dual p3 800, windows 2000 pro SP3
Posted on 2003-03-03 07:27:09 by Hiroshimator
Yes, that what I need.
Thank you.
Could others submit the info, please?
Posted on 2003-03-03 07:29:49 by The Svin
error caption
SMSW eax: 0F01E0 eax = 80000019
SMSW ax: 660F01E0 eax = 00000019
OK button

P4 1.4 GHz windows Me
Posted on 2003-03-03 07:40:47 by argus
---------------------------
Error
---------------------------
SMSW eax: 0F01E0 eax = 8001003B
SMSW ax: 660F01E0 eax = 0000003B
---------------------------
OK
---------------------------

AMD 1.33 gHz, Win XP Pro SP1
Posted on 2003-03-03 07:52:44 by Qweerdy
Thanx, for others:
caption, button texts are not needed
I'm interested in reurn value for the two opcodes.
The thing is about SMSW instruction that loads from
cr0 low 16 bits.
I got some confusing actuall data:
1. Intel refference are clear about using 32 bit operands
with SMSW, but says that only 16 bits of 32 bit operand
will be used, others ..."undefined" :)
Undefined does not mean "unchanged" as you can see it.
2. MASM doesn't allow 32 bit operand - it rejects it as an error BUT!
Funny thing - when you enter for example
smsw ax it encode actually 0F01E0 - opcode for
smws eax.
So there is 2 strange things about it
-1: Why it treats 32bit operand as error while Intel allow it.
-2: Why it actually encode it as 32 bit operand instead of 16 bit (with 66 prefix)
3. Since I (and you also that others too) get something
in upper 16 bit of eax, the question is - what are those bits and a guess that they might somehow relate to cr0
too.
The answer of course, can be done only with driver written or some debugger that shows cr0.
I don't know one.
Posted on 2003-03-03 08:03:32 by The Svin
---------------------------
Errore
---------------------------
SMSW eax: 0F01E0 eax = 80010031
SMSW ax: 660F01E0 eax = 00000031
---------------------------
OK
---------------------------

AMD Athlon XP 1600+ currently overclocked to 1502 MHz.
I ran it on Windows 2000, SP3.

Hope it helps.
Posted on 2003-03-03 08:03:33 by Maverick
Maverick,
on what OS have you run it, please?
Hope it helps

Of course, it is!
It's magic ability here on the board to have freinds around the world.
I couldn't do such a test otherwize :)
Posted on 2003-03-03 08:05:13 by The Svin
Looks like without prefix 66 smsw on new processors
reads 32 bits of cr0 to operand not only msw.
If I'm right then 8001 in upper bits means PG and WP
bit's on CR0 set to 1 and 8000 - PG=1,WP=0 that looks
very much like truth.
Posted on 2003-03-03 08:42:07 by The Svin

Maverick,
on what OS have you run it, please?
Windows 2000, SP3.
We posted at the same time (3:03 PM here), I immediately after noticed I forgot to put the OS and edited my post. You had already read the post then. :)

PS: about your SMSW test, also BSWAP behaves differently between CPU and CPU (at least Intel vs AMD) when prefixed with $66. On my ex Pentium I found this form useful (it ran two 16bit swap in parallel), while on my Athlon the high word gets zeroed instead.
Posted on 2003-03-03 09:15:46 by Maverick
Yes, the same here about bswap on PIII
Posted on 2003-03-03 09:19:35 by The Svin
Thanks SVIN you solve my problem once again.



SMSW AX ; Store Machine Status Word
xor al,1 ; Set the PMode switch, no need 0x66 Code or prefix
SETE AX ; Get Set


:alright:

Mine is Win98 400 Mhz

80000019 ---->eax
00000019 ---->ax

Thank you very Much...., Muachh...,muach...,
So I dont need 66 prefix instruction anymore do I ?
Posted on 2003-03-03 09:58:48 by realvampire
Well, you can do it either way...
I personally use

mov eax,cr0
or eax,1
mov cr0,eax

It gives access to the whole register.

-Stealth
Posted on 2003-03-03 10:06:17 by Stealth
It seems I was right :)
I wrote kmd (in fact I just udapted skeleton kmd from excelent Four-F package)
that reads mov eax,cr0 and smsw eax.
And at my machine they are the same!!!
So indeed smsw eax might be used as unpreveleged mov eax,cr0!
Might be ... :)
I again kindly ask those who has NT family (NT,2000,XP) run the following
app that comes now with kmd sys file and report results.
For those who has 9x(95,98,Me) some hero volanteer is needed to
write VXD that reads cr0. Unfortunatly I can not write VXD on my machine now.
Posted on 2003-03-03 11:15:29 by The Svin

Well, you can do it either way...
I personally use

mov eax,cr0
or eax,1
mov cr0,eax

It gives access to the whole register.

-Stealth

But you can not do it from level 3 ring can you ?
Posted on 2003-03-03 11:17:49 by The Svin

It seems I was right :)
I wrote kmd (in fact I just udapted skeleton kmd from excelent Four-F package)
that reads mov eax,cr0 and smsw eax.
And at my machine they are the same!!!
So indeed smsw eax might be used as unpreveleged mov eax,cr0!
Might be ... :)
I again kindly ask those who has NT family (NT,2000,XP) run the following
app that comes now with kmd sys file and report results.
For those who has 9x(95,98,Me) some hero volanteer is needed to
write VXD that reads cr0. Unfortunatly I can not write VXD on my machine now.

AMD Athlon XP 1600+ currently overclocked to 1502 MHz.
Windows 2000, SP3.

---------------------------
mov eax,CR0 and smsw, eax
---------------------------
mov eax,cr0=8001003B; smsw eax = 8001003B
---------------------------
OK
---------------------------
Posted on 2003-03-03 16:05:13 by Maverick
on that "skeleton" file on windows XP SP1 with a pentium 4:

mov eax,cr0=8001003B;

smsw eax = 8001003B
Posted on 2003-03-03 17:29:46 by kairon
AMD K7 500mhz

windows XP sp1

mov eax,cr0=8001003B;smsw eax = 8001003B
Posted on 2003-03-03 18:20:48 by va3gdr
same as Hiro's on my new P4. Still haven't loaded all my programs on to this computer yet :(
Posted on 2003-03-03 18:46:56 by jademtech
Same as Hiro on P4 XP Home
Posted on 2003-03-03 18:54:30 by drhowarddrfine