The MASM Forum Archive 2004 to 2012

Project Support Forums => 64 Bit Assembler => Topic started by: bootstrap on February 25, 2012, 07:47:46 AM

Title: problem with ALIGN directive
Post by: bootstrap on February 25, 2012, 07:47:46 AM
I'm converting some of my 64-bit linux assembly to 64-bit MASM, and have a problem with the ALIGN directive.  The following code generates this error:  "A2189: invalid combination with segment alignment : 64":

.DATA
ALIGN  64

ALIGN 16 assembles okay, but MASM64 doesn't accept ALIGN32 or ALIGN 64 in CODE or DATA segment.  This is STUPID, since cache lines align on 64-byte boundaries.  And this is even more EXTREMELY STUPID since 256-bit SIMD instructions require 32-byte alignment.  The code I'm porting has lots of AVX and FMA4 type 256-bit SIMD instructions, so this matters A LOT.

The ML64 I have came with the copy of "VisualStudio2005 professional" I purchased years ago, though somehow I doubt that matters.

What's the problem?
Title: Re: problem with ALIGN directive
Post by: jj2007 on February 25, 2012, 08:07:35 AM
Try JWasm (http://www.japheth.de/JWasm.html), it's the better choice anyway for 64-bit assembly.
Title: Re: problem with ALIGN directive
Post by: dedndave on February 25, 2012, 08:08:07 AM
have you looked at JwAsm ?
http://www.japheth.de/JWasm.html

lol Jochen beat me to it   :P
Title: Re: problem with ALIGN directive
Post by: sinsi on February 25, 2012, 09:39:37 AM
If you use explicit segments you can change the align
data segment align(4096)will let you use any power of 2 alignment from 2 to 4096.

eta: default alignment is PARA (16)
another wrinkle with a code segment
cseg segment read executeelse you get an access violation on your entry point :bdg