The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: billtrudell on February 01, 2005, 05:29:49 PM

Title: Need MASM versions prior to 6.0
Post by: billtrudell on February 01, 2005, 05:29:49 PM
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

Title: Re: Need MASM versions prior to 6.0
Post by: 00100b on February 01, 2005, 07:57:48 PM
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
Title: Re: Need MASM versions prior to 6.0
Post by: billtrudell on February 01, 2005, 08:56:13 PM
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.
Title: Re: Need MASM versions prior to 6.0
Post by: P1 on February 01, 2005, 09:37:31 PM
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)


Title: Re: Need MASM versions prior to 6.0
Post by: MichaelW on February 02, 2005, 12:33:07 AM
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.
Title: Re: Need MASM versions prior to 6.0
Post by: P1 on February 02, 2005, 06:45:49 PM
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)