From 4e8396b5cf3981f0746ed815ce8b6fb89146821e Mon Sep 17 00:00:00 2001 From: Ben Rudiak-Gould Date: Fri, 1 Mar 2013 10:28:32 +0400 Subject: Remove +s It doesn't seem worth >200 lines of C and Perl to save ~50 lines in insns.dat. In order to make this work I had to rename sbyte16/sbyte32 so that they can take an ordinary size suffix (their size suffix was formerly treated specially). This fixes one disassembly bug: 48C7C000000080 disassembles to mov rax,0x80000000, which reassembles to B800000080, which loads a different value. Signed-off-by: Ben Rudiak-Gould Acked-by: "H. Peter Anvin" Signed-off-by: Cyrill Gorcunov --- disasm.c | 45 +++++---------------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) (limited to 'disasm.c') diff --git a/disasm.c b/disasm.c index dcbd931..de80db9 100644 --- a/disasm.c +++ b/disasm.c @@ -397,7 +397,6 @@ static int matches(const struct itemplate *t, uint8_t *data, int op1, op2; struct operand *opx, *opy; uint8_t opex = 0; - int s_field_for = -1; /* No 144/154 series code encountered */ bool vex_ok = false; int regmask = (segsize == 64) ? 15 : 7; enum ea_type eat = EA_SCALAR; @@ -456,7 +455,6 @@ static int matches(const struct itemplate *t, uint8_t *data, break; } - case4(014): case4(0274): opx->offset = (int8_t)*data++; opx->segment |= SEG_SIGNED; @@ -488,11 +486,15 @@ static int matches(const struct itemplate *t, uint8_t *data, break; case4(040): - case4(0254): opx->offset = getu32(data); data += 4; break; + case4(0254): + opx->offset = gets32(data); + data += 4; + break; + case4(044): switch (asize) { case 16: @@ -570,33 +572,6 @@ static int matches(const struct itemplate *t, uint8_t *data, break; } - case4(0140): - if (s_field_for == op1) { - opx->offset = gets8(data); - data++; - } else { - opx->offset = getu16(data); - data += 2; - } - break; - - case4(0144): - case4(0154): - s_field_for = (*data & 0x02) ? op1 : -1; - if ((*data++ & ~0x02) != *r++) - return false; - break; - - case4(0150): - if (s_field_for == op1) { - opx->offset = gets8(data); - data++; - } else { - opx->offset = getu32(data); - data += 4; - } - break; - case 0172: { uint8_t ximm = *data++; @@ -647,16 +622,6 @@ static int matches(const struct itemplate *t, uint8_t *data, break; } - case4(0250): - if (s_field_for == op1) { - opx->offset = gets8(data); - data++; - } else { - opx->offset = gets32(data); - data += 4; - } - break; - case4(0260): case 0270: { -- cgit v1.2.3