flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Questions about AT&T syntax. |
Author |
|
revolution 06 Dec 2013, 11:56
With AT&T the order of operands is reversed.
Code: mov source,dest Anyhow, I though that GCC could be coaxed into Intel mode with some pragma or something. |
|||
06 Dec 2013, 11:56 |
|
nerdguy 06 Dec 2013, 12:18
@revolution
Code: .intel_syntax noprefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Let the awesome intel syntax go here ; And switch back to AT&T! Useless piece of puke .att_syntax noprefix ; Compile with ; gcc -<Options> -masm=intel source.c Man, this AT&T syntax is a killer! |
|||
06 Dec 2013, 12:18 |
|
dogman 17 Dec 2013, 19:00
AT&T syntax is ugly as hell and goes against the object code operand order in many cases. About the *only* thing good about it on Intel is the instructions specify operand length so you don't have to code byte, word, dword ugliness. It was not designed for humans to use, since UNIX-heads write C, not assembler like real men. So it's more about being easy to parse than it is about being useful and it is a back-end to all their compilers which are really not true compilers (they don't put out object code) but translators from whatever source language to assembly code on target X. Of course that means it's good for them if the assembly syntax varies as little as possible across the many platforms gcc has oozed and slimed itself onto.
The % for registers and $ for immediate operand stuff is a pain in the ass for humans and the operand reversal is a true mind-fart, especially since it's not 100%. |
|||
17 Dec 2013, 19:00 |
|
baldr 17 Dec 2013, 19:42
dogman,
You may guess why AT&T syntax is so thorough about operand's meaning (cf. MASM vs. TASM .ideal and fasm memory references' syntax). PDP's MACRO-11 also had those %0, …, %7 native names for slightly more user-friendly R0, …, R5, SP, PC, along with # for numeric literals and so on. That's all about simplification of source parsing (several KiBs of memory and lousy CPU speed definitely require it). |
|||
17 Dec 2013, 19:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.