WEBVTT

1
00:01.670 --> 00:03.200
Hello and welcome back.

2
00:03.200 --> 00:07.400
In this lesson, we are going to take a look at the zero flag, -.

3
00:07.610 --> 00:08.840
The - is set

4
00:08.840 --> 00:13.070
if the result of an arithmetic or logical operation is zero.

5
00:13.670 --> 00:18.080
This flag is often used for equality checks in conditional branch instructions.

6
00:18.740 --> 00:23.060
Let us take a look now at the x64dbg on how it works.

7
00:23.480 --> 00:32.030
So I've already opened the template two in my x64dbg, and I put a breakpoint in this location.

8
00:32.030 --> 00:37.850
Now I'm going to run to the breakpoint, and then I'm going to step over and go to this new line here.

9
00:40.010 --> 00:42.470
First, we'll perform a subtraction on -.

10
00:42.650 --> 00:43.850
- is one.

11
00:43.970 --> 00:48.830
So we are going to minus one from - and watch the zero flag.

12
00:52.110 --> 00:57.120
So we type in sub -, one.

13
00:59.800 --> 01:06.160
And then we step over, and the zero flag is set, meaning that the result of the operation results in

14
01:06.160 --> 01:06.850
zero.

15
01:06.880 --> 01:08.530
That's why it is set.

16
01:09.220 --> 01:14.410
Now we are going to add one to - and see what happens.

17
01:17.150 --> 01:18.110
Okay.

18
01:18.410 --> 01:20.030
And you step over there.

19
01:20.390 --> 01:25.970
And now the zero flag is cleared because the result of the operation is not a zero.

20
01:26.630 --> 01:28.400
So this is a very easy one.

21
01:28.400 --> 01:32.360
So this is how the zero flag works.

22
01:32.360 --> 01:34.430
So that's all for this video.

23
01:34.460 --> 01:35.810
Thank you for watching.