WEBVTT

00:00.560 --> 00:05.830
Hello, my name is Typhoon, and in this lecture you will learn about the jump if greater or equal.

00:05.840 --> 00:14.960
So the G instruction is typically used in the context of branching or decision making within a program.

00:14.960 --> 00:21.320
So it enables the program to alter its flow of execution based on a certain condition.

00:21.350 --> 00:26.540
Specifically, when a value is greater than or equal to another value.

00:26.570 --> 00:36.440
So intriguingly, the instruction g ge beckons us with the promise of jump if greater or equal.

00:36.440 --> 00:44.690
So this command boasts an intimate understanding of ex or operation between the sign flank s f and the

00:44.690 --> 00:46.630
overflow flag or f.

00:46.670 --> 00:54.980
So when they're harmonious interplay yields zero a pronounced declaration equals so the result is neither

00:54.980 --> 00:56.630
less or nor equal.

00:56.630 --> 01:06.200
So crafting an elegant narrative GE stands as a testament to our mastery over signed comparisons where

01:06.230 --> 01:09.700
greatness or equality reigns.

01:09.710 --> 01:15.950
So now we will also create another coding example for this here and.

01:16.950 --> 01:17.890
Uh, in here.

01:17.890 --> 01:19.780
We will also create a two value.

01:19.930 --> 01:21.970
So let's get started.

01:21.970 --> 01:31.420
So section, let's, uh, section data here we will create a define it with, with a value of, uh,

01:31.420 --> 01:36.370
30 value one to be 30.

01:36.790 --> 01:42.490
And we will define another, another byte with the value of 30 again.

01:42.520 --> 01:43.570
Value.

01:45.190 --> 01:51.660
To TB 30 and we will create a section text.

01:52.260 --> 01:53.580
And global.

01:54.670 --> 01:55.810
Start here.

01:56.290 --> 01:59.050
So in start we will write this.

02:15.880 --> 02:16.930
One, two, three.

02:17.000 --> 02:17.310
Yes.

02:17.320 --> 02:21.580
So in the start here, we will write.

02:23.900 --> 02:25.730
Liveright start label.

02:25.730 --> 02:31.210
So we will move the value of value one into the Al register again.

02:31.220 --> 02:33.380
So move the Al move.

02:34.920 --> 02:35.510
Al.

02:36.390 --> 02:37.100
Fight.

02:38.390 --> 02:42.130
And value one.

02:42.140 --> 02:47.570
And as well we will move the value of value two into the Belle Register.

02:47.570 --> 02:48.890
So move.

02:49.160 --> 02:50.090
Belle.

02:52.180 --> 02:53.500
The bite again.

02:54.850 --> 02:56.080
Value to.

02:57.010 --> 03:00.530
And we will compare the values in L and l.

03:01.000 --> 03:01.410
P.

03:01.520 --> 03:03.030
L p.

03:03.130 --> 03:07.060
L, and here we will use gauge.

03:07.210 --> 03:09.750
This is a greater or equal label.

03:09.760 --> 03:13.000
So gauge here greater.

03:14.160 --> 03:15.780
Or equal.

03:15.780 --> 03:18.750
And we will develop this label right now here.

03:18.750 --> 03:19.890
So we will.

03:19.890 --> 03:29.800
In this case, we are telling the jump to greater or equal label if L is greater than or equal to b,

03:29.850 --> 03:30.390
L.

03:30.720 --> 03:39.210
So now what we're going to do is we will first, uh, generate the node grid note greater or equal label,

03:39.210 --> 03:41.850
so not greater.

03:42.780 --> 03:45.120
Or equal label.

03:45.120 --> 03:54.480
So your code I will let comment that your code here for not better or equal case and after that we will

03:54.480 --> 04:00.330
jump to down label which we will develop now GNP done.

04:00.510 --> 04:06.720
And also we will need to create the grid greater or equal when the condition met.

04:07.710 --> 04:08.550
So.

04:09.260 --> 04:10.220
Greater.

04:11.030 --> 04:12.350
Or equal.

04:12.620 --> 04:19.700
So here your code here for greater or equal case.

04:22.510 --> 04:23.830
And after that.

04:25.150 --> 04:27.790
We've all done here.

04:29.310 --> 04:29.880
Uh, this, uh.

04:29.880 --> 04:31.590
This is your exit code.

04:33.300 --> 04:33.870
Here.

04:33.870 --> 04:38.550
And also we will move racks 60.

04:38.580 --> 04:40.920
This is for fiscal number for exit.

04:42.660 --> 04:46.190
Here and xor I.

04:47.980 --> 04:48.140
The.

04:49.330 --> 04:50.940
This is the exit status.

04:50.950 --> 04:51.430
Zero.

04:51.430 --> 04:53.950
And after that, we will just call Cisco.

04:54.800 --> 05:01.880
So now I will also explain this code from beginning and in data section, we created two values.

05:02.210 --> 05:05.900
We defined the two values, the value one and value two.

05:05.990 --> 05:14.270
The both value one and value two are defined as bytes with the value of 30 and in text section here,

05:14.270 --> 05:17.780
this text section contains the main code of the program.

05:17.780 --> 05:21.620
As you know, the Start label is the entry point of the program.

05:21.620 --> 05:30.860
And here we are, we have the loading labels in the first move instruction we have here move a byte

05:30.860 --> 05:37.550
value one instruction loads the value of value one into a register.

05:37.550 --> 05:47.300
It specifies that a single byte is being loaded and similarly move B byte value two loads the value

05:47.300 --> 05:50.450
of value two into the Belle Register as well.

05:50.450 --> 05:54.780
And it also specifies that a single byte is being loaded.

05:54.780 --> 06:02.340
And in comparison, the CMP instruction compares the values in the A, L and b L register.

06:02.370 --> 06:11.610
This comparison sets various flags, including zero flag Z, F and the sign flag F, and here we have

06:11.610 --> 06:16.620
conditional jump G instruction.

06:16.620 --> 06:20.130
This instruction checks the result of the comparison.

06:20.130 --> 06:28.650
So if the sign flag is F is not set, the which is a L is greater than or equal to b, l, it jumps

06:28.650 --> 06:31.200
to greater or equal label.

06:31.200 --> 06:37.290
Otherwise it falls through to the not greater or equal label.

06:37.290 --> 06:39.150
And we have two labels here.

06:39.180 --> 06:47.760
The greater or equal label is where you can write the code that executes when value one is greater than

06:47.760 --> 06:57.660
or equal to value two and the not greater or equal here label is for writing code that executes when

06:57.660 --> 06:58.980
value one.

07:00.000 --> 07:02.970
Is not greater than or equal to value.

07:02.970 --> 07:03.360
Two.

07:03.360 --> 07:06.900
And also we have this exit code here.

07:08.190 --> 07:15.660
As you can see here in done so this program flow reaches the down label after executing the relevant

07:15.660 --> 07:18.210
code based on the comparison.

07:18.240 --> 07:28.350
The exit code is similar to previous examples using the move or racks 60 instruction for the exit syscall

07:28.350 --> 07:29.850
here and that's it.

07:29.850 --> 07:35.550
So this code demonstrates another example of using conditional branching to handle different scenarios

07:35.550 --> 07:37.590
based on the comparison result.

07:37.590 --> 07:39.660
So I'm waiting you in next lecture.
