# at&t syntax in VS?

This topic is 3035 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Is it possible? I just tried a little experimentation and couldn't figure out how to do it.

##### Share on other sites
Not possible AFAICT. The closest you could get is using build rules to get other compilers (GCC) to compile the source files with AT&T syntax. Syntax highlighting won't work neither, of course.

##### Share on other sites
You could try using Yasm too.

##### Share on other sites
I've heard some pretty crazy things in my time, but actually wanting to use AT&T syntax? [rolleyes]

The Quake 1 source code includes a utility, gas2masm, that is used to preprocess the files before passing them to MASM to allow each version of Quake to share the same assembly source code. I have no idea how good it is for general purpose use, but it works well enough for Quake (and there's quite a lot of assembly in there).

##### Share on other sites
Hah,, yeah we were actually taught at&t syntax in college, so that's what I'm used to.

##### Share on other sites
Quote:
 Original post by benryvesI've heard some pretty crazy things in my time, but actually wanting to use AT&T syntax? [rolleyes]

Why not? It's a lot of fun!

Quote:
 The Quake 1 source code includes a utility, gas2masm, that is used to preprocess the files before passing them to MASM to allow each version of Quake to share the same assembly source code. I have no idea how good it is for general purpose use, but it works well enough for Quake (and there's quite a lot of assembly in there).

See, even id preferred AT&T syntax!

##### Share on other sites
I prefer AT&T syntax. It's less ambiguous.

Back in 2006 I wrote a draft tutorial about converting Intel syntax to at&t syntax. amodes.zip. YMMV.

And you might find Intel2GAS interesting.

I bet a little searching would turn up a utility that converts AT&T to Intel.

##### Share on other sites
Quote:
 Original post by LessBreadI prefer AT&T syntax. It's less ambiguous.

The Intel dialect NASM uses isn't ambigious either. Or did I miss something?

##### Share on other sites
I'm not familiar enough with NASM to say.

Here's a snippet from that tut

A more troublesome aspect of converting from Intel syntax is that the addition operator allows for the mixing up the order of the computational elements. For example, each of the following Intel expressions evaluate to the same effective address:

[base+index*scale+displacement][index*scale+base][displacement][index*scale+displacement][base][base+displacement][index*scale][displacement+base][index*scale]displacement[base][index*scale]displacement[index*scale][base]

There is only one equivalent expression using lcc-win32 syntax:

displacement(base,index,scale)

When I wrote that lcc-win32 employed a variation of AT&T syntax. I don't know what it uses now.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631781
• Total Posts
3002314
×