diff options
author | Ben Rudiak-Gould <benrudiak@gmail.com> | 2013-03-01 10:28:32 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2013-03-01 10:28:32 +0400 |
commit | 4e8396b5cf3981f0746ed815ce8b6fb89146821e (patch) | |
tree | a97cc2910461cab626c554e09729ea44ba07f747 /disasm.c | |
parent | 57162eb084ee80c2f024663c1bfc10c82bb83b20 (diff) | |
download | nasm-4e8396b5cf3981f0746ed815ce8b6fb89146821e.tar.gz nasm-4e8396b5cf3981f0746ed815ce8b6fb89146821e.tar.bz2 nasm-4e8396b5cf3981f0746ed815ce8b6fb89146821e.zip |
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 <benrudiak@gmail.com>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'disasm.c')
-rw-r--r-- | disasm.c | 45 |
1 files changed, 5 insertions, 40 deletions
@@ -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: { |