News:

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

MASM 6.1; Procedure References

Started by raleeper, August 07, 2011, 09:07:27 PM

Previous topic - Next topic

raleeper

1.  Can I more or less safely assume that the MASM32 I downloaded from a related site is about the same as MS MASM 6.1?

2.  MASM32 [and presumably MASM 6.1] blocks references into a procedure.  I recall reading in 6.1 documentation that there was a way to turn this off.  But I can't now find it.  Does anyone know what I'm talking about?

Thanks, ral

[later] Found it!  Code labels defined with a double colon "::" can be referenced from outsite the proc in which they are defined.  Works in MASM32.

dedndave

you can make local labels global by using double-colons
SomeProic PROC

SomeLabel::

SomeProc ENDP

        jmp     SomeLabel


not sure about version
i use 6.15 with a patch
http://www.4shared.com/file/-QIUp-BF/ML615.html

KeepingRealBusy

You don't even need a PROC, just declare a label and have the code do a ret when done, of course you need to do all of you own PROLOG and EPILOG coding and saving and restoring of regs yourself.

Dave.

GregL

MASM 6.14 is the MASM32 version.  The main difference is ml.exe 6.10 is a DOS executable and ml.exe 6.14 and above are Windows NT executables, someone correct me if I am wrong.

The following will give you an idea of the changes. It doesn't show 6.10 to 6.11 changes.

Quote from: MASM 6.11 to 6.14 Patch Release Notes
=================< Part 6: What Has Been Fixed in 6.11d? >=================

     - The opcode generated for the FSETPM instruction has been
       corrected.

     - Errors when using the ALIAS directive and creating COFF object
       files have been fixed.

     - Errors when using the ORG directive to back patch the code being
       generated in a COFF object file have been fixed.

     - The extra byte in the listing file for instructions using 32-bit
       addressing modes has been removed.

     - Unresolved externals that could occur when a symbol appeared more
       than once in EXTERNDEF directives have been fixed.

     - You can now step through code in include files when building COFF
       object files.

     - Various Access Violations when generating COFF object files (/coff)
       have been fixed.


=================< Part 7: What Has Been Fixed in 6.12? >==================

     - Various Access Violations when generating CodeView debug information
       (/Zi) have been fixed.

     - Errors when specifying an entry point with the END directive and
       creating COFF object files have been fixed.

     - Various structure packing inconsistencies when compared to the
       Microsoft C/C++ compilers have been corrected. MASM 6.12 should now
       pack structures the same as the Microsoft C/C++ compiler when using
       the same packing options.


     - Note there were no major fixes in MASM 6.13 so there's no section on
       those fixes


=================< Part 8: What Has Been Fixed in 6.14? >==================

     - Incorrect A2039 errors indicating 'line too long' have been fixed.


================< Part 9: What Has Been Added up to 6.14? >================

  .586 and .586P Directives in MASM 6.11
  --------------------------------------
  The .586 directive enables assembly of non-privileged instructions
  available for the Pentium processor. The .586P directive enables
  privileged instructions in addition to the non-privileged instructions
  for the Pentium.

  The following example demonstrates implementation of the .586 directive.
     
  .586
  .model flat, C

  .data
  ; .586  gives 110100111111y = 0D3Fh
  ; .586p gives 110110111111y = 0DBFh
  var1 dw @cpu

  IF  @Cpu AND 0100000y
      %echo Pentium instructions enabled.
  ELSE
      %echo Pentium instructions Not enabled.
  ENDIF

  end

  .686 and .686P Directives in MASM 6.12
  --------------------------------------
  The .686 directive enables assembly of non-privileged instructions
  available for the Pentium Pro processor. The .686P directive enables
  privileged instructions in addition to the non-privileged instructions
  for the Pentium Pro.

  The following example demonstrates implementation of the .686 directive.
     
  .686
  .model flat, C

  .data
  ; .686  gives 110101111111y = 0D7Fh
  ; .686p gives 110111111111y = 0DFFh
  var1 dw @cpu

  IF  @Cpu AND 1000000y
      %echo Pentium Pro instructions enabled.
  ELSE
      %echo Pentium Pro instructions Not enabled.
  ENDIF

  end

  .MMX Directive in MASM 6.12
  ---------------------------------------------------------------------
  The .MMX directive enables assembly of MMX instructions.  Users can
  check to see that @Version is 612 or higher to tell if the version
  of MASM being used supports the .MMX directive and MMX instructions.

  The following example demonstrates the use of the .MMX directive.
     
  .586
  .MMX
  .model flat, C

  .code
      ;; MMX opcodes can be assembled

  end

  .K3D Directive in MASM 6.13
  ---------------------------------------------------------------------
  The .K3D directive enables assembly of K3D instructions.  Users can
  check to see that @Version is 613 or higher to tell if the version
  of MASM being used supports the .K3D directive and K3D instructions.

  The following example demonstrates the use of the .K3D directive.
     
  .586
  .K3D
  .model flat, C

  .code
      ;; K3D opcodes can be assembled

  end

  .XMM Directive in MASM 6.14
  ---------------------------------------------------------------------
  The .XMM directive enables assembly of Internet Streaming SIMD
  Extension instructions.  Users can check to see that @Version is 614
  or higher to tell if the version of MASM being used supports the .XMM
  directive and Internet Streaming SIMD Extension instructions.

  The following example demonstrates the use of the .XMM directive.
     
  .686
  .XMM
  .model flat, C

  .code
      ;; Internet Streaming SIMD Extension opcodes can be assembled

  end

  The Intel Internet Streaming SIMD Extension instructions use 128-bit
  or 16 byte data items that need to be 16 byte aligned.  These data
  items would normally be defined as an array of REALs, but can be
  accessed with a single instruction as type OWORD (Octel Word). 
  This is an example of how the data would be defined and accessed.
     
  .686
  .XMM

  _DATA SEGMENT PARA 'DATA'
      ALIGN 16
      DATA_ARRAY  REAL4 1.0
                  REAL4 2.0
                  REAL4 3.0
                  REAL4 4.0
  _DATA ENDS

  _TEXT SEGMENT DWORD 'CODE'
      ASSUME ds:_DATA
      ;; ...
      movaps xmm1, OWORD PTR DATA_ARRAY
      ;; ...
  _TEXT ENDS

  end