Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like to say that AT&T follows natural English flow and byte order of the finally assembled binary code. Intel followed the more mathematically oriented syntax. Might be a bit back duck syndrome since I learned math and Intel first, but Intel seemed more intuitive to me as well.

   AT&T
   ASM             | English          | Binary
   MOVE src, dst   | src -> dst       | 01 src dst
   ADD src, dst    | src + dst -> dst | 02 src dst
                     or
                     src + dst = dst
Compared to

   Intel
   ASM             | English          | Binary
   MOV dst, src    | dst <- src       | 01 dst src
   ADD dst, src    | dst <- dst + src | 02 dst src
                     or
                     dst = dst + src
                     dst += src
<- could be read as `loaded from`

-> could be read as `stored to`

Notice the RISC-y-ness of that.

However, ISAs developed later and are primarily MIPS-like follow Intel convention and extend it because it aligns better with 3AC [0] SSA[1] based optimizations.

[0] https://en.wikipedia.org/wiki/Three-address_code

[1] https://en.wikipedia.org/wiki/Static_single_assignment_form



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: