

Say hello to x64 Assembly, Part 2 - valarauca1
http://0xax.blogspot.com/2014/09/say-hello-to-x64-assembly-part-2.html

======
Sophistifunk
I think the descriptions of endianness are off. Endianness doesn't affect the
order of an array of bytes at all, only the rules for converting longer words
to/from a byte array. [0xDE, 0xAD, 0xBE, 0xEF] will always be the same array
of bytes, but 0xDEAFBEEF will not.

~~~
readerrrr
It is phrased poorly. Author should mention that the memory he is talking
about is a single variable.

Otherwise I found the article to be very clearly written.

------
bandanabanana
I enjoy these, hope you keep going!

Maybe it's my nasm version, but "\n" seems to be inserted literal for me and
not translated into LF. Thus my program outputs "Sum is correct\". Doing "msg:
db 'Sum is correct',0xA" works for me though.

~~~
e12e
Nasm uses backquotes to enable c-style string escapes. So `\n` should work,
"\n" should render as \n (not new-line).

Eg:

    
    
        "Sum is correct",`\n` ;or
        `Sum is correct\n`

------
clarry
_> Signed integers are signed binary numbers held as unsigned in a byte, word
and etc... The sign bit is set for negative integers and cleared for positive
integers and zero._

That sounds like a description of sign-and-magnitude.

------
pmtarantino
I was very "anti" Assembly until I was forced to use it in college. It was
fun, it forces you to change your way of thinking and be creative on how you
code!

------
e40
Would love to see the same treatment for ARM64.

~~~
floody-berry
Not ARM64, but "Tonc: Whirlwind Tour of ARM Assembly" [1] is what I'm
repeatedly referring to while learning ARM. Pretty confusing coming from x86,
but it's starting to make sense and my ARM is getting slightly less awful.

[1]
[http://www.coranac.com/tonc/text/asm.htm](http://www.coranac.com/tonc/text/asm.htm)

~~~
e40
Quoting: "Because the ARM processor is 32bit" so this isn't for the 64-bit
variant, which is what I meant by _ARM64_.

------
_RPM
Looking for thoughts. What do you think is more useful to learn IBM 360
assembly (mainframe) or x64?

~~~
ANTSANTS
Undoubtedly x86, but it doesn't have to be an either/or thing, you know. Once
you've got one ISA under your belt, it's pretty easy to pick up others.

~~~
_RPM
The reason why I ask is because this CS major peer had said that it would be
_less_ useful to learn x86. Our class used IBM System/360

I assumed he was just trying to be a smart ass because I thought for sure it
would best to learn x64 especially because it is modern and what my machine
runs on / everything else.

~~~
ANTSANTS
I could be wrong, but I think System/360 is like COBOL: utterly obsolete and
useless outside of a small handful of multi-bajillion dollar banks and
government organizations with decades-long commitments. Maybe it lives on, but
any normal programmer is going to get a lot more use out of knowing x86.

That said, learning a simpler architecture before you tackle the rat's nest
that is x86 isn't a bad idea. 6502, 68000, MIPS, and ARM are all good choices
for different reasons. Pick whatever appeals to you most.

~~~
ido
Wouldn't both be kind of extreme niches? Who programs a 64bit x86 in asm? I
think the only places where you might use any asm language is embedded and
these chips don't use x64 (my last embedded job was around 2006 using 8-bit
CPUs @ about 1mhz & 4kB ram and even there we used c).

Not to be misunderstood - it's good for you to learn as a programmer but since
it's all for educational purposes anyway might as well learn something simpler
like the parent suggested. "Practically" both are impractical in the modern
world.

~~~
sharpneli
Knowing how it works is extremely useful. And if you know one it's trivial to
get to know another, like ARM as an example.

I haven't actually written a line of asm in last few years but when you are
thinking about performance you must be able to understand compiler output. And
that I have been doing a great deal. You simply cannot make well performing
code without that knowledge.

You can always say that in modern desktop performance does not matter, but you
cannot say the same in mobile space. There every single watt counts if you
want to increase your battery life. Because when the CPU is idle they can
pretty much shut the whole thing down for a small while.

~~~
ido
Well if you reread what I wrote you'd see I wrote that you should probably
learn _some_ asm, it just doesn't need to be x64 asm.

