Hello and welcome.
In this new lesson, we are going to take a look at partial move instructions.
Let us make use of our new x64 template, template two.
And scroll down to our starting point.
So normally, a move instruction involves moving, for example, um, -, and then some value there.
For example, like this.
So if you wanted to move only to part of the register, for example the lowest most byte, we can
put a B here, like this, so that we are accessing only the first byte of the - register.
And then we can move some value there.
All right.
Before we do that, let us try to move our -.
Uh, value negative one to - now.
So you see, negative one is encoded as all Fs.
So all Fs means that it is a negative one.
Let us put a breakpoint here now.
And run.
Step over.
And now you will see
your - has got all Fs.
Negative one.
Now let us try to move a value to just the first byte of -.
So to do that, we use move -.
Put the B suffix to indicate you are accessing the first byte, and then say we want to put the value
zero there.
So we click okay, and we step over.
And now you see zero has been written to the first byte.
What if we want to access the lower two bytes,
the word? We can do it this way.
Move -W, and then zero.
So in this case here, W means that we are accessing the lower two bytes, or a word, and click step over.
And you see now we have 0000,
the lower two bytes.
You can refer back to our PowerPoint slide, which we studied in the earlier lesson, where you can
access the parts of the register by putting the correct suffix.
So in this case here, you put the B at the back,
you get a byte.
You put a W, means it's a word, which means two bytes.
And if you put a D, it means double word, or DWORD.
It means four bytes.
So let's try the W now and see what happens.
So let's say we type move
-D, 0.
Okay.
And step over that.
And you see now everything becomes zero.
So that's the difference. When you use D, when you use D, it will write to the entire register.
So that's all for this video.
Thank you for watching.