Earlier quoted context omitted.
It's even more confusing if moves have a different operation order from arithmetic ops and comparisons, no?
No, each should have what makes sense, whether analogous to math or a shell command.
AT&T Syntax versus Intel Syntax (2001)
101–110 of 112 posts
Re: AT&T Syntax versus Intel Syntax (2001)
#102Earlier quoted context omitted.
The amount of disagreement this individual testimony is generating is fascinating and frustrating to me. I didn’t think it ever really makes sense to disagree with a comment like this, unless one is claiming that the content of your comment is intentionally untrue. Anyways, appreciate your perspective.
It's rare that I post unpopular opinions, but when I see an HN thread full of people talking about how terrible the tools are which helped me be successful, I just can't help but speak up. It's an important topic for me because I originally believed the consensus. Like all of you, I read the countless Internet comments which say things like GNU AS is meant only as a backend for GCC, that you must never write assembly…
As Stroustrup put it: “There are only two kinds of languages: the ones people complain about and the ones nobody uses.”
Re: AT&T Syntax versus Intel Syntax (2001)
#103Earlier quoted context omitted.
The line between syntax and functionality is pretty thin for an assembler. I've definitely had code that some assemblers accepted and others didn't on the same arch, so even if they could be equally expressive in practice they aren't. Fairly sure that's also true of inline assembly on clang x64, had to change between intel and at&t for something a while ago.
Not really. Intel vs AT&T syntax is about how to generate machine code from mnemonics. Cooperation with the linker comes with other directives and options. gas has tight cooperation with GNU ld via directives (which mostly are just implemented with ELF constructs AFAIK), not instruction syntax. It can actually be set to accept either AT&T or Intel syntax, without losing any support for other features.
Re: AT&T Syntax versus Intel Syntax (2001)
#104In grade school, they showed us a movie where researchers attached special glasses to a volunteer, and the volunteer had to wear them 24/7 or a mask for sleeping. The glasses turned everything upside down. After a few days, suddenly everything was right side up for the volunteer. Until he took the glasses off ... The movie ended with a warning to never try this yourself. Anyhow, I'm reminded of that movie every time…
https://www.madsci.org/posts/archives/mar97/858984531.Ns.r.h...
"""
[...] first investigated by George Stratton in the 1890 s
[...] he ran another experiment where he wore it for eight days in a row. On the fourth day, things seemed to be upright rather than inverted. On the fifth day, he was able to walk around his house fairly normally but he found that if he looked at objects very carefully, they again seemed to be inverted. On the whole, Stratton reported that his environment never really felt normal especially his body parts, although it was difficult to describe exactly how he felt. He also found that after removing the reversing lenses, it took several hours for his vision to return to normal.
[...]
"""
Re: AT&T Syntax versus Intel Syntax (2001)
#105Earlier quoted context omitted.
Not really. Intel vs AT&T syntax is about how to generate machine code from mnemonics. Cooperation with the linker comes with other directives and options. gas has tight cooperation with GNU ld via directives (which mostly are just implemented with ELF constructs AFAIK), not instruction syntax. It can actually be set to accept either AT&T or Intel syntax, without losing any support for other features.
The case that comes to mind was emitting a (correct) relocation for one mode and raising an error for the other. That was more likely to be llvm-mc than gas though, so results from on assembler may not apply to all assemblers.
Re: AT&T Syntax versus Intel Syntax (2001)
#106Earlier quoted context omitted.
The case that comes to mind was emitting a (correct) relocation for one mode and raising an error for the other. That was more likely to be llvm-mc than gas though, so results from on assembler may not apply to all assemblers.
Emitting a relocation with .reloc directive? Definitely sounds like an llvm-as bug.
Re: AT&T Syntax versus Intel Syntax (2001)
#107Earlier quoted context omitted.
No, each should have what makes sense, whether analogous to math or a shell command.
This implies that dst<-src "doesn't make sense"; but then why does practically every programming language use this ordering?
Re: AT&T Syntax versus Intel Syntax (2001)
#108In grade school, they showed us a movie where researchers attached special glasses to a volunteer, and the volunteer had to wear them 24/7 or a mask for sleeping. The glasses turned everything upside down. After a few days, suddenly everything was right side up for the volunteer. Until he took the glasses off ... The movie ended with a warning to never try this yourself. Anyhow, I'm reminded of that movie every time…
> glasses turned everything upside down https://www.madsci.org/posts/archives/mar97/858984531.Ns.r.h... """ [...] first investigated by George Stratton in the 1890 s [...] he ran another experiment where he wore it for eight days in a row. On the fourth day, things seemed to be upright rather than inverted. On the fifth day, he was able to walk around his house fairly normally but he found that if he looked at object…
Re: AT&T Syntax versus Intel Syntax (2001)
#109Earlier quoted context omitted.
Also the % before register names is completely unnecessary, it just another extra character to type.
It disambiguates labels from registers, assuming of course you allow labels to have register names. eg this is valid: mov rax,%rax rax: .ascii "hello\0" Stupid perhaps, but valid.
Re: AT&T Syntax versus Intel Syntax (2001)
#110Earlier quoted context omitted.
> glasses turned everything upside down https://www.madsci.org/posts/archives/mar97/858984531.Ns.r.h... """ [...] first investigated by George Stratton in the 1890 s [...] he ran another experiment where he wore it for eight days in a row. On the fourth day, things seemed to be upright rather than inverted. On the fifth day, he was able to walk around his house fairly normally but he found that if he looked at object…
Thanks for the references. I saw the black&white film around 1967.