Comment by rep_lodsb
A comment on the second blog post:
Some condition codes are different depending on signedness of the numbers being used. "Greater"/"Less"/"Overflow" are for signed, "Above"/"Below"/"Carry" for unsigned. The sign flag by itself is not what you would test when comparing two numbers, since the subtraction done by CMP might have overflowed - that's why the condition for "Less" is defined as "Sign XOR Overflow".
There are various arguments for always using signed types in C, but none of that applies to assembly, and unsigned is more appropriate in most cases. So maybe these conditions should be introduced first?
Readers might be confused why it is called EFLAGS, or about the register names, so maybe a little history should be included: registers were originally 16 bits, then "E"xtended to 32 bits, and later "R" was used to indicate 64 bits. AH/CH/DH/BH correspond to the high byte of the 16 bit registers AX/CX/DX/BX, not the extended ones. These aren't used much anymore.
Good tutorial nonetheless!
So many others don't even mention that official documentation by Intel / AMD exists. Instead it's mostly "here's what code GCC/Clang generates for this C program", in that horrid AT&T syntax, and links to one of several third-party reference sites containing nothing but giant dense tables of mnemonics, opcodes and flags. No wonder when people reading those come away convinced that it's impossible to actually understand this stuff.
Hey, thanks for the feedback (:
The second article is still shaping up, but I felt like publishing it to get some early feedback. What you mention are a couple of the reasons.
At this point, I find it too dense (and it was even more so in first drafts) hence missing information. Maybe I should cut some parts, like the rip intro, and accommodate for more details about flags and conditions.
This is good signal for me. Thanks again for taking the time