In the x86 assembly language, the TEST instruction performs a bitwise AND on two operands. The flags SF , ZF , PF are modified while the result of the AND is discarded. There are 9 different opcodes for the TEST instruction depending on the type and size of the operands.
Just so, what is Movzbl?
1 Answer. Specifically, the movzbl instruction fetches the byte stored at the sum of the two parameters, zero pads it, and stores it into eax . The movsbl instruction takes the lowest byte of eax, sign extends it, and stores the result back in eax.
Secondly, what does test EAX EAX do?
The test eax, eax is necessary to make the jne work in the first place. And jne is the same as jnz , just as je is the same as jz . Both act based on the ZF (zero-flag) value. The jne branch will be taken if ZF=0 and therefore whenever strcmp returns a non-zero value (i.e. strings not equal).
What is the difference between and & test instruction?
3.4. 6 Test Instruction. TEST (Test) performs the logical "and" of the two operands, clears OF and CF, leaves AF undefined, and updates SF, ZF, and PF. The difference between TEST and AND is that TEST does not alter the destination operand.
What will happen if you do XOR EAX EAX?
xor eax, eax is a faster way of setting eax to zero. This is happening because you're returning zero. The in instruction is doing stuff with I/O ports. Basically reading a word of data from the port specified dx in and storing it in al .