image/svg+xmlWRFSBASE/WRGSBASE—Write FS/GS Segment BaseInstruction Operand EncodingDescriptionLoads the FS or GS segment base address with the general-purpose register indicated by the modR/M:r/m field.The source operand may be either a 32-bit or a 64-bit general-purpose register. The REX.W prefix indicates the operand size is 64 bits. If no REX.W prefix is used, the operand size is 32 bits; the upper 32 bits of the source register are ignored and upper 32 bits of the base address (for FS or GS) are cleared. This instruction is supported only in 64-bit mode.OperationFS/GS segment base address := SRC;Flags AffectedNoneC/C++ Compiler Intrinsic EquivalentWRFSBASE: void _writefsbase_u32( unsigned int );WRFSBASE: _writefsbase_u64( unsigned __int64 );WRGSBASE: void _writegsbase_u32( unsigned int );WRGSBASE: _writegsbase_u64( unsigned __int64 );Protected Mode Exceptions#UD The WRFSBASE and WRGSBASE instructions are not recognized in protected mode.Real-Address Mode Exceptions#UDThe WRFSBASE and WRGSBASE instructions are not recognized in real-address mode.Virtual-8086 Mode Exceptions#UDThe WRFSBASE and WRGSBASE instructions are not recognized in virtual-8086 mode.Compatibility Mode Exceptions#UD The WRFSBASE and WRGSBASE instructions are not recognized in compatibility mode.Opcode/InstructionOp/ En64/32-bit ModeCPUID Fea-ture FlagDescriptionF3 0F AE /2WRFSBASE r32MV/IFSGSBASELoad the FS base address with the 32-bit value in the source register.F3 REX.W 0F AE /2WRFSBASE r64MV/IFSGSBASELoad the FS base address with the 64-bit value in the source register.F3 0F AE /3WRGSBASE r32MV/IFSGSBASELoad the GS base address with the 32-bit value in the source register.F3 REX.W 0F AE /3WRGSBASE r64MV/IFSGSBASELoad the GS base address with the 64-bit value in the source register.Op/EnOperand 1Operand 2Operand 3Operand 4MModRM:r/m (r)NANANA

image/svg+xml64-Bit Mode Exceptions#UD If the LOCK prefix is used.If CR4.FSGSBASE[bit 16] = 0.If CPUID.07H.0H:EBX.FSGSBASE[bit 0] = 0#GP(0)If the source register contains a non-canonical address.

This UNOFFICIAL reference was generated from the official Intel® 64 and IA-32 Architectures Software Developer’s Manual by a dumb script. There is no guarantee that some parts aren't mangled or broken and is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.