Hello and welcome back.
In this lesson, we are going to take a look at the zero flag, -.
The - is set
if the result of an arithmetic or logical operation is zero.
This flag is often used for equality checks in conditional branch instructions.
Let us take a look now at the x64dbg on how it works.
So I've already opened the template two in my x64dbg, and I put a breakpoint in this location.
Now I'm going to run to the breakpoint, and then I'm going to step over and go to this new line here.
First, we'll perform a subtraction on -.
- is one.
So we are going to minus one from - and watch the zero flag.
So we type in sub -, one.
And then we step over, and the zero flag is set, meaning that the result of the operation results in
zero.
That's why it is set.
Now we are going to add one to - and see what happens.
Okay.
And you step over there.
And now the zero flag is cleared because the result of the operation is not a zero.
So this is a very easy one.
So this is how the zero flag works.
So that's all for this video.
Thank you for watching.