Re: masm 6.1 unwelcome optimizations



When I reassemble the asm source (which needed to be tweaked to remove references
to registers and directives that don't apply to the 8086 -- one would think that
IDA would be smarter), I find that MASM 6.10 (ML.EXE) doesn't honor the explicit
forms of certain instructions and instead optimizes them to smaller forms, which
breaks all methods involving binary comparisons. For example, here is a statement
and the expected assembled object code:

81 E6 FEFF AND SI,FFFE

Instead, MASM produces:

83 E6 FE AND SI, -02


1) Are you using 6.10's ML.EXE or MASM.EXE?
2) If using ML.EXE directly, are you using /Zm
3) Is the source small enough that you can go through and replace every thing like
AND SI,FFFE
with
DB 081h,0E6h,0FEh,0FFh ; was AND SI,FFFE need to force EXACT mapping

4) DO you know what was used originally? Can you get that tool?
5) If not, have you tried TASM? OpenWatcom WASM? Wolfware WASM? GASM? or any other
assembler? Or is it too MS-ish?
.



Relevant Pages

  • Re: The textbook ASSEMBLERS AND LOADERS...
    ... cited has a whole chapter dedicated to directives... ... The directives are thus executed by the assembler, ... An HLA is not an HLL and we were talking about ... no version of MASM is an HLA since it passes the one most ...
    (alt.lang.asm)
  • Re: Apologies seem to hurt
    ... Are we talking MASM here? ... A assembler to me is a processor that can be made to group a precise ... fourth and fifth lines uses the BYTE and DWORD data directives ... cannot be duplicated with MACRO statements. ...
    (alt.lang.asm)
  • Re: Driver sample with *.asm source
    ... You can generate a .asm file from an existing driver using IDAPro 5. ... This program generates an .asm file that can be passed to masm. ... In *.cod file are much more directives, ... Tim Roberts, timr@xxxxxxxxx ...
    (microsoft.public.development.device.drivers)
  • Re: The textbook ASSEMBLERS AND LOADERS...
    ... > I do not understand what you mean as directives. ... But if you're going to call them directives in MASM, ... can continue to be assemblers, ... "The high-level control structures new to MASM 6.0 generate loop ...
    (alt.lang.asm)