|
TEST -- Logical Compare
Opcode | Instruction | Clocks |
Description | Example |
A8 ib | testb imm8,al | 2 |
AND immediate byte with AL | testb $0x7f,%al |
A9 iw | testw imm16,ax | 2 |
AND immediate word with AX | testw $0x7fff,%ax |
A9 id | testl imm32,eax | 2 |
AND immediate dword with EAX | testl $0x7fffffff,%eax |
F6 /0 ib | testb imm8,r/m8 | 2/5 |
AND immediate byte with r/m byte | testb $0x7f,%dl
testb $0x7f,(%ebx,1)
testb $0x7f,m8(%ebx,1)
testb $0x7f,m8(%ebx,%ebp,1) |
F7 /0 iw | testw imm16,r/m16 | 2/5 |
AND immediate word with r/m word | testw $0x7fff,%cx
testw $0x7fff,(%ebx,1)
testw $0x7fff,(%ebx,2)
testw $0x7fff,(%ebx,%ebp,1) |
F7 /0 id | testl imm32,r/m32 | 2/5 |
AND immediate dword with r/m dword | testl $0x7fffffff,%ecx
testl $0x7fffffff,(%ebx,2)
testl $0x7fffffff,(%ebx,4)
testl $0x7fffffff,(%ebx,%ebp,1) |
84 /r | testb r8,r/m8 | 2/5 |
AND byte register with r/m byte | testb %bh,%dl
testb %bh,(%ebx,1)
testb %bh,m8(%ebx,1)
testb %bh,m8(%ebx,%ebp,1) |
85 /r | testw r16,r/m16 | 2/5 |
AND word register with r/m word | testw %bx,%cx
testw %bx,(%ebx,1)
testw %bx,(%ebx,2)
testw %bx,(%ebx,%ebp,1) |
85 /r | testl r32,r/m32 | 2/5 |
AND dword register with r/m dword | testl %ebx,%ecx
testl %ebx,(%ebx,2)
testl %ebx,(%ebx,4)
testl %ebx,(%ebx,%ebp,1) |
Operation
DEST := LeftSRC AND RightSRC;
CF := 0;
OF := 0;
Description
TEST computes the bit-wise logical AND of its two operands. Each bit of the result is 1 if both of the corresponding bits of the operands are 1; otherwise, each bit is 0. The result of the operation is discarded and only the flags are modified.
Flags Affected
OF := 0, CF := 0; SF, ZF, and PF as described in Appendix C
Protected Mode Exceptions
#GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page fault
Real Address Mode Exceptions
Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH
Virtual 8086 Mode Exceptions
Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault
[Home Page dell'ITIS "Fermi"]
[80386 Programmer's Reference Manual Index]
[Previous]
[Next]
|