Difference between JE/JNE and JZ/JNZ

JE and JZ are just different names for exactly the same thing: a conditional jump when ZF (the “zero” flag) is equal to 1. (Similarly, JNE and JNZ are just different names for a conditional jump when ZF is equal to 0.) You could use them interchangeably, but you should use them depending on what you are doing: JZ/JNZ are more appropriate when you are explicitly testing for something being equal … Read more

What is the difference between MOV and LEA?

LEA means Load Effective Address MOV means Load Value In short, LEA loads a pointer to the item you’re addressing whereas MOV loads the actual value at that address. The purpose of LEA is to allow one to perform a non-trivial address calculation and store the result [for later usage] Where there are just constants … Read more

X86 assembly – Handling the IDIV instruction

The first part of Mysticials answer is correct, idiv does a 128/64 bit division, so the value of rdx, which holds the upper 64 bit from the dividend must not contain a random value. But a zero extension is the wrong way to go. As you have signed variables, you need to sign extend rax to rdx:rax. There is a specific instruction for this, cqto (convert quad … Read more

JNZ & CMP Assembly Instructions

JNZ is short for “Jump if not zero (ZF = 0)”, and NOT “Jump if the ZF is set”. If it’s any easier to remember, consider that JNZ and JNE (jump if not equal) are equivalent. Therefore, when you’re doing cmp al, 47 and the content of AL is equal to 47, the ZF is set, ergo the jump (if Not … Read more

Assembly – JG/JNLE/JL/JNGE after CMP

When you do a cmp a,b, the flags are set as if you had calculated a – b. Then the jmp-type instructions check those flags to see if the jump should be made. In other words, the first block of code you have (with my comments added): would jump to label1 if and only if al was greater than dl. You’re probably better … Read more

How do AX, AH, AL map onto EAX?

No, that’s not quite right. So AX is composed of AH:AL halves, and is itself the low half of EAX. (The upper half of EAX isn’t directly accessible as a 16-bit register; you can shift or rotate EAX if you want to get at it.) For completeness, in addition to the above, which was based … Read more

Which variable size to use (db, dw, dd) with x86 assembly?

Quick review, DB – Define Byte. 8 bits DW – Define Word. Generally 2 bytes on a typical x86 32-bit system DD – Define double word. Generally 4 bytes on a typical x86 32-bit system From x86 assembly tutorial, The pop instruction removes the 4-byte data element from the top of the hardware-supported stack into the specified operand (i.e. register or … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)