You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(208) |
Jun
(43) |
Jul
|
Aug
(2) |
Sep
(17) |
Oct
|
Nov
(4) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
(11) |
Mar
(3) |
Apr
(2) |
May
|
Jun
(3) |
Jul
(29) |
Aug
(29) |
Sep
(48) |
Oct
|
Nov
|
Dec
(5) |
2004 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(12) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(21) |
Nov
(25) |
Dec
(16) |
2007 |
Jan
(26) |
Feb
(26) |
Mar
(18) |
Apr
(51) |
May
(45) |
Jun
(26) |
Jul
(6) |
Aug
(85) |
Sep
(161) |
Oct
(111) |
Nov
(83) |
Dec
(18) |
2008 |
Jan
(31) |
Feb
(27) |
Mar
|
Apr
(16) |
May
(142) |
Jun
(136) |
Jul
(51) |
Aug
(21) |
Sep
(47) |
Oct
(428) |
Nov
(19) |
Dec
(6) |
2009 |
Jan
(11) |
Feb
(37) |
Mar
(17) |
Apr
(15) |
May
(13) |
Jun
(61) |
Jul
(127) |
Aug
(15) |
Sep
(22) |
Oct
(28) |
Nov
(37) |
Dec
(10) |
2010 |
Jan
(18) |
Feb
(22) |
Mar
(10) |
Apr
(41) |
May
|
Jun
(48) |
Jul
(61) |
Aug
(54) |
Sep
(34) |
Oct
(15) |
Nov
(49) |
Dec
(11) |
2011 |
Jan
|
Feb
(24) |
Mar
(10) |
Apr
(9) |
May
|
Jun
(33) |
Jul
(41) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(86) |
Mar
(12) |
Apr
|
May
(10) |
Jun
|
Jul
(9) |
Aug
(4) |
Sep
(11) |
Oct
(3) |
Nov
(3) |
Dec
(10) |
2013 |
Jan
(1) |
Feb
(23) |
Mar
(15) |
Apr
(7) |
May
(20) |
Jun
(3) |
Jul
(15) |
Aug
|
Sep
(29) |
Oct
(16) |
Nov
(69) |
Dec
(18) |
2014 |
Jan
|
Feb
(8) |
Mar
|
Apr
|
May
(16) |
Jun
(7) |
Jul
|
Aug
(5) |
Sep
(2) |
Oct
(4) |
Nov
(25) |
Dec
(8) |
2015 |
Jan
(6) |
Feb
(6) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
(1) |
Nov
(6) |
Dec
|
2016 |
Jan
(12) |
Feb
(97) |
Mar
(57) |
Apr
(52) |
May
(33) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(3) |
Nov
(3) |
Dec
|
2017 |
Jan
(4) |
Feb
|
Mar
(23) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(3) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(4) |
Feb
(11) |
Mar
|
Apr
(1) |
May
(3) |
Jun
(6) |
Jul
|
Aug
(5) |
Sep
(5) |
Oct
(36) |
Nov
(128) |
Dec
(18) |
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(24) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: nasm-bot f. B. Rudiak-G. <ben...@gm...> - 2013-03-01 06:35:50
|
Commit-ID: 4e8396b5cf3981f0746ed815ce8b6fb89146821e Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=4e8396b5cf3981f0746ed815ce8b6fb89146821e Author: Ben Rudiak-Gould <ben...@gm...> AuthorDate: Fri, 1 Mar 2013 10:28:32 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 1 Mar 2013 10:28:32 +0400 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 <ben...@gm...> Acked-by: "H. Peter Anvin" <hp...@zy...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- assemble.c | 210 ++++++------------------------------------ disasm.c | 45 +-------- insns.dat | 301 +++++++++++++++++++++++++++++++++++-------------------------- insns.pl | 38 +------- opflags.h | 17 ++-- parser.c | 28 +++--- 6 files changed, 229 insertions(+), 410 deletions(-) diff --git a/assemble.c b/assemble.c index 7b33df9..df0ac7d 100644 --- a/assemble.c +++ b/assemble.c @@ -42,9 +42,8 @@ * \7 - add 4 to both the primary and the secondary operand number * \10..\13 - a literal byte follows in the code stream, to be added * to the register value of operand 0..3 - * \14..\17 - a signed byte immediate operand, from operand 0..3 * \20..\23 - a byte immediate operand, from operand 0..3 - * \24..\27 - an unsigned byte immediate operand, from operand 0..3 + * \24..\27 - a zero-extended byte immediate operand, from operand 0..3 * \30..\33 - a word immediate operand, from operand 0..3 * \34..\37 - select between \3[0-3] and \4[0-3] depending on 16/32 bit * assembly mode or the operand-size override on the operand @@ -60,12 +59,6 @@ * \74..\77 - a word constant, from the _segment_ part of operand 0..3 * \1ab - a ModRM, calculated on EA in operand a, with the spare * field the register value of operand b. - * \140..\143 - an immediate word or signed byte for operand 0..3 - * \144..\147 - or 2 (s-field) into opcode byte if operand 0..3 - * is a signed byte rather than a word. Opcode byte follows. - * \150..\153 - an immediate dword or signed byte for operand 0..3 - * \154..\157 - or 2 (s-field) into opcode byte if operand 0..3 - * is a signed byte rather than a dword. Opcode byte follows. * \172\ab - the register number from operand a in bits 7..4, with * the 4-bit immediate from operand b in bits 3..0. * \173\xab - the register number from operand a in bits 7..4, with @@ -74,9 +67,6 @@ * an arbitrary value in bits 3..0 (assembled as zero.) * \2ab - a ModRM, calculated on EA in operand a, with the spare * field equal to digit b. - * \250..\253 - same as \150..\153, except warn if the 64-bit operand - * is not equal to the truncated and sign-extended 32-bit - * operand; used for 32-bit immediates in 64-bit mode. * \254..\257 - a signed 32-bit operand to be extended to 64 bits. * \260..\263 - this instruction uses VEX/XOP rather than REX, with the * V field taken from operand 0..3. @@ -100,8 +90,8 @@ * \271 - instruction takes XRELEASE (F3) with or without lock * \272 - instruction takes XACQUIRE/XRELEASE with or without lock * \273 - instruction takes XACQUIRE/XRELEASE with lock only - * \274..\277 - a signed byte immediate operand, from operand 0..3, - * which is to be extended to the operand size. + * \274..\277 - a byte immediate operand, from operand 0..3, sign-extended + * to the operand size (if o16/o32/o64 present) or the bit size * \310 - indicates fixed 16-bit address size, i.e. optional 0x67. * \311 - indicates fixed 32-bit address size, i.e. optional 0x67. * \312 - (disassembler only) invalid with non-default address size. @@ -321,6 +311,17 @@ static void out(int64_t offset, int32_t segto, const void *data, outfmt->output(segto, data, type, size, segment, wrt); } +static void out_imm8(int64_t offset, int32_t segment, struct operand *opx) +{ + if (opx->segment != NO_SEG) { + uint64_t data = opx->offset; + out(offset, segment, &data, OUT_ADDRESS, 1, opx->segment, opx->wrt); + } else { + uint8_t byte = opx->offset; + out(offset, segment, &byte, OUT_RAWDATA, 1, NO_SEG, NO_SEG); + } +} + static bool jmp_match(int32_t segment, int64_t offset, int bits, insn * ins, const struct itemplate *temp) { @@ -765,36 +766,6 @@ int64_t insn_size(int32_t segment, int64_t offset, int bits, uint32_t cp, } } -static bool possible_sbyte(operand *o) -{ - return o->wrt == NO_SEG && o->segment == NO_SEG && - !(o->opflags & OPFLAG_UNKNOWN) && - optimizing >= 0 && !(o->type & STRICT); -} - -/* check that opn[op] is a signed byte of size 16 or 32 */ -static bool is_sbyte16(operand *o) -{ - int16_t v; - - if (!possible_sbyte(o)) - return false; - - v = o->offset; - return v >= -128 && v <= 127; -} - -static bool is_sbyte32(operand *o) -{ - int32_t v; - - if (!possible_sbyte(o)) - return false; - - v = o->offset; - return v >= -128 && v <= 127; -} - static void bad_hle_warn(const insn * ins, uint8_t hleok) { enum prefixes rep_pfx = ins->prefixes[PPS_REP]; @@ -887,7 +858,6 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, codes++, length++; break; - case4(014): case4(020): case4(024): length++; @@ -939,24 +909,6 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, length += 2; break; - case4(0140): - length += is_sbyte16(opx) ? 1 : 2; - break; - - case4(0144): - codes++; - length++; - break; - - case4(0150): - length += is_sbyte32(opx) ? 1 : 4; - break; - - case4(0154): - codes++; - length++; - break; - case 0172: case 0173: codes++; @@ -967,10 +919,6 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, length++; break; - case4(0250): - length += is_sbyte32(opx) ? 1 : 4; - break; - case4(0254): length += 4; break; @@ -1320,45 +1268,12 @@ static void gencode(int32_t segment, int64_t offset, int bits, offset += 1; break; - case4(014): - /* - * The test for BITS8 and SBYTE here is intended to avoid - * warning on optimizer actions due to SBYTE, while still - * warn on explicit BYTE directives. Also warn, obviously, - * if the optimizer isn't enabled. - */ - if (((opx->type & BITS8) || - !(opx->type & temp->opd[op1] & BYTENESS)) && - (opx->offset < -128 || opx->offset > 127)) { - errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV, - "signed byte value exceeds bounds"); - } - if (opx->segment != NO_SEG) { - data = opx->offset; - out(offset, segment, &data, OUT_ADDRESS, 1, - opx->segment, opx->wrt); - } else { - bytes[0] = opx->offset; - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, - NO_SEG); - } - offset += 1; - break; - case4(020): if (opx->offset < -256 || opx->offset > 255) { errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV, "byte value exceeds bounds"); } - if (opx->segment != NO_SEG) { - data = opx->offset; - out(offset, segment, &data, OUT_ADDRESS, 1, - opx->segment, opx->wrt); - } else { - bytes[0] = opx->offset; - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, - NO_SEG); - } + out_imm8(offset, segment, opx); offset += 1; break; @@ -1366,15 +1281,7 @@ static void gencode(int32_t segment, int64_t offset, int bits, if (opx->offset < 0 || opx->offset > 255) errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV, "unsigned byte value exceeds bounds"); - if (opx->segment != NO_SEG) { - data = opx->offset; - out(offset, segment, &data, OUT_ADDRESS, 1, - opx->segment, opx->wrt); - } else { - bytes[0] = opx->offset; - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, - NO_SEG); - } + out_imm8(offset, segment, opx); offset += 1; break; @@ -1495,54 +1402,6 @@ static void gencode(int32_t segment, int64_t offset, int bits, offset += 2; break; - case4(0140): - data = opx->offset; - warn_overflow_opd(opx, 2); - if (is_sbyte16(opx)) { - bytes[0] = data; - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, - NO_SEG); - offset++; - } else { - out(offset, segment, &data, OUT_ADDRESS, 2, - opx->segment, opx->wrt); - offset += 2; - } - break; - - case4(0144): - EMIT_REX(); - bytes[0] = *codes++; - if (is_sbyte16(opx)) - bytes[0] |= 2; /* s-bit */ - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG); - offset++; - break; - - case4(0150): - data = opx->offset; - warn_overflow_opd(opx, 4); - if (is_sbyte32(opx)) { - bytes[0] = data; - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, - NO_SEG); - offset++; - } else { - out(offset, segment, &data, OUT_ADDRESS, 4, - opx->segment, opx->wrt); - offset += 4; - } - break; - - case4(0154): - EMIT_REX(); - bytes[0] = *codes++; - if (is_sbyte32(opx)) - bytes[0] |= 2; /* s-bit */ - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG); - offset++; - break; - case 0172: c = *codes++; opx = &ins->oprs[c >> 3]; @@ -1578,25 +1437,6 @@ static void gencode(int32_t segment, int64_t offset, int bits, offset++; break; - case4(0250): - data = opx->offset; - if (opx->wrt == NO_SEG && opx->segment == NO_SEG && - (int32_t)data != (int64_t)data) { - errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV, - "signed dword immediate exceeds bounds"); - } - if (is_sbyte32(opx)) { - bytes[0] = data; - out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, - NO_SEG); - offset++; - } else { - out(offset, segment, &data, OUT_ADDRESS, 4, - opx->segment, opx->wrt); - offset += 4; - } - break; - case4(0254): data = opx->offset; if (opx->wrt == NO_SEG && opx->segment == NO_SEG && @@ -1652,8 +1492,15 @@ static void gencode(int32_t segment, int64_t offset, int bits, if (uv > 127 && uv < (uint64_t)-128 && (uv < um-128 || uv > um-1)) { + /* If this wasn't explicitly byte-sized, warn as though we + * had fallen through to the imm16/32/64 case. + */ errfunc(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV, - "signed byte value exceeds bounds"); + "%s value exceeds bounds", + (opx->type & BITS8) ? "signed byte" : + s == 16 ? "word" : + s == 32 ? "dword" : + "signed dword"); } if (opx->segment != NO_SEG) { data = uv; @@ -2197,10 +2044,11 @@ static enum match_result matches(const struct itemplate *itemp, if (type != instruction->oprs[j].type || instruction->oprs[i].basereg != instruction->oprs[j].basereg) return MERR_INVALOP; - } else if (itemp->opd[i] & ~type || - ((itemp->opd[i] & SIZE_MASK) && - ((itemp->opd[i] ^ type) & SIZE_MASK))) { - if ((itemp->opd[i] & ~type & ~SIZE_MASK) || (type & SIZE_MASK)) { + } else if (itemp->opd[i] & ~type & ~SIZE_MASK) { + return MERR_INVALOP; + } else if ((itemp->opd[i] & SIZE_MASK) && + (itemp->opd[i] & SIZE_MASK) != (type & SIZE_MASK)) { + if (type & SIZE_MASK) { return MERR_INVALOP; } else if (!is_class(REGISTER, type)) { /* 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: { diff --git a/insns.dat b/insns.dat index f386adb..9e14106 100644 --- a/insns.dat +++ b/insns.dat @@ -86,23 +86,28 @@ ADC reg32,mem [rm: o32 13 /r] 386,SM ADC reg32,reg32 [rm: o32 13 /r] 386 ADC reg64,mem [rm: o64 13 /r] X64,SM ADC reg64,reg64 [rm: o64 13 /r] X64 -ADC rm16,imm8 [mi: hle o16 83 /2 ibx] 8086,LOCK -ADC rm32,imm8 [mi: hle o32 83 /2 ibx] 386,LOCK -ADC rm64,imm8 [mi: hle o64 83 /2 ibx] X64,LOCK +ADC rm16,imm8 [mi: hle o16 83 /2 ib,s] 8086,LOCK +ADC rm32,imm8 [mi: hle o32 83 /2 ib,s] 386,LOCK +ADC rm64,imm8 [mi: hle o64 83 /2 ib,s] X64,LOCK ADC reg_al,imm [-i: 14 ib] 8086,SM -ADC reg_ax,sbyte16 [mi: o16 83 /2 ibx] 8086,SM +ADC reg_ax,sbyteword [mi: o16 83 /2 ib,s] 8086,SM,ND ADC reg_ax,imm [-i: o16 15 iw] 8086,SM -ADC reg_eax,sbyte32 [mi: o32 83 /2 ibx] 386,SM +ADC reg_eax,sbytedword [mi: o32 83 /2 ib,s] 386,SM,ND ADC reg_eax,imm [-i: o32 15 id] 386,SM -ADC reg_rax,sbyte64 [mi: o64 83 /2 ibx] X64,SM -ADC reg_rax,imm [-i: o64 15 idx] X64,SM +ADC reg_rax,sbytedword [mi: o64 83 /2 ib,s] X64,SM,ND +ADC reg_rax,imm [-i: o64 15 id,s] X64,SM ADC rm8,imm [mi: hle 80 /2 ib] 8086,SM,LOCK -ADC rm16,imm [mi: hle o16 81+s /2 ibw] 8086,SM,LOCK -ADC rm32,imm [mi: hle o32 81+s /2 ibd] 386,SM,LOCK -ADC rm64,imm [mi: hle o64 81+s /2 ibd,s] X64,SM,LOCK -ADC mem,imm8 [mi: hle 80 /2 ib] 8086,SM,LOCK -ADC mem,imm16 [mi: hle o16 81+s /2 ibw] 8086,SM,LOCK -ADC mem,imm32 [mi: hle o32 81+s /2 ibd] 386,SM,LOCK +ADC rm16,sbyteword [mi: hle o16 83 /2 ib,s] 8086,SM,LOCK,ND +ADC rm16,imm [mi: hle o16 81 /2 iw] 8086,SM,LOCK +ADC rm32,sbytedword [mi: hle o32 83 /2 ib,s] 386,SM,LOCK,ND +ADC rm32,imm [mi: hle o32 81 /2 id] 386,SM,LOCK +ADC rm64,sbytedword [mi: hle o64 83 /2 ib,s] X64,SM,LOCK,ND +ADC rm64,imm [mi: hle o64 81 /2 id,s] X64,SM,LOCK +ADC mem,imm8 [mi: hle 80 /2 ib] 8086,SM,LOCK,ND +ADC mem,sbyteword16 [mi: hle o16 83 /2 ib,s] 8086,SM,LOCK,ND +ADC mem,imm16 [mi: hle o16 81 /2 iw] 8086,SM,LOCK +ADC mem,sbytedword32 [mi: hle o32 83 /2 ib,s] 386,SM,LOCK,ND +ADC mem,imm32 [mi: hle o32 81 /2 id] 386,SM,LOCK ADC rm8,imm [mi: hle 82 /2 ib] 8086,SM,LOCK,ND,NOLONG ADD mem,reg8 [mr: hle 00 /r] 8086,SM,LOCK ADD reg8,reg8 [mr: 00 /r] 8086 @@ -120,23 +125,28 @@ ADD reg32,mem [rm: o32 03 /r] 386,SM ADD reg32,reg32 [rm: o32 03 /r] 386 ADD reg64,mem [rm: o64 03 /r] X64,SM ADD reg64,reg64 [rm: o64 03 /r] X64 -ADD rm16,imm8 [mi: hle o16 83 /0 ibx] 8086,LOCK -ADD rm32,imm8 [mi: hle o32 83 /0 ibx] 386,LOCK -ADD rm64,imm8 [mi: hle o64 83 /0 ibx] X64,LOCK +ADD rm16,imm8 [mi: hle o16 83 /0 ib,s] 8086,LOCK +ADD rm32,imm8 [mi: hle o32 83 /0 ib,s] 386,LOCK +ADD rm64,imm8 [mi: hle o64 83 /0 ib,s] X64,LOCK ADD reg_al,imm [-i: 04 ib] 8086,SM -ADD reg_ax,sbyte16 [mi: o16 83 /0 ibx] 8086,SM +ADD reg_ax,sbyteword [mi: o16 83 /0 ib,s] 8086,SM,ND ADD reg_ax,imm [-i: o16 05 iw] 8086,SM -ADD reg_eax,sbyte32 [mi: o32 83 /0 ibx] 386,SM +ADD reg_eax,sbytedword [mi: o32 83 /0 ib,s] 386,SM,ND ADD reg_eax,imm [-i: o32 05 id] 386,SM -ADD reg_rax,sbyte64 [mi: o64 83 /0 ibx] X64,SM -ADD reg_rax,imm [-i: o64 05 idx] X64,SM +ADD reg_rax,sbytedword [mi: o64 83 /0 ib,s] X64,SM,ND +ADD reg_rax,imm [-i: o64 05 id,s] X64,SM ADD rm8,imm [mi: hle 80 /0 ib] 8086,SM,LOCK -ADD rm16,imm [mi: hle o16 81+s /0 ibw] 8086,SM,LOCK -ADD rm32,imm [mi: hle o32 81+s /0 ibd] 386,SM,LOCK -ADD rm64,imm [mi: hle o64 81+s /0 ibd,s] X64,SM,LOCK +ADD rm16,sbyteword [mi: hle o16 83 /0 ib,s] 8086,SM,LOCK,ND +ADD rm16,imm [mi: hle o16 81 /0 iw] 8086,SM,LOCK +ADD rm32,sbytedword [mi: hle o32 83 /0 ib,s] 386,SM,LOCK,ND +ADD rm32,imm [mi: hle o32 81 /0 id] 386,SM,LOCK +ADD rm64,sbytedword [mi: hle o64 83 /0 ib,s] X64,SM,LOCK,ND +ADD rm64,imm [mi: hle o64 81 /0 id,s] X64,SM,LOCK ADD mem,imm8 [mi: hle 80 /0 ib] 8086,SM,LOCK -ADD mem,imm16 [mi: hle o16 81+s /0 ibw] 8086,SM,LOCK -ADD mem,imm32 [mi: hle o32 81+s /0 ibd] 386,SM,LOCK +ADD mem,sbyteword16 [mi: hle o16 83 /0 ib,s] 8086,SM,LOCK,ND +ADD mem,imm16 [mi: hle o16 81 /0 iw] 8086,SM,LOCK +ADD mem,sbytedword32 [mi: hle o32 83 /0 ib,s] 386,SM,LOCK,ND +ADD mem,imm32 [mi: hle o32 81 /0 id] 386,SM,LOCK ADD rm8,imm [mi: hle 82 /0 ib] 8086,SM,LOCK,ND,NOLONG AND mem,reg8 [mr: hle 20 /r] 8086,SM,LOCK AND reg8,reg8 [mr: 20 /r] 8086 @@ -154,23 +164,28 @@ AND reg32,mem [rm: o32 23 /r] 386,SM AND reg32,reg32 [rm: o32 23 /r] 386 AND reg64,mem [rm: o64 23 /r] X64,SM AND reg64,reg64 [rm: o64 23 /r] X64 -AND rm16,imm8 [mi: hle o16 83 /4 ibx] 8086,LOCK -AND rm32,imm8 [mi: hle o32 83 /4 ibx] 386,LOCK -AND rm64,imm8 [mi: hle o64 83 /4 ibx] X64,LOCK +AND rm16,imm8 [mi: hle o16 83 /4 ib,s] 8086,LOCK +AND rm32,imm8 [mi: hle o32 83 /4 ib,s] 386,LOCK +AND rm64,imm8 [mi: hle o64 83 /4 ib,s] X64,LOCK AND reg_al,imm [-i: 24 ib] 8086,SM -AND reg_ax,sbyte16 [mi: o16 83 /4 ibx] 8086,SM +AND reg_ax,sbyteword [mi: o16 83 /4 ib,s] 8086,SM,ND AND reg_ax,imm [-i: o16 25 iw] 8086,SM -AND reg_eax,sbyte32 [mi: o32 83 /4 ibx] 386,SM +AND reg_eax,sbytedword [mi: o32 83 /4 ib,s] 386,SM,ND AND reg_eax,imm [-i: o32 25 id] 386,SM -AND reg_rax,sbyte64 [mi: o64 83 /4 ibx] X64,SM -AND reg_rax,imm [-i: o64 25 idx] X64,SM +AND reg_rax,sbytedword [mi: o64 83 /4 ib,s] X64,SM,ND +AND reg_rax,imm [-i: o64 25 id,s] X64,SM AND rm8,imm [mi: hle 80 /4 ib] 8086,SM,LOCK -AND rm16,imm [mi: hle o16 81+s /4 ibw] 8086,SM,LOCK -AND rm32,imm [mi: hle o32 81+s /4 ibd] 386,SM,LOCK -AND rm64,imm [mi: hle o64 81+s /4 ibd,s] X64,SM,LOCK +AND rm16,sbyteword [mi: hle o16 83 /4 ib,s] 8086,SM,LOCK,ND +AND rm16,imm [mi: hle o16 81 /4 iw] 8086,SM,LOCK +AND rm32,sbytedword [mi: hle o32 83 /4 ib,s] 386,SM,LOCK,ND +AND rm32,imm [mi: hle o32 81 /4 id] 386,SM,LOCK +AND rm64,sbytedword [mi: hle o64 83 /4 ib,s] X64,SM,LOCK,ND +AND rm64,imm [mi: hle o64 81 /4 id,s] X64,SM,LOCK AND mem,imm8 [mi: hle 80 /4 ib] 8086,SM,LOCK -AND mem,imm16 [mi: hle o16 81+s /4 ibw] 8086,SM,LOCK -AND mem,imm32 [mi: hle o32 81+s /4 ibd] 386,SM,LOCK +AND mem,sbyteword16 [mi: hle o16 83 /4 ib,s] 8086,SM,LOCK,ND +AND mem,imm16 [mi: hle o16 81 /4 iw] 8086,SM,LOCK +AND mem,sbytedword32 [mi: hle o32 83 /4 ib,s] 386,SM,LOCK,ND +AND mem,imm32 [mi: hle o32 81 /4 id] 386,SM,LOCK AND rm8,imm [mi: hle 82 /4 ib] 8086,SM,LOCK,ND,NOLONG ARPL mem,reg16 [mr: 63 /r] 286,PROT,SM,NOLONG ARPL reg16,reg16 [mr: 63 /r] 286,PROT,NOLONG @@ -282,23 +297,28 @@ CMP reg32,mem [rm: o32 3b /r] 386,SM CMP reg32,reg32 [rm: o32 3b /r] 386 CMP reg64,mem [rm: o64 3b /r] X64,SM CMP reg64,reg64 [rm: o64 3b /r] X64 -CMP rm16,imm8 [mi: o16 83 /7 ibx] 8086 -CMP rm32,imm8 [mi: o32 83 /7 ibx] 386 -CMP rm64,imm8 [mi: o64 83 /7 ibx] X64 +CMP rm16,imm8 [mi: o16 83 /7 ib,s] 8086 +CMP rm32,imm8 [mi: o32 83 /7 ib,s] 386 +CMP rm64,imm8 [mi: o64 83 /7 ib,s] X64 CMP reg_al,imm [-i: 3c ib] 8086,SM -CMP reg_ax,sbyte16 [mi: o16 83 /7 ibx] 8086,SM +CMP reg_ax,sbyteword [mi: o16 83 /7 ib,s] 8086,SM,ND CMP reg_ax,imm [-i: o16 3d iw] 8086,SM -CMP reg_eax,sbyte32 [mi: o32 83 /7 ibx] 386,SM +CMP reg_eax,sbytedword [mi: o32 83 /7 ib,s] 386,SM,ND CMP reg_eax,imm [-i: o32 3d id] 386,SM -CMP reg_rax,sbyte64 [mi: o64 83 /7 ibx] X64,SM -CMP reg_rax,imm [-i: o64 3d idx] X64,SM +CMP reg_rax,sbytedword [mi: o64 83 /7 ib,s] X64,SM,ND +CMP reg_rax,imm [-i: o64 3d id,s] X64,SM CMP rm8,imm [mi: 80 /7 ib] 8086,SM -CMP rm16,imm [mi: o16 81+s /7 ibw] 8086,SM -CMP rm32,imm [mi: o32 81+s /7 ibd] 386,SM -CMP rm64,imm [mi: o64 81+s /7 ibd,s] X64,SM +CMP rm16,sbyteword [mi: o16 83 /7 ib,s] 8086,SM,ND +CMP rm16,imm [mi: o16 81 /7 iw] 8086,SM +CMP rm32,sbytedword [mi: o32 83 /7 ib,s] 386,SM,ND +CMP rm32,imm [mi: o32 81 /7 id] 386,SM +CMP rm64,sbytedword [mi: o64 83 /7 ib,s] X64,SM,ND +CMP rm64,imm [mi: o64 81 /7 id,s] X64,SM CMP mem,imm8 [mi: 80 /7 ib] 8086,SM -CMP mem,imm16 [mi: o16 81+s /7 ibw] 8086,SM -CMP mem,imm32 [mi: o32 81+s /7 ibd] 386,SM +CMP mem,sbyteword16 [mi: o16 83 /7 ib,s] 8086,SM,ND +CMP mem,imm16 [mi: o16 81 /7 iw] 8086,SM +CMP mem,sbytedword32 [mi: o32 83 /7 ib,s] 386,SM,ND +CMP mem,imm32 [mi: o32 81 /7 id] 386,SM CMP rm8,imm [mi: 82 /7 ib] 8086,SM,ND,NOLONG CMPSB void [ repe a6] 8086 CMPSD void [ repe o32 a7] 386 @@ -582,41 +602,41 @@ IMUL reg32,reg32 [rm: o32 0f af /r] 386 IMUL reg64,mem [rm: o64 0f af /r] X64,SM IMUL reg64,reg64 [rm: o64 0f af /r] X64 IMUL reg16,mem,imm8 [rmi: o16 6b /r ib,s] 186,SM -IMUL reg16,mem,sbyte16 [rmi: o16 6b /r ib,s] 186,SM,ND +IMUL reg16,mem,sbyteword [rmi: o16 6b /r ib,s] 186,SM,ND IMUL reg16,mem,imm16 [rmi: o16 69 /r iw] 186,SM -IMUL reg16,mem,imm [rmi: o16 69+s /r ibw] 186,SM,ND +IMUL reg16,mem,imm [rmi: o16 69 /r iw] 186,SM,ND IMUL reg16,reg16,imm8 [rmi: o16 6b /r ib,s] 186 -IMUL reg16,reg16,sbyte16 [rmi: o16 6b /r ib,s] 186,SM,ND +IMUL reg16,reg16,sbyteword [rmi: o16 6b /r ib,s] 186,SM,ND IMUL reg16,reg16,imm16 [rmi: o16 69 /r iw] 186 -IMUL reg16,reg16,imm [rmi: o16 69+s /r ibw] 186,SM,ND +IMUL reg16,reg16,imm [rmi: o16 69 /r iw] 186,SM,ND IMUL reg32,mem,imm8 [rmi: o32 6b /r ib,s] 386,SM -IMUL reg32,mem,sbyte32 [rmi: o32 6b /r ib,s] 386,SM,ND +IMUL reg32,mem,sbytedword [rmi: o32 6b /r ib,s] 386,SM,ND IMUL reg32,mem,imm32 [rmi: o32 69 /r id] 386,SM -IMUL reg32,mem,imm [rmi: o32 69+s /r ibd] 386,SM,ND +IMUL reg32,mem,imm [rmi: o32 69 /r id] 386,SM,ND IMUL reg32,reg32,imm8 [rmi: o32 6b /r ib,s] 386 -IMUL reg32,reg32,sbyte32 [rmi: o32 6b /r ib,s] 386,SM,ND +IMUL reg32,reg32,sbytedword [rmi: o32 6b /r ib,s] 386,SM,ND IMUL reg32,reg32,imm32 [rmi: o32 69 /r id] 386 -IMUL reg32,reg32,imm [rmi: o32 69+s /r ibd] 386,SM,ND +IMUL reg32,reg32,imm [rmi: o32 69 /r id] 386,SM,ND IMUL reg64,mem,imm8 [rmi: o64 6b /r ib,s] X64,SM -IMUL reg64,mem,sbyte64 [rmi: o64 6b /r ib,s] X64,SM,ND +IMUL reg64,mem,sbytedword [rmi: o64 6b /r ib,s] X64,SM,ND IMUL reg64,mem,imm32 [rmi: o64 69 /r id] X64,SM -IMUL reg64,mem,imm [rmi: o64 69+s /r ibd,s] X64,SM,ND +IMUL reg64,mem,imm [rmi: o64 69 /r id,s] X64,SM,ND IMUL reg64,reg64,imm8 [rmi: o64 6b /r ib,s] X64 -IMUL reg64,reg64,sbyte64 [rmi: o64 6b /r ib,s] X64,SM,ND +IMUL reg64,reg64,sbytedword [rmi: o64 6b /r ib,s] X64,SM,ND IMUL reg64,reg64,imm32 [rmi: o64 69 /r id] X64 -IMUL reg64,reg64,imm [rmi: o64 69+s /r ibd,s] X64,SM,ND +IMUL reg64,reg64,imm [rmi: o64 69 /r id,s] X64,SM,ND IMUL reg16,imm8 [r+mi: o16 6b /r ib,s] 186 -IMUL reg16,sbyte16 [r+mi: o16 6b /r ib,s] 186,SM,ND +IMUL reg16,sbyteword [r+mi: o16 6b /r ib,s] 186,SM,ND IMUL reg16,imm16 [r+mi: o16 69 /r iw] 186 -IMUL reg16,imm [r+mi: o16 69+s /r ibw] 186,SM,ND +IMUL reg16,imm [r+mi: o16 69 /r iw] 186,SM,ND IMUL reg32,imm8 [r+mi: o32 6b /r ib,s] 386 -IMUL reg32,sbyte32 [r+mi: o32 6b /r ib,s] 386,SM,ND +IMUL reg32,sbytedword [r+mi: o32 6b /r ib,s] 386,SM,ND IMUL reg32,imm32 [r+mi: o32 69 /r id] 386 -IMUL reg32,imm [r+mi: o32 69+s /r ibd] 386,SM,ND +IMUL reg32,imm [r+mi: o32 69 /r id] 386,SM,ND IMUL reg64,imm8 [r+mi: o64 6b /r ib,s] X64 -IMUL reg64,sbyte64 [r+mi: o64 6b /r ib,s] X64,SM,ND -IMUL reg64,imm32 [r+mi: o64 69 /r idx] X64 -IMUL reg64,imm [r+mi: o64 69+s /r ibd,s] X64,SM,ND +IMUL reg64,sbytedword [r+mi: o64 6b /r ib,s] X64,SM,ND +IMUL reg64,imm32 [r+mi: o64 69 /r id,s] X64 +IMUL reg64,imm [r+mi: o64 69 /r id,s] X64,SM,ND IN reg_al,imm [-i: e4 ib,u] 8086,SB IN reg_ax,imm [-i: o16 e5 ib,u] 8086,SB IN reg_eax,imm [-i: o32 e5 ib,u] 386,SB @@ -824,14 +844,14 @@ MOV reg64,reg64 [rm: o64 8b /r] X64 MOV reg8,imm [ri: b0+r ib] 8086,SM MOV reg16,imm [ri: o16 b8+r iw] 8086,SM MOV reg32,imm [ri: o32 b8+r id] 386,SM -MOV reg64,udword64 [ri: o64nw b8+r id] X64,SM,OPT,ND -MOV reg64,sdword64 [mi: o64 c7 /0 idx] X64,SM,OPT,ND +MOV reg64,udword [ri: o64nw b8+r id] X64,SM,OPT,ND +MOV reg64,sdword [mi: o64 c7 /0 id,s] X64,SM,OPT,ND MOV reg64,imm [ri: o64 b8+r iq] X64,SM MOV rm8,imm [mi: hlexr c6 /0 ib] 8086,SM MOV rm16,imm [mi: hlexr o16 c7 /0 iw] 8086,SM MOV rm32,imm [mi: hlexr o32 c7 /0 id] 386,SM -MOV rm64,imm [mi: hlexr o64 c7 /0 idx] X64,SM -MOV rm64,imm32 [mi: hlexr o64 c7 /0 idx] X64 +MOV rm64,imm [mi: hlexr o64 c7 /0 id,s] X64,SM +MOV rm64,imm32 [mi: hlexr o64 c7 /0 id,s] X64 MOV mem,imm8 [mi: hlexr c6 /0 ib] 8086,SM MOV mem,imm16 [mi: hlexr o16 c7 /0 iw] 8086,SM MOV mem,imm32 [mi: hlexr o32 c7 /0 id] 386,SM @@ -895,23 +915,28 @@ OR reg32,mem [rm: o32 0b /r] 386,SM OR reg32,reg32 [rm: o32 0b /r] 386 OR reg64,mem [rm: o64 0b /r] X64,SM OR reg64,reg64 [rm: o64 0b /r] X64 -OR rm16,imm8 [mi: hle o16 83 /1 ibx] 8086,LOCK -OR rm32,imm8 [mi: hle o32 83 /1 ibx] 386,LOCK -OR rm64,imm8 [mi: hle o64 83 /1 ibx] X64,LOCK +OR rm16,imm8 [mi: hle o16 83 /1 ib,s] 8086,LOCK +OR rm32,imm8 [mi: hle o32 83 /1 ib,s] 386,LOCK +OR rm64,imm8 [mi: hle o64 83 /1 ib,s] X64,LOCK OR reg_al,imm [-i: 0c ib] 8086,SM -OR reg_ax,sbyte16 [mi: o16 83 /1 ibx] 8086,SM +OR reg_ax,sbyteword [mi: o16 83 /1 ib,s] 8086,SM,ND OR reg_ax,imm [-i: o16 0d iw] 8086,SM -OR reg_eax,sbyte32 [mi: o32 83 /1 ibx] 386,SM +OR reg_eax,sbytedword [mi: o32 83 /1 ib,s] 386,SM,ND OR reg_eax,imm [-i: o32 0d id] 386,SM -OR reg_rax,sbyte64 [mi: o64 83 /1 ibx] X64,SM -OR reg_rax,imm [-i: o64 0d idx] X64,SM +OR reg_rax,sbytedword [mi: o64 83 /1 ib,s] X64,SM,ND +OR reg_rax,imm [-i: o64 0d id,s] X64,SM OR rm8,imm [mi: hle 80 /1 ib] 8086,SM,LOCK -OR rm16,imm [mi: hle o16 81+s /1 ibw] 8086,SM,LOCK -OR rm32,imm [mi: hle o32 81+s /1 ibd] 386,SM,LOCK -OR rm64,imm [mi: hle o64 81+s /1 ibd,s] X64,SM,LOCK +OR rm16,sbyteword [mi: hle o16 83 /1 ib,s] 8086,SM,LOCK,ND +OR rm16,imm [mi: hle o16 81 /1 iw] 8086,SM,LOCK +OR rm32,sbytedword [mi: hle o32 83 /1 ib,s] 386,SM,LOCK,ND +OR rm32,imm [mi: hle o32 81 /1 id] 386,SM,LOCK +OR rm64,sbytedword [mi: hle o64 83 /1 ib,s] X64,SM,LOCK,ND +OR rm64,imm [mi: hle o64 81 /1 id,s] X64,SM,LOCK OR mem,imm8 [mi: hle 80 /1 ib] 8086,SM,LOCK -OR mem,imm16 [mi: hle o16 81+s /1 ibw] 8086,SM,LOCK -OR mem,imm32 [mi: hle o32 81+s /1 ibd] 386,SM,LOCK +OR mem,sbyteword16 [mi: hle o16 83 /1 ib,s] 8086,SM,LOCK,ND +OR mem,imm16 [mi: hle o16 81 /1 iw] 8086,SM,LOCK +OR mem,sbytedword32 [mi: hle o32 83 /1 ib,s] 386,SM,LOCK,ND +OR mem,imm32 [mi: hle o32 81 /1 id] 386,SM,LOCK OR rm8,imm [mi: hle 82 /1 ib] 8086,SM,LOCK,ND,NOLONG OUT imm,reg_al [i-: e6 ib,u] 8086,SB OUT imm,reg_ax [i-: o16 e7 ib,u] 8086,SB @@ -1032,12 +1057,17 @@ PUSH rm64 [m: o64nw ff /6] X64 PUSH reg_cs [-: pushseg] 8086,NOLONG PUSH reg_dess [-: pushseg] 8086,NOLONG PUSH reg_fsgs [-: 0f pushseg2] 386 -PUSH imm8 [i: 6a ibx] 186 -PUSH imm16 [i: o16 68+s ibw] 186,AR0,SZ -PUSH imm32 [i: o32 68+s ibd] 386,NOLONG,AR0,SZ -PUSH imm32 [i: o32 68+s ibd] 386,NOLONG,SD -PUSH imm32 [i: o64nw 68+s ibd,s] X64,AR0,SZ -PUSH imm64 [i: o64nw 68+s ibd,s] X64,AR0,SZ +PUSH imm8 [i: 6a ib,s] 186 +PUSH sbyteword16 [i: o16 6a ib,s] 186,AR0,SZ,ND +PUSH imm16 [i: o16 68 iw] 186,AR0,SZ +PUSH sbytedword32 [i: o32 6a ib,s] 386,NOLONG,AR0,SZ,ND +PUSH imm32 [i: o32 68 id] 386,NOLONG,AR0,SZ +PUSH sbytedword32 [i: o32 6a ib,s] 386,NOLONG,SD,ND +PUSH imm32 [i: o32 68 id] 386,NOLONG,SD +PUSH sbytedword64 [i: o64nw 6a ib,s] X64,AR0,SZ,ND +PUSH imm64 [i: o64nw 68 id,s] X64,AR0,SZ +PUSH sbytedword32 [i: o64nw 6a ib,s] X64,AR0,SZ,ND +PUSH imm32 [i: o64nw 68 id,s] X64,AR0,SZ PUSHA void [ odf 60] 186,NOLONG PUSHAD void [ o32 60] 386,NOLONG PUSHAW void [ o16 60] 186,NOLONG @@ -1152,23 +1182,28 @@ SBB reg32,mem [rm: o32 1b /r] 386,SM SBB reg32,reg32 [rm: o32 1b /r] 386 SBB reg64,mem [rm: o64 1b /r] X64,SM SBB reg64,reg64 [rm: o64 1b /r] X64 -SBB rm16,imm8 [mi: hle o16 83 /3 ibx] 8086,LOCK -SBB rm32,imm8 [mi: hle o32 83 /3 ibx] 386,LOCK -SBB rm64,imm8 [mi: hle o64 83 /3 ibx] X64,LOCK +SBB rm16,imm8 [mi: hle o16 83 /3 ib,s] 8086,LOCK +SBB rm32,imm8 [mi: hle o32 83 /3 ib,s] 386,LOCK +SBB rm64,imm8 [mi: hle o64 83 /3 ib,s] X64,LOCK SBB reg_al,imm [-i: 1c ib] 8086,SM -SBB reg_ax,sbyte16 [mi: o16 83 /3 ibx] 8086,SM +SBB reg_ax,sbyteword [mi: o16 83 /3 ib,s] 8086,SM,ND SBB reg_ax,imm [-i: o16 1d iw] 8086,SM -SBB reg_eax,sbyte32 [mi: o32 83 /3 ibx] 386,SM +SBB reg_eax,sbytedword [mi: o32 83 /3 ib,s] 386,SM,ND SBB reg_eax,imm [-i: o32 1d id] 386,SM -SBB reg_rax,sbyte64 [mi: o64 83 /3 ibx] X64,SM -SBB reg_rax,imm [-i: o64 1d idx] X64,SM +SBB reg_rax,sbytedword [mi: o64 83 /3 ib,s] X64,SM,ND +SBB reg_rax,imm [-i: o64 1d id,s] X64,SM SBB rm8,imm [mi: hle 80 /3 ib] 8086,SM,LOCK -SBB rm16,imm [mi: hle o16 81+s /3 ibw] 8086,SM,LOCK -SBB rm32,imm [mi: hle o32 81+s /3 ibd] 386,SM,LOCK -SBB rm64,imm [mi: hle o64 81+s /3 ibd,s] X64,SM,LOCK +SBB rm16,sbyteword [mi: hle o16 83 /3 ib,s] 8086,SM,LOCK,ND +SBB rm16,imm [mi: hle o16 81 /3 iw] 8086,SM,LOCK +SBB rm32,sbytedword [mi: hle o32 83 /3 ib,s] 386,SM,LOCK,ND +SBB rm32,imm [mi: hle o32 81 /3 id] 386,SM,LOCK +SBB rm64,sbytedword [mi: hle o64 83 /3 ib,s] X64,SM,LOCK,ND +SBB rm64,imm [mi: hle o64 81 /3 id,s] X64,SM,LOCK SBB mem,imm8 [mi: hle 80 /3 ib] 8086,SM,LOCK -SBB mem,imm16 [mi: hle o16 81+s /3 ibw] 8086,SM,LOCK -SBB mem,imm32 [mi: hle o32 81+s /3 ibd] 386,SM,LOCK +SBB mem,sbyteword16 [mi: hle o16 83 /3 ib,s] 8086,SM,LOCK,ND +SBB mem,imm16 [mi: hle o16 81 /3 iw] 8086,SM,LOCK +SBB mem,sbytedword32 [mi: hle o32 83 /3 ib,s] 386,SM,LOCK,ND +SBB mem,imm32 [mi: hle o32 81 /3 id] 386,SM,LOCK SBB rm8,imm [mi: hle 82 /3 ib] 8086,SM,LOCK,ND,NOLONG SCASB void [ repe ae] 8086 SCASD void [ repe o32 af] 386 @@ -1268,23 +1303,28 @@ SUB reg32,mem [rm: o32 2b /r] 386,SM SUB reg32,reg32 [rm: o32 2b /r] 386 SUB reg64,mem [rm: o64 2b /r] X64,SM SUB reg64,reg64 [rm: o64 2b /r] X64 -SUB rm16,imm8 [mi: hle o16 83 /5 ibx] 8086,LOCK -SUB rm32,imm8 [mi: hle o32 83 /5 ibx] 386,LOCK -SUB rm64,imm8 [mi: hle o64 83 /5 ibx] X64,LOCK +SUB rm16,imm8 [mi: hle o16 83 /5 ib,s] 8086,LOCK +SUB rm32,imm8 [mi: hle o32 83 /5 ib,s] 386,LOCK +SUB rm64,imm8 [mi: hle o64 83 /5 ib,s] X64,LOCK SUB reg_al,imm [-i: 2c ib] 8086,SM -SUB reg_ax,sbyte16 [mi: o16 83 /5 ibx] 8086,SM +SUB reg_ax,sbyteword [mi: o16 83 /5 ib,s] 8086,SM,ND SUB reg_ax,imm [-i: o16 2d iw] 8086,SM -SUB reg_eax,sbyte32 [mi: o32 83 /5 ibx] 386,SM +SUB reg_eax,sbytedword [mi: o32 83 /5 ib,s] 386,SM,ND SUB reg_eax,imm [-i: o32 2d id] 386,SM -SUB reg_rax,sbyte64 [mi: o64 83 /5 ibx] X64,SM -SUB reg_rax,imm [-i: o64 2d idx] X64,SM +SUB reg_rax,sbytedword [mi: o64 83 /5 ib,s] X64,SM,ND +SUB reg_rax,imm [-i: o64 2d id,s] X64,SM SUB rm8,imm [mi: hle 80 /5 ib] 8086,SM,LOCK -SUB rm16,imm [mi: hle o16 81+s /5 ibw] 8086,SM,LOCK -SUB rm32,imm [mi: hle o32 81+s /5 ibd] 386,SM,LOCK -SUB rm64,imm [mi: hle o64 81+s /5 ibd,s] X64,SM,LOCK +SUB rm16,sbyteword [mi: hle o16 83 /5 ib,s] 8086,SM,LOCK,ND +SUB rm16,imm [mi: hle o16 81 /5 iw] 8086,SM,LOCK +SUB rm32,sbytedword [mi: hle o32 83 /5 ib,s] 386,SM,LOCK,ND +SUB rm32,imm [mi: hle o32 81 /5 id] 386,SM,LOCK +SUB rm64,sbytedword [mi: hle o64 83 /5 ib,s] X64,SM,LOCK,ND +SUB rm64,imm [mi: hle o64 81 /5 id,s] X64,SM,LOCK SUB mem,imm8 [mi: hle 80 /5 ib] 8086,SM,LOCK -SUB mem,imm16 [mi: hle o16 81+s /5 ibw] 8086,SM,LOCK -SUB mem,imm32 [mi: hle o32 81+s /5 ibd] 386,SM,LOCK +SUB mem,sbyteword16 [mi: hle o16 83 /5 ib,s] 8086,SM,LOCK,ND +SUB mem,imm16 [mi: hle o16 81 /5 iw] 8086,SM,LOCK +SUB mem,sbytedword32 [mi: hle o32 83 /5 ib,s] 386,SM,LOCK,ND +SUB mem,imm32 [mi: hle o32 81 /5 id] 386,SM,LOCK SUB rm8,imm [mi: hle 82 /5 ib] 8086,SM,LOCK,ND,NOLONG SVDC mem80,reg_sreg [mr: 0f 78 /r] 486,CYRIX,SMM SVLDT mem80 [m: 0f 7a /0] 486,CYRIX,SMM,ND @@ -1309,11 +1349,11 @@ TEST reg64,mem [rm: o64 85 /r] X64,SM TEST reg_al,imm [-i: a8 ib] 8086,SM TEST reg_ax,imm [-i: o16 a9 iw] 8086,SM TEST reg_eax,imm [-i: o32 a9 id] 386,SM -TEST reg_rax,imm [-i: o64 a9 idx] X64,SM +TEST reg_rax,imm [-i: o64 a9 id,s] X64,SM TEST rm8,imm [mi: f6 /0 ib] 8086,SM TEST rm16,imm [mi: o16 f7 /0 iw] 8086,SM TEST rm32,imm [mi: o32 f7 /0 id] 386,SM -TEST rm64,imm [mi: o64 f7 /0 idx] X64,SM +TEST rm64,imm [mi: o64 f7 /0 id,s] X64,SM TEST mem,imm8 [mi: f6 /0 ib] 8086,SM TEST mem,imm16 [mi: o16 f7 /0 iw] 8086,SM TEST mem,imm32 [mi: o32 f7 /0 id] 386,SM @@ -1399,23 +1439,28 @@ XOR reg32,mem [rm: o32 33 /r] 386,SM XOR reg32,reg32 [rm: o32 33 /r] 386 XOR reg64,mem [rm: o64 33 /r] X64,SM XOR reg64,reg64 [rm: o64 33 /r] X64 -XOR rm16,imm8 [mi: hle o16 83 /6 ibx] 8086,LOCK -XOR rm32,imm8 [mi: hle o32 83 /6 ibx] 386,LOCK -XOR rm64,imm8 [mi: hle o64 83 /6 ibx] X64,LOCK +XOR rm16,imm8 [mi: hle o16 83 /6 ib,s] 8086,LOCK +XOR rm32,imm8 [mi: hle o32 83 /6 ib,s] 386,LOCK +XOR rm64,imm8 [mi: hle o64 83 /6 ib,s] X64,LOCK XOR reg_al,imm [-i: 34 ib] 8086,SM -XOR reg_ax,sbyte16 [mi: o16 83 /6 ibx] 8086,SM +XOR reg_ax,sbyteword [mi: o16 83 /6 ib,s] 8086,SM,ND XOR reg_ax,imm [-i: o16 35 iw] 8086,SM -XOR reg_eax,sbyte32 [mi: o32 83 /6 ibx] 386,SM +XOR reg_eax,sbytedword [mi: o32 83 /6 ib,s] 386,SM,ND XOR reg_eax,imm [-i: o32 35 id] 386,SM -XOR reg_rax,sbyte64 [mi: o64 83 /6 ibx] X64,SM -XOR reg_rax,imm [-i: o64 35 idx] X64,SM +XOR reg_rax,sbytedword [mi: o64 83 /6 ib,s] X64,SM,ND +XOR reg_rax,imm [-i: o64 35 id,s] X64,SM XOR rm8,imm [mi: hle 80 /6 ib] 8086,SM,LOCK -XOR rm16,imm [mi: hle o16 81+s /6 ibw] 8086,SM,LOCK -XOR rm32,imm [mi: hle o32 81+s /6 ibd] 386,SM,LOCK -XOR rm64,imm [mi: hle o64 81+s /6 ibd,s] X64,SM,LOCK +XOR rm16,sbyteword [mi: hle o16 83 /6 ib,s] 8086,SM,LOCK,ND +XOR rm16,imm [mi: hle o16 81 /6 iw] 8086,SM,LOCK +XOR rm32,sbytedword [mi: hle o32 83 /6 ib,s] 386,SM,LOCK,ND +XOR rm32,imm [mi: hle o32 81 /6 id] 386,SM,LOCK +XOR rm64,sbytedword [mi: hle o64 83 /6 ib,s] X64,SM,LOCK,ND +XOR rm64,imm [mi: hle o64 81 /6 id,s] X64,SM,LOCK XOR mem,imm8 [mi: hle 80 /6 ib] 8086,SM,LOCK -XOR mem,imm16 [mi: hle o16 81+s /6 ibw] 8086,SM,LOCK -XOR mem,imm32 [mi: hle o32 81+s /6 ibd] 386,SM,LOCK +XOR mem,sbyteword16 [mi: hle o16 83 /6 ib,s] 8086,SM,LOCK,ND +XOR mem,imm16 [mi: hle o16 81 /6 iw] 8086,SM,LOCK +XOR mem,sbytedword32 [mi: hle o32 83 /6 ib,s] 386,SM,LOCK,ND +XOR mem,imm32 [mi: hle o32 81 /6 id] 386,SM,LOCK XOR rm8,imm [mi: hle 82 /6 ib] 8086,SM,LOCK,ND,NOLONG CMOVcc reg16,mem [rm: o16 0f 40+c /r] P6,SM CMOVcc reg16,reg16 [rm: o16 0f 40+c /r] P6 diff --git a/insns.pl b/insns.pl index 1b9d980..fde4f45 100755 --- a/insns.pl +++ b/insns.pl @@ -439,13 +439,8 @@ sub format_insn($$$$$) { @opx = (); foreach $opp (split(/\|/, $op)) { @oppx = (); - if ($opp =~ /^(.*[^\d])(8|16|32|64|80|128|256)$/) { - my $ox = $1; - my $on = $2; - if ($ox !~ /^(sbyte|sdword|udword)$/) { - $opp = $ox; - push(@oppx, "bits$on"); - } + if ($opp =~ s/(?<=\D)(8|16|32|64|80|128|256)$//) { + push(@oppx, "bits$1"); } $opp =~ s/^mem$/memory/; $opp =~ s/^memory_offs$/mem_offs/; @@ -670,29 +665,20 @@ sub byte_code_compile($$) { my $opex; my %imm_codes = ( - 'ib,s' => 014, # Signed imm8 'ib' => 020, # imm8 'ib,u' => 024, # Unsigned imm8 'iw' => 030, # imm16 - 'ibx' => 0274, # imm8 sign-extended to opsize + 'ib,s' => 0274, # imm8 sign-extended to opsize or bits 'iwd' => 034, # imm16 or imm32, depending on opsize 'id' => 040, # imm32 - 'idx' => 0254, # imm32 extended to 64 bits - 'iwdq' => 044, # imm16/32/64, depending on opsize + 'id,s' => 0254, # imm32 sign-extended to 64 bits + 'iwdq' => 044, # imm16/32/64, depending on addrsize 'rel8' => 050, 'iq' => 054, 'rel16' => 060, 'rel' => 064, # 16 or 32 bit relative operand 'rel32' => 070, 'seg' => 074, - 'ibw' => 0140, # imm16 that can be bytified - 'ibd' => 0150, # imm32 that can be bytified - 'ibd,s' => 0250 # imm32 that can be bytified, sign extended to 64 bits - ); - my %imm_codes_bytifiers = ( - 'ibw' => 0144, - 'ibd' => 0154, - 'ibd,s' => 0154 ); my %plain_codes = ( 'o16' => 0320, # 16-bit operand size @@ -877,12 +863,6 @@ sub byte_code_compile($$) { } push(@codes, 05) if ($oppos{$last_imm} & 4); push(@codes, $imm_codes{$op} + ($oppos{$last_imm} & 3)); - if (defined $imm_codes_bytifiers{$op}) { - if (!defined($s_pos)) { - die "$fname: $line: $op without a +s byte\n"; - } - $codes[$s_pos] += $imm_codes_bytifiers{$op}; - } $prefix_ok = 0; } elsif ($op eq '/is4') { if (!defined($oppos{'s'})) { @@ -905,14 +885,6 @@ sub byte_code_compile($$) { } push(@codes, 0173, ($oppos{'s'} << 4) + $imm); $prefix_ok = 0; - } elsif ($op =~ /^([0-9a-f]{2})\+s$/) { - if (!defined($oppos{'i'})) { - die "$fname: $line: $op without 'i' operand\n"; - } - $s_pos = scalar @codes; - push(@codes, 05) if ($oppos{'i'} & 4); - push(@codes, $oppos{'i'} & 3, hex $1); - $prefix_ok = 0; } elsif ($op =~ /^([0-9a-f]{2})\+c$/) { push(@codes, 0330, hex $1); $prefix_ok = 0; diff --git a/opflags.h b/opflags.h index 883d13b..2552e30 100644 --- a/opflags.h +++ b/opflags.h @@ -226,17 +226,12 @@ typedef uint64_t opflags_t; /* memory which matches any type of r/m operand */ #define MEMORY_ANY (MEMORY | RM_GPR | RM_MMX | RM_XMM | RM_YMM) -/* special type of immediate operand */ -#define UNITY (GEN_SUBCLASS(1) | IMMEDIATE) /* for shift/rotate instructions */ -#define SBYTE16 (GEN_SUBCLASS(2) | IMMEDIATE) /* for op r16,immediate instrs. */ -#define SBYTE32 (GEN_SUBCLASS(3) | IMMEDIATE) /* for op r32,immediate instrs. */ -#define SBYTE64 (GEN_SUBCLASS(4) | IMMEDIATE) /* for op r64,immediate instrs. */ -#define SDWORD64 (GEN_SUBCLASS(5) | IMMEDIATE) /* for op r64,simm32 instrs. */ -#define UDWORD64 (GEN_SUBCLASS(0) | IMMEDIATE) /* for op r64,uimm32 instrs. */ - -#define BYTENESS (GEN_SUBCLASS(2) | \ - GEN_SUBCLASS(3) | \ - GEN_SUBCLASS(4)) /* for testing for byteness */ +/* special immediate values */ +#define UNITY (GEN_SUBCLASS(0) | IMMEDIATE) /* operand equals 1 */ +#define SBYTEWORD (GEN_SUBCLASS(1) | IMMEDIATE) /* operand is in the range -128..127 mod 2^16 */ +#define SBYTEDWORD (GEN_SUBCLASS(2) | IMMEDIATE) /* operand is in the range -128..127 mod 2^32 */ +#define SDWORD (GEN_SUBCLASS(3) | IMMEDIATE) /* operand is in the range -0x80000000..0x7FFFFFFF */ +#define UDWORD (GEN_SUBCLASS(4) | IMMEDIATE) /* operand is in the range 0..0xFFFFFFFF */ /* special flags */ #define SAME_AS GEN_SPECIAL(0) diff --git a/parser.c b/parser.c index 889adf3..99bbc25 100644 --- a/parser.c +++ b/parser.c @@ -853,7 +853,7 @@ is_expression: if(optimizing >= 0 && !(result->oprs[operand].type & STRICT)) { /* Be optimistic */ result->oprs[operand].type |= - SBYTE16 | SBYTE32 | SBYTE64 | UDWORD64 | SDWORD64; + UNITY | SBYTEWORD | SBYTEDWORD | UDWORD | SDWORD; } } else if (is_reloc(value)) { /* it's immediate */ result->oprs[operand].type |= IMMEDIATE; @@ -862,25 +862,19 @@ is_expression: result->oprs[operand].wrt = reloc_wrt(value); if (is_simple(value)) { - if (reloc_value(value) == 1) + uint64_t n = reloc_value(value); + if (n == 1) result->oprs[operand].type |= UNITY; if (optimizing >= 0 && !(result->oprs[operand].type & STRICT)) { - int64_t v64 = reloc_value(value); - int32_t v32 = (int32_t)v64; - int16_t v16 = (int16_t)v32; - - if (v64 >= -128 && v64 <= 127) - result->oprs[operand].type |= SBYTE64; - if (v32 >= -128 && v32 <= 127) - result->oprs[operand].type |= SBYTE32; - if (v16 >= -128 && v16 <= 127) - result->oprs[operand].type |= SBYTE16; - if ((uint64_t)v64 <= UINT64_C(0xffffffff)) - result->oprs[operand].type |= UDWORD64; - if (v64 >= -INT64_C(0x80000000) && - v64 <= INT64_C(0x7fffffff)) - result->oprs[operand].type |= SDWORD64; + if ((uint32_t) (n + 128) <= 255) + result->oprs[operand].type |= SBYTEDWORD; + if ((uint16_t) (n + 128) <= 255) + result->oprs[operand].type |= SBYTEWORD; + if (n <= 0xFFFFFFFF) + result->oprs[operand].type |= UDWORD; + if (n + 0x80000000 <= 0xFFFFFFFF) + result->oprs[operand].type |= SDWORD; } } } else { /* it's a register */ |
From: nasm-bot f. A. N. <re...@gm...> - 2013-02-24 21:10:18
|
Commit-ID: 57162eb084ee80c2f024663c1bfc10c82bb83b20 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=57162eb084ee80c2f024663c1bfc10c82bb83b20 Author: Andrew Nayenko <re...@gm...> AuthorDate: Sun, 24 Feb 2013 23:08:40 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 25 Feb 2013 01:08:00 +0400 Fix warnings generated by clang 3.0 Fix warnings like this: output/outelf32.c:2120:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((match->section == index)) { ~~~~~~~~~~~~~~~^~~~~~~~ output/outelf32.c:2120:33: note: remove extraneous parentheses around the comparison to silence this warning if ((match->section == index)) { ~ ^ ~ output/outelf32.c:2120:33: note: use '=' to turn this equality comparison into an assignment if ((match->section == index)) { ^~ = 1 warning generated. Signed-off-by: Andrew Nayenko <re...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 2 +- output/outelf64.c | 2 +- output/outelfx32.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 00b3f5e..48f9177 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -2117,7 +2117,7 @@ static void dwarf32_findsect(const int index) if (dwarf_fsect) { match = dwarf_fsect; for (sinx = 0; sinx < dwarf_nsections; sinx++) { - if ((match->section == index)) { + if (match->section == index) { dwarf_csect = match; return; } diff --git a/output/outelf64.c b/output/outelf64.c index 9776972..8175aed 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -2204,7 +2204,7 @@ static void dwarf64_findsect(const int index) if (dwarf_fsect) { match = dwarf_fsect; for (sinx = 0; sinx < dwarf_nsections; sinx++) { - if ((match->section == index)) { + if (match->section == index) { dwarf_csect = match; return; } diff --git a/output/outelfx32.c b/output/outelfx32.c index 914a83e..57bbf75 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -2159,7 +2159,7 @@ static void dwarfx32_findsect(const int index) if (dwarf_fsect) { match = dwarf_fsect; for (sinx = 0; sinx < dwarf_nsections; sinx++) { - if ((match->section == index)) { + if (match->section == index) { dwarf_csect = match; return; } |
From: nasm-bot f. A. N. <re...@gm...> - 2013-02-20 22:48:17
|
Commit-ID: 842512c527160f79a4d9b70318143a43d673c043 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=842512c527160f79a4d9b70318143a43d673c043 Author: Andrew Nayenko <re...@gm...> AuthorDate: Thu, 21 Feb 2013 02:36:57 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Thu, 21 Feb 2013 02:36:57 +0400 BR3392242: insns.dat -- Support AMD SVM instructions in 32bit mode AMD CPUs do support SVM instructions in 32-bit mode thus drop X64 restriction from instructions template where appropriate. Signed-off-by: Andrew Nayenko <re...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- insns.dat | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/insns.dat b/insns.dat index 0ff5a0a..f386adb 100644 --- a/insns.dat +++ b/insns.dat @@ -263,7 +263,6 @@ CDQ void [ o32 99] 386 CDQE void [ o64 98] X64 CLC void [ f8] 8086 CLD void [ fc] 8086 -CLGI void [ 0f 01 dd] X64,AMD CLI void [ fa] 8086 CLTS void [ 0f 06] 286,PRIV CMC void [ f5] 8086 @@ -1243,7 +1242,6 @@ SMSW reg16 [m: o16 0f 01 /4] 286 SMSW reg32 [m: o32 0f 01 /4] 386 STC void [ f9] 8086 STD void [ fd] 8086 -STGI void [ 0f 01 dc] X64 STI void [ fb] 8086 STOSB void [ aa] 8086 STOSD void [ o32 ab] 386 @@ -1787,20 +1785,22 @@ MOVDDUP xmmreg,xmmrm [rm: f2 0f 12 /r] PRESCOTT,SSE3 MOVSHDUP xmmreg,xmmrm [rm: f3 0f 16 /r] PRESCOTT,SSE3 MOVSLDUP xmmreg,xmmrm [rm: f3 0f 12 /r] PRESCOTT,SSE3 -;# VMX Instructions +;# VMX/SVM Instructions +CLGI void [ 0f 01 dd] VMX,AMD +STGI void [ 0f 01 dc] VMX,AMD VMCALL void [ 0f 01 c1] VMX VMCLEAR mem [m: 66 0f c7 /6] VMX VMFUNC void [ 0f 01 d4] VMX VMLAUNCH void [ 0f 01 c2] VMX -VMLOAD void [ 0f 01 da] X64,VMX -VMMCALL void [ 0f 01 d9] X64,VMX +VMLOAD void [ 0f 01 da] VMX,AMD +VMMCALL void [ 0f 01 d9] VMX,AMD VMPTRLD mem [m: np 0f c7 /6] VMX VMPTRST mem [m: np 0f c7 /7] VMX VMREAD rm32,reg32 [mr: np 0f 78 /r] VMX,NOLONG,SD VMREAD rm64,reg64 [mr: o64nw np 0f 78 /r] X64,VMX,SQ VMRESUME void [ 0f 01 c3] VMX -VMRUN void [ 0f 01 d8] X64,VMX -VMSAVE void [ 0f 01 db] X64,VMX +VMRUN void [ 0f 01 d8] VMX,AMD +VMSAVE void [ 0f 01 db] VMX,AMD VMWRITE reg32,rm32 [rm: np 0f 79 /r] VMX,NOLONG,SD VMWRITE reg64,rm64 [rm: o64nw np 0f 79 /r] X64,VMX,SQ VMXOFF void [ 0f 01 c4] VMX |
From: nasm-bot f. B. Rudiak-G. <ben...@gm...> - 2013-02-20 22:24:50
|
Commit-ID: bf0f42390d8eda2ce1b07a7d94fa5b041820c332 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=bf0f42390d8eda2ce1b07a7d94fa5b041820c332 Author: Ben Rudiak-Gould <ben...@gm...> AuthorDate: Wed, 20 Feb 2013 23:25:59 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Wed, 20 Feb 2013 23:25:59 +0400 Fix jmp/call near offsets in long mode In long mode relative offsets are always 32 bits sign-extended to 64 bits and absolute near addresses are always 64 bits, regardless of the operand size. Signed-off-by: Ben Rudiak-Gould <ben...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- disasm.c | 29 ++++++++++++------------- insns.dat | 73 ++++++++++++++++++++++++++++++++------------------------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/disasm.c b/disasm.c index c28ebe2..dcbd931 100644 --- a/disasm.c +++ b/disasm.c @@ -532,22 +532,21 @@ static int matches(const struct itemplate *t, uint8_t *data, opx->segment &= ~SEG_32BIT; break; - case4(064): + case4(064): /* rel */ opx->segment |= SEG_RELATIVE; - if (osize == 16) { - opx->offset = gets16(data); - data += 2; - opx->segment &= ~(SEG_32BIT|SEG_64BIT); - } else if (osize == 32) { - opx->offset = gets32(data); - data += 4; - opx->segment &= ~SEG_64BIT; - opx->segment |= SEG_32BIT; - } - if (segsize != osize) { - opx->type = - (opx->type & ~SIZE_MASK) - | ((osize == 16) ? BITS16 : BITS32); + /* In long mode rel is always 32 bits, sign extended. */ + if (segsize == 64 || osize == 32) { + opx->offset = gets32(data); + data += 4; + if (segsize != 64) + opx->segment |= SEG_32BIT; + opx->type = (opx->type & ~SIZE_MASK) + | (segsize == 64 ? BITS64 : BITS32); + } else { + opx->offset = gets16(data); + data += 2; + opx->segment &= ~SEG_32BIT; + opx->type = (opx->type & ~SIZE_MASK) | BITS16; } break; diff --git a/insns.dat b/insns.dat index 0c3828d..0ff5a0a 100644 --- a/insns.dat +++ b/insns.dat @@ -229,14 +229,17 @@ BTS rm16,imm [mi: hle o16 0f ba /5 ib,u] 386,SB,LOCK BTS rm32,imm [mi: hle o32 0f ba /5 ib,u] 386,SB,LOCK BTS rm64,imm [mi: hle o64 0f ba /5 ib,u] X64,SB,LOCK CALL imm [i: odf e8 rel] 8086 -CALL imm|near [i: odf e8 rel] 8086 +CALL imm|near [i: odf e8 rel] 8086,ND CALL imm|far [i: odf 9a iwd seg] 8086,ND,NOLONG -CALL imm16 [i: o16 e8 rel] 8086 -CALL imm16|near [i: o16 e8 rel] 8086 +; Call/jmp near imm/reg/mem is always 64-bit in long mode. +CALL imm16 [i: o16 e8 rel] 8086,NOLONG +CALL imm16|near [i: o16 e8 rel] 8086,ND,NOLONG CALL imm16|far [i: o16 9a iwd seg] 8086,ND,NOLONG -CALL imm32 [i: o32 e8 rel] 386 -CALL imm32|near [i: o32 e8 rel] 386 +CALL imm32 [i: o32 e8 rel] 386,NOLONG +CALL imm32|near [i: o32 e8 rel] 386,ND,NOLONG CALL imm32|far [i: o32 9a iwd seg] 386,ND,NOLONG +CALL imm64 [i: o64nw e8 rel] X64 +CALL imm64|near [i: o64nw e8 rel] X64,ND CALL imm:imm [ji: odf 9a iwd iw] 8086,NOLONG CALL imm16:imm [ji: o16 9a iw iw] 8086,NOLONG CALL imm:imm16 [ji: o16 9a iw iw] 8086,NOLONG @@ -248,17 +251,13 @@ CALL mem16|far [m: o16 ff /3] 8086 CALL mem32|far [m: o32 ff /3] 386 CALL mem64|far [m: o64 ff /3] X64 CALL mem|near [m: odf ff /2] 8086,ND -CALL mem16|near [m: o16 ff /2] 8086,ND -CALL mem32|near [m: o32 ff /2] 386,NOLONG,ND -CALL mem64|near [m: o64nw ff /2] X64,ND -CALL reg16 [m: o16 ff /2] 8086 -CALL reg32 [m: o32 ff /2] 386,NOLONG -CALL reg64 [m: o64nw ff /2] X64 +CALL rm16|near [m: o16 ff /2] 8086,NOLONG,ND +CALL rm32|near [m: o32 ff /2] 386,NOLONG,ND +CALL rm64|near [m: o64nw ff /2] X64,ND CALL mem [m: odf ff /2] 8086 -CALL mem16 [m: o16 ff /2] 8086 -CALL mem32 [m: o32 ff /2] 386,NOLONG -CALL mem [m: o64nw ff /2] X64 -CALL mem64 [m: o64nw ff /2] X64 +CALL rm16 [m: o16 ff /2] 8086,NOLONG +CALL rm32 [m: o32 ff /2] 386,NOLONG +CALL rm64 [m: o64nw ff /2] X64 CBW void [ o16 98] 8086 CDQ void [ o32 99] 386 CDQE void [ o64 98] X64 @@ -661,12 +660,15 @@ JMP imm [i: jmp8 eb rel8] 8086,ND JMP imm [i: odf e9 rel] 8086 JMP imm|near [i: odf e9 rel] 8086,ND JMP imm|far [i: odf ea iwd seg] 8086,ND,NOLONG -JMP imm16 [i: o16 e9 rel] 8086 -JMP imm16|near [i: o16 e9 rel] 8086,ND +; Call/jmp near imm/reg/mem is always 64-bit in long mode. +JMP imm16 [i: o16 e9 rel] 8086,NOLONG +JMP imm16|near [i: o16 e9 rel] 8086,ND,NOLONG JMP imm16|far [i: o16 ea iwd seg] 8086,ND,NOLONG -JMP imm32 [i: o32 e9 rel] 386 -JMP imm32|near [i: o32 e9 rel] 386,ND +JMP imm32 [i: o32 e9 rel] 386,NOLONG +JMP imm32|near [i: o32 e9 rel] 386,ND,NOLONG JMP imm32|far [i: o32 ea iwd seg] 386,ND,NOLONG +JMP imm64 [i: o64nw e9 rel] X64 +JMP imm64|near [i: o64nw e9 rel] X64,ND JMP imm:imm [ji: odf ea iwd iw] 8086,NOLONG JMP imm16:imm [ji: o16 ea iw iw] 8086,NOLONG JMP imm:imm16 [ji: o16 ea iw iw] 8086,NOLONG @@ -678,17 +680,13 @@ JMP mem16|far [m: o16 ff /5] 8086 JMP mem32|far [m: o32 ff /5] 386 JMP mem64|far [m: o64 ff /5] X64 JMP mem|near [m: odf ff /4] 8086,ND -JMP mem16|near [m: o16 ff /4] 8086,ND -JMP mem32|near [m: o32 ff /4] 386,NOLONG,ND -JMP mem64|near [m: o64nw ff /4] X64,ND -JMP reg16 [m: o16 ff /4] 8086 -JMP reg32 [m: o32 ff /4] 386,NOLONG -JMP reg64 [m: o64nw ff /4] X64 +JMP rm16|near [m: o16 ff /4] 8086,NOLONG,ND +JMP rm32|near [m: o32 ff /4] 386,NOLONG,ND +JMP rm64|near [m: o64nw ff /4] X64,ND JMP mem [m: odf ff /4] 8086 -JMP mem16 [m: o16 ff /4] 8086 -JMP mem32 [m: o32 ff /4] 386,NOLONG -JMP mem [m: o64nw ff /4] X64 -JMP mem64 [m: o64nw ff /4] X64 +JMP rm16 [m: o16 ff /4] 8086,NOLONG +JMP rm32 [m: o32 ff /4] 386,NOLONG +JMP rm64 [m: o64nw ff /4] X64 JMPE imm [i: odf 0f b8 rel] IA64 JMPE imm16 [i: o16 0f b8 rel] IA64 JMPE imm32 [i: o32 0f b8 rel] IA64 @@ -1428,8 +1426,9 @@ CMOVcc reg32,reg32 [rm: o32 0f 40+c /r] P6 CMOVcc reg64,mem [rm: o64 0f 40+c /r] X64,SM CMOVcc reg64,reg64 [rm: o64 0f 40+c /r] X64 Jcc imm|near [i: odf 0f 80+c rel] 386 -Jcc imm16|near [i: o16 0f 80+c rel] 386 -Jcc imm32|near [i: o32 0f 80+c rel] 386 +Jcc imm16|near [i: o16 0f 80+c rel] 386,NOLONG +Jcc imm32|near [i: o32 0f 80+c rel] 386,NOLONG +Jcc imm64|near [i: o64nw 0f 80+c rel] X64 Jcc imm|short [i: 70+c rel8] 8086,ND Jcc imm [i: jcc8 70+c rel8] 8086,ND Jcc imm [i: 0f 80+c rel] 386,ND @@ -3344,11 +3343,13 @@ VPGATHERQQ ymmreg,mem64,ymmreg [rmv: vm64y vex.dds.256.66.0f38.w1 91 /r] FUTURE XABORT imm [i: c6 f8 ib] FUTURE,RTM XABORT imm8 [i: c6 f8 ib] FUTURE,RTM XBEGIN imm [i: odf c7 f8 rel] FUTURE,RTM -XBEGIN imm|near [i: odf c7 f8 rel] FUTURE,RTM -XBEGIN imm16 [i: o16 c7 f8 rel] FUTURE,RTM -XBEGIN imm16|near [i: o16 c7 f8 rel] FUTURE,RTM -XBEGIN imm32 [i: o32 c7 f8 rel] FUTURE,RTM -XBEGIN imm32|near [i: o32 c7 f8 rel] FUTURE,RTM +XBEGIN imm|near [i: odf c7 f8 rel] FUTURE,RTM,ND +XBEGIN imm16 [i: o16 c7 f8 rel] FUTURE,RTM,NOLONG +XBEGIN imm16|near [i: o16 c7 f8 rel] FUTURE,RTM,NOLONG,ND +XBEGIN imm32 [i: o32 c7 f8 rel] FUTURE,RTM,NOLONG +XBEGIN imm32|near [i: o32 c7 f8 rel] FUTURE,RTM,NOLONG,ND +XBEGIN imm64 [i: o64nw c7 f8 rel] FUTURE,RTM,LONG +XBEGIN imm64|near [i: o64nw c7 f8 rel] FUTURE,RTM,LONG,ND XEND void [ 0f 01 d5] FUTURE,RTM XTEST void [ 0f 01 d6] FUTURE,HLE,RTM |
From: nasm-bot f. B. Rudiak-G. <ben...@gm...> - 2013-02-20 22:24:43
|
Commit-ID: d7ab1f963823edc1156e19077769585089b13a89 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=d7ab1f963823edc1156e19077769585089b13a89 Author: Ben Rudiak-Gould <ben...@gm...> AuthorDate: Wed, 20 Feb 2013 23:25:54 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Wed, 20 Feb 2013 23:25:54 +0400 Add np and similar prefixes to instructions that should have them This adds "np" to a bunch of SSE-style instructions that should have it, "norep" (which was implemented but unused) on quasi-SSE instructions that use F2 and F3 as instruction extensions but 66 for operand size, "nof3" (newly implemented) on a few instructions, "norexw" on some instructions that have only 32-bit and 64-bit versions, and one NOLONG. It also removes some incorrect "np"s, changes some "f3"s to "f3i"s, and fixes the decoding of the XCHG/NOP/PAUSE mess: F390 is always PAUSE even when rex.b=1 (at least according to XED). Signed-off-by: Ben Rudiak-Gould <ben...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- assemble.c | 8 +++++ disasm.c | 5 +++ insns.dat | 112 ++++++++++++++++++++++++++++++------------------------------- insns.pl | 2 ++ 4 files changed, 71 insertions(+), 56 deletions(-) diff --git a/assemble.c b/assemble.c index 4f791ec..7b33df9 100644 --- a/assemble.c +++ b/assemble.c @@ -118,6 +118,8 @@ * \323 - indicates fixed 64-bit operand size, REX on extensions only. * \324 - indicates 64-bit operand size requiring REX prefix. * \325 - instruction which always uses spl/bpl/sil/dil + * \326 - instruction not valid with 0xF3 REP prefix. Hint for + disassembler only; for SSE instructions. * \330 - a literal byte follows in the code stream, to be added * to the condition code value of the instruction. * \331 - instruction not valid with REP prefix. Hint for @@ -1061,6 +1063,9 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, ins->rex |= REX_NH; break; + case 0326: + break; + case 0330: codes++, length++; break; @@ -1709,6 +1714,9 @@ static void gencode(int32_t segment, int64_t offset, int bits, case 0325: break; + case 0326: + break; + case 0330: *bytes = *codes++ ^ condval[ins->condition]; out(offset, segment, bytes, OUT_RAWDATA, 1, NO_SEG, NO_SEG); diff --git a/disasm.c b/disasm.c index 46cec8a..c28ebe2 100644 --- a/disasm.c +++ b/disasm.c @@ -819,6 +819,11 @@ static int matches(const struct itemplate *t, uint8_t *data, break; } + case 0326: + if (prefix->rep == 0xF3) + return false; + break; + case 0331: if (prefix->rep) return false; diff --git a/insns.dat b/insns.dat index a039106..0c3828d 100644 --- a/insns.dat +++ b/insns.dat @@ -178,18 +178,18 @@ BB0_RESET void [ 0f 3a] PENT,CYRIX,ND BB1_RESET void [ 0f 3b] PENT,CYRIX,ND BOUND reg16,mem [rm: o16 62 /r] 186,NOLONG BOUND reg32,mem [rm: o32 62 /r] 386,NOLONG -BSF reg16,mem [rm: o16 0f bc /r] 386,SM -BSF reg16,reg16 [rm: o16 0f bc /r] 386 -BSF reg32,mem [rm: o32 0f bc /r] 386,SM -BSF reg32,reg32 [rm: o32 0f bc /r] 386 -BSF reg64,mem [rm: o64 0f bc /r] X64,SM -BSF reg64,reg64 [rm: o64 0f bc /r] X64 -BSR reg16,mem [rm: o16 0f bd /r] 386,SM -BSR reg16,reg16 [rm: o16 0f bd /r] 386 -BSR reg32,mem [rm: o32 0f bd /r] 386,SM -BSR reg32,reg32 [rm: o32 0f bd /r] 386 -BSR reg64,mem [rm: o64 0f bd /r] X64,SM -BSR reg64,reg64 [rm: o64 0f bd /r] X64 +BSF reg16,mem [rm: o16 nof3 0f bc /r] 386,SM +BSF reg16,reg16 [rm: o16 nof3 0f bc /r] 386 +BSF reg32,mem [rm: o32 nof3 0f bc /r] 386,SM +BSF reg32,reg32 [rm: o32 nof3 0f bc /r] 386 +BSF reg64,mem [rm: o64 nof3 0f bc /r] X64,SM +BSF reg64,reg64 [rm: o64 nof3 0f bc /r] X64 +BSR reg16,mem [rm: o16 nof3 0f bd /r] 386,SM +BSR reg16,reg16 [rm: o16 nof3 0f bd /r] 386 +BSR reg32,mem [rm: o32 nof3 0f bd /r] 386,SM +BSR reg32,reg32 [rm: o32 nof3 0f bd /r] 386 +BSR reg64,mem [rm: o64 nof3 0f bd /r] X64,SM +BSR reg64,reg64 [rm: o64 nof3 0f bd /r] X64 BSWAP reg32 [r: o32 0f c8+r] 486 BSWAP reg64 [r: o64 0f c8+r] X64 BT mem,reg16 [mr: o16 0f a3 /r] 386,SM @@ -320,7 +320,7 @@ CMPXCHG486 mem,reg16 [mr: o16 0f a7 /r] 486,SM,UNDOC,ND,LOCK CMPXCHG486 reg16,reg16 [mr: o16 0f a7 /r] 486,UNDOC,ND CMPXCHG486 mem,reg32 [mr: o32 0f a7 /r] 486,SM,UNDOC,ND,LOCK CMPXCHG486 reg32,reg32 [mr: o32 0f a7 /r] 486,UNDOC,ND -CMPXCHG8B mem [m: hle 0f c7 /1] PENT,LOCK +CMPXCHG8B mem [m: hle norexw 0f c7 /1] PENT,LOCK CMPXCHG16B mem [m: o64 0f c7 /1] X64,LOCK CPUID void [ 0f a2] PENT CPU_READ void [ 0f 3d] PENT,CYRIX @@ -715,7 +715,7 @@ LEA reg64,mem [rm: o64 8d /r] X64 LEAVE void [ c9] 186 LES reg16,mem [rm: o16 c4 /r] 8086,NOLONG LES reg32,mem [rm: o32 c4 /r] 386,NOLONG -LFENCE void [ 0f ae e8] X64,AMD +LFENCE void [ np 0f ae e8] X64,AMD LFS reg16,mem [rm: o16 0f b4 /r] 386 LFS reg32,mem [rm: o32 0f b4 /r] 386 LFS reg64,mem [rm: o64 0f b4 /r] X64 @@ -774,9 +774,9 @@ LSS reg64,mem [rm: o64 0f b2 /r] X64 LTR mem [m: 0f 00 /3] 286,PROT,PRIV LTR mem16 [m: 0f 00 /3] 286,PROT,PRIV LTR reg16 [m: 0f 00 /3] 286,PROT,PRIV -MFENCE void [ 0f ae f0] X64,AMD +MFENCE void [ np 0f ae f0] X64,AMD MONITOR void [ 0f 01 c8] PRESCOTT -MONITOR reg_eax,reg_ecx,reg_edx [---: 0f 01 c8] PRESCOTT,ND +MONITOR reg_eax,reg_ecx,reg_edx [---: 0f 01 c8] PRESCOTT,NOLONG,ND MONITOR reg_rax,reg_ecx,reg_edx [---: 0f 01 c8] X64,ND MOV mem,reg_sreg [mr: 8c /r] 8086,SW MOV reg16,reg_sreg [mr: o16 8c /r] 8086 @@ -874,7 +874,7 @@ NEG rm8 [m: hle f6 /3] 8086,LOCK NEG rm16 [m: hle o16 f7 /3] 8086,LOCK NEG rm32 [m: hle o32 f7 /3] 386,LOCK NEG rm64 [m: hle o64 f7 /3] X64,LOCK -NOP void [ norexb 90] 8086 +NOP void [ norexb nof3 90] 8086 NOP rm16 [m: o16 0f 1f /0] P6 NOP rm32 [m: o32 0f 1f /0] P6 NOP rm64 [m: o64 0f 1f /0] X64 @@ -938,7 +938,7 @@ PADDUSW mmxreg,mmxrm [rm: np o64nw 0f dd /r] PENT,MMX,SQ PADDW mmxreg,mmxrm [rm: np o64nw 0f fd /r] PENT,MMX,SQ PAND mmxreg,mmxrm [rm: np o64nw 0f db /r] PENT,MMX,SQ PANDN mmxreg,mmxrm [rm: np o64nw 0f df /r] PENT,MMX,SQ -PAUSE void [ norexb f3i 90] 8086 +PAUSE void [ f3i 90] 8086 PAVEB mmxreg,mmxrm [rm: o64nw 0f 50 /r] PENT,MMX,SQ,CYRIX PAVGUSB mmxreg,mmxrm [rm: o64nw 0f 0f /r bf] PENT,3DNOW,SQ PCMPEQB mmxreg,mmxrm [rm: np o64nw 0f 74 /r] PENT,MMX,SQ @@ -1177,7 +1177,7 @@ SCASB void [ repe ae] 8086 SCASD void [ repe o32 af] 386 SCASQ void [ repe o64 af] X64 SCASW void [ repe o16 af] 8086 -SFENCE void [ 0f ae f8] X64,AMD +SFENCE void [ np 0f ae f8] X64,AMD SGDT mem [m: 0f 01 /0] 286 SHL rm8,unity [m-: d0 /4] 8086 SHL rm8,reg_cl [m-: d2 /4] 8086 @@ -1480,7 +1480,7 @@ CVTTSS2SI reg32,xmmrm [rm: f3 0f 2c /r] KATMAI,SSE,SD,AR1 CVTTSS2SI reg64,xmmrm [rm: o64 f3 0f 2c /r] X64,SSE,SD,AR1 DIVPS xmmreg,xmmrm128 [rm: np 0f 5e /r] KATMAI,SSE DIVSS xmmreg,xmmrm32 [rm: f3 0f 5e /r] KATMAI,SSE -LDMXCSR mem32 [m: 0f ae /2] KATMAI,SSE +LDMXCSR mem32 [m: np 0f ae /2] KATMAI,SSE MAXPS xmmreg,xmmrm128 [rm: np 0f 5f /r] KATMAI,SSE MAXSS xmmreg,xmmrm32 [rm: f3 0f 5f /r] KATMAI,SSE MINPS xmmreg,xmmrm128 [rm: np 0f 5d /r] KATMAI,SSE @@ -1511,7 +1511,7 @@ RSQRTSS xmmreg,xmmrm32 [rm: f3 0f 52 /r] KATMAI,SSE SHUFPS xmmreg,xmmrm128,imm8 [rmi: np 0f c6 /r ib,u] KATMAI,SSE SQRTPS xmmreg,xmmrm128 [rm: np 0f 51 /r] KATMAI,SSE SQRTSS xmmreg,xmmrm32 [rm: f3 0f 51 /r] KATMAI,SSE -STMXCSR mem32 [m: 0f ae /3] KATMAI,SSE +STMXCSR mem32 [m: np 0f ae /3] KATMAI,SSE SUBPS xmmreg,xmmrm128 [rm: np 0f 5c /r] KATMAI,SSE SUBSS xmmreg,xmmrm32 [rm: f3 0f 5c /r] KATMAI,SSE UCOMISS xmmreg,xmmrm32 [rm: np 0f 2e /r] KATMAI,SSE @@ -1520,22 +1520,22 @@ UNPCKLPS xmmreg,xmmrm128 [rm: np 0f 14 /r] KATMAI,SSE XORPS xmmreg,xmmrm128 [rm: np 0f 57 /r] KATMAI,SSE ;# Introduced in Deschutes but necessary for SSE support -FXRSTOR mem [m: 0f ae /1] P6,SSE,FPU -FXRSTOR64 mem [m: o64 0f ae /1] X64,SSE,FPU -FXSAVE mem [m: 0f ae /0] P6,SSE,FPU -FXSAVE64 mem [m: o64 0f ae /0] X64,SSE,FPU +FXRSTOR mem [m: np 0f ae /1] P6,SSE,FPU +FXRSTOR64 mem [m: o64 np 0f ae /1] X64,SSE,FPU +FXSAVE mem [m: np 0f ae /0] P6,SSE,FPU +FXSAVE64 mem [m: o64 np 0f ae /0] X64,SSE,FPU ;# XSAVE group (AVX and extended state) ; Introduced in late Penryn ... we really need to clean up the handling ; of CPU feature bits. -XGETBV void [ np 0f 01 d0] NEHALEM -XSETBV void [ np 0f 01 d1] NEHALEM,PRIV -XSAVE mem [m: 0f ae /4] NEHALEM -XSAVE64 mem [m: o64 0f ae /4] LONG,NEHALEM -XSAVEOPT mem [m: 0f ae /6] FUTURE -XSAVEOPT64 mem [m: o64 0f ae /6] LONG,FUTURE -XRSTOR mem [m: 0f ae /5] NEHALEM -XRSTOR64 mem [m: o64 0f ae /5] LONG,NEHALEM +XGETBV void [ 0f 01 d0] NEHALEM +XSETBV void [ 0f 01 d1] NEHALEM,PRIV +XSAVE mem [m: np 0f ae /4] NEHALEM +XSAVE64 mem [m: o64 np 0f ae /4] LONG,NEHALEM +XSAVEOPT mem [m: np 0f ae /6] FUTURE +XSAVEOPT64 mem [m: o64 np 0f ae /6] LONG,FUTURE +XRSTOR mem [m: np 0f ae /5] NEHALEM +XRSTOR64 mem [m: o64 np 0f ae /5] LONG,NEHALEM ; These instructions are not SSE-specific; they are ;# Generic memory operations @@ -1544,7 +1544,7 @@ PREFETCHNTA mem [m: 0f 18 /0] KATMAI PREFETCHT0 mem [m: 0f 18 /1] KATMAI PREFETCHT1 mem [m: 0f 18 /2] KATMAI PREFETCHT2 mem [m: 0f 18 /3] KATMAI -SFENCE void [ 0f ae f8] KATMAI +SFENCE void [ np 0f ae f8] KATMAI ;# New MMX instructions introduced in Katmai MASKMOVQ mmxreg,mmxreg [rm: np 0f f7 /r] KATMAI,MMX @@ -1576,13 +1576,13 @@ PSWAPD mmxreg,mmxrm [rm: o64nw 0f 0f /r bb] PENT,3DNOW,SQ ;# Willamette SSE2 Cacheability Instructions MASKMOVDQU xmmreg,xmmreg [rm: 66 0f f7 /r] WILLAMETTE,SSE2 ; CLFLUSH needs its own feature flag implemented one day -CLFLUSH mem [m: 0f ae /7] WILLAMETTE,SSE2 +CLFLUSH mem [m: np 0f ae /7] WILLAMETTE,SSE2 MOVNTDQ mem,xmmreg [mr: 66 0f e7 /r] WILLAMETTE,SSE2,SO MOVNTI mem,reg32 [mr: np 0f c3 /r] WILLAMETTE,SD MOVNTI mem,reg64 [mr: o64 np 0f c3 /r] X64,SQ MOVNTPD mem,xmmreg [mr: 66 0f 2b /r] WILLAMETTE,SSE2,SO -LFENCE void [ 0f ae e8] WILLAMETTE,SSE2 -MFENCE void [ 0f ae f0] WILLAMETTE,SSE2 +LFENCE void [ np 0f ae e8] WILLAMETTE,SSE2 +MFENCE void [ np 0f ae f0] WILLAMETTE,SSE2 ;# Willamette MMX instructions (SSE2 SIMD Integer Instructions) MOVD mem,xmmreg [mr: 66 norexw 0f 7e /r] WILLAMETTE,SSE2,SD @@ -1722,20 +1722,20 @@ CVTPD2PS xmmreg,xmmrm [rm: 66 0f 5a /r] WILLAMETTE,SSE2,SO CVTPI2PD xmmreg,mmxrm [rm: 66 0f 2a /r] WILLAMETTE,SSE2,SQ CVTPS2DQ xmmreg,xmmrm [rm: 66 0f 5b /r] WILLAMETTE,SSE2,SO CVTPS2PD xmmreg,xmmrm [rm: np 0f 5a /r] WILLAMETTE,SSE2,SQ -CVTSD2SI reg32,xmmreg [rm: f2 0f 2d /r] WILLAMETTE,SSE2,SQ,AR1 -CVTSD2SI reg32,mem [rm: f2 0f 2d /r] WILLAMETTE,SSE2,SQ,AR1 +CVTSD2SI reg32,xmmreg [rm: norexw f2 0f 2d /r] WILLAMETTE,SSE2,SQ,AR1 +CVTSD2SI reg32,mem [rm: norexw f2 0f 2d /r] WILLAMETTE,SSE2,SQ,AR1 CVTSD2SI reg64,xmmreg [rm: o64 f2 0f 2d /r] X64,SSE2,SQ,AR1 CVTSD2SI reg64,mem [rm: o64 f2 0f 2d /r] X64,SSE2,SQ,AR1 CVTSD2SS xmmreg,xmmrm [rm: f2 0f 5a /r] WILLAMETTE,SSE2,SQ CVTSI2SD xmmreg,mem [rm: f2 0f 2a /r] WILLAMETTE,SSE2,SD,AR1,ND -CVTSI2SD xmmreg,rm32 [rm: f2 0f 2a /r] WILLAMETTE,SSE2,SD,AR1 +CVTSI2SD xmmreg,rm32 [rm: norexw f2 0f 2a /r] WILLAMETTE,SSE2,SD,AR1 CVTSI2SD xmmreg,rm64 [rm: o64 f2 0f 2a /r] X64,SSE2,SQ,AR1 CVTSS2SD xmmreg,xmmrm [rm: f3 0f 5a /r] WILLAMETTE,SSE2,SD CVTTPD2PI mmxreg,xmmrm [rm: 66 0f 2c /r] WILLAMETTE,SSE2,SO CVTTPD2DQ xmmreg,xmmrm [rm: 66 0f e6 /r] WILLAMETTE,SSE2,SO CVTTPS2DQ xmmreg,xmmrm [rm: f3 0f 5b /r] WILLAMETTE,SSE2,SO -CVTTSD2SI reg32,xmmreg [rm: f2 0f 2c /r] WILLAMETTE,SSE2,SQ,AR1 -CVTTSD2SI reg32,mem [rm: f2 0f 2c /r] WILLAMETTE,SSE2,SQ,AR1 +CVTTSD2SI reg32,xmmreg [rm: norexw f2 0f 2c /r] WILLAMETTE,SSE2,SQ,AR1 +CVTTSD2SI reg32,mem [rm: norexw f2 0f 2c /r] WILLAMETTE,SSE2,SQ,AR1 CVTTSD2SI reg64,xmmreg [rm: o64 f2 0f 2c /r] X64,SSE2,SQ,AR1 CVTTSD2SI reg64,mem [rm: o64 f2 0f 2c /r] X64,SSE2,SQ,AR1 DIVPD xmmreg,xmmrm [rm: 66 0f 5e /r] WILLAMETTE,SSE2,SO @@ -1795,8 +1795,8 @@ VMFUNC void [ 0f 01 d4] VMX VMLAUNCH void [ 0f 01 c2] VMX VMLOAD void [ 0f 01 da] X64,VMX VMMCALL void [ 0f 01 d9] X64,VMX -VMPTRLD mem [m: 0f c7 /6] VMX -VMPTRST mem [m: 0f c7 /7] VMX +VMPTRLD mem [m: np 0f c7 /6] VMX +VMPTRST mem [m: np 0f c7 /7] VMX VMREAD rm32,reg32 [mr: np 0f 78 /r] VMX,NOLONG,SD VMREAD rm64,reg64 [mr: o64nw np 0f 78 /r] X64,VMX,SQ VMRESUME void [ 0f 01 c3] VMX @@ -1878,7 +1878,7 @@ PCMPEQQ xmmreg,xmmrm [rm: 66 0f 38 29 /r] SSE41 PEXTRB reg32,xmmreg,imm [mri: 66 0f 3a 14 /r ib,u] SSE41 PEXTRB mem8,xmmreg,imm [mri: 66 0f 3a 14 /r ib,u] SSE41 PEXTRB reg64,xmmreg,imm [mri: o64 66 0f 3a 14 /r ib,u] SSE41,X64 -PEXTRD rm32,xmmreg,imm [mri: 66 0f 3a 16 /r ib,u] SSE41 +PEXTRD rm32,xmmreg,imm [mri: norexw 66 0f 3a 16 /r ib,u] SSE41 PEXTRQ rm64,xmmreg,imm [mri: o64 66 0f 3a 16 /r ib,u] SSE41,X64 PEXTRW reg32,xmmreg,imm [mri: 66 0f 3a 15 /r ib,u] SSE41 PEXTRW mem16,xmmreg,imm [mri: 66 0f 3a 15 /r ib,u] SSE41 @@ -1887,8 +1887,8 @@ PHMINPOSUW xmmreg,xmmrm [rm: 66 0f 38 41 /r] SSE41 PINSRB xmmreg,mem,imm [rmi: 66 0f 3a 20 /r ib,u] SSE41,SB,AR2 PINSRB xmmreg,rm8,imm [rmi: nohi 66 0f 3a 20 /r ib,u] SSE41,SB,AR2 PINSRB xmmreg,reg32,imm [rmi: 66 0f 3a 20 /r ib,u] SSE41,SB,AR2 -PINSRD xmmreg,mem,imm [rmi: 66 0f 3a 22 /r ib,u] SSE41,SB,AR2 -PINSRD xmmreg,rm32,imm [rmi: 66 0f 3a 22 /r ib,u] SSE41,SB,AR2 +PINSRD xmmreg,mem,imm [rmi: norexw 66 0f 3a 22 /r ib,u] SSE41,SB,AR2 +PINSRD xmmreg,rm32,imm [rmi: norexw 66 0f 3a 22 /r ib,u] SSE41,SB,AR2 PINSRQ xmmreg,mem,imm [rmi: o64 66 0f 3a 22 /r ib,u] SSE41,X64,SB,AR2 PINSRQ xmmreg,rm64,imm [rmi: o64 66 0f 3a 22 /r ib,u] SSE41,X64,SB,AR2 PMAXSB xmmreg,xmmrm [rm: 66 0f 38 3c /r] SSE41 @@ -1943,12 +1943,12 @@ PFRSQRTV mmxreg,mmxrm [rm: o64nw 0f 0f /r 87] PENT,3DNOW,SQ,CYRIX ;# Intel new instructions in ??? ; Is NEHALEM right here? -MOVBE reg16,mem16 [rm: o16 0f 38 f0 /r] NEHALEM,SM -MOVBE reg32,mem32 [rm: o32 0f 38 f0 /r] NEHALEM,SM -MOVBE reg64,mem64 [rm: o64 0f 38 f0 /r] NEHALEM,SM -MOVBE mem16,reg16 [mr: o16 0f 38 f1 /r] NEHALEM,SM -MOVBE mem32,reg32 [mr: o32 0f 38 f1 /r] NEHALEM,SM -MOVBE mem64,reg64 [mr: o64 0f 38 f1 /r] NEHALEM,SM +MOVBE reg16,mem16 [rm: o16 norep 0f 38 f0 /r] NEHALEM,SM +MOVBE reg32,mem32 [rm: o32 norep 0f 38 f0 /r] NEHALEM,SM +MOVBE reg64,mem64 [rm: o64 norep 0f 38 f0 /r] NEHALEM,SM +MOVBE mem16,reg16 [mr: o16 norep 0f 38 f1 /r] NEHALEM,SM +MOVBE mem32,reg32 [mr: o32 norep 0f 38 f1 /r] NEHALEM,SM +MOVBE mem64,reg64 [mr: o64 norep 0f 38 f1 /r] NEHALEM,SM ;# Intel AES instructions AESENC xmmreg,xmmrm128 [rm: 66 0f 38 dc /r] SSE,WESTMERE @@ -3356,9 +3356,9 @@ XTEST void [ 0f 01 d6] FUTURE,HLE,RTM ; ; based on pub number 319433-011 dated July 2011 ; -TZCNT reg16,rm16 [rm: o16 f3 0f bc /r] FUTURE,BMI1 -TZCNT reg32,rm32 [rm: o32 f3 0f bc /r] FUTURE,BMI1 -TZCNT reg64,rm64 [rm: o64 f3 0f bc /r] LONG,FUTURE,BMI1 +TZCNT reg16,rm16 [rm: o16 f3i 0f bc /r] FUTURE,BMI1 +TZCNT reg32,rm32 [rm: o32 f3i 0f bc /r] FUTURE,BMI1 +TZCNT reg64,rm64 [rm: o64 f3i 0f bc /r] LONG,FUTURE,BMI1 ANDN reg32,reg32,rm32 [rvm: vex.nds.lz.0f38.w0 f2 /r] FUTURE,BMI1 ANDN reg64,reg64,rm64 [rvm: vex.nds.lz.0f38.w1 f2 /r] LONG,FUTURE,BMI1 BEXTR reg32,rm32,reg32 [rmv: vex.nds.lz.0f38.w0 f7 /r] FUTURE,BMI1 diff --git a/insns.pl b/insns.pl index b154dbd..1b9d980 100755 --- a/insns.pl +++ b/insns.pl @@ -721,6 +721,8 @@ sub byte_code_compile($$) { 'norexw' => 0317, 'repe' => 0335, 'nohi' => 0325, # Use spl/bpl/sil/dil even without REX + 'nof3' => 0326, # No REP 0xF3 prefix permitted + 'norep' => 0331, # No REP prefix permitted 'wait' => 0341, # Needs a wait prefix 'resb' => 0340, 'jcc8' => 0370, # Match only if Jcc possible with single byte |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-17 21:42:18
|
Commit-ID: 71ba1f0e7b9b08fef1a6b0e70c8f1276bcfd7439 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=71ba1f0e7b9b08fef1a6b0e70c8f1276bcfd7439 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Mon, 18 Feb 2013 01:38:11 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 18 Feb 2013 01:38:11 +0400 eval: Use is_power2 helper instead of open code Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval.c b/eval.c index d7cf844..0035088 100644 --- a/eval.c +++ b/eval.c @@ -742,8 +742,8 @@ static int64_t eval_ifunc(int64_t val, enum ifunc func) case IFUNC_ILOG2E: case IFUNC_ILOG2W: errtype = (func == IFUNC_ILOG2E) ? ERR_NONFATAL : ERR_WARNING; - - if ((!uval) | (uval & (uval-1))) + + if (!is_power2(uval)) error(errtype, "ilog2 argument is not a power of two"); /* fall through */ case IFUNC_ILOG2F: |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-17 21:33:22
|
Commit-ID: 1930007f3f1ac627fa6906111a41d2d39f0c2b6a Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=1930007f3f1ac627fa6906111a41d2d39f0c2b6a Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Mon, 18 Feb 2013 01:31:59 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 18 Feb 2013 01:31:59 +0400 make: Don't forget to generate manpage for all target Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0ea71f7..983ff6d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -92,7 +92,7 @@ NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \ insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) #-- End File Lists --# -all: nasm$(X) ndisasm$(X) nasm.man ndisasm.man rdf +all: nasm$(X) ndisasm$(X) nasm.1 ndisasm.1 rdf nasm$(X): $(NASM) $(XOBJS) $(CC) $(LDFLAGS) -o nasm$(X) $(NASM) $(XOBJS) $(LIBS) @@ -210,7 +210,7 @@ distclean: clean cd rdoff && $(MAKE) distclean cleaner: clean - $(RM) -f $(PERLREQ) *.man nasm.spec + $(RM) -f $(PERLREQ) *.1 nasm.spec cd doc && $(MAKE) clean spotless: distclean cleaner |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-17 18:54:36
|
Commit-ID: 1a63699ce58044f99bd56bab89d3b08e41d29bd9 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=1a63699ce58044f99bd56bab89d3b08e41d29bd9 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 17 Feb 2013 22:50:19 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 17 Feb 2013 22:50:19 +0400 man: Generate manpages from asciidoc format The asciidoc format is a way more easier to read by a human. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- Makefile.in | 10 +- configure.in | 2 + nasm.1 | 535 ----------------------------------------------------------- nasm.txt | 292 ++++++++++++++++++++++++++++++++ ndisasm.1 | 129 -------------- ndisasm.txt | 94 +++++++++++ 6 files changed, 395 insertions(+), 667 deletions(-) diff --git a/Makefile.in b/Makefile.in index d7b4e22..0ea71f7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,6 +31,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ NROFF = @NROFF@ +ASCIIDOC = @ASCIIDOC@ +XMLTO = @XMLTO@ MKDIR = mkdir RM = rm @@ -47,7 +49,7 @@ ifeq ($(TRACE),1) CFLAGS += -DNASM_TRACE endif -.SUFFIXES: .c .i .s .$(O) .1 .man +.SUFFIXES: .c .i .s .$(O) .1 .txt .PHONY: all doc rdf install clean distclean cleaner spotless install_rdf test .PHONY: install_doc everything install_everything strip perlreq dist tags TAGS @@ -61,8 +63,10 @@ endif .c.i: $(CC) -E $(ALL_CFLAGS) -o $@ $< -.1.man: - $(NROFF) -man $< > $@ +.txt.1: + $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.1,%.xml,$@) $< + $(XMLTO) man --skip-validation $(patsubst %.1,%.xml,$@) 2>/dev/null + #-- Begin File Lists --# NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \ diff --git a/configure.in b/configure.in index 8c6a429..b325dd2 100644 --- a/configure.in +++ b/configure.in @@ -68,6 +68,8 @@ PA_ADD_CFLAGS([-pedantic]) dnl Look for programs... AC_CHECK_PROGS(NROFF, nroff, echo) +AC_CHECK_PROGS(ASCIIDOC, asciidoc, echo) +AC_CHECK_PROGS(XMLTO, xmlto, echo) AC_CHECK_PROGS(ACRODIST, acrodist, false) AC_CHECK_PROGS(PS2PDF, ps2pdf, false) AC_CHECK_PROGS(PSTOPDF, pstopdf, false) diff --git a/nasm.1 b/nasm.1 deleted file mode 100644 index bca0cd5..0000000 --- a/nasm.1 +++ /dev/null @@ -1,535 +0,0 @@ -.TH NASM 1 "The Netwide Assembler Project" -.SH NAME -nasm \- the Netwide Assembler, a portable 80x86 assembler -.SH SYNOPSIS -.B nasm -[ -.B \-@ -response file -] [ -.B \-f -format -] [ -.B \-o -outfile -] [ -.B \-l -listfile -] [ -.IR options ... -] filename -.br -.B nasm \-h -.br -.B nasm \-v -.SH DESCRIPTION -The -.B nasm -command assembles the file -.I filename -and directs output to the file -.I outfile -if specified. If -.I outfile -is not specified, -.B nasm -will derive a default output file name from the name of its input -file, usually by appending `.o' or `.obj', or by removing all -extensions for a raw binary file. Failing that, the output file name -will be `nasm.out'. -.SS OPTIONS -.TP -.BI \-@ " filename" -Causes -.B nasm -to process options from -.I filename -as if they were included on the command line. -.TP -.B \-a -Causes -.B nasm -to assemble the given input file without first applying the macro -preprocessor. -.TP -.BI \-D " macro[=value]" -Pre-defines a single-line macro. -.TP -.BI \-d " macro[=value]" -Same as the -.B \-D -option. -.TP -.B \-e -Causes -.B nasm -to preprocess the given input file, and write the output to -.I stdout -(or the specified output file name), and not actually assemble -anything. -.TP -.BI \-f " format" -Specifies the output file format. To see a list of valid output -formats, use the -.B -hf -option. -.TP -.B \-g -Causes -.B nasm -to generate debug information in selected format -.TP -.B \-h -Causes -.B nasm -to exit immediately, after giving a summary of its invocation -options. -.TP -.B \-hf -Same as -.B -h -, but also lists all valid output formats. -.TP -.BI \-I " directory" -Adds a directory to the search path for include files. The directory -specification must include the trailing slash, as it will be -directly prepended to the name of the include file. -.TP -.BI \-i " directory" -Same as the -.B \-I -option. -.TP -.BI \-l " listfile" -Causes an assembly listing to be directed to the given file, in -which the original source is displayed on the right hand side (plus -the source for included files and the expansions of multi-line -macros) and the generated code is shown in hex on the left. -.TP -.B \-M -Causes -.B nasm -to output Makefile-style dependencies to stdout; normal output is -suppressed. -.TP -.BI \-MG " file" -Same as -.B \-M -but assumes that missing Makefile dependecies are generated and added -to dependency list without a prefix. -.TP -.BI \-MF " file" -Output Makefile-style dependencies to the specified file. -.TP -.BI \-MD " file" -Same as a combination of -.B \-M -and -.B \-MF -options. -.TP -.BI \-MT " file" -Override the default name of the dependency target -dependency target name. This is normally the same -as the output filename, specified by the -.B \-o -option. -.TP -.BI \-MQ " file" -The same as -.B \-MT -except it tries to quote characters that have special -meaning in Makefile syntax. This is not foolproof, -as not all characters with special meaning are quotable -in Make. -.TP -.BI \-MP -Emit phony target -.TP -.BI \-O " number" -Optimize branch offsets. -.ti -.B \-O0 -:No optimization -.ti -.B \-O1 -:Minimal optimization -.ti -.B \-Ox -:Multipass optimization (default) -.TP -.BI \-o " outfile" -Specifies a precise name for the output file, overriding -.BR nasm 's -default means of determining it. -.TP -.BI \-P " file" -Specifies a file to be pre-included, before the main source file -starts to be processed. -.TP -.BI \-p " file" -Same as the -.B \-P -option. -.TP -.BI \-r -Causes -.B nasm -to exit immediately, after displaying its version number. -.I (obsolete) -.TP -.B \-s -Causes -.B nasm -to send its error messages and/or help text to -.I stdout -instead of -.IR stderr . -.TP -.B \-t -Causes -.B nasm -to assemble in SciTech TASM compatible mode -.TP -.BI \-U " macro" -Undefines a single-line macro. -.TP -.BI \-u " macro" -Same as the -.B \-U -option. -.TP -.BI \-v -Causes -.B nasm -to exit immediately, after displaying its version number. -.TP -.BI \-w [+-]foo -Causes -.B nasm -to enable or disable certain classes of warning messages, for -example -.B \-w+orphan-labels -or -.B \-w-macro-params -.TP -.BI \-X " format" -specifies error reporting format (gnu or vc). -.TP -.BI \-Z " filename" -Causes -.B nasm -to redirect error messages to -.IR filename . -This option exists to support operating systems on which stderr is not -easily redirected. -.TP -.BI \-\-prefix -.TP -.BI \-\-postfix -Prepend or append (respectively) the given argument to all -global or extern variables. -.PP -.RE -.SS SYNTAX -This man page does not fully describe the syntax of -.BR nasm 's -assembly language, but does give a summary of the differences from -other assemblers. -.PP -.I Registers -have no leading `%' sign, unlike -.BR gas , -and floating-point stack registers are referred to as -.IR st0 , -.IR st1 , -and so on. -.PP -.I Floating-point instructions -may use either the single-operand form or the double. A -.I TO -keyword is provided; thus, one could either write -.PP -.ti +15n -fadd st0,st1 -.br -.ti +15n -fadd st1,st0 -.PP -or one could use the alternative single-operand forms -.PP -.ti +15n -fadd st1 -.br -.ti +15n -fadd to st1 -.PP -.I Uninitialised storage -is reserved using the -.IR RESB , -.IR RESW , -.IR RESD , -.IR RESQ , -.I REST -and -.I RESO -pseudo-opcodes, each taking one parameter which gives the number of -bytes, words, doublewords, quadwords or ten-byte words to reserve. -.PP -.I Repetition -of data items is not done by the -.I DUP -keyword as seen in DOS assemblers, but by the use of the -.I TIMES -prefix, like this: -.PP -.ti +6n -.ta 9n -message: times 3 db 'abc' -.br -.ti +15n -times 64-$+message db 0 -.PP -which defines the string `abcabcabc', followed by the right number -of zero bytes to make the total length up to 64 bytes. -.PP -.I Symbol references -are always understood to be immediate (i.e. the address of the -symbol), unless square brackets are used, in which case the contents -of the memory location are used. Thus: -.PP -.ti +15n -mov ax,wordvar -.PP -loads AX with the address of the variable `wordvar', whereas -.PP -.ti +15n -mov ax,[wordvar] -.br -.ti +15n -mov ax,[wordvar+1] -.br -.ti +15n -mov ax,[es:wordvar+bx] -.PP -all refer to the -.I contents -of memory locations. The syntaxes -.PP -.ti +15n -mov ax,es:wordvar[bx] -.br -.ti +15n -es mov ax,wordvar[1] -.PP -are not legal at all, although the use of a segment register name as -an instruction prefix is valid, and can be used with instructions -such as -.I LODSB -which can't be overridden any other way. -.PP -.I Constants -may be expressed numerically in most formats: a trailing H, Q or B -denotes hex, octal or binary respectively, and a leading `0x' or `$' -denotes hex as well. Leading zeros are not treated specially at all. -Character constants may be enclosed in single or double quotes; -there is no escape character. The ordering is little-endian -(reversed), so that the character constant -.I 'abcd' -denotes 0x64636261 and not 0x61626364. -.PP -.I Local labels -begin with a period, and their `locality' is granted by the -assembler prepending the name of the previous non-local symbol. Thus -declaring a label `.loop' after a label `label' has actually defined -a symbol called `label.loop'. -.SS DIRECTIVES -.I SECTION name -or -.I SEGMENT name -causes -.B nasm -to direct all following code to the named section. Section names -vary with output file format, although most formats support the -names -.IR .text , -.I .data -and -.IR .bss . -(The exception is the -.I obj -format, in which all segments are user-definable.) -.PP -.I ABSOLUTE address -causes -.B nasm -to position its notional assembly point at an absolute address: so -no code or data may be generated, but you can use -.IR RESB , -.I RESW -and -.I RESD -to move the assembly point further on, and you can define labels. So -this directive may be used to define data structures. When you have -finished doing absolute assembly, you must issue another -.I SECTION -directive to return to normal assembly. -.PP -.I BITS 16, -.I BITS 32 -or -.I BITS 64 -switches the default processor mode for which -.B nasm -is generating code: it is equivalent to -.I USE16 -or -.I USE32 -in DOS assemblers. -.PP -.I EXTERN symbol -and -.I GLOBAL symbol -import and export symbol definitions, respectively, from and to -other modules. Note that the -.I GLOBAL -directive must appear before the definition of the symbol it refers -to. -.PP -.I STRUC strucname -and -.IR ENDSTRUC , -when used to bracket a number of -.IR RESB , -.I RESW -or similar instructions, define a data structure. In addition to -defining the offsets of the structure members, the construct also -defines a symbol for the size of the structure, which is simply the -structure name with -.I _size -tacked on to the end. -.SS FORMAT-SPECIFIC DIRECTIVES -.I ORG address -is used by the -.I bin -flat-form binary output format, and specifies the address at which -the output code will eventually be loaded. -.PP -.I GROUP grpname seg1 seg2... -is used by the -.I obj -(Microsoft 16-bit) output format, and defines segment groups. This -format also uses -.IR UPPERCASE , -which directs that all segment, group and symbol names output to the -object file should be in uppercase. Note that the actual assembly is -still case sensitive. -.PP -.I LIBRARY libname -is used by the -.I rdf -output format, and causes a dependency record to be written to the -output file which indicates that the program requires a certain -library in order to run. -.SS MACRO PREPROCESSOR -Single-line macros are defined using the -.I %define -or -.I %idefine -commands, in a similar fashion to the C preprocessor. They can be -overloaded with respect to number of parameters, although defining a -macro with no parameters prevents the definition of any macro with -the same name taking parameters, and vice versa. -.I %define -defines macros whose names match case-sensitively, whereas -.I %idefine -defines case-insensitive macros. -.PP -Multi-line macros are defined using -.I %macro -and -.I %imacro -(the distinction is the same as that between -.I %define -and -.IR %idefine ), -whose syntax is as follows: -.PP -.ti +6n -%macro -.I name -.IR minprm [- maxprm "][+][.nolist] [" defaults ] -.br -.ti +15n -<some lines of macro expansion text> -.br -.ti +6n -%endmacro -.PP -Again, these macros may be overloaded. The trailing plus sign -indicates that any parameters after the last one get subsumed, with -their separating commas, into the last parameter. The -.I defaults -part can be used to specify defaults for unspecified macro -parameters after -.IR minparam . -.I %endm -is a valid synonym for -.IR %endmacro . -.PP -To refer to the macro parameters within a macro expansion, you use -.IR %1 , -.I %2 -and so on. You can also enforce that a macro parameter should -contain a condition code by using -.IR %+1 , -and you can invert the condition code by using -.IR %-1 . -You can also define a label specific to a macro invocation by -prefixing it with a double % sign. -.PP -Files can be included using the -.I %include -directive, which works like C. -.PP -The preprocessor has a `context stack', which may be used by one -macro to store information that a later one will retrieve. You can -push a context on the stack using -.IR %push , -remove one using -.IR %pop , -and change the name of the top context (without disturbing any -associated definitions) using -.IR %repl . -Labels and -.I %define -macros specific to the top context may be defined by prefixing their -names with %$, and things specific to the next context down with -%$$, and so on. -.PP -Conditional assembly is done by means of -.IR %ifdef , -.IR %ifndef , -.I %else -and -.I %endif -as in C. (Except that -.I %ifdef -can accept several putative macro names, and will evaluate TRUE if -any of them is defined.) In addition, the directives -.I %ifctx -and -.I %ifnctx -can be used to condition on the name of the top context on the -context stack. The obvious set of `else-if' directives, -.IR %elifdef , -.IR %elifndef , -.IR %elifctx -and -.IR %elifnctx -are also supported. -.SH BUGS -Please report bugs through the bug tracker function at http://nasm.sourceforge.org. -.SH SEE ALSO -.BR as "(" 1 ")," -.BR ld "(" 1 ")." diff --git a/nasm.txt b/nasm.txt new file mode 100644 index 0000000..dde95ba --- /dev/null +++ b/nasm.txt @@ -0,0 +1,292 @@ +nasm(1) +======= +:doctype: manpage +:man source: NASM +:man manual: The Netwide Assembler Project + +NAME +---- +nasm - the Netwide Assembler, a portable 80x86 assembler + +SYNOPSIS +-------- +*nasm* [*-@* response file] [*-f* format] [*-o* outfile] [*-l* listfile] ['options'...] filename + +DESCRIPTION +----------- +The *nasm* command assembles the file 'filename' and directs output to the file +'outfile' if specified. If 'outfile' is not specified, *nasm* will derive a default +output file name from the name of its input file, usually by appending `.o' or +`.obj', or by removing all extensions for a raw binary file. Failing that, the +output file name will be `nasm.out'. + +OPTIONS +------- +*-@* 'filename':: + Causes *nasm* to process options from filename as if they were included on + the command line. + +*-a*:: + Causes *nasm* to assemble the given input file without first applying the + macro preprocessor. + +*-D*|*-d* 'macro[=value]':: + Pre-defines a single-line macro. + +*-e*:: + Causes *nasm* to preprocess the given input file, and write the output to + 'stdout' (or the specified output file name), and not actually assemble + anything. + +*-f* 'format':: + Specifies the output file format. To see a list of valid output formats, + use the *-hf* option. + +*-g*:: + Causes *nasm* to generate debug information in selected format + +*-h*:: + Causes *nasm* to exit immediately, after giving a summary of its + invocation options. + +*-hf*:: + Same as *-h* , but also lists all valid output formats. + +*-I*|*-i* 'directory':: + Adds a directory to the search path for include files. The directory + specification must include the trailing slash, as it will be directly + prepended to the name of the include file. + +*-l* 'listfile':: + Causes an assembly listing to be directed to the given file, in which + the original source is displayed on the right hand side (plus the source + for included files and the expansions of multi-line macros) and the + generated code is shown in hex on the left. + +*-M*:: + Causes *nasm* to output Makefile-style dependencies to stdout; normal + output is suppressed. + +*-MG* 'file':: + Same as *-M* but assumes that missing Makefile dependecies are generated + and added to dependency list without a prefix. + +*-MF* 'file':: + Output Makefile-style dependencies to the specified file. + +*-MD* 'file':: + Same as a combination of *-M* and *-MF* options. + +*-MT* 'file':: + Override the default name of the dependency target dependency target name. + This is normally the same as the output filename, specified by + the *-o* option. + +*-MQ* 'file':: + The same as *-MT* except it tries to quote characters that have special + meaning in Makefile syntax. This is not foolproof, as not all characters + with special meaning are quotable in Make. + +*-MP*:: + Emit phony target. + +*-O* 'number':: + Optimize branch offsets. + * *-O0*: No optimization + * *-O1*: Minimal optimization + * *-Ox*: Multipass optimization (default) + +*-o* 'outfile':: + Specifies a precise name for the output file, overriding *nasm*'s default + means of determining it. + +*-P*|*-p* 'file':: + Specifies a file to be pre-included, before the main source file + starts to be processed. + +*-s*:: + Causes *nasm* to send its error messages and/or help text to stdout + instead of stderr. + +*-t*:: + Causes *nasm* to assemble in SciTech TASM compatible mode. + +*-U*|*-u* 'macro':: + Undefines a single-line macro. + +*-v*:: + Causes *nasm* to exit immediately, after displaying its version number. + +*-w*'[+-]foo':: + Causes *nasm* to enable or disable certain classes of warning messages, + for example *-w+orphan-labels* or *-w-macro-params*. + +*-X* 'format':: + Specifies error reporting format (gnu or vc). + +*-Z* 'filename':: + Causes *nasm* to redirect error messages to 'filename'. This option exists + to support operating systems on which stderr is not easily redirected. + +--prefix:: +--postfix:: + Prepend or append (respectively) the given argument to all global or + extern variables. + +SYNTAX +------ +This man page does not fully describe the syntax of *nasm*'s assembly language, +but does give a summary of the differences from other assemblers. + +'Registers' have no leading `%' sign, unlike *gas*, and floating-point stack +registers are referred to as 'st0', 'st1', and so on. + +'Floating-point instructions' may use either the single-operand form or the +double. A 'TO' keyword is provided; thus, one could either write + + fadd st0,st1 + fadd st1,st0 + +or one could use the alternative single-operand forms + + fadd st1 + fadd to st1 + +'Uninitialised storage' is reserved using the 'RESB', 'RESW', 'RESD', 'RESQ', +'REST' and 'RESO' pseudo-opcodes, each taking one parameter which gives the +number of bytes, words, doublewords, quadwords or ten-byte words to reserve. + +'Repetition' of data items is not done by the 'DUP' keyword as seen in DOS +assemblers, but by the use of the 'TIMES' prefix, like this: + + message: times 3 db 'abc' + times 64-$+message db 0 + +which defines the string `abcabcabc`, followed by the right number of zero +bytes to make the total length up to 64 bytes. + +'Symbol references' are always understood to be immediate (i.e. the address +of the symbol), unless square brackets are used, in which case the contents +of the memory location are used. Thus: + + mov ax,wordvar + +loads AX with the address of the variable `wordvar`, whereas + + mov ax,[wordvar] + mov ax,[wordvar+1] + mov ax,[es:wordvar+bx] + +all refer to the 'contents' of memory locations. The syntaxes + + mov ax,es:wordvar[bx] + es mov ax,wordvar[1] + +are not legal at all, although the use of a segment register name as an instruction +prefix is valid, and can be used with instructions such as 'LODSB' which can't +be overridden any other way. + +'Constants' may be expressed numerically in most formats: a trailing H, Q or +B denotes hex, octal or binary respectively, and a leading `0x' or `$' denotes +hex as well. Leading zeros are not treated specially at all. Character constants +may be enclosed in single or double quotes; there is no escape character. The +ordering is little-endian (reversed), so that the character constant ''abcd'' +denotes 0x64636261 and not 0x61626364. + +Local labels begin with a period, and their `locality' is granted by the assembler +prepending the name of the previous non-local symbol. Thus declaring a label +`.loop' after a label `label' has actually defined a symbol called `label.loop'. + +DIRECTIVES +---------- +'SECTION' 'name' or 'SEGMENT' 'name' causes *nasm* to direct all following code +to the named section. Section names vary with output file format, although most +formats support the names '.text', '.data' and '.bss'. (The exception is the +'obj' format, in which all segments are user-definable.) + +'ABSOLUTE' 'address' causes *nasm* to position its notional assembly point at +an absolute address: so no code or data may be generated, but you can use 'RESB', +'RESW' and 'RESD' to move the assembly point further on, and you can define labels. +So this directive may be used to define data structures. When you have finished +doing absolute assembly, you must issue another 'SECTION' directive to return to +normal assembly. + +'BITS' '16', 'BITS' '32' or 'BITS' '64' switches the default processor mode for +which *nasm* is generating code: it is equivalent to 'USE16' or 'USE32' in DOS +assemblers. + +'EXTERN' 'symbol' and 'GLOBAL' 'symbol' import and export symbol definitions, +respectively, from and to other modules. Note that the 'GLOBAL' directive must +appear before the definition of the symbol it refers to. + +'STRUC' 'strucname' and 'ENDSTRUC', when used to bracket a number of 'RESB', +'RESW' or similar instructions, define a data structure. In addition to +defining the offsets of the structure members, the construct also defines a symbol +for the size of the structure, which is simply the structure name with 'size' +tacked on to the end. + +FORMAT-SPECIFIC DIRECTIVES +-------------------------- +'ORG' 'address' is used by the 'bin' flat-form binary output format, and +specifies the address at which the output code will eventually be loaded. + +'GROUP' 'grpname' 'seg1' 'seg2'... is used by the obj (Microsoft 16-bit) +output format, and defines segment groups. This format also uses 'UPPERCASE', +which directs that all segment, group and symbol names output to the object +file should be in uppercase. Note that the actual assembly is still case +sensitive. + +'LIBRARY' 'libname' is used by the 'rdf' output format, and causes a +dependency record to be written to the output file which indicates that +the program requires a certain library in order to run. + +MACRO PREPROCESSOR +------------------ +Single-line macros are defined using the '%define' or '%idefine' commands, in +a similar fashion to the C preprocessor. They can be overloaded with respect +to number of parameters, although defining a macro with no parameters prevents +the definition of any macro with the same name taking parameters, and vice versa. +'%define' defines macros whose names match case-sensitively, whereas '%idefine' +defines case-insensitive macros. + +Multi-line macros are defined using '%macro' and '%imacro' (the distinction is the +same as that between '%define' and '%idefine'), whose syntax is as follows + + %macro name minprm[-maxprm][+][.nolist] [defaults] + <some lines of macro expansion text> + %endmacro + +Again, these macros may be overloaded. The trailing plus sign indicates that +any parameters after the last one get subsumed, with their separating commas, +into the last parameter. The 'defaults' part can be used to specify defaults for +unspecified macro parameters after 'minparam'. '%endm' is a valid synonym for +'%endmacro'. + +To refer to the macro parameters within a macro expansion, you use '%1', '%2' and +so on. You can also enforce that a macro parameter should contain a condition +code by using '%+1', and you can invert the condition code by using '%-1'. You can also +define a label specific to a macro invocation by prefixing it with a double `%' sign. + +Files can be included using the '%include' directive, which works like C. + +The preprocessor has a `context stack', which may be used by one macro to store +information that a later one will retrieve. You can push a context on the stack +using '%push', remove one using '%pop', and change the name of the top context (without +disturbing any associated definitions) using '%repl'. Labels and '%define' macros +specific to the top context may be defined by prefixing their names with %$, +and things specific to the next context down with %$$, and so on. + +Conditional assembly is done by means of '%ifdef', '%ifndef', '%else' and '%endif' +as in C. (Except that '%ifdef' can accept several putative macro names, and +will evaluate TRUE if any of them is defined.) In addition, the directives +'%ifctx' and '%ifnctx' can be used to condition on the name of the top context +on the context stack. The obvious set of `else-if' directives, '%elifdef', +'%elifndef', '%elifctx' and '%elifnctx' are also supported. + +BUGS +---- +Please report bugs through the bug tracker function at http://nasm.us. + +SEE ALSO +-------- +*as*(1), *ld*(1). diff --git a/ndisasm.1 b/ndisasm.1 deleted file mode 100644 index 622500f..0000000 --- a/ndisasm.1 +++ /dev/null @@ -1,129 +0,0 @@ -.\" -.\" This file is part of NASM and is released under the NASM License. -.\" -.TH NDISASM 1 "The Netwide Assembler Project" -.SH NAME -ndisasm \- the Netwide Disassembler, an 80x86 binary file disassembler -.SH SYNOPSIS -.B ndisasm -[ -.B \-o -origin -] [ -.B \-s -sync-point [...]] -[ -.B \-a -| -.B \-i -] [ -.B \-b -bits -] [ -.B -u -] [ -.B \-e -hdrlen -] [ -.B \-k -offset,length [...]] -infile -.br -.B ndisasm \-h -.br -.B ndisasm \-r -.SH DESCRIPTION -The -.B ndisasm -command generates a disassembly listing of the binary file -.I infile -and directs it to stdout. -.SS OPTIONS -.TP -.B \-h -Causes -.B ndisasm -to exit immediately, after giving a summary of its invocation -options. -.TP -.BI \-r -Causes -.B ndisasm -to exit immediately, after displaying its version number. -.TP -.BI \-o " origin" -Specifies the notional load address for the file. This option causes -.B ndisasm -to get the addresses it lists down the left hand margin, and the -target addresses of PC-relative jumps and calls, right. -.TP -.BI \-s " sync-point" -Manually specifies a synchronisation address, such that -.B ndisasm -will not output any machine instruction which encompasses bytes on -both sides of the address. Hence the instruction which -.I starts -at that address will be correctly disassembled. -.TP -.BI \-e " hdrlen" -Specifies a number of bytes to discard from the beginning of the -file before starting disassembly. This does not count towards the -calculation of the disassembly offset: the first -.I disassembled -instruction will be shown starting at the given load address. -.TP -.BI \-k " offset,length" -Specifies that -.I length -bytes, starting from disassembly offset -.IR offset , -should be skipped over without generating any output. The skipped -bytes still count towards the calculation of the disassembly offset. -.TP -.BR \-a " or " \-i -Enables automatic (or intelligent) sync mode, in which -.B ndisasm -will attempt to guess where synchronisation should be performed, by -means of examining the target addresses of the relative jumps and -calls it disassembles. -.TP -.BI \-b " bits" -Specifies 16-, 32- or 64-bit mode. The default is 16-bit mode. -.TP -.B \-u -Specifies 32-bit mode, more compactly than using `-b 32'. -.TP -.BI \-p " vendor" -Prefers instructions as defined by -.I vendor -in case of a conflict. Known -.I vendor -names include -.BR intel , -.BR amd , -.BR cyrix , -and -.BR idt . -The default is -.BR intel . -.PP -.RE -.SH RESTRICTIONS -.B ndisasm -only disassembles binary files: it has no understanding of the -header information present in object or executable files. If you -want to disassemble an object file, you should probably be using -.BR objdump "(" 1 ")." -.PP -Auto-sync mode won't necessarily cure all your synchronisation -problems: a sync marker can only be placed automatically if a jump -or call instruction is found to refer to it -.I before -.B ndisasm -actually disassembles that part of the code. Also, if spurious jumps -or calls result from disassembling non-machine-code data, sync -markers may get placed in strange places. Feel free to turn -auto-sync off and go back to doing it manually if necessary. -.PP -.SH SEE ALSO -.BR objdump "(" 1 ")." diff --git a/ndisasm.txt b/ndisasm.txt new file mode 100644 index 0000000..a5f1e59 --- /dev/null +++ b/ndisasm.txt @@ -0,0 +1,94 @@ +ndisasm(1) +========== +:doctype: manpage +:man source: NASM +:man manual: The Netwide Assembler Project + +NAME +---- +ndisasm - the Netwide Disassembler, an 80x86 binary file disassembler + +SYNOPSIS +-------- +*ndisasm* [ *-o* origin ] [ *-s* sync-point [...]] [ *-a* | *-i* ] + [ *-b* bits ] [ *-u* ] [ *-e* hdrlen ] + [ *-k* offset,length [...]] infile + +DESCRIPTION +----------- +The *ndisasm* command generates a disassembly listing of the binary file +infile and directs it to stdout. + +OPTIONS +------- +-h:: + Causes *ndisasm* to exit immediately, after giving a summary + of its invocation options. + +-r:: + Causes *ndisasm* to exit immediately, after displaying its + version number. + +-o 'origin':: + Specifies the notional load address for the file. This + option causes *ndisasm* to get the addresses it lists + down the left hand margin, and the target addresses + of PC-relative jumps and calls, right. + +-s 'sync-point':: + Manually specifies a synchronisation address, such that + *ndisasm* will not output any machine instruction which + encompasses bytes on both sides of the address. Hence + the instruction which starts at that address will be + correctly disassembled. + +-e 'hdrlen':: + Specifies a number of bytes to discard from the beginning + of the file before starting disassembly. This does not + count towards the calculation of the disassembly offset: + the first 'disassembled' instruction will be shown starting + at the given load address. + +-k 'offset,length':: + Specifies that 'length' bytes, starting from disassembly + offset 'offset', should be skipped over without generating + any output. The skipped bytes still count towards the + calculation of the disassembly offset. + +-a|-i:: + Enables automatic (or intelligent) sync mode, in which + *ndisasm* will attempt to guess where synchronisation should + be performed, by means of examining the target addresses + of the relative jumps and calls it disassembles. + +-b 'bits':: + Specifies 16-, 32- or 64-bit mode. The default is 16-bit + mode. + +-u:: + Specifies 32-bit mode, more compactly than using `-b 32'. + +-p 'vendor':: + Prefers instructions as defined by 'vendor' in case of + a conflict. Known 'vendor' names include *intel*, *amd*, + *cyrix*, and *idt*. The default is *intel*. + +RESTRICTIONS +------------ +*ndisasm* only disassembles binary files: it has no understanding of +the header information present in object or executable files. +If you want to disassemble an object file, you should probably +be using *objdump*(1). + +Auto-sync mode won't necessarily cure all your synchronisation +problems: a sync marker can only be placed automatically if a +jump or call instruction is found to refer to it 'before' +*ndisasm* actually disassembles that part of the code. Also, +if spurious jumps or calls result from disassembling +non-machine-code data, sync markers may get placed in strange +places. Feel free to turn auto-sync off and go back to doing +it manually if necessary. + +SEE ALSO +-------- +*objdump*(1) |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-17 18:54:30
|
Commit-ID: a709e767f608f633cd14ac04c4f776fc2c57a00c Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=a709e767f608f633cd14ac04c4f776fc2c57a00c Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 17 Feb 2013 22:47:28 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 17 Feb 2013 22:47:28 +0400 Update .gitignore Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index f812e77..6c72bf2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,16 @@ *.orig *.out *.rej +*.xml +*.swp +.*swo *~ \#* *.bak *.tmp +cscope* +tags +TAGS /Makefile /config.h /config.h.in |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:54
|
Commit-ID: d59b2602b3ec5bc7fafd36ae7abe27b9042c70e7 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=d59b2602b3ec5bc7fafd36ae7abe27b9042c70e7 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 02:09:16 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 02:09:16 +0400 Drop trailing space from directive.pl Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- directiv.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/directiv.pl b/directiv.pl index 0417f56..01af235 100755 --- a/directiv.pl +++ b/directiv.pl @@ -122,7 +122,7 @@ if ($output eq 'h') { print C "#include \"directiv.h\"\n"; print C "\n"; - printf C "const char * const directives[%d] = \n", + printf C "const char * const directives[%d] =\n", scalar(@directives)+scalar(@specials); $c = '{'; foreach $d (@specials) { |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:53
|
Commit-ID: cdaae1a8e3abae746ebc16d31fd20af4e92a69ba Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=cdaae1a8e3abae746ebc16d31fd20af4e92a69ba Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 02:16:58 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 02:16:58 +0400 nasm.c: Tabs to spaces in define_macros_early Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/nasm.c b/nasm.c index 2ee319f..f231b30 100644 --- a/nasm.c +++ b/nasm.c @@ -216,42 +216,42 @@ static void define_macros_early(void) lt_p = localtime(&official_compile_time); if (lt_p) { - lt = *lt_p; - - strftime(temp, sizeof temp, "__DATE__=\"%Y-%m-%d\"", <); - preproc->pre_define(temp); - strftime(temp, sizeof temp, "__DATE_NUM__=%Y%m%d", <); - preproc->pre_define(temp); - strftime(temp, sizeof temp, "__TIME__=\"%H:%M:%S\"", <); - preproc->pre_define(temp); - strftime(temp, sizeof temp, "__TIME_NUM__=%H%M%S", <); - preproc->pre_define(temp); + lt = *lt_p; + + strftime(temp, sizeof temp, "__DATE__=\"%Y-%m-%d\"", <); + preproc->pre_define(temp); + strftime(temp, sizeof temp, "__DATE_NUM__=%Y%m%d", <); + preproc->pre_define(temp); + strftime(temp, sizeof temp, "__TIME__=\"%H:%M:%S\"", <); + preproc->pre_define(temp); + strftime(temp, sizeof temp, "__TIME_NUM__=%H%M%S", <); + preproc->pre_define(temp); } gm_p = gmtime(&official_compile_time); if (gm_p) { - gm = *gm_p; - - strftime(temp, sizeof temp, "__UTC_DATE__=\"%Y-%m-%d\"", &gm); - preproc->pre_define(temp); - strftime(temp, sizeof temp, "__UTC_DATE_NUM__=%Y%m%d", &gm); - preproc->pre_define(temp); - strftime(temp, sizeof temp, "__UTC_TIME__=\"%H:%M:%S\"", &gm); - preproc->pre_define(temp); - strftime(temp, sizeof temp, "__UTC_TIME_NUM__=%H%M%S", &gm); - preproc->pre_define(temp); + gm = *gm_p; + + strftime(temp, sizeof temp, "__UTC_DATE__=\"%Y-%m-%d\"", &gm); + preproc->pre_define(temp); + strftime(temp, sizeof temp, "__UTC_DATE_NUM__=%Y%m%d", &gm); + preproc->pre_define(temp); + strftime(temp, sizeof temp, "__UTC_TIME__=\"%H:%M:%S\"", &gm); + preproc->pre_define(temp); + strftime(temp, sizeof temp, "__UTC_TIME_NUM__=%H%M%S", &gm); + preproc->pre_define(temp); } if (gm_p) - posix_time = posix_mktime(&gm); + posix_time = posix_mktime(&gm); else if (lt_p) - posix_time = posix_mktime(<); + posix_time = posix_mktime(<); else - posix_time = 0; + posix_time = 0; if (posix_time) { - snprintf(temp, sizeof temp, "__POSIX_TIME__=%"PRId64, posix_time); - preproc->pre_define(temp); + snprintf(temp, sizeof temp, "__POSIX_TIME__=%"PRId64, posix_time); + preproc->pre_define(temp); } } |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:52
|
Commit-ID: 35392256098f36dd1ea9f91c4558ef6457d52918 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=35392256098f36dd1ea9f91c4558ef6457d52918 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 02:06:24 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 02:06:24 +0400 Align enum prefixes members It's a way easier to read. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/nasm.h b/nasm.h index 7422635..a9bff49 100644 --- a/nasm.h +++ b/nasm.h @@ -496,10 +496,24 @@ enum vex_class { enum prefixes { /* instruction prefixes */ P_none = 0, PREFIX_ENUM_START = REG_ENUM_LIMIT, - P_A16 = PREFIX_ENUM_START, P_A32, P_A64, P_ASP, - P_LOCK, P_O16, P_O32, P_O64, P_OSP, - P_REP, P_REPE, P_REPNE, P_REPNZ, P_REPZ, P_TIMES, - P_WAIT, P_XACQUIRE, P_XRELEASE, + P_A16 = PREFIX_ENUM_START, + P_A32, + P_A64, + P_ASP, + P_LOCK, + P_O16, + P_O32, + P_O64, + P_OSP, + P_REP, + P_REPE, + P_REPNE, + P_REPNZ, + P_REPZ, + P_TIMES, + P_WAIT, + P_XACQUIRE, + P_XRELEASE, PREFIX_ENUM_LIMIT }; |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:51
|
Commit-ID: 04dba65098e7b679db58eb22147af5d6d0ea972f Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=04dba65098e7b679db58eb22147af5d6d0ea972f Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 02:21:07 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 02:21:07 +0400 nasm.c: Tabs to spaces in nasm_verror_gnu Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nasm.c b/nasm.c index 6d8163d..07642ce 100644 --- a/nasm.c +++ b/nasm.c @@ -1850,10 +1850,10 @@ static void nasm_verror_gnu(int severity, const char *fmt, va_list ap) src_get(&lineno, ¤tfile); if (currentfile) { - fprintf(error_file, "%s:%"PRId32": ", currentfile, lineno); - nasm_free(currentfile); + fprintf(error_file, "%s:%"PRId32": ", currentfile, lineno); + nasm_free(currentfile); } else { - fputs("nasm: ", error_file); + fputs("nasm: ", error_file); } nasm_verror_common(severity, fmt, ap); |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:51
|
Commit-ID: 52405e372767fe373c3063ae75f713dfe60ff658 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=52405e372767fe373c3063ae75f713dfe60ff658 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:25:04 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:25:04 +0400 nasm.c: Tabs to spaces in emit_dependencies Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/nasm.c b/nasm.c index 38eee80..1b19760 100644 --- a/nasm.c +++ b/nasm.c @@ -276,38 +276,38 @@ static void emit_dependencies(StrList *list) StrList *l, *nl; if (depend_file && strcmp(depend_file, "-")) { - deps = fopen(depend_file, "w"); - if (!deps) { - nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE, - "unable to write dependency file `%s'", depend_file); - return; - } + deps = fopen(depend_file, "w"); + if (!deps) { + nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE, + "unable to write dependency file `%s'", depend_file); + return; + } } else { - deps = stdout; + deps = stdout; } linepos = fprintf(deps, "%s:", depend_target); list_for_each(l, list) { char *file = quote_for_make(l->str); - len = strlen(file); - if (linepos + len > 62 && linepos > 1) { - fprintf(deps, " \\\n "); - linepos = 1; - } - fprintf(deps, " %s", file); - linepos += len+1; + len = strlen(file); + if (linepos + len > 62 && linepos > 1) { + fprintf(deps, " \\\n "); + linepos = 1; + } + fprintf(deps, " %s", file); + linepos += len+1; nasm_free(file); } fprintf(deps, "\n\n"); list_for_each_safe(l, nl, list) { - if (depend_emit_phony) - fprintf(deps, "%s:\n\n", l->str); - nasm_free(l); + if (depend_emit_phony) + fprintf(deps, "%s:\n\n", l->str); + nasm_free(l); } if (deps != stdout) - fclose(deps); + fclose(deps); } int main(int argc, char **argv) |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:51
|
Commit-ID: f196451d66be51ce0d03c5af973bb2780ff984fb Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=f196451d66be51ce0d03c5af973bb2780ff984fb Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:14:06 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:14:06 +0400 nasm.c: Tabs to spaces in process_response_file Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nasm.c b/nasm.c index fde5c5e..dd5224f 100644 --- a/nasm.c +++ b/nasm.c @@ -1075,11 +1075,11 @@ static void process_response_file(const char *file) char str[2048]; FILE *f = fopen(file, "r"); if (!f) { - perror(file); - exit(-1); + perror(file); + exit(-1); } while (fgets(str, sizeof str, f)) { - process_args(str); + process_args(str); } fclose(f); } |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:49
|
Commit-ID: 45aa118fdfb9955ed431431d8d1179bd36054f10 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=45aa118fdfb9955ed431431d8d1179bd36054f10 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:22:59 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:22:59 +0400 nasm.c: Tabs to spaces in copy_filename Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nasm.c b/nasm.c index ffdec47..89dd07e 100644 --- a/nasm.c +++ b/nasm.c @@ -522,8 +522,8 @@ static void copy_filename(char *dst, const char *src) size_t len = strlen(src); if (len >= (size_t)FILENAME_MAX) { - nasm_error(ERR_FATAL | ERR_NOFILE, "file name too long"); - return; + nasm_error(ERR_FATAL | ERR_NOFILE, "file name too long"); + return; } strncpy(dst, src, FILENAME_MAX); } |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:49
|
Commit-ID: f187eb778823e34283eaaad1d2e0404e263282ff Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=f187eb778823e34283eaaad1d2e0404e263282ff Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:25:33 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:25:33 +0400 nasm.c: Update year in header Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nasm.c b/nasm.c index 1b19760..6b8dab1 100644 --- a/nasm.c +++ b/nasm.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 1996-2012 The NASM Authors - All Rights Reserved + * Copyright 1996-2013 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:49
|
Commit-ID: 22ad9043410c17c912cc026680fe8f68258f858e Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=22ad9043410c17c912cc026680fe8f68258f858e Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 02:20:26 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 02:20:26 +0400 nasm.c: Tabs to spaces in nasm_verror_common Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nasm.c b/nasm.c index f231b30..6d8163d 100644 --- a/nasm.c +++ b/nasm.c @@ -1953,8 +1953,8 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) pfx = "debug: "; break; default: - pfx = ""; - break; + pfx = ""; + break; } vsnprintf(msg, sizeof msg, fmt, args); @@ -1962,7 +1962,7 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) fprintf(error_file, "%s%s\n", pfx, msg); if (*listname) - nasmlist.error(severity, pfx, msg); + nasmlist.error(severity, pfx, msg); if (severity & ERR_USAGE) want_usage = true; @@ -1972,10 +1972,10 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) /* no further action, by definition */ break; case ERR_WARNING: - /* Treat warnings as errors */ - if (warning_on[WARN_IDX(ERR_WARN_TERM)]) - terminate_after_phase = true; - break; + /* Treat warnings as errors */ + if (warning_on[WARN_IDX(ERR_WARN_TERM)]) + terminate_after_phase = true; + break; case ERR_NONFATAL: terminate_after_phase = true; break; @@ -1983,7 +1983,7 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) if (ofile) { fclose(ofile); remove(outname); - ofile = NULL; + ofile = NULL; } if (want_usage) usage(); @@ -1991,7 +1991,7 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) break; /* placate silly compilers */ case ERR_PANIC: fflush(NULL); - /* abort(); *//* halt, catch fire, and dump core */ + /* abort(); */ /* halt, catch fire, and dump core */ exit(3); break; } |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:47
|
Commit-ID: 331fd7c8aa3c0c11cbd4d95470c6ac079c7b628b Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=331fd7c8aa3c0c11cbd4d95470c6ac079c7b628b Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:20:58 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:20:58 +0400 nasm.c: Tabs to spaces in process_arg Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 308 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/nasm.c b/nasm.c index dd5224f..de03d52 100644 --- a/nasm.c +++ b/nasm.c @@ -635,124 +635,124 @@ static bool process_arg(char *p, char *q) return false; if (p[0] == '-' && !stopoptions) { - if (strchr("oOfpPdDiIlFXuUZwW", p[1])) { - /* These parameters take values */ - if (!(param = get_param(p, q, &advance))) - return advance; - } + if (strchr("oOfpPdDiIlFXuUZwW", p[1])) { + /* These parameters take values */ + if (!(param = get_param(p, q, &advance))) + return advance; + } switch (p[1]) { case 's': error_file = stdout; break; - case 'o': /* output file */ - copy_filename(outname, param); - break; + case 'o': /* output file */ + copy_filename(outname, param); + break; - case 'f': /* output format */ - ofmt = ofmt_find(param, &ofmt_alias); - if (!ofmt) { - nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE, - "unrecognised output format `%s' - " - "use -hf for a list", param); - } - break; + case 'f': /* output format */ + ofmt = ofmt_find(param, &ofmt_alias); + if (!ofmt) { + nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE, + "unrecognised output format `%s' - " + "use -hf for a list", param); + } + break; - case 'O': /* Optimization level */ - { - int opt; - - if (!*param) { - /* Naked -O == -Ox */ - optimizing = MAX_OPTIMIZE; - } else { - while (*param) { - switch (*param) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - opt = strtoul(param, ¶m, 10); - - /* -O0 -> optimizing == -1, 0.98 behaviour */ - /* -O1 -> optimizing == 0, 0.98.09 behaviour */ - if (opt < 2) - optimizing = opt - 1; - else - optimizing = opt; - break; - - case 'v': - case '+': - param++; - opt_verbose_info = true; - break; - - case 'x': - param++; - optimizing = MAX_OPTIMIZE; - break; - - default: - nasm_error(ERR_FATAL, - "unknown optimization option -O%c\n", - *param); - break; - } - } - if (optimizing > MAX_OPTIMIZE) - optimizing = MAX_OPTIMIZE; - } - break; - } + case 'O': /* Optimization level */ + { + int opt; - case 'p': /* pre-include */ - case 'P': - preproc->pre_include(param); - break; + if (!*param) { + /* Naked -O == -Ox */ + optimizing = MAX_OPTIMIZE; + } else { + while (*param) { + switch (*param) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + opt = strtoul(param, ¶m, 10); + + /* -O0 -> optimizing == -1, 0.98 behaviour */ + /* -O1 -> optimizing == 0, 0.98.09 behaviour */ + if (opt < 2) + optimizing = opt - 1; + else + optimizing = opt; + break; - case 'd': /* pre-define */ - case 'D': - preproc->pre_define(param); - break; + case 'v': + case '+': + param++; + opt_verbose_info = true; + break; - case 'u': /* un-define */ - case 'U': - preproc->pre_undefine(param); - break; + case 'x': + param++; + optimizing = MAX_OPTIMIZE; + break; - case 'i': /* include search path */ - case 'I': - preproc->include_path(param); - break; + default: + nasm_error(ERR_FATAL, + "unknown optimization option -O%c\n", + *param); + break; + } + } + if (optimizing > MAX_OPTIMIZE) + optimizing = MAX_OPTIMIZE; + } + break; + } - case 'l': /* listing file */ - copy_filename(listname, param); - break; + case 'p': /* pre-include */ + case 'P': + preproc->pre_include(param); + break; - case 'Z': /* error messages file */ - copy_filename(errname, param); - break; + case 'd': /* pre-define */ + case 'D': + preproc->pre_define(param); + break; - case 'F': /* specify debug format */ - ofmt->current_dfmt = dfmt_find(ofmt, param); - if (!ofmt->current_dfmt) { - nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE, - "unrecognized debug format `%s' for" - " output format `%s'", - param, ofmt->shortname); - } - using_debug_info = true; - break; + case 'u': /* un-define */ + case 'U': + preproc->pre_undefine(param); + break; + + case 'i': /* include search path */ + case 'I': + preproc->include_path(param); + break; + + case 'l': /* listing file */ + copy_filename(listname, param); + break; + + case 'Z': /* error messages file */ + copy_filename(errname, param); + break; + + case 'F': /* specify debug format */ + ofmt->current_dfmt = dfmt_find(ofmt, param); + if (!ofmt->current_dfmt) { + nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE, + "unrecognized debug format `%s' for" + " output format `%s'", + param, ofmt->shortname); + } + using_debug_info = true; + break; - case 'X': /* specify error reporting format */ - if (nasm_stricmp("vc", param) == 0) - nasm_set_verror(nasm_verror_vc); - else if (nasm_stricmp("gnu", param) == 0) - nasm_set_verror(nasm_verror_gnu); - else - nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE, - "unrecognized error reporting format `%s'", - param); + case 'X': /* specify error reporting format */ + if (nasm_stricmp("vc", param) == 0) + nasm_set_verror(nasm_verror_vc); + else if (nasm_stricmp("gnu", param) == 0) + nasm_set_verror(nasm_verror_gnu); + else + nasm_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE, + "unrecognized error reporting format `%s'", + param); break; case 'g': @@ -811,7 +811,7 @@ static bool process_arg(char *p, char *q) printf("\nFor a list of valid output formats, use -hf.\n"); printf("For a list of debug formats, use -f <form> -y.\n"); } - exit(0); /* never need usage message here */ + exit(0); /* never need usage message here */ break; case 'y': @@ -826,37 +826,37 @@ static bool process_arg(char *p, char *q) break; case 'v': - printf("NASM version %s compiled on %s%s\n", - nasm_version, nasm_date, nasm_compile_options); - exit(0); /* never need usage message here */ + printf("NASM version %s compiled on %s%s\n", + nasm_version, nasm_date, nasm_compile_options); + exit(0); /* never need usage message here */ break; - case 'e': /* preprocess only */ - case 'E': + case 'e': /* preprocess only */ + case 'E': operating_mode = op_preprocess; break; - case 'a': /* assemble only - don't preprocess */ + case 'a': /* assemble only - don't preprocess */ preproc = &preproc_nop; break; - case 'W': - if (param[0] == 'n' && param[1] == 'o' && param[2] == '-') { - do_warn = false; - param += 3; - } else { - do_warn = true; - } - goto set_warning; + case 'W': + if (param[0] == 'n' && param[1] == 'o' && param[2] == '-') { + do_warn = false; + param += 3; + } else { + do_warn = true; + } + goto set_warning; case 'w': if (param[0] != '+' && param[0] != '-') { nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE, "invalid option to `-w'"); - break; + break; } - do_warn = (param[0] == '+'); - param++; + do_warn = (param[0] == '+'); + param++; set_warning: for (i = 0; i <= ERR_WARN_MAX; i++) { @@ -878,39 +878,39 @@ set_warning: break; case 'M': - switch (p[2]) { - case 0: - operating_mode = op_depend; - break; - case 'G': - operating_mode = op_depend; - depend_missing_ok = true; - break; - case 'P': - depend_emit_phony = true; - break; - case 'D': - depend_file = q; - advance = true; - break; - case 'T': - depend_target = q; - advance = true; - break; - case 'Q': - depend_target = quote_for_make(q); - advance = true; - break; - default: - nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE, - "unknown dependency option `-M%c'", p[2]); - break; - } - if (advance && (!q || !q[0])) { - nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE, - "option `-M%c' requires a parameter", p[2]); - break; - } + switch (p[2]) { + case 0: + operating_mode = op_depend; + break; + case 'G': + operating_mode = op_depend; + depend_missing_ok = true; + break; + case 'P': + depend_emit_phony = true; + break; + case 'D': + depend_file = q; + advance = true; + break; + case 'T': + depend_target = q; + advance = true; + break; + case 'Q': + depend_target = quote_for_make(q); + advance = true; + break; + default: + nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE, + "unknown dependency option `-M%c'", p[2]); + break; + } + if (advance && (!q || !q[0])) { + nasm_error(ERR_NONFATAL|ERR_NOFILE|ERR_USAGE, + "option `-M%c' requires a parameter", p[2]); + break; + } break; case '-': @@ -976,7 +976,7 @@ set_warning: "more than one input file specified"); } else { copy_filename(inname, p); - } + } } return advance; |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:45
|
Commit-ID: f831645ed8dac3bb545876d19e631c5c789181ca Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=f831645ed8dac3bb545876d19e631c5c789181ca Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:22:27 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:22:27 +0400 nasm.c: Tabs to spaces in copy_filename Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 104 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/nasm.c b/nasm.c index de03d52..ffdec47 100644 --- a/nasm.c +++ b/nasm.c @@ -536,74 +536,74 @@ static char *quote_for_make(const char *str) const char *p; char *os, *q; - size_t n = 1; /* Terminating zero */ + size_t n = 1; /* Terminating zero */ size_t nbs = 0; if (!str) - return NULL; + return NULL; for (p = str; *p; p++) { - switch (*p) { - case ' ': - case '\t': - /* Convert N backslashes + ws -> 2N+1 backslashes + ws */ - n += nbs + 2; - nbs = 0; - break; - case '$': - case '#': - nbs = 0; - n += 2; - break; - case '\\': - nbs++; - n++; - break; - default: - nbs = 0; - n++; - break; - } + switch (*p) { + case ' ': + case '\t': + /* Convert N backslashes + ws -> 2N+1 backslashes + ws */ + n += nbs + 2; + nbs = 0; + break; + case '$': + case '#': + nbs = 0; + n += 2; + break; + case '\\': + nbs++; + n++; + break; + default: + nbs = 0; + n++; + break; + } } /* Convert N backslashes at the end of filename to 2N backslashes */ if (nbs) - n += nbs; + n += nbs; os = q = nasm_malloc(n); nbs = 0; for (p = str; *p; p++) { - switch (*p) { - case ' ': - case '\t': - while (nbs--) - *q++ = '\\'; - *q++ = '\\'; - *q++ = *p; - break; - case '$': - *q++ = *p; - *q++ = *p; - nbs = 0; - break; - case '#': - *q++ = '\\'; - *q++ = *p; - nbs = 0; - break; - case '\\': - *q++ = *p; - nbs++; - break; - default: - *q++ = *p; - nbs = 0; - break; - } + switch (*p) { + case ' ': + case '\t': + while (nbs--) + *q++ = '\\'; + *q++ = '\\'; + *q++ = *p; + break; + case '$': + *q++ = *p; + *q++ = *p; + nbs = 0; + break; + case '#': + *q++ = '\\'; + *q++ = *p; + nbs = 0; + break; + case '\\': + *q++ = *p; + nbs++; + break; + default: + *q++ = *p; + nbs = 0; + break; + } } while (nbs--) - *q++ = '\\'; + *q++ = '\\'; *q = '\0'; |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:45
|
Commit-ID: 9f5636988332955fcec7fe1f7e949995910d4151 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=9f5636988332955fcec7fe1f7e949995910d4151 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:24:11 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:24:11 +0400 nasm.c: Tabs to spaces in main Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/nasm.c b/nasm.c index 89dd07e..38eee80 100644 --- a/nasm.c +++ b/nasm.c @@ -357,18 +357,17 @@ int main(int argc, char **argv) /* define some macros dependent of command-line */ define_macros_late(); - depend_ptr = (depend_file || (operating_mode == op_depend)) - ? &depend_list : NULL; + depend_ptr = (depend_file || (operating_mode == op_depend)) ? &depend_list : NULL; if (!depend_target) - depend_target = quote_for_make(outname); + depend_target = quote_for_make(outname); switch (operating_mode) { case op_depend: { char *line; - if (depend_missing_ok) - preproc->include_path(NULL); /* "assume generated" */ + if (depend_missing_ok) + preproc->include_path(NULL); /* "assume generated" */ preproc->reset(inname, 0, &nasmlist, depend_ptr); if (outname[0] == '\0') @@ -428,7 +427,7 @@ int main(int argc, char **argv) fclose(ofile); if (ofile && terminate_after_phase) remove(outname); - ofile = NULL; + ofile = NULL; } break; @@ -457,7 +456,7 @@ int main(int argc, char **argv) init_labels(); ofmt->init(); - dfmt = ofmt->current_dfmt; + dfmt = ofmt->current_dfmt; dfmt->init(); assemble_file(inname, depend_ptr); @@ -465,25 +464,25 @@ int main(int argc, char **argv) if (!terminate_after_phase) { ofmt->cleanup(using_debug_info); cleanup_labels(); - fflush(ofile); - if (ferror(ofile)) { - nasm_error(ERR_NONFATAL|ERR_NOFILE, - "write error on output file `%s'", outname); - } - } - - if (ofile) { - fclose(ofile); - if (terminate_after_phase) - remove(outname); - ofile = NULL; - } + fflush(ofile); + if (ferror(ofile)) { + nasm_error(ERR_NONFATAL|ERR_NOFILE, + "write error on output file `%s'", outname); + } + } + + if (ofile) { + fclose(ofile); + if (terminate_after_phase) + remove(outname); + ofile = NULL; + } } break; } if (depend_list && !terminate_after_phase) - emit_dependencies(depend_list); + emit_dependencies(depend_list); if (want_usage) usage(); |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:45
|
Commit-ID: 1476319ced5e42c17583466bf9426a4c07c8dfbc Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=1476319ced5e42c17583466bf9426a4c07c8dfbc Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:13:09 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:13:09 +0400 nasm.c: Tabs to spaces in assemble_file Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 370 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 183 insertions(+), 187 deletions(-) diff --git a/nasm.c b/nasm.c index 07642ce..fde5c5e 100644 --- a/nasm.c +++ b/nasm.c @@ -1188,7 +1188,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) int pass1, pass2; ldfunc def_label; - pass1 = pass0 == 2 ? 2 : 1; /* 1, 1, 1, ..., 1, 2 */ + pass1 = pass0 == 2 ? 2 : 1; /* 1, 1, 1, ..., 1, 2 */ pass2 = passn > 1 ? 2 : 1; /* 1, 2, 2, ..., 2, 2 */ /* pass0 0, 0, 0, ..., 1, 2 */ @@ -1211,7 +1211,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) offsets = raa_init(); } preproc->reset(fname, pass1, &nasmlist, - pass1 == 2 ? depend_ptr : NULL); + pass1 == 2 ? depend_ptr : NULL); memcpy(warning_on, warning_on_global, (ERR_WARN_MAX+1) * sizeof(bool)); globallineno = 0; @@ -1220,21 +1220,21 @@ static void assemble_file(char *fname, StrList **depend_ptr) location.offset = offs = GET_CURR_OFFS; while ((line = preproc->getline())) { - enum directives d; + enum directives d; globallineno++; /* - * Here we parse our directives; this is not handled by the - * 'real' parser. This really should be a separate function. - */ + * Here we parse our directives; this is not handled by the + * 'real' parser. This really should be a separate function. + */ directive = line; - d = getkw(&directive, &value); + d = getkw(&directive, &value); if (d) { - int err = 0; + int err = 0; switch (d) { - case D_SEGMENT: /* [SEGMENT n] */ - case D_SECTION: + case D_SEGMENT: /* [SEGMENT n] */ + case D_SECTION: seg = ofmt->section(value, pass2, &sb); if (seg == NO_SEG) { nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC, @@ -1245,7 +1245,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) location.segment = seg; } break; - case D_SECTALIGN: /* [SECTALIGN n] */ + case D_SECTALIGN: /* [SECTALIGN n] */ if (*value) { stdscan_reset(); stdscan_set(value); @@ -1271,7 +1271,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) } } break; - case D_EXTERN: /* [EXTERN label:special] */ + case D_EXTERN: /* [EXTERN label:special] */ if (*value == '$') value++; /* skip initial $ if present */ if (pass0 == 2) { @@ -1312,10 +1312,10 @@ static void assemble_file(char *fname, StrList **depend_ptr) } } /* else pass0 == 1 */ break; - case D_BITS: /* [BITS bits] */ + case D_BITS: /* [BITS bits] */ globalbits = sb = get_bits(value); break; - case D_GLOBAL: /* [GLOBAL symbol:special] */ + case D_GLOBAL: /* [GLOBAL symbol:special] */ if (*value == '$') value++; /* skip initial $ if present */ if (pass0 == 2) { /* pass 2 */ @@ -1349,60 +1349,60 @@ static void assemble_file(char *fname, StrList **depend_ptr) declare_as_global(value, special); } /* pass == 1 */ break; - case D_COMMON: /* [COMMON symbol size:special] */ - { - int64_t size; + case D_COMMON: /* [COMMON symbol size:special] */ + { + int64_t size; if (*value == '$') value++; /* skip initial $ if present */ - p = value; - validid = true; - if (!isidstart(*p)) - validid = false; - while (*p && !nasm_isspace(*p)) { - if (!isidchar(*p)) - validid = false; - p++; - } - if (!validid) { - nasm_error(ERR_NONFATAL, - "identifier expected after COMMON"); - break; - } - if (*p) { + p = value; + validid = true; + if (!isidstart(*p)) + validid = false; + while (*p && !nasm_isspace(*p)) { + if (!isidchar(*p)) + validid = false; + p++; + } + if (!validid) { + nasm_error(ERR_NONFATAL, + "identifier expected after COMMON"); + break; + } + if (*p) { p = nasm_zap_spaces_fwd(p); - q = p; - while (*q && *q != ':') - q++; - if (*q == ':') { - *q++ = '\0'; - special = q; - } else { - special = NULL; - } - size = readnum(p, &rn_error); - if (rn_error) { - nasm_error(ERR_NONFATAL, - "invalid size specified" - " in COMMON declaration"); - break; - } - } else { - nasm_error(ERR_NONFATAL, - "no size specified in" - " COMMON declaration"); - break; - } + q = p; + while (*q && *q != ':') + q++; + if (*q == ':') { + *q++ = '\0'; + special = q; + } else { + special = NULL; + } + size = readnum(p, &rn_error); + if (rn_error) { + nasm_error(ERR_NONFATAL, + "invalid size specified" + " in COMMON declaration"); + break; + } + } else { + nasm_error(ERR_NONFATAL, + "no size specified in" + " COMMON declaration"); + break; + } if (pass0 < 2) { - define_common(value, seg_alloc(), size, special); + define_common(value, seg_alloc(), size, special); } else if (pass0 == 2) { - if (special) - ofmt->symdef(value, 0L, 0L, 3, special); + if (special) + ofmt->symdef(value, 0L, 0L, 3, special); } break; - } - case D_ABSOLUTE: /* [ABSOLUTE address] */ + } + case D_ABSOLUTE: /* [ABSOLUTE address] */ stdscan_reset(); stdscan_set(value); tokval.t_type = TOKEN_INVALID; @@ -1426,76 +1426,75 @@ static void assemble_file(char *fname, StrList **depend_ptr) in_abs_seg = true; location.segment = NO_SEG; break; - case D_DEBUG: /* [DEBUG] */ - { - char debugid[128]; - bool badid, overlong; + case D_DEBUG: /* [DEBUG] */ + { + char debugid[128]; + bool badid, overlong; p = value; q = debugid; - badid = overlong = false; + badid = overlong = false; if (!isidstart(*p)) { badid = true; - } else { - while (*p && !nasm_isspace(*p)) { - if (q >= debugid + sizeof debugid - 1) { - overlong = true; - break; - } - if (!isidchar(*p)) - badid = true; - *q++ = *p++; - } - *q = 0; - } + } else { + while (*p && !nasm_isspace(*p)) { + if (q >= debugid + sizeof debugid - 1) { + overlong = true; + break; + } + if (!isidchar(*p)) + badid = true; + *q++ = *p++; + } + *q = 0; + } if (badid) { - nasm_error(passn == 1 ? ERR_NONFATAL : ERR_PANIC, - "identifier expected after DEBUG"); - break; - } - if (overlong) { - nasm_error(passn == 1 ? ERR_NONFATAL : ERR_PANIC, - "DEBUG identifier too long"); - break; - } + nasm_error(passn == 1 ? ERR_NONFATAL : ERR_PANIC, + "identifier expected after DEBUG"); + break; + } + if (overlong) { + nasm_error(passn == 1 ? ERR_NONFATAL : ERR_PANIC, + "DEBUG identifier too long"); + break; + } p = nasm_skip_spaces(p); if (pass0 == 2) dfmt->debug_directive(debugid, p); break; - } - case D_WARNING: /* [WARNING {+|-|*}warn-name] */ + } + case D_WARNING: /* [WARNING {+|-|*}warn-name] */ value = nasm_skip_spaces(value); - switch(*value) { - case '-': validid = 0; value++; break; - case '+': validid = 1; value++; break; - case '*': validid = 2; value++; break; - default: validid = 1; break; - } + switch(*value) { + case '-': validid = 0; value++; break; + case '+': validid = 1; value++; break; + case '*': validid = 2; value++; break; + default: validid = 1; break; + } - for (i = 1; i <= ERR_WARN_MAX; i++) - if (!nasm_stricmp(value, warnings[i].name)) - break; - if (i <= ERR_WARN_MAX) { - switch(validid) { - case 0: - warning_on[i] = false; - break; - case 1: - warning_on[i] = true; - break; - case 2: - warning_on[i] = warning_on_global[i]; - break; - } - } - else - nasm_error(ERR_NONFATAL, - "invalid warning id in WARNING directive"); + for (i = 1; i <= ERR_WARN_MAX; i++) + if (!nasm_stricmp(value, warnings[i].name)) + break; + if (i <= ERR_WARN_MAX) { + switch(validid) { + case 0: + warning_on[i] = false; + break; + case 1: + warning_on[i] = true; + break; + case 2: + warning_on[i] = warning_on_global[i]; + break; + } + } else + nasm_error(ERR_NONFATAL, + "invalid warning id in WARNING directive"); break; - case D_CPU: /* [CPU] */ + case D_CPU: /* [CPU] */ cpu = get_cpu(value); break; - case D_LIST: /* [LIST {+|-}] */ + case D_LIST: /* [LIST {+|-}] */ value = nasm_skip_spaces(value); if (*value == '+') { user_nolist = 0; @@ -1503,52 +1502,52 @@ static void assemble_file(char *fname, StrList **depend_ptr) if (*value == '-') { user_nolist = 1; } else { - err = 1; + err = 1; } } break; - case D_DEFAULT: /* [DEFAULT] */ - stdscan_reset(); + case D_DEFAULT: /* [DEFAULT] */ + stdscan_reset(); stdscan_set(value); tokval.t_type = TOKEN_INVALID; - if (stdscan(NULL, &tokval) == TOKEN_SPECIAL) { - switch ((int)tokval.t_integer) { - case S_REL: - globalrel = 1; - break; - case S_ABS: - globalrel = 0; - break; - default: - err = 1; - break; - } - } else { - err = 1; - } - break; - case D_FLOAT: - if (float_option(value)) { - nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC, - "unknown 'float' directive: %s", - value); - } - break; + if (stdscan(NULL, &tokval) == TOKEN_SPECIAL) { + switch ((int)tokval.t_integer) { + case S_REL: + globalrel = 1; + break; + case S_ABS: + globalrel = 0; + break; + default: + err = 1; + break; + } + } else { + err = 1; + } + break; + case D_FLOAT: + if (float_option(value)) { + nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC, + "unknown 'float' directive: %s", + value); + } + break; default: - if (ofmt->directive(d, value, pass2)) - break; - /* else fall through */ - case D_unknown: - nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC, - "unrecognised directive [%s]", - directive); - break; + if (ofmt->directive(d, value, pass2)) + break; + /* else fall through */ + case D_unknown: + nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC, + "unrecognised directive [%s]", + directive); + break; + } + if (err) { + nasm_error(ERR_NONFATAL, + "invalid parameter to [%s] directive", + directive); } - if (err) { - nasm_error(ERR_NONFATAL, - "invalid parameter to [%s] directive", - directive); - } } else { /* it isn't a directive */ parse_line(pass1, line, &output_ins, def_label); @@ -1563,18 +1562,16 @@ static void assemble_file(char *fname, StrList **depend_ptr) } else output_ins.forw_ref = false; - if (output_ins.forw_ref) { - if (passn == 1) { - for (i = 0; i < output_ins.operands; i++) { - if (output_ins.oprs[i].opflags & OPFLAG_FORWARD) { - struct forwrefinfo *fwinf = - (struct forwrefinfo *) - saa_wstruct(forwrefs); - fwinf->lineno = globallineno; - fwinf->operand = i; - } - } - } + if (output_ins.forw_ref) { + if (passn == 1) { + for (i = 0; i < output_ins.operands; i++) { + if (output_ins.oprs[i].opflags & OPFLAG_FORWARD) { + struct forwrefinfo *fwinf = (struct forwrefinfo *)saa_wstruct(forwrefs); + fwinf->lineno = globallineno; + fwinf->operand = i; + } + } + } } } @@ -1596,8 +1593,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) if (output_ins.operands == 1 && (output_ins.oprs[0].type & IMMEDIATE) && output_ins.oprs[0].wrt == NO_SEG) { - bool isext = !!(output_ins.oprs[0].opflags - & OPFLAG_EXTERN); + bool isext = !!(output_ins.oprs[0].opflags & OPFLAG_EXTERN); def_label(output_ins.label, output_ins.oprs[0].segment, output_ins.oprs[0].offset, NULL, @@ -1613,7 +1609,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) def_label(output_ins.label, output_ins.oprs[0].offset | SEG_ABS, output_ins.oprs[1].offset, - NULL, false, false); + NULL, false, false); } else nasm_error(ERR_NONFATAL, "bad syntax for EQU"); @@ -1707,12 +1703,12 @@ static void assemble_file(char *fname, StrList **depend_ptr) case I_DT: typeinfo |= TY_TBYTE; break; - case I_DO: - typeinfo |= TY_OWORD; - break; - case I_DY: - typeinfo |= TY_YWORD; - break; + case I_DO: + typeinfo |= TY_OWORD; + break; + case I_DY: + typeinfo |= TY_YWORD; + break; default: typeinfo = TY_LABEL; @@ -1745,23 +1741,23 @@ static void assemble_file(char *fname, StrList **depend_ptr) if (pass0 == 2 && global_offset_changed && !terminate_after_phase) nasm_error(ERR_NONFATAL, - "phase error detected at end of assembly."); + "phase error detected at end of assembly."); if (pass1 == 1) preproc->cleanup(1); if ((passn > 1 && !global_offset_changed) || pass0 == 2) { pass0++; - } else if (global_offset_changed && - global_offset_changed < prev_offset_changed) { + } else if (global_offset_changed && + global_offset_changed < prev_offset_changed) { prev_offset_changed = global_offset_changed; stall_count = 0; - } else { - stall_count++; - } + } else { + stall_count++; + } - if (terminate_after_phase) - break; + if (terminate_after_phase) + break; if ((stall_count > 997) || (passn >= pass_max)) { /* We get here if the labels don't converge @@ -1770,16 +1766,16 @@ static void assemble_file(char *fname, StrList **depend_ptr) nasm_error(ERR_NONFATAL, "Can't find valid values for all labels " "after %d passes, giving up.", passn); - nasm_error(ERR_NONFATAL, - "Possible causes: recursive EQUs, macro abuse."); - break; - } + nasm_error(ERR_NONFATAL, + "Possible causes: recursive EQUs, macro abuse."); + break; + } } preproc->cleanup(0); nasmlist.cleanup(); if (!terminate_after_phase && opt_verbose_info) { - /* -On and -Ov switches */ + /* -On and -Ov switches */ fprintf(stdout, "info: assembly required 1+%d+1 passes\n", passn-3); } } |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-15 08:39:44
|
Commit-ID: 190232f013f96f264c3437ff18e786b5593a1e37 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=190232f013f96f264c3437ff18e786b5593a1e37 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Fri, 15 Feb 2013 12:35:04 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Fri, 15 Feb 2013 12:35:04 +0400 nasm.c: Convert GET_CURR_OFFS/SET_CURR_OFFS to functions In future better to not work with global variables but rather pass arguments. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- nasm.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/nasm.c b/nasm.c index 6b8dab1..4896d70 100644 --- a/nasm.c +++ b/nasm.c @@ -165,20 +165,25 @@ static const struct warning { {"hle", "invalid hle prefixes", true}, }; -/* - * get/set current offset... - */ -#define GET_CURR_OFFS (in_abs_seg?abs_offset:\ - raa_read(offsets,location.segment)) -#define SET_CURR_OFFS(x) (in_abs_seg?(void)(abs_offset=(x)):\ - (void)(offsets=raa_write(offsets,location.segment,(x)))) - static bool want_usage; static bool terminate_after_phase; int user_nolist = 0; /* fbk 9/2/00 */ static char *quote_for_make(const char *str); +static int64_t get_curr_offs(void) +{ + return in_abs_seg ? abs_offset : raa_read(offsets, location.segment); +} + +static void set_curr_offs(int64_t l_off) +{ + if (in_abs_seg) + abs_offset = l_off; + else + offsets = raa_write(offsets, location.segment, l_off); +} + static void nasm_fputs(const char *line, FILE * outfile) { if (outfile) { @@ -1216,7 +1221,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) globallineno = 0; if (passn == 1) location.known = true; - location.offset = offs = GET_CURR_OFFS; + location.offset = offs = get_curr_offs(); while ((line = preproc->getline())) { enum directives d; @@ -1717,7 +1722,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) } if (l != -1) { offs += l; - SET_CURR_OFFS(offs); + set_curr_offs(offs); } /* * else l == -1 => invalid instruction, which will be @@ -1728,14 +1733,14 @@ static void assemble_file(char *fname, StrList **depend_ptr) offs += assemble(location.segment, offs, sb, cpu, &output_ins, ofmt, nasm_error, &nasmlist); - SET_CURR_OFFS(offs); + set_curr_offs(offs); } } /* not an EQU */ cleanup_insn(&output_ins); } nasm_free(line); - location.offset = offs = GET_CURR_OFFS; + location.offset = offs = get_curr_offs(); } /* end while (line = preproc->getline... */ if (pass0 == 2 && global_offset_changed && !terminate_after_phase) |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-02-04 06:21:30
|
Commit-ID: 8b5c9fba4ea12437ec4fe28d3e6675880ca92d59 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=8b5c9fba4ea12437ec4fe28d3e6675880ca92d59 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Mon, 4 Feb 2013 01:24:54 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 4 Feb 2013 10:18:21 +0400 BR3392240: preproc: Don't fail on pasting of space expanded rvalue tokens Reported-by: KO Myung-Hun <ko...@ch...> Tested-by: KO Myung-Hun <ko...@ch...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- preproc.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/preproc.c b/preproc.c index 9d65917..0ca360e 100644 --- a/preproc.c +++ b/preproc.c @@ -3640,14 +3640,35 @@ static bool paste_tokens(Token **head, const struct tokseq_match *m, if (!pasted) pasted = true; - /* No ending token */ - if (!next) - error(ERR_FATAL, "No rvalue found on pasting"); - /* Left pasting token is start of line */ if (!prev_nonspace) error(ERR_FATAL, "No lvalue found on pasting"); + /* + * No ending token, this might happen in two + * cases + * + * 1) There indeed no right token at all + * 2) There is a bare "%define ID" statement, + * and @ID does expand to whitespace. + * + * So technically we need to do a grammar analysis + * in another stage of parsing, but for now lets don't + * change the behaviour people used to. Simply allow + * whitespace after paste token. + */ + if (!next) { + /* + * Zap ending space tokens and that's all. + */ + tok = (*prev_nonspace)->next; + while (tok_type_(tok, TOK_WHITESPACE)) + tok = delete_Token(tok); + tok = *prev_nonspace; + tok->next = NULL; + break; + } + tok = *prev_nonspace; while (tok_type_(tok, TOK_WHITESPACE)) tok = delete_Token(tok); |
From: nasm-bot f. C. G. <gor...@gm...> - 2013-01-02 08:45:29
|
Commit-ID: 7c88b3a9d7719e53cc408d3d9aeba548b8931337 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=7c88b3a9d7719e53cc408d3d9aeba548b8931337 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Wed, 2 Jan 2013 12:42:01 +0400 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Wed, 2 Jan 2013 12:42:01 +0400 NASM 2.10.07 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 471f1b4..80278b5 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.10.06 +2.10.07 |