Skip to main content

asmkit/x86/features/
WRMSRNS.rs

1use crate::x86::assembler::*;
2use crate::x86::operands::*;
3use super::super::opcodes::*;
4use crate::core::emitter::*;
5use crate::core::operand::*;
6
7/// A dummy operand that represents no register. Here just for simplicity.
8const NOREG: Operand = Operand::new();
9
10/// `WRMSRNS`.
11///
12/// Supported operand variants:
13///
14/// ```text
15/// +---+----------+
16/// | # | Operands |
17/// +---+----------+
18/// | 1 | (none)   |
19/// +---+----------+
20/// ```
21pub trait WrmsrnsEmitter {
22    fn wrmsrns(&mut self);
23}
24
25impl<'a> WrmsrnsEmitter for Assembler<'a> {
26    fn wrmsrns(&mut self) {
27        self.emit(WRMSRNS, &NOREG, &NOREG, &NOREG, &NOREG);
28    }
29}
30
31
32impl<'a> Assembler<'a> {
33    /// `WRMSRNS`.
34    ///
35    /// Supported operand variants:
36    ///
37    /// ```text
38    /// +---+----------+
39    /// | # | Operands |
40    /// +---+----------+
41    /// | 1 | (none)   |
42    /// +---+----------+
43    /// ```
44    #[inline]
45    pub fn wrmsrns(&mut self)
46    where Assembler<'a>: WrmsrnsEmitter {
47        <Self as WrmsrnsEmitter>::wrmsrns(self);
48    }
49}