WEBVTT

00:00.440 --> 00:07.010
Hello, my name is Stephane, and in this lecture you will learn about the jumping bow or equal instruction

00:07.190 --> 00:09.200
in assembly language programming.

00:09.200 --> 00:17.750
The GE instruction representing jump jumping a bow or equal controls program execution based on a specific

00:17.750 --> 00:19.240
comparison condition.

00:19.250 --> 00:22.970
It is often used for unsigned integer comparisons.

00:23.150 --> 00:31.640
So the GE Instruction directs a program to jump if one value is either greater than or equal to another

00:31.640 --> 00:32.350
value.

00:32.360 --> 00:36.980
So here is a breakdown of this places.

00:37.610 --> 00:40.820
So the first is comparison here.

00:40.820 --> 00:47.240
Compare two values which can be from registers, memory or immediate values.

00:47.660 --> 00:49.730
The second is condition check.

00:49.760 --> 00:58.340
If the first value is greater than or equal to the to the second, the jump occurs and the third is

00:58.340 --> 01:01.130
jump or sequential execution.

01:01.130 --> 01:05.810
If the condition is met, the program jumps to a specified location.

01:05.810 --> 01:08.690
Otherwise it continues sequentially.

01:09.020 --> 01:12.410
Now let's actually create some basic example here.

01:12.440 --> 01:13.720
CMP c.

01:13.730 --> 01:14.440
X.

01:14.600 --> 01:14.840
D.

01:14.870 --> 01:15.530
X.

01:16.280 --> 01:16.970
And.

01:17.650 --> 01:18.010
J.

01:18.010 --> 01:18.660
A e.

01:19.890 --> 01:20.430
A ball.

01:22.890 --> 01:23.040
Yea.

01:23.150 --> 01:27.600
A e above or equal here.

01:27.870 --> 01:36.270
So here we are comparing values in registers C and D and G, above or equal.

01:36.270 --> 01:45.330
Here we are jumping If C is greater than or equal to D in this example, if the value in register C

01:45.510 --> 01:54.390
is greater than or equal to the value in register, a jump to above or equal label occurs.

01:54.390 --> 02:04.590
So a jump above or equal along with other conditional jumps like b jump if below j a jump if equal forms

02:04.590 --> 02:07.440
the cornerstone of control flow.

02:07.440 --> 02:13.800
So these instructions enable programmers to create sophisticated algorithms and logical structures at

02:13.800 --> 02:16.140
a low level of abstraction.

02:16.850 --> 02:18.390
Crucial for efficiency.

02:18.410 --> 02:20.180
Assembly language programming.

02:21.410 --> 02:27.140
And here we will, as we always do, we will create another example here.

02:27.560 --> 02:32.330
And here we will start from the data section, as always.

02:32.510 --> 02:38.060
So section data, we will define allocate memory for value one.

02:39.080 --> 02:39.530
Value.

02:39.530 --> 02:41.990
One DBM 25.

02:42.990 --> 02:48.150
25 and value to be be 25 again.

02:48.180 --> 02:55.170
So here we are allocating memory for value one and initializing it with 25 and here we are allocating

02:55.170 --> 03:01.260
memory for value two and initializing it with 25 as well.

03:01.260 --> 03:04.070
And here we will create our section.

03:04.690 --> 03:05.050
Section.

03:06.010 --> 03:06.610
Shen.

03:08.840 --> 03:11.600
Text and global.

03:11.600 --> 03:12.590
Global.

03:13.300 --> 03:14.350
Start again.

03:14.350 --> 03:18.220
And in this start, we will move.

03:20.050 --> 03:25.480
L which is value one and move l.

03:31.950 --> 03:33.030
Value two.

03:33.180 --> 03:34.530
And here we are.

03:34.650 --> 03:37.650
Load the value stored at the memory address.

03:37.650 --> 03:41.340
Value one into Al.

03:41.340 --> 03:43.200
And here we are doing the same.

03:43.320 --> 03:49.230
Load the value stored at memory address value two into Bel and CMP.

03:50.280 --> 03:50.940
CMP.

03:51.750 --> 03:52.500
Al.

03:52.980 --> 03:53.430
Al.

03:53.460 --> 03:55.410
Here we are comparing.

03:57.080 --> 04:07.320
We are comparing the values in Al and BL and here we are going to use the jump if above and or equal

04:07.320 --> 04:11.820
jump if above or equal to a e here.

04:11.850 --> 04:12.900
Above.

04:13.020 --> 04:14.610
Above or.

04:15.370 --> 04:15.880
Equal.

