Live data from Hacker News

An Introduction to x86_64 Assembly Language

hackeradam17.com

31–40 of 56 posts

Re: An Introduction to x86_64 Assembly Language

#31
post #20

Are there any books available that someone could recommend for me to go down this route, specifically for hand crafting assembly routines inside my C++ programs. (note I'm currently only compiling for 32 bit). It's something of interest to me, but I've never gotten around to it. I'm comfortable with ARM assembly, and have a solid enough understanding to proceed, but the references I've come across so far go as far as…

If you are using GCC and Linux, you might find "Programming from the Ground Up" to be a useful resource: ftp://gnu.mirrors.pair.com/savannah/pgubook/ProgrammingGroundUp-1-0-booksize.pdf

You may find Agner Fog's Optimization series helpful too: http://www.agner.org/optimize/

Check out every volume, as each has very useful information tucked away. For example, "Calling Conventions" is great for understanding how C++ and assembly interfaces should work.

Re: An Introduction to x86_64 Assembly Language

#32
post #15

Learning Assembly language has been on my list of "want to do" for a long time now but as I have never had a need for it professionally I kept putting it off. I actually have time for myself now and outside of learning to cook properly and cycle a lot I would really like to finally tick this off my bucket list. The problem is I am not too sure where to actually start. I want something that starts from the bottom and…

Might be a good idea to brush up your C first. Make sure you really understand memory and pointers.

Re: An Introduction to x86_64 Assembly Language

#33
post #26

After learning 6502 assembly when I was a teenager, I was floored by the beauty and straightforward cleanliness of the 68000 used by Macs and then the similar assembly of the VAX. x86_64 is just plain ugly. While I admire the backward compatibility, it's sad that this nasty-looking architecture won out. I'm really glad that the compiler handles it.

I was not there at the time of 6502, but imo ARM assembly is simpler (relative to x86_64).

I would go as far to say I really love debug things on RISC instruction set.

Re: An Introduction to x86_64 Assembly Language

#34
post #26

After learning 6502 assembly when I was a teenager, I was floored by the beauty and straightforward cleanliness of the 68000 used by Macs and then the similar assembly of the VAX. x86_64 is just plain ugly. While I admire the backward compatibility, it's sad that this nasty-looking architecture won out. I'm really glad that the compiler handles it.

ASM is not made to be read by humans but by computers.

Re: An Introduction to x86_64 Assembly Language

#35
post #34
post #26

After learning 6502 assembly when I was a teenager, I was floored by the beauty and straightforward cleanliness of the 68000 used by Macs and then the similar assembly of the VAX. x86_64 is just plain ugly. While I admire the backward compatibility, it's sad that this nasty-looking architecture won out. I'm really glad that the compiler handles it.

ASM is not made to be read by humans but by computers.

Actually, Assembly is sometimes called Mnemonic Assembly. Mnemonic roughly means "a device such as a pattern of letters, ideas, or associations that assists in remembering something." Assembly was developed to help humans write machine code more easily. It is machine code that is not for humans. Assembly certainly is. (Although, as a historical note, humans have often written raw machine code in a number ways, including toggling it in via switches)

Re: An Introduction to x86_64 Assembly Language

#36
post #34
post #26

After learning 6502 assembly when I was a teenager, I was floored by the beauty and straightforward cleanliness of the 68000 used by Macs and then the similar assembly of the VAX. x86_64 is just plain ugly. While I admire the backward compatibility, it's sad that this nasty-looking architecture won out. I'm really glad that the compiler handles it.

ASM is not made to be read by humans but by computers.

Modern assembly less and less so, but it definitively was originally intended for humans, and for quite some time a lot of fairly substantial programs were handwritten in assembly.

When I was in my teens I even occasionally resorted to compling C code and disassembling it to work with it, because I preferred M68k assembly to the C source, and the C compilers of the time were horribly inefficient - I could often delete pointless lines and reassign registers etc. almost as fast as I could read the code...

Re: An Introduction to x86_64 Assembly Language

#37
post #26

After learning 6502 assembly when I was a teenager, I was floored by the beauty and straightforward cleanliness of the 68000 used by Macs and then the similar assembly of the VAX. x86_64 is just plain ugly. While I admire the backward compatibility, it's sad that this nasty-looking architecture won out. I'm really glad that the compiler handles it.

[deleted]

Re: An Introduction to x86_64 Assembly Language

#38

This is a great resource, and the following is not a criticism, but an observation. What I've found with most assembly language textbooks and online resources is that while the basics get covered well enough, the fundamental knowledge base is often skimmed over, as are the many assumptions and conventions that are made in how the CPU is supposed to work. I first learned 8086 assembler from Peter Norton's book ( http:…

I recommend Computer Systems: A Programmer's Perspective. It sounds like what you're looking for, although it uses a mix of C and IA32.

Re: An Introduction to x86_64 Assembly Language

#39
post #15

Learning Assembly language has been on my list of "want to do" for a long time now but as I have never had a need for it professionally I kept putting it off. I actually have time for myself now and outside of learning to cook properly and cycle a lot I would really like to finally tick this off my bucket list. The problem is I am not too sure where to actually start. I want something that starts from the bottom and…

"Programming from the Ground Up" (linked from a couple of other posts) has exactly what you want. There's no need to learn C first - it becomes obvious how memory and pointers work when you're actually doing it. It's a lot easier than people make out, just give it a go.

Re: An Introduction to x86_64 Assembly Language

#40
post #26

After learning 6502 assembly when I was a teenager, I was floored by the beauty and straightforward cleanliness of the 68000 used by Macs and then the similar assembly of the VAX. x86_64 is just plain ugly. While I admire the backward compatibility, it's sad that this nasty-looking architecture won out. I'm really glad that the compiler handles it.

If you start from 8080/Z80 and work your way up, you will have a very different perspective. 16-bit (and especially 32-bit) x86 looks quite regular if you see it in the right way; although IMHO the 64-bit extension wasn't designed as well as the move to 32-bit.
Post reply on HN