Jump to content
  • Advertisement
Sign in to follow this  
theMadHatter

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.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by benryves
I'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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by LessBread
I prefer AT&T syntax. It's less ambiguous.


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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!