asmkit/x86/features/
MOVDIRI.rs1use super::super::opcodes::*;
2use crate::core::emitter::*;
3use crate::core::operand::*;
4use crate::x86::assembler::*;
5use crate::x86::operands::*;
6
7const NOREG: Operand = Operand::new();
9
10pub trait MovdiriEmitter<A, B> {
23 fn movdiri(&mut self, op0: A, op1: B);
24}
25
26impl<'a> MovdiriEmitter<Mem, Gpd> for Assembler<'a> {
27 fn movdiri(&mut self, op0: Mem, op1: Gpd) {
28 self.emit(
29 MOVDIRI32MR,
30 op0.as_operand(),
31 op1.as_operand(),
32 &NOREG,
33 &NOREG,
34 );
35 }
36}
37
38impl<'a> MovdiriEmitter<Mem, Gpq> for Assembler<'a> {
39 fn movdiri(&mut self, op0: Mem, op1: Gpq) {
40 self.emit(
41 MOVDIRI64MR,
42 op0.as_operand(),
43 op1.as_operand(),
44 &NOREG,
45 &NOREG,
46 );
47 }
48}
49
50impl<'a> Assembler<'a> {
51 #[inline]
64 pub fn movdiri<A, B>(&mut self, op0: A, op1: B)
65 where
66 Assembler<'a>: MovdiriEmitter<A, B>,
67 {
68 <Self as MovdiriEmitter<A, B>>::movdiri(self, op0, op1);
69 }
70}