Hello, my name is Stephen and welcome to a captivating lecture that delves into the heart of assembly
language.
And in this session we are immersing ourselves in the intricate world of instruction, flags and their
profound influence on conditional jumps.
So brace yourselves for an enlightening journey as we meticulously dissect each instruction, unraveling
the signal and unveiling their impact on a program flow.
So without further ado, let's embark on this exciting addition to the realm of instruction, flags
and conditional jumps.
Now we will create a new project folder for this lecture here.
Let's name it the instruction flags and.
And instruction flags and.
Uh, con jumps here.
Yeah.
And jumps here.
That's it.
Now we will here create the default.
Or actually, let's open the terminal here just as a CSM here.
Create a new project.
Let's do the default project here.
Save this in instruction flags and jumps as the project dot ASM.
And here we will start with the g e here.
This means jump if equal.
So our voyage begins with an introduction.
G is an abbreviation for jump if equal.
Here G is jump if equal.
So this instruction plays a pivotal role in facilitating decisions based on equality conditions.
So it hinges on the zero flag z, F and the key indicator of whether the previous operation resulted
in an equal comparison.
Regardless of whether we are dealing with a signed or unsigned numbers, the g e instruction empowers
us to gracefully navigate program flow when two values are equal.
So this means jump if equal.
So now we will also create an example code for this and I will explain this example code further and
you will learn.
Learn everything you need to know about g jump if equal here.
So section data we will create a two value.
This is the byte with value ten and we will define another byte with the value ten again.
So value one db ten value value two.
Be ten again.
Then and here we will develop our text section here.
In text section we will global.
Global.
Start and in start.
Here.
Start, we will move the value of value one into a register here.
A l.
Uh, value one.
And we will move.
L two.
Value to.
And now we will compare the values in al and bl cmp.
Al.
And Bell.
And this is we wrote this because of the comparing the values in L and L, and we will use G here and
we will write equal font.
So this we are jumping the equal font label if they are equal.
But if they are not equal, we will create this new line here.
Not equal.
So here in this case, your code or code here for not equal case and after the case ends, jump done.
So now we are jumping to the done label.
And if the equal is font here, equal font here and here, you will also your code here.
Here for equal.
Case.
Case and after that.
Again.
And after that, you will need to write your exit code here.
So that's it with our jump if equal instruction here and I'm waiting you in next lecture.
So remember that we wrote this code in 32 bit assembly in ACM x86.
32 bit.
So that's why we have two characters instead of three here.
And in next lecture we will also try 64 bit for this testing here.
So I'm waiting you in next lecture.