diff options
author | iximeow <me@iximeow.net> | 2024-04-01 23:38:57 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2024-04-02 00:29:30 -0700 |
commit | bbdf78c061b6e685d1992dcdeac692fc2f8f0d34 (patch) | |
tree | 17e0db9b07c6401fd7d424a442f247937aa3c4c9 /src/protected_mode/display.rs | |
parent | 96a83895ae7b99efe35c45066e4f35b4c441e359 (diff) |
display opt: mem size labels and minor segment reporting changes
for mem size labels: add one new "BUG" entry at the start of the array
so `mem_size` does not need to be adjusted before being used to look
up a string from the `MEM_SIZE_STRINGS` array. it's hard to measure
the direct benefit of this, but it shrinks codegen size by a bit and
simplfies a bit of assembly....
for segment reporting changes: stos/scas/lods do not actually need
special segment override logic. instead, set their use of `es` when
decoded, if appropriate. this is potentially ambiguous; in non-64bit
modes the sequence `26aa` would decode as `stos` with explicit `es`
prefix. this is now identical to simply decoding `aa`, which now also
reports that there is an explicit `es` prefix even though there is no
prefix on tne instruction.
on the other hand, the prefix-reported segment now more accurately
describes the memory selector through which memory accesses will
happen. seems ok?
Diffstat (limited to 'src/protected_mode/display.rs')
-rw-r--r-- | src/protected_mode/display.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protected_mode/display.rs b/src/protected_mode/display.rs index 55cab9e..89b7565 100644 --- a/src/protected_mode/display.rs +++ b/src/protected_mode/display.rs @@ -3436,7 +3436,7 @@ fn contextualize_intel<T: fmt::Write, Y: YaxColors>(instr: &Instruction, colors: } if x.is_memory() { - out.write_str(MEM_SIZE_STRINGS[instr.mem_size as usize - 1])?; + out.write_str(MEM_SIZE_STRINGS[instr.mem_size as usize])?; out.write_str(" ")?; } @@ -3456,7 +3456,7 @@ fn contextualize_intel<T: fmt::Write, Y: YaxColors>(instr: &Instruction, colors: out.write_str(", ")?; let x = Operand::from_spec(instr, instr.operands[i as usize]); if x.is_memory() { - out.write_str(MEM_SIZE_STRINGS[instr.mem_size as usize - 1])?; + out.write_str(MEM_SIZE_STRINGS[instr.mem_size as usize])?; out.write_str(" ")?; } if let Some(prefix) = instr.segment_override_for_op(i) { |