Difference between revisions of "Assembler:Commands:AND"
(Created page with ''''command''' and ''destination'', ''source'' The AND instruction is used for supporting logical expressions by performing bitwise AND operation. The bitwise AND operation retur…') |
|||
Line 71: | Line 71: | ||
* [https://wikipedia.org/wiki/X86_instruction_listings wikipedia.org/wiki/X86_instruction_listings] | * [https://wikipedia.org/wiki/X86_instruction_listings wikipedia.org/wiki/X86_instruction_listings] | ||
* [https://wikibooks.org/wiki/X86_Assembly/Other_Instructions wikibooks.org/wiki/X86_Assembly/Other_Instructions] | * [https://wikibooks.org/wiki/X86_Assembly/Other_Instructions wikibooks.org/wiki/X86_Assembly/Other_Instructions] | ||
+ | * [http://x86.renejeschke.de/ x86.renejeschke.de] | ||
* [http://www.asmpedia.org/index.php?title=Main_Page asmpedia.org] | * [http://www.asmpedia.org/index.php?title=Main_Page asmpedia.org] |
Revision as of 04:09, 15 March 2017
command and destination, source
The AND instruction is used for supporting logical expressions by performing bitwise AND operation. The bitwise AND operation returns 1, if the matching bits from both the operands are 1, otherwise it returns 0.
destination = destination & source
Example:
| destination: 0101 | | source: 0011 | |------------------------------------| | After AND -> destination: 0001 |
The OF and CF flags are cleared; the SF, ZF, and PF flags are set according to the result. The state of the AF flag is undefined.
Performs a bitwise AND operation on the destination (first) and source (second) operands and stores the result in the destination operand location. The source operand can be an immediate, a register, or a memory location; the destination operand can be a register or a memory location. (However, two memory operands cannot be used in one instruction.) Each bit of the result is set to 1 if both corresponding bits of the first and second operands are 1; otherwise, it is set to 0.
Command Parameters
Parameter | Description |
---|---|
destination | The destination operand |
source | The source operand |
Examples
and al,1
and ax,1
and ax,1
and eax,1
and rax,1
and al,al
and ax,ax
and ax,ax
and eax,eax
and rax,rax
and [eax],eax
and [rax],rax
and [00123ABC],eax
and [SomeSymbol],rax