3 ms·
Does it make sense to learn x86 assembly now, or is x64 assembly simpler? All the machines I use are x64 and the binaries I generate are 64-bit. (I realize it
by chubot 11y ago
Does it make sense to learn x86 assembly now, or is x64 assembly simpler? All the machines I use are x64 and the binaries I generate are 64-bit. (I realize it's a superset, but I suppose I want to learn the smallest useful subset, since it's a big topic...)
- colejohnson66 11y agoLearn the x86 instructions that are supported in x86-64 and ignore those that aren't. When you need a specific extension, learn it then. For example, I haven't needed to use the AES instructions yet, so I've yet to learn them.
- MichaelBurge 11y agoUse x64 - the calling convention is simpler and you get more registers. Avoid the exotic instructions.
- spc476 11y agoAnd just accept that half the registers are named (rax, rbx) and the other half are numbered (r8, r9).
- chubot 11y agoCan anyone recommend the best resource for learning x64 then? I did computer architecture and assembly language 15+ years ago in school but haven't really needed to touch assembly language as a professional programmer. So I know the basic idea of registers and addressing modes and pipelines and stuff, but nothing specific to any architecture. My goal is basically to be able to write faster C and C++ programs and analyze constructs like the cost of things like smart pointers, virtual dispatch, templates, etc.
- lorenzhs 11y agoI'd be very interested in such a resource as well. At the moment I'm just staring at the output of 'objdump -S', trying to make sense of things and find what's different between two versions. For smaller things, Matt Godbolt's compiler explorer is very helpful as well. But I'm still having trouble figuring out what exactly is happening and why some things are required, etc.