Partager via


__setReg

Microsoft Specific

Sets the value of a register specified by the first parameter, which are the same values as declared in the header file intrin.h.

void __setReg( 
   int Register, 
   unsigned __int64 Value 
);

Parameters

  • [in] Register
    A constant specifying the desired processor register.

  • [in] Value
    The value to set in the specified register.

Requirements

Intrinsic

Architecture

__setReg

IPF

Header file <intrin.h>

Remarks

Attempting to write directly to processor registers can produce unexpected results. Some registers are not writeable in user mode and might throw a hardware exception or ignore attempts to write to them. For more information, see the processor documentation.

This routine is only available as an intrinsic.

Example

// setReg.cpp
// processor: IPF
#include <cstdio>
#include <intrin.h>
#define __CV_IPF_IntR10 1034

#pragma intrinsic(__setReg)
#pragma intrinsic(__getReg)

int main()
{
    __setReg(__CV_IPF_IntR10, 167);
    printf_s("%I64d\n", __getReg(__CV_IPF_IntR10));
   
    return 0;
}
167

See Also

Reference

__getReg

Compiler Intrinsics