aboutsummaryrefslogtreecommitdiff
path: root/test/protected_mode/operand.rs
blob: 8fda18160301289c8ffe6327d6a9d5879fc2db9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use yaxpeax_arch::{Decoder, LengthedInstruction};
use yaxpeax_x86::protected_mode::{DecodeError, InstDecoder, Opcode, Operand, RegSpec};

#[test]
fn register_widths() {
    assert_eq!(Operand::Register(RegSpec::esp()).width(), 4);
    assert_eq!(Operand::Register(RegSpec::sp()).width(), 2);
    assert_eq!(Operand::Register(RegSpec::cl()).width(), 1);
    assert_eq!(Operand::Register(RegSpec::ch()).width(), 1);
    assert_eq!(Operand::Register(RegSpec::gs()).width(), 2);
}

#[test]
fn memory_widths() {
    assert_eq!(Operand::RegDeref(RegSpec::esp()).width(), 4);
}