I wouldn't focus on trying to write programs in assembly, at least not at first. If you're on x86 (which I assume you are, since you're using Windows), there are tons of weird special cases that it's kind of pointless to learn. For example, many instructions assume you're operating on a register that you don't explicitly name, and other instructions work on some registers but not others.
I would learn just enough about your intended architecture that you understand the basics, then just jump right in and try to understand your compiler's output. Arm yourself with the Intel manuals and just dive right into your compiler's output. Isolate the code of interest into a small function, so you can be sure to understand the entire thing.
I would consider the basics to be:
- registers: how many are there, what are their names, and what are their sizes?
- operand order:
add eax, ebx
means "Add ebx to eax and store the result in eax".
- FPU: learn the basics of the floating-point stack and how you convert to/from fp.
- addressing modes: [base + offset * multiplier], but multiplier can only be 1, 2, or 4 (or maybe 8?)
- calling conventions: how are parameters passed to a function?
A lot of the time it will be surprising what the compiler emits. Make it a puzzle of figuring out why the heck the compiler thought this would be a good idea. It will teach you a lot.
It will probably also help to arm yourself with Agner Fog's manuals, especially the instruction listing one. It will tell you roughly how expensive each instruction is, though this is harder to directly quantify on modern processors. But it will help explain why, for example, the compiler goes so far out of its way to avoid issuing an idiv
instruction.
My only other piece of advice is to always use Intel syntax instead of AT&T when you have a choice. I used to be pretty neutral on this point, until the day I realized that some instructions are totally different between the two (for example, movslq
in AT&T syntax is movsxd
in Intel syntax). Since the manuals are all written using Intel syntax, just stick with that.
Good luck!