and( <var>, <num1>, <num2> )

Description

This will perform a logical AND as follows:
Take num1 and AND it with num2, write the result to var.

Example

A = B AND 15
and(A, B, 15)

Notes

AND is useful for restricting information to be processed. For example, if you are looking at a byte but you are only interested in the lower nibble, you could:
and(A, A, %1111)
Likewise, if you wanted the upper nibble, you could:
and(A, A, %11110000)
Likewise, you can use AND to mask out everything except specific bits that you wish to check, such as:
and(A, A, %100)
which means discard everything except the third bit (b2).