Hello and welcome.
In this practical, we are going to take a look at the AND operations.
And the AND operations have got this syntax: source, destination.
So the result of the AND will be stored in the destination.
And there are few variations here.
You can AND register immediate and register register.
So let's try them one by one.
And for the purpose of this exercise, we are going to make use of these values from the slides over here.
So the first value will be this,
and the second value will be this,
and the result should be this.
We are going to store the first value here into the register.
And then we are going to use the immediate value over here as the second parameter.
So now we're going to store this value in the register.
So we are going to use - as an example.
You could also use other registers.
Let's move this value into -.
So the value that we are going to move into - is this value: 00100000.
So let's do that now.
Move -.
And then for the prefix, instead of 0x, which means hex,
now we put 0b, which means binary.
Now we can type our binary number.
Okay, okay.
So in hex it is 20.
So we step over this.
Now we run to this breakpoint first.
Before that, make sure you put the breakpoint.
This is your template 2x.
Step over until you come to this line.
Step over that,
and now you see the value.
20 is already in -.
Next, we are going to AND with this value here.
AND -, 0b
01100111.
So let's step over and see the result.
Right, and you go back to 20.
So 20 is the original value that we input here. To confirm this,
you can use your programmer's calculator.
So let's search for calculator and then...
Make sure you use the programmer one.
You can change the calculator here.
Standard or scientific or programmer.
And here, set it to byte.
And here, the input, change it to binary.
So let's put in the first value.
So type it in.
This is the first value.
Now the second one, we are going to perform a bitwise AND operation.
So let's tap on that and AND, enter the second value here.
You close, and you get 00100000, which is 0x20, which we are seeing here.
So this works.
That means this proves that the result is correct.
The result.
Next, we are going to try the second variation, which is register to register, AND register,
register.
So we are going to use the - here and - here.
So - already got 20.
So now we're going to move the second value into -.
This value here.
So we type: move -.
Hit okay.
In hex it's 67.
And now the 67 is in the, is in, is in -.
So let's confirm the 67 is indeed this number, this value here.
So we clear all this and we key in this:
01100111.
And we see, indeed, it is hex 67.
So this is this number.
So now we are going to AND -, -.
Hit okay.
And now step over it.
And you see the result is still 20.
So it is correct.
Okay.
So this is how we perform AND operations using the AND operator.
That's all for this video.
Thank you for watching.