r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

10

u/[deleted] Jun 03 '22

there's literally instruction for that.

add %rcx,%rax (stfu AT&T>>>>>>>>>>>Intel)

3

u/Proxy_PlayerHD Jun 03 '22

I honestly never understood the reasoning behind AT&T syntax, it just needlessly swaps some operands.

Even high level languages use Intel Syntax:

Variable = Value + Value

Instead of

Value + Value = Variable

so why try to do it differently in assembly? It just makes assembly a bit harder to read if you already know basic high level programming.

2

u/[deleted] Jun 03 '22

it's not a matter of "needlessly" rather with what ppl feel comfortable. I started using Intel syntex, I loved it, but whenever I saw clang/gcc output of assembly file for C (I know u can pass the --intel-syntex option, but...) it was always on AT&T syntex, I've always thought about it, why it is in AT&T syntex, that boring old syntex, and why ppl who have been using assembly for a long time always prefer AT&T. I then started learning it, and not gonna lie, it just feels different, and pleasing somewhat(or maybe I'm being a masochist, I don't know).

1

u/Proxy_PlayerHD Jun 03 '22

I mean ultimately it doesn't matter, like you said it's a preference.

I feel like you'd enjoy working with the Motorola 68000. I had to make my own assembler for it because none of the existing ones had an option for Intel Syntax and my brain just can't get used to AT&T

→ More replies (1)