WEBVTT

00:00.410 --> 00:01.970
Assembly language instruction.

00:01.970 --> 00:04.520
JB signifying jump.

00:04.550 --> 00:10.730
If below is a vital tool for controlling program flow based on a specific comparison condition.

00:11.380 --> 00:16.120
It is commonly employed for signed and unsigned integer comparisons.

00:17.870 --> 00:25.850
The JB instruction dictates program execution by prompting a jump if one value is less than another

00:25.850 --> 00:26.600
value.

00:26.630 --> 00:31.570
So here's a brief rundown of this comparisons here.

00:31.580 --> 00:34.040
At first we are comparison process.

00:34.160 --> 00:40.310
So we are comparing two values which can be sourced from registers, memory or immediate values.

00:41.500 --> 00:41.720
Condition.

00:41.940 --> 00:45.480
Check if the first value is less than the second.

00:45.510 --> 00:47.340
The jump takes place.

00:48.450 --> 00:50.430
Jump or sequential execution.

00:50.430 --> 00:58.110
If the condition holds true, the program jumps to a designated location or label, and if not, it

00:58.110 --> 00:59.940
continues executing.

01:02.160 --> 01:06.390
And now what we're going to do is we will just see a basic example here.

01:06.390 --> 01:06.780
So.

01:06.780 --> 01:07.350
CMP.

01:08.770 --> 01:09.490
A x.

01:09.520 --> 01:09.880
B.

01:09.880 --> 01:10.540
X.

01:11.780 --> 01:14.660
And JB below.

01:16.000 --> 01:16.480
Below.

01:17.350 --> 01:20.530
And here, as you can see, here we are.

01:21.220 --> 01:24.670
Compare the values in registers A x and b x.

01:25.790 --> 01:27.980
And here jump.

01:27.980 --> 01:30.500
We are telling the assembly to jump.

01:30.500 --> 01:34.430
If a x is less than b x.

01:34.430 --> 01:43.250
And in this example, a jump to below label occurs if the value in register a x is less than the value

01:43.280 --> 01:53.330
in register b, x and JB Blanc alongside other conditional jumps like a jump off, a jump above or equal

01:53.370 --> 02:01.850
g jump if equal constitutes the fundamental basis of control flow, these instructions empower programmers

02:01.850 --> 02:08.690
to devise intricate algorithms and logical constructions at a low level of abstraction and essential

02:08.690 --> 02:11.390
for effective assembly language programming.

02:11.420 --> 02:13.490
As I tell you always.

02:13.490 --> 02:15.860
And now we always do.

02:17.120 --> 02:21.860
Um, here we will create another sample application here.

02:21.860 --> 02:30.050
And this is so after this lecture, there's just one more lecture that we will discuss the JB jump if

02:30.050 --> 02:31.940
lesser or equal in next lecture.

02:32.210 --> 02:38.630
And after that we are done with this, uh, logical conditions here and in next lectures.

02:38.630 --> 02:44.540
In the next section, we will use that knowledge and create a big assembly program here.

02:45.610 --> 02:47.680
So here we will create a section.

02:48.190 --> 02:51.700
Uh, data value one.

02:52.120 --> 02:53.230
Value.

02:53.260 --> 02:55.630
Value one DB.

02:58.430 --> 02:59.240
15.

03:01.380 --> 03:04.740
And value to DB.

03:07.050 --> 03:14.700
Uh, value to DB 20 and here we will create a section text.

03:15.060 --> 03:19.380
Also, we will create a global global start.

03:19.560 --> 03:22.860
And here in this start we will start.

03:24.160 --> 03:26.310
They will move all.

03:30.790 --> 03:32.470
Well, you won, so.

03:33.800 --> 03:36.440
Value one and move.

03:37.570 --> 03:38.210
L.

03:40.850 --> 03:41.900
Value to.

03:42.780 --> 03:48.570
And here we are allocating memory for value one and initializing it with 15.

03:48.570 --> 03:57.420
And in the third line we are allocating memory for value two and initializing it with 20.

03:57.630 --> 04:05.610
And here we are loading the value stored at memory address value one into the Al register and we are

04:05.610 --> 04:06.510
doing the same here.

04:06.510 --> 04:12.900
We are loading the value stored in memory address value two into the Belle Register and here we will

04:12.900 --> 04:18.060
compare the value in Al and Belle CMP Al.

04:18.990 --> 04:27.960
An P, a L and P, l, and after that we will use this j P and.

04:28.810 --> 04:29.350
Hello.

04:29.590 --> 04:32.560
So if Al is below.

04:33.590 --> 04:34.950
Uh, Bell.

04:35.420 --> 04:39.470
Here we are jumping, uh, to Yellow label.

04:42.050 --> 04:46.910
And so we are using GB here, which means jump if below.

