News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Need MASM versions prior to 6.0

Started by billtrudell, February 01, 2005, 05:29:49 PM

Previous topic - Next topic

billtrudell

Hi,

I've isolated an issue where the opcodes generated by MASM 6.0 are different that those in an older object/exe file.  Here are the source lines from the lst file:

Offset Opcodes    (MASM 6.0)
005A   83 C0 02        add     ax,2   ; step to next word
005D   83 F8 3E        cmp     ax,BUFFER_END  ; compare to buffer end

Offset Opcodes    (MASM ???)
005A   05 02 00        add     ax,2   ; step to next word
005D   3D 3E 00        cmp     ax,BUFFER_END  ; compare to buffer end

The Intel manual essentially helped me determine these were equivalent, it's just that MASM 6.0 is using Opcode extensions.  However, I'd like to find the version of MASM used to assemble the file previously without using the Opcode extensions.

Thanks,

Bill


00100b

Have you tried using the /Zm command-line switch for MASM 6's ML?  This is supposed to enable the M510 option for compatibility with MASM 5.1x

billtrudell

Thanks for responding, yes I was already using the /Zm switch.  My assumption is that the opcode extensions are for "newer" processors (386, 486, etc) and hence newer MASM programs.

P1

Welcome Bill   :U

You will find some the best people in the world, come here to get answers, as well as give them.

If you like getting and giving help in Assembler, this is the place for you!!    :clap:

Look forward to you participating with us.   

What makes you so sure it was assembled by an old MASM? 

Regards,  P1  :8)



MichaelW

For this source:

    .model small
    .386
    .stack
    .data
    .code
  start:
    add   ax,2
    cmp   ax,3eh
end start

MASM 5.1 generates this:

0A38:0000 050200        ADD     AX,0002
0A38:0003 3D3E00        CMP     AX,003E

And MASM 6.14 generates this (even with the /Zm option):

0A38:0000 83C002        ADD     AX,+02
0A38:0003 83F83E        CMP     AX,+3E

But for this source:

    .model small
    .386
    .stack
    .data
    .code
  start:
    add   bx,2
    cmp   bx,3eh
end start

Both versions of MASM generate this:

0A38:0000 83C302        ADD     BX,+02
0A38:0003 83FB3E        CMP     BX,+3E

So the difference for the first source is that MASM 5.1 is using the ADD accum,immed encoding, and MASM 6.14 is using the ADD reg,immed encoding.
eschew obfuscation

P1

Bill,

My guess is, this is not the only differences you are fighting in the code?? 

Otherwise, you may wish to use custom macros to generate the code you desire from ML 6.XX.  Because you will need port it to the new assembler for it's other features.

I can also tell, your not giving enough information for us to help properly.  There are other ways to make legacy code able to run on the newer OSes.

Regards,  P1  :8)