1 00:00:00,410 --> 00:00:01,970 Assembly language instruction. 2 00:00:01,970 --> 00:00:04,520 JB signifying jump. 3 00:00:04,550 --> 00:00:10,730 If below is a vital tool for controlling program flow based on a specific comparison condition. 4 00:00:11,380 --> 00:00:16,120 It is commonly employed for signed and unsigned integer comparisons. 5 00:00:17,870 --> 00:00:25,850 The JB instruction dictates program execution by prompting a jump if one value is less than another 6 00:00:25,850 --> 00:00:26,600 value. 7 00:00:26,630 --> 00:00:31,570 So here's a brief rundown of this comparisons here. 8 00:00:31,580 --> 00:00:34,040 At first we are comparison process. 9 00:00:34,160 --> 00:00:40,310 So we are comparing two values which can be sourced from registers, memory or immediate values. 10 00:00:41,500 --> 00:00:41,720 Condition. 11 00:00:41,940 --> 00:00:45,480 Check if the first value is less than the second. 12 00:00:45,510 --> 00:00:47,340 The jump takes place. 13 00:00:48,450 --> 00:00:50,430 Jump or sequential execution. 14 00:00:50,430 --> 00:00:58,110 If the condition holds true, the program jumps to a designated location or label, and if not, it 15 00:00:58,110 --> 00:00:59,940 continues executing. 16 00:01:02,160 --> 00:01:06,390 And now what we're going to do is we will just see a basic example here. 17 00:01:06,390 --> 00:01:06,780 So. 18 00:01:06,780 --> 00:01:07,350 CMP. 19 00:01:08,770 --> 00:01:09,490 A x. 20 00:01:09,520 --> 00:01:09,880 B. 21 00:01:09,880 --> 00:01:10,540 X. 22 00:01:11,780 --> 00:01:14,660 And JB below. 23 00:01:16,000 --> 00:01:16,480 Below. 24 00:01:17,350 --> 00:01:20,530 And here, as you can see, here we are. 25 00:01:21,220 --> 00:01:24,670 Compare the values in registers A x and b x. 26 00:01:25,790 --> 00:01:27,980 And here jump. 27 00:01:27,980 --> 00:01:30,500 We are telling the assembly to jump. 28 00:01:30,500 --> 00:01:34,430 If a x is less than b x. 29 00:01:34,430 --> 00: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 30 00:01:43,280 --> 00:01:53,330 in register b, x and JB Blanc alongside other conditional jumps like a jump off, a jump above or equal 31 00:01:53,370 --> 00:02:01,850 g jump if equal constitutes the fundamental basis of control flow, these instructions empower programmers 32 00:02:01,850 --> 00:02:08,690 to devise intricate algorithms and logical constructions at a low level of abstraction and essential 33 00:02:08,690 --> 00:02:11,390 for effective assembly language programming. 34 00:02:11,420 --> 00:02:13,490 As I tell you always. 35 00:02:13,490 --> 00:02:15,860 And now we always do. 36 00:02:17,120 --> 00:02:21,860 Um, here we will create another sample application here. 37 00:02:21,860 --> 00:02:30,050 And this is so after this lecture, there's just one more lecture that we will discuss the JB jump if 38 00:02:30,050 --> 00:02:31,940 lesser or equal in next lecture. 39 00:02:32,210 --> 00:02:38,630 And after that we are done with this, uh, logical conditions here and in next lectures. 40 00:02:38,630 --> 00:02:44,540 In the next section, we will use that knowledge and create a big assembly program here. 41 00:02:45,610 --> 00:02:47,680 So here we will create a section. 42 00:02:48,190 --> 00:02:51,700 Uh, data value one. 43 00:02:52,120 --> 00:02:53,230 Value. 44 00:02:53,260 --> 00:02:55,630 Value one DB. 45 00:02:58,430 --> 00:02:59,240 15. 46 00:03:01,380 --> 00:03:04,740 And value to DB. 47 00:03:07,050 --> 00:03:14,700 Uh, value to DB 20 and here we will create a section text. 48 00:03:15,060 --> 00:03:19,380 Also, we will create a global global start. 49 00:03:19,560 --> 00:03:22,860 And here in this start we will start. 50 00:03:24,160 --> 00:03:26,400 They will move all. 51 00:03:31,000 --> 00:03:32,470 You won, So. 52 00:03:33,800 --> 00:03:36,440 Value one and move. 53 00:03:37,570 --> 00:03:38,210 L. 54 00:03:40,850 --> 00:03:41,900 Value to. 55 00:03:42,780 --> 00:03:48,570 And here we are allocating memory for value one and initializing it with 15. 56 00:03:48,570 --> 00:03:57,420 And in the third line we are allocating memory for value two and initializing it with 20. 57 00:03:57,630 --> 00:04:05,610 And here we are loading the value stored at memory address value one into the Al register and we are 58 00:04:05,610 --> 00:04:06,510 doing the same here. 59 00:04:06,510 --> 00:04:12,900 We are loading the value stored in memory address value two into the Belle Register and here we will 60 00:04:12,900 --> 00:04:18,060 compare the value in Al and Belle CMP Al. 61 00:04:18,990 --> 00:04:27,960 An P, a L and P, l, and after that we will use this j P and. 62 00:04:28,810 --> 00:04:29,350 Hello. 63 00:04:29,590 --> 00:04:32,560 So if Al is below. 64 00:04:33,590 --> 00:04:34,950 Uh, Bell. 65 00:04:35,420 --> 00:04:39,470 Here we are jumping, uh, to Yellow label. 66 00:04:42,050 --> 00:04:46,910 And so we are using GB here, which means jump if below. 67 00:04:48,000 --> 00:04:51,720 And here we will create a node below label. 68 00:04:52,860 --> 00:05:00,960 And here you will create this your coding expertise takes. 69 00:05:01,720 --> 00:05:04,720 X spotlight here. 70 00:05:04,720 --> 00:05:11,650 And this here you are addressing scenarios where value one is not below value two. 71 00:05:11,680 --> 00:05:12,220 Right. 72 00:05:15,090 --> 00:05:16,890 So let's make it in parenthesis. 73 00:05:17,070 --> 00:05:20,190 Value one is not below. 74 00:05:20,220 --> 00:05:21,480 Value two. 75 00:05:21,480 --> 00:05:23,400 And we will create another label. 76 00:05:23,400 --> 00:05:26,940 But before this we will call this non label. 77 00:05:26,940 --> 00:05:30,270 So GNP done. 78 00:05:30,270 --> 00:05:37,950 So here we are executing jump to the done label, marking the completion of this section and here we 79 00:05:37,950 --> 00:05:40,830 will also create this below label. 80 00:05:41,040 --> 00:05:42,150 This is for. 81 00:05:43,020 --> 00:05:43,430 Uh. 82 00:05:45,310 --> 00:05:45,800 We are. 83 00:05:45,820 --> 00:05:46,960 This is for the. 84 00:05:48,010 --> 00:05:56,840 A chord here for cases where value one is indeed below value two. 85 00:05:56,860 --> 00:05:57,670 So. 86 00:06:00,610 --> 00:06:01,570 According. 87 00:06:03,390 --> 00:06:04,170 Holding. 88 00:06:05,230 --> 00:06:05,560 Or. 89 00:06:08,950 --> 00:06:13,870 Court cases where value of one is below. 90 00:06:17,280 --> 00:06:20,410 Value one is below. 91 00:06:20,430 --> 00:06:21,870 Value two. 92 00:06:22,950 --> 00:06:25,800 And after that we will also create our own label. 93 00:06:28,270 --> 00:06:28,660 Lon. 94 00:06:32,590 --> 00:06:37,990 Um, and this is our gateway for exit related instructions. 95 00:06:41,180 --> 00:06:42,230 Related court. 96 00:06:43,760 --> 00:06:46,760 And here we will, as we always do. 97 00:06:46,760 --> 00:06:47,450 We will. 98 00:06:48,190 --> 00:06:50,260 Analyze it from beginning. 99 00:06:51,490 --> 00:06:57,040 And in this data section at the second line here, as you can see. 100 00:06:58,390 --> 00:07:02,740 A memory location is designated for value one. 101 00:07:03,970 --> 00:07:06,870 Initialized with 15. 102 00:07:07,110 --> 00:07:10,440 And here, similarly, memory is allocated for value. 103 00:07:10,440 --> 00:07:13,620 Two is initialized with 20. 104 00:07:14,100 --> 00:07:20,730 And here our exploration begins with the Move instruction which transfers the value stored at the memory 105 00:07:20,730 --> 00:07:26,190 address value of one into the Al register and Parallelly. 106 00:07:26,190 --> 00:07:30,300 The Move instruction performs the same action for value two. 107 00:07:30,810 --> 00:07:40,800 Um, where uh, moving its contents into the register and this is a pivotal juncture arrives as the 108 00:07:40,800 --> 00:07:49,770 CMP instruction engages in a meticulous comparison between the contents of Al and b l, and here this 109 00:07:49,770 --> 00:07:53,730 is a direction of our journey hinges on the outcome. 110 00:07:53,730 --> 00: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. 111 00:08:05,890 --> 00:08:15,150 And here in note below within this space here, your technical technical expertise takes center stage. 112 00:08:15,160 --> 00:08:24,190 Um, paving the way for inventive solution tailored to scenarios where value one is not below value 113 00:08:24,190 --> 00:08:24,850 to. 114 00:08:25,690 --> 00:08:28,780 And in this here we are leap to the. 115 00:08:29,930 --> 00:08:35,630 Now this is a leap to down label signals, the culmination of this segment. 116 00:08:35,780 --> 00:08:44,510 And here below here you are coding, uh, finds expression shaping code specifically catered to scenarios 117 00:08:44,510 --> 00:08:52,040 where value one is indeed below value two and this is the final stages of our journey unfolded at the 118 00:08:52,040 --> 00:08:53,030 down label. 119 00:08:53,510 --> 00:09:00,110 Uh, so your canvas for exit related instructions that conclude this program's execution here. 120 00:09:00,110 --> 00:09:04,670 And as we traverse this assembly code, we plunge deeper into the realm of conditional branching and 121 00:09:04,670 --> 00:09:12,080 comparisons, uncovering the nuances of scenarios where value one is below, value two and armed with 122 00:09:12,080 --> 00:09:18,680 the sound of understanding of this integrate mechanisms, you are well equipped to navigate the complexities 123 00:09:18,680 --> 00:09:21,380 of assembly programming with confidence. 124 00:09:21,380 --> 00:09:29,450 So your ongoing pursuit of assembly, uh, programming knowledge will undoubtedly prove to be both enlightening 125 00:09:29,550 --> 00:09:30,990 and transformative. 126 00:09:31,110 --> 00:09:37,560 Continuing to explore the applications of assembly programming with enthusiasm and determination and 127 00:09:37,560 --> 00:09:38,490 happy learning. 128 00:09:38,490 --> 00:09:39,870 And in next lecture. 129 00:09:40,320 --> 00:09:44,340 In next lecture, it will be our last lecture about this. 130 00:09:44,340 --> 00:09:45,150 So. 131 00:09:45,960 --> 00:09:47,700 And I'm waiting you in next lecture.