1 00:00:00,560 --> 00:00:05,830 Hello, my name is Typhoon, and in this lecture you will learn about the jump if greater or equal. 2 00:00:05,840 --> 00:00:14,960 So the G instruction is typically used in the context of branching or decision making within a program. 3 00:00:14,960 --> 00:00:21,320 So it enables the program to alter its flow of execution based on a certain condition. 4 00:00:21,350 --> 00:00:26,540 Specifically, when a value is greater than or equal to another value. 5 00:00:26,570 --> 00:00:36,440 So intriguingly, the instruction g ge beckons us with the promise of jump if greater or equal. 6 00:00:36,440 --> 00:00:44,690 So this command boasts an intimate understanding of ex or operation between the sign flank s f and the 7 00:00:44,690 --> 00:00:46,630 overflow flag or f. 8 00:00:46,670 --> 00:00:54,980 So when they're harmonious interplay yields zero a pronounced declaration equals so the result is neither 9 00:00:54,980 --> 00:00:56,630 less or nor equal. 10 00:00:56,630 --> 00:01:06,200 So crafting an elegant narrative GE stands as a testament to our mastery over signed comparisons where 11 00:01:06,230 --> 00:01:09,700 greatness or equality reigns. 12 00:01:09,710 --> 00:01:15,950 So now we will also create another coding example for this here and. 13 00:01:16,940 --> 00:01:17,890 Uh, in here. 14 00:01:17,890 --> 00:01:19,780 We will also create a two value. 15 00:01:19,930 --> 00:01:21,970 So let's get started. 16 00:01:21,970 --> 00:01:31,410 So section, let's, uh, section data here we will create a define it with, with a value of, uh, 17 00:01:31,420 --> 00:01:36,370 30 value one to be 30. 18 00:01:36,790 --> 00:01:42,490 And we will define another, another byte with the value of 30 again. 19 00:01:42,520 --> 00:01:43,570 Value. 20 00:01:45,190 --> 00:01:51,660 To TB 30 and we will create a section text. 21 00:01:52,260 --> 00:01:53,580 And global. 22 00:01:54,670 --> 00:01:55,810 Start here. 23 00:01:56,290 --> 00:01:59,050 So in start we will write this. 24 00:02:15,880 --> 00:02:16,930 One, two, three. 25 00:02:17,000 --> 00:02:17,310 Yes. 26 00:02:17,320 --> 00:02:21,580 So in the start here, we will write. 27 00:02:23,900 --> 00:02:25,730 Liveright start label. 28 00:02:25,730 --> 00:02:31,210 So we will move the value of value one into the Al register again. 29 00:02:31,220 --> 00:02:33,380 So move the Al move. 30 00:02:34,920 --> 00:02:35,510 Al. 31 00:02:36,390 --> 00:02:37,100 Fight. 32 00:02:38,390 --> 00:02:42,130 And value one. 33 00:02:42,140 --> 00:02:47,570 And as well we will move the value of value two into the Belle Register. 34 00:02:47,570 --> 00:02:48,890 So move. 35 00:02:49,160 --> 00:02:50,090 Belle. 36 00:02:52,180 --> 00:02:53,500 The bite again. 37 00:02:54,850 --> 00:02:56,080 Value to. 38 00:02:57,010 --> 00:03:00,470 And we will compare the values in L and l. 39 00:03:01,000 --> 00:03:01,400 P. 40 00:03:01,520 --> 00:03:03,040 L p. 41 00:03:03,130 --> 00:03:07,060 L, and here we will use gauge. 42 00:03:07,210 --> 00:03:09,750 This is a greater or equal label. 43 00:03:09,760 --> 00:03:13,000 So gauge here greater. 44 00:03:14,160 --> 00:03:15,780 Or equal. 45 00:03:15,780 --> 00:03:18,750 And we will develop this label right now here. 46 00:03:18,750 --> 00:03:19,890 So we will. 47 00:03:19,890 --> 00: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, 48 00:03:29,850 --> 00:03:30,390 L. 49 00:03:30,720 --> 00: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, 50 00:03:39,210 --> 00:03:41,850 so not greater. 51 00:03:42,780 --> 00:03:45,120 Or equal label. 52 00:03:45,120 --> 00: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 53 00:03:54,480 --> 00:04:00,330 jump to down label which we will develop now GNP done. 54 00:04:00,510 --> 00:04:06,720 And also we will need to create the grid greater or equal when the condition met. 55 00:04:07,710 --> 00:04:08,550 So. 56 00:04:09,260 --> 00:04:10,220 Greater. 57 00:04:11,030 --> 00:04:12,350 Or equal. 58 00:04:12,620 --> 00:04:19,700 So here your code here for greater or equal case. 59 00:04:22,510 --> 00:04:23,830 And after that. 60 00:04:25,150 --> 00:04:27,790 We've all done here. 61 00:04:29,310 --> 00:04:29,880 Uh, this, uh. 62 00:04:29,880 --> 00:04:31,590 This is your exit code. 63 00:04:33,300 --> 00:04:33,870 Here. 64 00:04:33,870 --> 00:04:38,550 And also we will move racks 60. 65 00:04:38,580 --> 00:04:40,920 This is for fiscal number for exit. 66 00:04:42,660 --> 00:04:46,190 Here and xor I. 67 00:04:47,980 --> 00:04:48,140 The. 68 00:04:49,330 --> 00:04:50,940 This is the exit status. 69 00:04:50,950 --> 00:04:51,430 Zero. 70 00:04:51,430 --> 00:04:53,950 And after that, we will just call Cisco. 71 00:04:54,800 --> 00:05:01,880 So now I will also explain this code from beginning and in data section, we created two values. 72 00:05:02,210 --> 00:05:05,900 We defined the two values, the value one and value two. 73 00:05:05,990 --> 00:05:14,270 The both value one and value two are defined as bytes with the value of 30 and in text section here, 74 00:05:14,270 --> 00:05:17,780 this text section contains the main code of the program. 75 00:05:17,780 --> 00:05:21,620 As you know, the Start label is the entry point of the program. 76 00:05:21,620 --> 00:05:30,860 And here we are, we have the loading labels in the first move instruction we have here move a byte 77 00:05:30,860 --> 00:05:37,550 value one instruction loads the value of value one into a register. 78 00:05:37,550 --> 00:05:47,300 It specifies that a single byte is being loaded and similarly move B byte value two loads the value 79 00:05:47,300 --> 00:05:50,450 of value two into the Belle Register as well. 80 00:05:50,450 --> 00:05:54,780 And it also specifies that a single byte is being loaded. 81 00:05:54,780 --> 00:06:02,340 And in comparison, the CMP instruction compares the values in the A, L and b L register. 82 00:06:02,370 --> 00:06:11,610 This comparison sets various flags, including zero flag Z, F and the sign flag F, and here we have 83 00:06:11,610 --> 00:06:16,620 conditional jump G instruction. 84 00:06:16,620 --> 00:06:20,130 This instruction checks the result of the comparison. 85 00:06:20,130 --> 00: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 86 00:06:28,650 --> 00:06:31,200 to greater or equal label. 87 00:06:31,200 --> 00:06:37,290 Otherwise it falls through to the not greater or equal label. 88 00:06:37,290 --> 00:06:39,150 And we have two labels here. 89 00:06:39,180 --> 00:06:47,760 The greater or equal label is where you can write the code that executes when value one is greater than 90 00:06:47,760 --> 00:06:57,660 or equal to value two and the not greater or equal here label is for writing code that executes when 91 00:06:57,660 --> 00:06:58,980 value one. 92 00:07:00,000 --> 00:07:02,970 Is not greater than or equal to value. 93 00:07:02,970 --> 00:07:03,360 Two. 94 00:07:03,360 --> 00:07:06,900 And also we have this exit code here. 95 00:07:08,190 --> 00:07:15,660 As you can see here in done so this program flow reaches the down label after executing the relevant 96 00:07:15,660 --> 00:07:18,210 code based on the comparison. 97 00:07:18,240 --> 00:07:28,350 The exit code is similar to previous examples using the move or racks 60 instruction for the exit syscall 98 00:07:28,350 --> 00:07:29,850 here and that's it. 99 00:07:29,850 --> 00:07:35,550 So this code demonstrates another example of using conditional branching to handle different scenarios 100 00:07:35,550 --> 00:07:37,590 based on the comparison result. 101 00:07:37,590 --> 00:07:39,660 So I'm waiting you in next lecture.