From: Cyrill G. <gor...@gm...> - 2011-07-19 18:43:01
|
On Tue, Jul 19, 2011 at 01:31:33PM +0000, Mahmoud Jaoune wrote: > Some minor changes made to "assemble.c" file, please take a look in > the attachments. > > Yours, > Mahmoud Jaoune Hi Mahmoud, I managed to get some time for review (I've applied your code on top of current assemble.c to figure out the differences) diff --git a/assemble.c b/assemble.c index 790bb12..aff7f05 100644 --- a/assemble.c +++ b/assemble.c ... + * \160..\163 - this instruction uses DREX rather than REX, with the + * OC0 field set to 0, and the dest field taken from + * operand 0..3. + * \164..\167 - this instruction uses DREX rather than REX, with the + * OC0 field set to 1, and the dest field taken from + * operand 0..3. + * \171 - placement of DREX suffix in the absence of an EA DREX has beed deprecated by commit fc561203fde370a5ab9db2d089053de51f8a5e04 Remove support for DREX encoding The DREX encoding never hit production silicon, and has been replaced by VEX/XOP encoding, so remove support for it. Signed-off-by: H. Peter Anvin <hp...@li...> ... static int has_prefix(insn * ins, enum prefix_pos pos, enum prefixes prefix) { return ins->prefixes[pos] == prefix; @@ -236,8 +239,10 @@ static const char *size_name(int size) return "oword"; case 32: return "yword"; + case 64: + return "64 Bytes"; I guess we need a prefix here rather than 64 bytes, though I forget which prefix would be fine ;) default: - return "???"; + return "Size Unknown"; } } @@ -450,7 +455,7 @@ int64_t assemble(int32_t segment, int64_t offset, int bits, uint32_t cp, * it. */ error(ERR_NONFATAL, - "`incbin': unexpected EOF while" + "`incbin': unexpected 'End Of File' while" " reading file `%s'", fname); t = 0; /* Try to exit cleanly */ break; EOF is well known abbreviation ;) ... c = *codes++; @@ -1227,11 +1244,15 @@ static void gencode(int32_t segment, int64_t offset, int bits, case 02: case 03: case 04: + #ifdef EMIT_REX() EMIT_REX(); out(offset, segment, codes, OUT_RAWDATA, c, NO_SEG, NO_SEG); codes += c; offset += c; break; + #else + printf ("NASM internal execution Error!"); + #endif This is not needed as well ;) If EMIT_REX is not defined we will get compilation error, which is pretty fine (I think I would rather switch to helper function here at all instead of this macro). So Mahmoud, I think this patch can't be merged at moment. Still it's *quite* good that you desided to start nasm hacking! Please don't hesitate to send patches. (btw you might be insterested in using say WinMerge which produce pretty good patches) Cyrill |