04:48.000 --> 04:51.720
And here we will create a node below label.

04:52.860 --> 05:00.960
And here you will create this your coding expertise takes.

05:01.720 --> 05:04.720
X spotlight here.

05:04.720 --> 05:11.650
And this here you are addressing scenarios where value one is not below value two.

05:11.680 --> 05:12.220
Right.

05:15.090 --> 05:16.890
So let's make it in parenthesis.

05:17.070 --> 05:20.190
Value one is not below.

05:20.220 --> 05:21.480
Value two.

05:21.480 --> 05:23.400
And we will create another label.

05:23.400 --> 05:26.940
But before this we will call this non label.

05:26.940 --> 05:30.270
So GNP done.

05:30.270 --> 05:37.950
So here we are executing jump to the done label, marking the completion of this section and here we

05:37.950 --> 05:40.830
will also create this below label.

05:41.040 --> 05:42.150
This is for.

05:43.020 --> 05:43.430
Uh.

05:45.310 --> 05:45.800
We are.

05:45.820 --> 05:46.960
This is for the.

05:48.010 --> 05:56.840
A chord here for cases where value one is indeed below value two.

05:56.860 --> 05:57.670
So.

06:00.610 --> 06:01.570
According.

06:03.390 --> 06:04.170
Holding.

06:05.230 --> 06:05.560
Or.

06:08.950 --> 06:13.870
Court cases where value of one is below.

06:17.280 --> 06:20.410
Value one is below.

06:20.430 --> 06:21.870
Value two.

06:22.950 --> 06:25.800
And after that we will also create our own label.

06:28.270 --> 06:28.660
Lon.

06:32.590 --> 06:37.990
Um, and this is our gateway for exit related instructions.

06:41.180 --> 06:42.230
Related court.

06:43.760 --> 06:46.760
And here we will, as we always do.

06:46.760 --> 06:47.450
We will.

06:48.190 --> 06:50.260
Analyze it from beginning.

06:51.490 --> 06:57.040
And in this data section at the second line here, as you can see.

06:58.390 --> 07:02.740
A memory location is designated for value one.

07:03.970 --> 07:06.870
Initialized with 15.

07:07.110 --> 07:10.440
And here, similarly, memory is allocated for value.

07:10.440 --> 07:13.620
Two is initialized with 20.

07:14.100 --> 07:20.730
And here our exploration begins with the Move instruction which transfers the value stored at the memory

07:20.730 --> 07:26.190
address value of one into the Al register and Parallelly.

07:26.190 --> 07:30.300
The Move instruction performs the same action for value two.

07:30.810 --> 07:40.800
Um, where uh, moving its contents into the register and this is a pivotal juncture arrives as the

07:40.800 --> 07:49.770
CMP instruction engages in a meticulous comparison between the contents of Al and b l, and here this

07:49.770 --> 07:53.730
is a direction of our journey hinges on the outcome.

07:53.730 --> 08:05.110
So if Al is determined to be below b l the JB jump if below instruction propels us to the below label.

08:05.890 --> 08:15.150
And here in note below within this space here, your technical technical expertise takes center stage.

08:15.160 --> 08:24.190
Um, paving the way for inventive solution tailored to scenarios where value one is not below value

08:24.190 --> 08:24.850
to.

08:25.690 --> 08:28.780
And in this here we are leap to the.

08:29.930 --> 08:35.630
Now this is a leap to down label signals, the culmination of this segment.

08:35.780 --> 08:44.510
And here below here you are coding, uh, finds expression shaping code specifically catered to scenarios

08:44.510 --> 08:52.040
where value one is indeed below value two and this is the final stages of our journey unfolded at the

08:52.040 --> 08:53.030
down label.

08:53.510 --> 09:00.110
Uh, so your canvas for exit related instructions that conclude this program's execution here.

09:00.110 --> 09:04.670
And as we traverse this assembly code, we plunge deeper into the realm of conditional branching and

09:04.670 --> 09:12.080
comparisons, uncovering the nuances of scenarios where value one is below, value two and armed with

09:12.080 --> 09:18.680
the sound of understanding of this integrate mechanisms, you are well equipped to navigate the complexities

09:18.680 --> 09:21.380
of assembly programming with confidence.

09:21.380 --> 09:29.450
So your ongoing pursuit of assembly, uh, programming knowledge will undoubtedly prove to be both enlightening

09:29.550 --> 09:30.990
and transformative.

09:31.110 --> 09:37.560
Continuing to explore the applications of assembly programming with enthusiasm and determination and

09:37.560 --> 09:38.490
happy learning.

09:38.490 --> 09:39.870
And in next lecture.

09:40.320 --> 09:44.340
In next lecture, it will be our last lecture about this.

09:44.340 --> 09:45.150
So.

09:45.960 --> 09:47.700
And I'm waiting you in next lecture.
