Can any one tell me the meaning of the following:
gdb> disas 0x080ed5af
0x080ed5ac <func1+205>: mov 0x8(%eax),%eax
0x080ed5af <func1+208>: testb $0x10,0x8(%eax)
0x080ed5b3 <func1+212>: jne 0x80ed604 <dapriv_disk_op+293>
0x080ed5b5 <func1+214>: mov %edi,(%esp)
What is the meaning of testb $0x10,0x8(%eax)
?
The TESTB operation compares the bits identified in factor 2 with the corresponding bits in the field named as the result field. The result field must be a one-position character field. Resulting indicators in positions 71 through 76 reflect the status of the result field bits.
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. The OF and CF flags are set to 0 , while AF flag is undefined.
For MOVZBL, the low 8 bits of the destination are replaced by the source operand. the top 24 bits are set to 0. The source operand is unaffected. For MOVZBW, the low 16 bits of the destination are replaced by the source operand.
The least significant byte of AX can be used as a single 8-bit register called AL, while the most significant byte of AX can be used as a single 8-bit register called AH. These names refer to the same physical register. When a two-byte quantity is placed into DX, the update affects the value of DH, DL, and EDX.
It performs a bitwise AND of the two operands (0x10
AND 0x8(%eax)
(this is, the value of the byte located at the address pointed to by %eax
+ 0x8). Neither of the operands is altered, however, the instruction alters the flags, most importantly the ZF flag to either 1 if the result of the AND is zero, or 0 otherwise. The following jne
performs a jump if ZF is equal to 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With