aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn/cmp.rs
blob: 57e53eb5a87bcf6ae8487730428a2200411b913d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::Cmp;
use crate::{Asm, Imm16, Imm8, Mem16, Mem8, Reg64};

impl Cmp<Mem8, Imm8> for Asm {
    fn cmp(&mut self, op1: Mem8, op2: Imm8) {
        self.encode_mi(0x80, 0x7, op1, op2);
    }
}

impl Cmp<Mem16, Imm16> for Asm {
    fn cmp(&mut self, op1: Mem16, op2: Imm16) {
        self.encode_mi(0x81, 0x7, op1, op2);
    }
}

impl Cmp<Reg64, Reg64> for Asm {
    fn cmp(&mut self, op1: Reg64, op2: Reg64) {
        self.encode_rr(&[0x3b], op1, op2);
    }
}