8

For example, I'm running Windows 7 64 bit, but it seems like all of the best resources out there for learning assembly languages speak about x86. If writing x86 on x64 is possible, what's the best way to go about this? Are there converters in existence? Also, what are some good resources for 64 bit assembly programming?

zeboidlund
  • 9,731
  • 31
  • 118
  • 180

3 Answers3

4

Most 64-bit operating systems can run 32-bit binaries without trouble. Since your question is tagged [windows], you should be fine. If you follow the instructions for building a 32-bit binary from your tutorials, the resulting binaries should work without modification. If you are using a different toolchain, you might need to find the flag that tells your assembler to produce 32-bit rather than 64-bit code.

The differences between 32- and 64-bit assembly programming are pretty minor. There are some new and improved instructions to handle the 64-bit types, plus some new register names. There's a new ABI to contend with, too. Intel has Software Developer Manuals that describe all of the possible instructions and how they work.

Carl Norum
  • 219,201
  • 40
  • 422
  • 469
3

x86 is definitely not the best, first, assembly to learn. if at all it is the last one you want to learn. checkout https://github.com/dwelch67 lsasim is an instruction set designed for learning assembly. pcemu_samples is a modified pcemu (8086/88 emulator capable of running dos), with the bios/dos calls removed, specifically for learning 8088/86 assembler. I recommend when you approach x86 assembly you start with 8088/86, something like the pcemu_samples (where you are forced to focus on assembly language and not system calls). dosbox and bochs can run 8088/86 programs with dos/bios when you want to move into system calls. THEN move up into the 32 and 64 bit enhancements, multi-core and all that.

You will do yourself a great benefit by learning x86 last. msp430, the lsasim thing above, arm, thumb (not thumb2) are all good starting points. Learning a few different instruction sets at least, if not many, will also benefit you greatly. I have simulators for some of these which give you good visibility into what is going on, I recommend learning on simulators first, simulators you can get visibility into.

if you start with 8088/86 then move to 386/486 then forward into x64 the other answers you are getting about the instructions (sorta) working everywhere will make a whole lot of sense.

old_timer
  • 69,149
  • 8
  • 89
  • 168
1

x64 can run x86 applications without any difficulty in most cases. There are some differences in the ABI, but if you just want to learn assembly programming any x86 resource you look at should be fine. As for learning assembly programming itself that is a broader question. You might want to look at NASM to get started.

Gabriel Southern
  • 9,602
  • 12
  • 56
  • 95