Re: Test whether rdmsr instruction is supported.
- From: "Volodymyr Shcherbyna" <v_scherbina@xxxxxxxxxxxxxxx>
- Date: Fri, 7 Aug 2009 17:03:43 +0200
"Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxxxxxx> wrote in message
news:ADF9BC63-C9D3-423E-A60A-8D32440DF139@xxxxxxxxxxxxxxxx
What compiler are you using? With Microsoft C++ (cl.exe), if you aren't
using declspec(naked) then registers should be saved.
Yes and no :) If you are changing ECX in _asm block inside class function,
the compiler saves the register in stack and restore it after, so that
program does not cause access violation. But you can play with ECX in non
class functions and compiler does not save it. The notion "compiler always
saves registers which are used in _asm block" is wrong, instead it seems to
be sticking to "compiler always saves register in stack and restore it later
if it's use in _asm block might cause instability of code".
--
Volodymyr M. Shcherbyna, blog: http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no
rights)
.
- Follow-Ups:
- Re: Test whether rdmsr instruction is supported.
- From: Maxim S. Shatskih
- Re: Test whether rdmsr instruction is supported.
- References:
- Re: Test whether rdmsr instruction is supported.
- From: Ben Voigt [C++ MVP]
- Re: Test whether rdmsr instruction is supported.
- Prev by Date: Re: Process Quantum
- Next by Date: Re: Virtual Driver for TV Capture
- Previous by thread: Re: Test whether rdmsr instruction is supported.
- Next by thread: Re: Test whether rdmsr instruction is supported.
- Index(es):
Relevant Pages
|