WEBVTT

1
00:01.580 --> 00:02.690
Hello and welcome.

2
00:02.690 --> 00:06.800
In this new lesson, we are going to take a look at partial move instructions.

3
00:07.190 --> 00:11.690
Let us make use of our new x64 template, template two.

4
00:14.090 --> 00:17.060
And scroll down to our starting point.

5
00:17.780 --> 00:27.950
So normally, a move instruction involves moving, for example, um, -, and then some value there.

6
00:30.090 --> 00:31.320
For example, like this.

7
00:32.160 --> 00:39.030
So if you wanted to move only to part of the register, for example the lowest most byte, we can

8
00:39.030 --> 00:45.150
put a B here, like this, so that we are accessing only the first byte of the - register.

9
00:45.240 --> 00:47.310
And then we can move some value there.

10
00:47.460 --> 00:48.060
All right.

11
00:48.060 --> 00:51.900
Before we do that, let us try to move our -.

12
00:53.310 --> 00:55.440
Uh, value negative one to - now.

13
00:58.810 --> 01:02.170
So you see, negative one is encoded as all Fs.

14
01:02.170 --> 01:04.720
So all Fs means that it is a negative one.

15
01:05.410 --> 01:07.210
Let us put a breakpoint here now.

16
01:09.360 --> 01:10.320
And run.

17
01:11.640 --> 01:12.660
Step over.

18
01:13.260 --> 01:14.370
And now you will see

19
01:14.370 --> 01:15.660
your - has got all Fs.

20
01:15.690 --> 01:16.560
Negative one.

21
01:16.890 --> 01:21.180
Now let us try to move a value to just the first byte of -.

22
01:23.620 --> 01:26.230
So to do that, we use move -.

23
01:26.680 --> 01:33.370
Put the B suffix to indicate you are accessing the first byte, and then say we want to put the value

24
01:33.370 --> 01:34.150
zero there.

25
01:36.070 --> 01:38.830
So we click okay, and we step over.

26
01:39.460 --> 01:42.340
And now you see zero has been written to the first byte.

27
01:42.940 --> 01:45.700
What if we want to access the lower two bytes,

28
01:45.880 --> 01:49.390
the word? We can do it this way.

29
01:50.170 --> 01:54.970
Move -W, and then zero.

30
01:55.810 --> 02:04.510
So in this case here, W means that we are accessing the lower two bytes, or a word, and click step over.

31
02:05.110 --> 02:07.870
And you see now we have 0000,

32
02:07.900 --> 02:08.920
the lower two bytes.

33
02:11.840 --> 02:17.600
You can refer back to our PowerPoint slide, which we studied in the earlier lesson, where you can

34
02:17.600 --> 02:21.830
access the parts of the register by putting the correct suffix.

35
02:22.040 --> 02:24.380
So in this case here, you put the B at the back,

36
02:24.380 --> 02:25.940
you get a byte.

37
02:25.940 --> 02:29.810
You put a W, means it's a word, which means two bytes.

38
02:29.810 --> 02:33.710
And if you put a D, it means double word, or DWORD.

39
02:33.710 --> 02:34.970
It means four bytes.

40
02:34.970 --> 02:37.820
So let's try the W now and see what happens.

41
02:38.390 --> 02:41.150
So let's say we type move

42
02:41.630 --> 02:46.250
-D, 0.

43
02:47.330 --> 02:48.080
Okay.

44
02:48.830 --> 02:50.030
And step over that.

45
02:50.600 --> 02:55.040
And you see now everything becomes zero.

46
02:55.040 --> 03:00.560
So that's the difference. When you use D, when you use D, it will write to the entire register.

47
03:03.920 --> 03:05.660
So that's all for this video.

48
03:05.660 --> 03:07.070
Thank you for watching.