I think Fordy has it backwards. Learn ASM first then C++. IMO C++ is fifty times harder than assembly language. Assembly is simple because everything is broken down into small steps. But it is also cumbersome because there is no way to skip steps or provide structure to the code. After awhile even well commented assembler turns into a large jumbled mess.
If you can understand this, then you can do assembly. Say you want to do this:
Here it is:
And that's just one of a million ways you could do it. Here's another way.
;Put y value into eax
;Put width value into ebx
;multiply eax by ebx leaving result in eax
;add x value to eax
If you wanted to break 320 down into 2 base 2 values you could do this.
320 is essentially 256+64. Since those are both base 2 we can do this:
After all (y*128)+(y*64)+x is the same as y*(128+64)+x or y*320+x.
Here is the asm code:
;put y value into eax
;shift left by 8 -> multiplies by 2^8 or by 128
;put y value into ebx
;shift left by 6 -> multiplies by 2^6 or by 64
;add ebx to eax, leave result in eax
;add x value to eax, leave result in eax