1 00:00:00,440 --> 00:00:07,010 Hello, my name is Stephane, and in this lecture you will learn about the jumping bow or equal instruction 2 00:00:07,190 --> 00:00:09,200 in assembly language programming. 3 00:00:09,200 --> 00:00:17,750 The GE instruction representing jump jumping a bow or equal controls program execution based on a specific 4 00:00:17,750 --> 00:00:19,240 comparison condition. 5 00:00:19,250 --> 00:00:22,970 It is often used for unsigned integer comparisons. 6 00:00:23,150 --> 00:00:31,640 So the GE Instruction directs a program to jump if one value is either greater than or equal to another 7 00:00:31,640 --> 00:00:32,350 value. 8 00:00:32,360 --> 00:00:36,980 So here is a breakdown of this places. 9 00:00:37,610 --> 00:00:40,820 So the first is comparison here. 10 00:00:40,820 --> 00:00:47,240 Compare two values which can be from registers, memory or immediate values. 11 00:00:47,660 --> 00:00:49,730 The second is condition check. 12 00:00:49,760 --> 00:00:58,340 If the first value is greater than or equal to the to the second, the jump occurs and the third is 13 00:00:58,340 --> 00:01:01,130 jump or sequential execution. 14 00:01:01,130 --> 00:01:05,810 If the condition is met, the program jumps to a specified location. 15 00:01:05,810 --> 00:01:08,690 Otherwise it continues sequentially. 16 00:01:09,020 --> 00:01:12,410 Now let's actually create some basic example here. 17 00:01:12,440 --> 00:01:13,720 CMP c. 18 00:01:13,730 --> 00:01:14,440 X. 19 00:01:14,600 --> 00:01:14,840 D. 20 00:01:14,870 --> 00:01:15,530 X. 21 00:01:16,280 --> 00:01:16,970 And. 22 00:01:17,650 --> 00:01:18,010 J. 23 00:01:18,010 --> 00:01:18,640 A e. 24 00:01:19,890 --> 00:01:20,430 A ball. 25 00:01:22,890 --> 00:01:23,040 Yea. 26 00:01:23,150 --> 00:01:27,600 A e above or equal here. 27 00:01:27,870 --> 00:01:36,270 So here we are comparing values in registers C and D and G, above or equal. 28 00:01:36,270 --> 00: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 29 00:01:45,510 --> 00:01:54,390 is greater than or equal to the value in register, a jump to above or equal label occurs. 30 00:01:54,390 --> 00: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 31 00:02:04,590 --> 00:02:07,440 the cornerstone of control flow. 32 00:02:07,440 --> 00:02:13,800 So these instructions enable programmers to create sophisticated algorithms and logical structures at 33 00:02:13,800 --> 00:02:16,140 a low level of abstraction. 34 00:02:16,850 --> 00:02:18,390 Crucial for efficiency. 35 00:02:18,410 --> 00:02:20,180 Assembly language programming. 36 00:02:21,410 --> 00:02:27,140 And here we will, as we always do, we will create another example here. 37 00:02:27,560 --> 00:02:32,330 And here we will start from the data section, as always. 38 00:02:32,510 --> 00:02:38,060 So section data, we will define allocate memory for value one. 39 00:02:39,080 --> 00:02:39,530 Value. 40 00:02:39,530 --> 00:02:41,990 One DBM 25. 41 00:02:42,990 --> 00:02:48,120 25 and value to be be 25 again. 42 00:02:48,180 --> 00:02:55,170 So here we are allocating memory for value one and initializing it with 25 and here we are allocating 43 00:02:55,170 --> 00:03:01,260 memory for value two and initializing it with 25 as well. 44 00:03:01,260 --> 00:03:04,080 And here we will create our section. 45 00:03:04,710 --> 00:03:05,190 Section. 46 00:03:06,010 --> 00:03:06,610 Shen. 47 00:03:08,840 --> 00:03:11,600 Text and global. 48 00:03:11,600 --> 00:03:12,590 Global. 49 00:03:13,300 --> 00:03:14,350 Start again. 50 00:03:14,350 --> 00:03:18,220 And in this start, we will move. 51 00:03:20,050 --> 00:03:25,440 L which is value one and move l. 52 00:03:31,950 --> 00:03:33,030 Value two. 53 00:03:33,180 --> 00:03:34,530 And here we are. 54 00:03:34,650 --> 00:03:37,650 Load the value stored at the memory address. 55 00:03:37,650 --> 00:03:41,330 Value one into Al. 56 00:03:41,340 --> 00:03:43,190 And here we are doing the same. 57 00:03:43,320 --> 00:03:49,230 Load the value stored at memory address value two into Bel and CMP. 58 00:03:50,280 --> 00:03:50,940 CMP. 59 00:03:51,750 --> 00:03:52,410 Al. 60 00:03:52,480 --> 00:03:52,950 Al. 61 00:03:53,460 --> 00:03:55,410 Here we are comparing. 62 00:03:57,080 --> 00: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 63 00:04:07,320 --> 00:04:11,820 jump if above or equal to a e here. 64 00:04:11,850 --> 00:04:12,900 Above. 65 00:04:13,020 --> 00:04:14,610 Above or. 66 00:04:15,370 --> 00:04:15,880 Equal. 67 00:04:15,880 --> 00:04:17,770 We named this label like this. 68 00:04:17,920 --> 00:04:18,820 But you can do. 69 00:04:20,150 --> 00:04:20,750 Another. 70 00:04:20,900 --> 00:04:23,360 You can use another word for this label. 71 00:04:25,120 --> 00:04:27,880 You can actually use almost any. 72 00:04:28,750 --> 00:04:32,350 Label for any name for the labels in assembler programming. 73 00:04:32,500 --> 00:04:37,270 And here we are jump to above or equal label. 74 00:04:37,270 --> 00:04:42,460 If Al is above or equal to b L here. 75 00:04:43,270 --> 00:04:49,390 In this case, P is value two and L is value one. 76 00:04:50,800 --> 00:04:57,160 And here we will firstly create our false condition, not above or equal. 77 00:04:57,190 --> 00:05:00,880 Not above or equal. 78 00:05:00,880 --> 00:05:04,600 And your code will be here. 79 00:05:04,800 --> 00:05:05,180 Sorry. 80 00:05:05,230 --> 00:05:08,550 Also we need to this double dots for the start as well. 81 00:05:08,560 --> 00:05:10,870 So your code. 82 00:05:11,530 --> 00:05:13,090 Your code here. 83 00:05:13,090 --> 00:05:16,960 Your code here for the scenario. 84 00:05:17,380 --> 00:05:28,950 When value one is when value one is not above or equal to value two And here we will again use the jump 85 00:05:28,990 --> 00:05:31,540 down to jump to. 86 00:05:32,210 --> 00:05:40,850 Done to finally jump to the done label to finalize this section and as well we will create above. 87 00:05:42,440 --> 00:05:45,740 Or equal here? 88 00:05:45,770 --> 00:05:48,500 GNP down here. 89 00:05:49,500 --> 00:05:50,000 Uh, ops. 90 00:05:50,010 --> 00:05:51,560 Actually, we don't need that for now. 91 00:05:51,570 --> 00:05:52,230 This is just an. 92 00:05:53,860 --> 00:05:59,410 The LatAm project and your code here for your code. 93 00:05:59,770 --> 00:06:05,920 Your code here for the scenario when value. 94 00:06:05,950 --> 00:06:12,220 Value one is above or equal to value two. 95 00:06:12,790 --> 00:06:19,990 And after that we will also we will create a done label here and exit code here. 96 00:06:20,170 --> 00:06:31,240 And in this educational journey, we are poised to dive into the provided disassembly code, deciphering 97 00:06:31,240 --> 00:06:38,980 its intricacies while fostering a deep understanding of conditional branching and comparisons of j. 98 00:06:39,010 --> 00:06:39,640 A e. 99 00:06:40,630 --> 00:06:48,310 So here our journey ignites with the declaration of this data section where memory is allocated to house. 100 00:06:48,310 --> 00:06:51,280 The variables value one and value two. 101 00:06:51,280 --> 00:06:54,160 Both variables are initialized with the value. 102 00:06:54,170 --> 00:07:01,640 25 Laying the groundwork for forthcoming comparisons here and transitioning to the text section. 103 00:07:01,640 --> 00:07:05,120 As always, our focal point of executable instructions. 104 00:07:05,120 --> 00:07:14,660 The Start label stands as our entry point again the always so the voyage commences with the move instructions 105 00:07:14,930 --> 00:07:23,570 facilitating the transfer of the value stored at memory address pointed to by value one into the a register. 106 00:07:23,570 --> 00:07:29,480 In similar vein, the subsequent Move instruction orchestrates the loading of the value at the memory 107 00:07:29,480 --> 00:07:35,660 location indicated by value two into b l register. 108 00:07:35,690 --> 00:07:44,030 The subsequent CMP instruction undertakes a meticulous comparison between the values in Al and b l. 109 00:07:44,950 --> 00:07:50,000 And here our journey's direction pivots based on the outcome of this comparison. 110 00:07:50,020 --> 00:08:00,970 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 111 00:08:00,970 --> 00:08:07,810 above or equal instruction steers us towards the above or equal label. 112 00:08:07,810 --> 00:08:09,730 So our code here will execute. 113 00:08:09,880 --> 00:08:16,570 And conversely, in instances where the comparison results oppose the notion of value one being above 114 00:08:16,570 --> 00:08:23,130 or equal to value, two we navigate to the note above or equal realm. 115 00:08:23,140 --> 00:08:27,220 So here your creative coding solutions come into play. 116 00:08:27,250 --> 00:08:36,670 Addressing scenarios where value one is not above or equal to value two and the down label here becomes 117 00:08:36,670 --> 00:08:39,550 marking the closure of this segment. 118 00:08:40,150 --> 00:08:46,850 On the flip side above, our equal label offers a distinctive platform enabling your code to unfold 119 00:08:46,850 --> 00:08:52,580 in a manner suited for scenarios where value one is indeed above or equal to value. 120 00:08:52,580 --> 00:08:53,000 Two. 121 00:08:53,960 --> 00:08:55,340 And that's it. 122 00:08:55,490 --> 00:09:02,690 Our educational odyssey reaches its zenith at the dawn label, encapsulating the conclusion of this 123 00:09:02,690 --> 00:09:03,620 program's logic. 124 00:09:03,620 --> 00:09:10,490 This is the optimal space for including instructions for program termination or any necessary cleanup.