NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: hyram on August 08, 2012, 04:29:13 PM

Title: Instruction issue (newbie question alert!!!)
Post by: hyram on August 08, 2012, 04:29:13 PM
Hi folks first post here.

Ok... I'm obviously doing something wrong, but can't noodle out. Neither have I been able to find it on the forum via a search. So if someone could kindly point me in the right direction...

I'm trying to do this:

Code: [Select]
or word[esi+6], 0FFFFh
Which should assemble as:
Code: [Select]
66 81 8e 06 00 00 00 ff ffIf I run this back through a disassembler (IDAPro and Pym's) I get back:
Code: [Select]
or word[esi+6], 0FFFFh
Nowever, NASM assembles this instruction as:
Code: [Select]
66 83 8e 06 00 00 00 ffIf I run this thru a disassembler I get back:
Code: [Select]
or word[esi+6], 0FFh
What am I missing that causes NASM to not give me what I really want?

-TIA
Title: Re: Instruction issue (newbie question alert!!!)
Post by: Frank Kotler on August 08, 2012, 07:53:36 PM
I'm confused. What is it you want Nasm to produce?

I'm seeing:
Code: [Select]
66 83 4E 06 FF

If you really want the "long form":
Code: [Select]
66 81 4E FF FF
the easiest way is to add "-O0" to Nasm's command line.

Some of the alternatives you suggest don't look like anything Nasm will produce at all to me (alternative encodings?). You can try a list of "db"s, if you want specific encodings.

Of course, we have no control over what IDAPro or "Pym's"(?) will produce.

Best,
Frank

Title: Re: Instruction issue (newbie question alert!!!)
Post by: Frank Kotler on August 08, 2012, 08:05:21 PM
Okay, I take it back...
Code: [Select]
or word [dword esi + 6], strict word 0FFFFh
may do what you want.

Best,
Frank

Title: Re: Instruction issue (newbie question alert!!!)
Post by: hyram on August 09, 2012, 12:50:08 PM
Thanks Frank... strict did the trick.