WEBVTT

00:00.350 --> 00:06.470
Hello, my name is Stephen and welcome to a captivating lecture that delves into the heart of assembly

00:06.470 --> 00:07.340
language.

00:07.340 --> 00:15.170
And in this session we are immersing ourselves in the intricate world of instruction, flags and their

00:15.170 --> 00:18.230
profound influence on conditional jumps.

00:18.230 --> 00:26.360
So brace yourselves for an enlightening journey as we meticulously dissect each instruction, unraveling

00:26.360 --> 00:31.150
the signal and unveiling their impact on a program flow.

00:31.160 --> 00:38.180
So without further ado, let's embark on this exciting addition to the realm of instruction, flags

00:38.180 --> 00:39.860
and conditional jumps.

00:39.860 --> 00:44.060
Now we will create a new project folder for this lecture here.

00:44.300 --> 00:50.480
Let's name it the instruction flags and.

00:51.220 --> 00:53.260
And instruction flags and.

00:54.790 --> 00:57.220
Uh, con jumps here.

01:02.540 --> 01:02.990
Yeah.

01:03.380 --> 01:05.030
And jumps here.

01:05.150 --> 01:06.020
That's it.

01:06.050 --> 01:09.470
Now we will here create the default.

01:09.470 --> 01:15.260
Or actually, let's open the terminal here just as a CSM here.

01:17.030 --> 01:18.070
Create a new project.

01:18.080 --> 01:20.270
Let's do the default project here.

01:20.300 --> 01:27.560
Save this in instruction flags and jumps as the project dot ASM.

01:33.120 --> 01:37.610
And here we will start with the g e here.

01:37.620 --> 01:40.260
This means jump if equal.

01:40.260 --> 01:43.500
So our voyage begins with an introduction.

01:43.630 --> 01:47.380
G is an abbreviation for jump if equal.

01:47.420 --> 01:54.420
Here G is jump if equal.

01:54.420 --> 02:01.080
So this instruction plays a pivotal role in facilitating decisions based on equality conditions.

02:01.080 --> 02:09.810
So it hinges on the zero flag z, F and the key indicator of whether the previous operation resulted

02:09.810 --> 02:11.640
in an equal comparison.

02:11.640 --> 02:17.580
Regardless of whether we are dealing with a signed or unsigned numbers, the g e instruction empowers

02:17.580 --> 02:23.730
us to gracefully navigate program flow when two values are equal.

02:23.730 --> 02:26.360
So this means jump if equal.

02:26.370 --> 02:33.550
So now we will also create an example code for this and I will explain this example code further and

02:33.550 --> 02:34.240
you will learn.

02:34.690 --> 02:38.800
Learn everything you need to know about g jump if equal here.

02:38.800 --> 02:43.030
So section data we will create a two value.

02:43.750 --> 02:50.200
This is the byte with value ten and we will define another byte with the value ten again.

02:50.200 --> 02:56.440
So value one db ten value value two.

02:57.240 --> 02:59.300
Be ten again.

03:02.740 --> 03:07.420
Then and here we will develop our text section here.

03:07.420 --> 03:09.730
In text section we will global.

03:12.600 --> 03:13.470
Global.

03:14.370 --> 03:17.100
Start and in start.

03:17.990 --> 03:18.590
Here.

03:21.910 --> 03:28.930
Start, we will move the value of value one into a register here.

03:34.630 --> 03:35.660
A l.

03:37.630 --> 03:40.120
Uh, value one.

03:41.550 --> 03:43.380
And we will move.

03:44.250 --> 03:46.220
L two.

03:47.670 --> 03:48.870
Value to.

03:50.120 --> 03:56.570
And now we will compare the values in al and bl cmp.

03:58.010 --> 03:58.970
Al.

03:59.850 --> 04:01.160
And Bell.

04:09.120 --> 04:19.200
And this is we wrote this because of the comparing the values in L and L, and we will use G here and

04:19.200 --> 04:22.470
we will write equal font.

04:22.830 --> 04:28.500
So this we are jumping the equal font label if they are equal.

04:28.500 --> 04:32.640
But if they are not equal, we will create this new line here.

04:32.670 --> 04:34.470
Not equal.

04:34.500 --> 04:47.430
So here in this case, your code or code here for not equal case and after the case ends, jump done.

04:47.460 --> 04:50.970
So now we are jumping to the done label.

04:50.970 --> 05:02.760
And if the equal is font here, equal font here and here, you will also your code here.

05:03.870 --> 05:06.570
Here for equal.

05:07.340 --> 05:08.150
Case.

05:11.310 --> 05:12.990
Case and after that.

05:13.770 --> 05:14.460
Again.

05:18.950 --> 05:24.050
And after that, you will need to write your exit code here.

05:24.140 --> 05:32.840
So that's it with our jump if equal instruction here and I'm waiting you in next lecture.

05:32.840 --> 05:39.740
So remember that we wrote this code in 32 bit assembly in ACM x86.

05:39.860 --> 05:40.810
32 bit.

05:40.820 --> 05:44.780
So that's why we have two characters instead of three here.

05:44.780 --> 05:50.870
And in next lecture we will also try 64 bit for this testing here.

05:50.870 --> 05:52.370
So I'm waiting you in next lecture.