04:15.880 --> 04:17.770
We named this label like this.

04:17.920 --> 04:18.820
But you can do.

04:20.150 --> 04:20.750
Another.

04:20.900 --> 04:23.360
You can use another word for this label.

04:25.120 --> 04:27.880
You can actually use almost any.

04:28.750 --> 04:32.350
Label for any name for the labels in assembler programming.

04:32.500 --> 04:37.270
And here we are jump to above or equal label.

04:37.270 --> 04:42.460
If Al is above or equal to b L here.

04:43.270 --> 04:49.390
In this case, P is value two and L is value one.

04:50.800 --> 04:57.160
And here we will firstly create our false condition, not above or equal.

04:57.190 --> 05:00.880
Not above or equal.

05:00.880 --> 05:04.600
And your code will be here.

05:04.800 --> 05:05.180
Sorry.

05:05.230 --> 05:08.550
Also we need to this double dots for the start as well.

05:08.560 --> 05:10.870
So your code.

05:11.530 --> 05:13.090
Your code here.

05:13.090 --> 05:16.960
Your code here for the scenario.

05:17.380 --> 05:28.960
When value one is when value one is not above or equal to value two And here we will again use the jump

05:28.990 --> 05:31.540
down to jump to.

05:32.210 --> 05:40.850
Done to finally jump to the done label to finalize this section and as well we will create above.

05:42.440 --> 05:45.740
Or equal here?

05:45.770 --> 05:48.500
GNP down here.

05:49.500 --> 05:50.000
Uh, ops.

05:50.010 --> 05:51.560
Actually, we don't need that for now.

05:51.570 --> 05:52.220
This is just an.

05:53.860 --> 05:59.410
The LatAm project and your code here for your code.

05:59.770 --> 06:05.920
Your code here for the scenario when value.

06:05.950 --> 06:12.220
Value one is above or equal to value two.

06:12.790 --> 06:19.990
And after that we will also we will create a done label here and exit code here.

06:20.170 --> 06:31.240
And in this educational journey, we are poised to dive into the provided disassembly code, deciphering

06:31.240 --> 06:38.980
its intricacies while fostering a deep understanding of conditional branching and comparisons of j.

06:39.010 --> 06:39.640
A e.

06:40.630 --> 06:48.310
So here our journey ignites with the declaration of this data section where memory is allocated to house.

06:48.310 --> 06:51.280
The variables value one and value two.

06:51.280 --> 06:54.160
Both variables are initialized with the value.

06:54.170 --> 07:01.640
25 Laying the groundwork for forthcoming comparisons here and transitioning to the text section.

07:01.640 --> 07:05.120
As always, our focal point of executable instructions.

07:05.120 --> 07:14.660
The Start label stands as our entry point again the always so the voyage commences with the move instructions

07:14.930 --> 07:23.570
facilitating the transfer of the value stored at memory address pointed to by value one into the a register.

07:23.570 --> 07:29.480
In similar vein, the subsequent Move instruction orchestrates the loading of the value at the memory

07:29.480 --> 07:35.660
location indicated by value two into b l register.

07:35.690 --> 07:44.030
The subsequent CMP instruction undertakes a meticulous comparison between the values in Al and b l.

07:44.950 --> 07:50.000
And here our journey's direction pivots based on the outcome of this comparison.

07:50.020 --> 08:00.930
If it is determined that the value in Al is above or equal to the value in PL, the j a e a jump if

08:00.970 --> 08:07.810
above or equal instruction steers us towards the above or equal label.

08:07.810 --> 08:09.730
So our code here will execute.

08:09.880 --> 08:16.570
And conversely, in instances where the comparison results oppose the notion of value one being above

08:16.570 --> 08:23.130
or equal to value, two we navigate to the note above or equal realm.

08:23.140 --> 08:27.220
So here your creative coding solutions come into play.

08:27.250 --> 08:36.670
Addressing scenarios where value one is not above or equal to value two and the down label here becomes

08:36.670 --> 08:39.550
marking the closure of this segment.

08:40.150 --> 08:46.850
On the flip side above, our equal label offers a distinctive platform enabling your code to unfold

08:46.850 --> 08:52.580
in a manner suited for scenarios where value one is indeed above or equal to value.

08:52.580 --> 08:53.000
Two.

08:53.960 --> 08:55.340
And that's it.

08:55.490 --> 09:02.690
Our educational odyssey reaches its zenith at the dawn label, encapsulating the conclusion of this

09:02.690 --> 09:03.620
program's logic.

09:03.620 --> 09:10.490
This is the optimal space for including instructions for program termination or any necessary cleanup.
