aboutsummaryrefslogtreecommitdiff
path: root/src/long_mode/display.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2026-05-25 17:32:57 +0000
committeriximeow <me@iximeow.net>2026-05-25 18:00:30 +0000
commitf2a2a09688421f2c532ab6f02527bf68f095407a (patch)
treee7b5c3c5302c4c1a4ef89c1a5852b50059850986 /src/long_mode/display.rs
parent94f39674e0aee55ff6f6bb59f7d7c4873d2d1a6c (diff)
j*cxz/pusha/popa alternate size forms
these all existed since forever but the library did not distinguish them and did not provide prefix information for users to tell which had been decoded.
Diffstat (limited to 'src/long_mode/display.rs')
-rw-r--r--src/long_mode/display.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs
index f215d07..a00dd22 100644
--- a/src/long_mode/display.rs
+++ b/src/long_mode/display.rs
@@ -2100,6 +2100,8 @@ const MNEMONICS: &[&'static str] = &[
"pvalidate",
"rmpadjust",
"rmpupdate",
+
+ "jecxz",
];
impl Opcode {
@@ -2699,6 +2701,7 @@ impl <T: fmt::Write, Y: YaxColors> Colorize<T, Y> for Opcode {
Opcode::LOOPZ |
Opcode::LOOP |
Opcode::JRCXZ |
+ Opcode::JECXZ |
Opcode::CALL |
Opcode::CALLF |
Opcode::JMP |
@@ -4018,6 +4021,10 @@ pub(crate) fn contextualize_c<T: DisplaySink>(instr: &Instruction, out: &mut T)
out.write_str("if rcx == 0 then jmp ")?;
write_jmp_operand(instr.operand(0), out)?;
},
+ Opcode::JECXZ => {
+ out.write_str("if ecx == 0 then jmp ")?;
+ write_jmp_operand(instr.operand(0), out)?;
+ },
Opcode::LOOP => {
out.write_str("rcx--; if rcx != 0 then jmp ")?;
write_jmp_operand(instr.operand(0), out)?;
@@ -4216,8 +4223,9 @@ impl <T: fmt::Write, Y: YaxColors> ShowContextual<u64, [Option<alloc::string::St
}
}
-static RELATIVE_BRANCHES: [Opcode; 22] = [
- Opcode::JMP, Opcode::CALL, Opcode::JRCXZ,
+static RELATIVE_BRANCHES: [Opcode; 23] = [
+ Opcode::JMP, Opcode::CALL,
+ Opcode::JRCXZ, Opcode::JECXZ,
Opcode::LOOP, Opcode::LOOPZ, Opcode::LOOPNZ,
Opcode::JO, Opcode::JNO,
Opcode::JB, Opcode::JNB,