News:

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

problem with ALIGN directive

Started by bootstrap, February 25, 2012, 07:47:46 AM

Previous topic - Next topic

bootstrap

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?

jj2007

Try JWasm, it's the better choice anyway for 64-bit assembly.

dedndave

have you looked at JwAsm ?
http://www.japheth.de/JWasm.html

lol Jochen beat me to it   :P

sinsi

#3
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
Light travels faster than sound, that's why some people seem bright until you hear them.