aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2026-04-12 01:07:03 +0000
committeriximeow <me@iximeow.net>2026-04-12 01:07:03 +0000
commit904cd18c41691a3255c08019fbc7db4ae77a9a9b (patch)
tree26ea3d72d23b7d1ee5e1661ee565e23d9ac5c7c6
parentdb39e9f141ca3746f16803afa35ac77b28ab4aff (diff)
sgdt/lidt/lgdt test fixes
-rw-r--r--test/long_mode/mod.rs10
-rw-r--r--test/long_mode/operand.rs8
2 files changed, 13 insertions, 5 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index dd19b55..3b55f32 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -957,11 +957,11 @@ fn test_0f01() {
}
test_display(&[0x0f, 0x01, 0x38], "invlpg byte [rax]");
test_display(&[0x0f, 0x01, 0x3f], "invlpg byte [rdi]");
- test_display(&[0x0f, 0x01, 0x40, 0xff], "sgdt ptr [rax - 0x1]");
- test_display(&[0x0f, 0x01, 0x41, 0xff], "sgdt ptr [rcx - 0x1]");
- test_display(&[0x0f, 0x01, 0x49, 0xff], "sidt ptr [rcx - 0x1]");
- test_display(&[0x0f, 0x01, 0x51, 0xff], "lgdt ptr [rcx - 0x1]");
- test_display(&[0x0f, 0x01, 0x59, 0xff], "lidt ptr [rcx - 0x1]");
+ test_display(&[0x0f, 0x01, 0x40, 0xff], "sgdt mword [rax - 0x1]");
+ test_display(&[0x0f, 0x01, 0x41, 0xff], "sgdt mword [rcx - 0x1]");
+ test_display(&[0x0f, 0x01, 0x49, 0xff], "sidt mword [rcx - 0x1]");
+ test_display(&[0x0f, 0x01, 0x51, 0xff], "lgdt mword [rcx - 0x1]");
+ test_display(&[0x0f, 0x01, 0x59, 0xff], "lidt mword [rcx - 0x1]");
test_display(&[0x0f, 0x01, 0x61, 0xff], "smsw word [rcx - 0x1]");
test_invalid(&[0x0f, 0x01, 0x69, 0xff]);
test_display(&[0x0f, 0x01, 0x71, 0xff], "lmsw word [rcx - 0x1]");
diff --git a/test/long_mode/operand.rs b/test/long_mode/operand.rs
index 09ac5a2..9f594b5 100644
--- a/test/long_mode/operand.rs
+++ b/test/long_mode/operand.rs
@@ -69,4 +69,12 @@ fn test_implied_memory_width() {
assert_eq!(mem_size_of(&[0x0f, 0xa8]), Some(8));
// pop gs
assert_eq!(mem_size_of(&[0x0f, 0xa9]), Some(8));
+ // lidt
+ assert_eq!(mem_size_of(&[0x0f, 0x01, 0x18]), Some(10));
+ // sidt
+ assert_eq!(mem_size_of(&[0x0f, 0x01, 0x08]), Some(10));
+ // lgdt
+ assert_eq!(mem_size_of(&[0x0f, 0x01, 0x10]), Some(10));
+ // sgdt
+ assert_eq!(mem_size_of(&[0x0f, 0x01, 0x00]), Some(10));
}