News for hackers. Stuff that matters.
Re:Everything I googled in a week as a professional software... by dmoy on Friday September 06, 2019 @01:49PM (#20897904)
Given the number of things that use different source vs destination with the same type, I just have trained myself to always look it up, even if I am 99% sure I remembered it correctly, because holy shit when you get it wrong sometimes it's bad.

softlink dest <- src

file cp src -> dest

std::memcpy dest <- src

java arraycopy src -> dest

golang io.Copy dest <- src

etc etc

I'm only 80% confident I didn't make an error in the above 5 examples...

Re:Everything I googled in a week as a professional software... by EliRivers on Friday September 06, 2019 @02:24PM (#20898298)
Intel assembly: mov dest, src

AT&T assembly: mov src, dest

Whenever I'm debugging at the assembly level I have to just write down the appropriate one on a piece of paper in front of me.

Re:Everything I googled in a week as a professional software... by dmoy on Friday September 06, 2019 @02:29PM (#20898365)
at least arm and mips both match x86 (right? unless I forgot. probably I forgot, it's been over a decade)
Re:Everything I googled in a week as a professional software... by nostoc on Friday September 06, 2019 @02:47PM (#20898574)
Both of the parent's examples were in x86, intel and AT&T are only syntaxes for the same thing.
Re:Everything I googled in a week as a professional software... by grumdan on Friday September 06, 2019 @02:48PM (#20898585)
Well two differing conventions above are both for x86, so you can't "match x86".
Re:Everything I googled in a week as a professional software... by saagarjha on Friday September 06, 2019 @02:26PM (#20898323)
I've heard that C's src/dest parameter order is supposed to match assignment.