;
; INTEL CONFIDENTIAL
;
; P5 CODE MACRO FILE FOR USE WITH MICROSOFT MASM 5.1 OR LATER
; ASSEMBLER.
;
; These macros have been developed by Intel Corporation and have
; been verified on a working P5 system.
;
; You have Intel's permission to incorporate these macros into
; your product royalty free.
;
; Intel specifically disclaims all warranties, express or implied,
; and all liability, including consequential and other indirect
; damages, for the use of these macros, including liability for
; infringement of any proprietary rights. Intel does not assume
; any responsibility for any errors which may appear in these macros
; nor any responsibility to update them.
;
; Filename: p5masm.mac
; Date: 10/92
;
; These code macros have been generated because at the current time
; Microsoft's assembler does not include built-in assembler
; mnemonics for the new P5 instructions.
;
; To make use of the code macros defined below, include
; the contents of this file by placing the following
; statement in your masm source file:
;
; INCLUDE P5MASM.MAC
;
; To invoke a code macro, use the name of the macro just
; as you would use any other assembler instruction
; mnemonic, including any required operands.
; Examples are given with each macro.
;
; The new instructions include:
;
; CMPXCHG8B ;Compare and exchange
; ;eight bytes
; CPUID ;CPU Identification
; RDTSC ;Read Time Stamp Counter
; MOVTOCR4 ;Move reg to CR4
; MOVFROMCR4 ;Move CR4 to reg
; RDMSR ;Read Model Specific Register
; WRMSR ;Write Model Specific Register
; RSM ;Resume from SMM
;
; NOTE: All but two of the code macro names in this file correspond
; directly with the actual names given to the new instructions.
;
;
; Instruction opcode bits in MOD REG R/M and SIB formats
;
.xcref MODRM_REC,SIB_REC
MODRM_REC record $MOD:2,$REG:3,$RM:3
SIB_REC record $SS:2,$IND:3,$BASE:3

;**************************************************************************
;
; MOVSPR - Move to/from special register macro -
;
; Input: general purpose register/control or debug register
; Output: control or debug register/general purpose register
;
; Use this macro to move to/from CR4 which MASM does not currently
; support. Any R32 can be used as well as any special register
; (CRn, DRn) as either the source or destination.
; This macro requires Microsoft MASM 5.10 or later.
;

;**************************************************************************
;
; RDMSR - Read from Model Specific Register -
;
; Input: ECX indicating which MSR to read from
; Output: EDX:EAX
;
; To use this instruction the ECX register must hold a value that
; specifies which model specific register is to be read. After
; the instruction has completed the contents of the model specific
; register will be found in the EDX:EAX register pair.
;
; See the P5 documentation for a complete list of model specific registers.
;

RDMSR MACRO
db 0FH
db 32H
ENDM

;**************************************************************************
;
; WRMSR - Write to a Model Specific Register -
;
; Input: ECX indicating which MSR to write to
; Output: MSR
;
; To use this instruction the ECX register must hold a value that
; specifies which model specific register is to be written. After
; the instruction has completed, the contents of the EDX:EAX
; register pair will be transferred to the specified model specific
; register.
;
; See the P5 documentation for a complete list of model specific registers.
;