asmkit/x86/features/
MSR_IMM.rs1use crate::x86::assembler::*;
2use crate::x86::operands::*;
3use super::super::opcodes::*;
4use crate::core::emitter::*;
5use crate::core::operand::*;
6
7const NOREG: Operand = Operand::new();
9
10pub trait RdmsrEmitter_2<A, B> {
22 fn rdmsr_2(&mut self, op0: A, op1: B);
23}
24
25impl<'a> RdmsrEmitter_2<Gpd, Imm> for Assembler<'a> {
26 fn rdmsr_2(&mut self, op0: Gpd, op1: Imm) {
27 self.emit(RDMSRRI, op0.as_operand(), op1.as_operand(), &NOREG, &NOREG);
28 }
29}
30
31pub trait WrmsrnsEmitter_2<A, B> {
43 fn wrmsrns_2(&mut self, op0: A, op1: B);
44}
45
46impl<'a> WrmsrnsEmitter_2<Imm, Gpd> for Assembler<'a> {
47 fn wrmsrns_2(&mut self, op0: Imm, op1: Gpd) {
48 self.emit(WRMSRNSIR, op0.as_operand(), op1.as_operand(), &NOREG, &NOREG);
49 }
50}
51
52
53impl<'a> Assembler<'a> {
54 #[inline]
66 pub fn rdmsr_2<A, B>(&mut self, op0: A, op1: B)
67 where Assembler<'a>: RdmsrEmitter_2<A, B> {
68 <Self as RdmsrEmitter_2<A, B>>::rdmsr_2(self, op0, op1);
69 }
70 #[inline]
82 pub fn wrmsrns_2<A, B>(&mut self, op0: A, op1: B)
83 where Assembler<'a>: WrmsrnsEmitter_2<A, B> {
84 <Self as WrmsrnsEmitter_2<A, B>>::wrmsrns_2(self, op0, op1);
85 }
86}