1 00:00:00,350 --> 00:00:06,470 Hello, my name is Stephen and welcome to a captivating lecture that delves into the heart of assembly 2 00:00:06,470 --> 00:00:07,340 language. 3 00:00:07,340 --> 00:00:15,170 And in this session we are immersing ourselves in the intricate world of instruction, flags and their 4 00:00:15,170 --> 00:00:18,230 profound influence on conditional jumps. 5 00:00:18,230 --> 00:00:26,360 So brace yourselves for an enlightening journey as we meticulously dissect each instruction, unraveling 6 00:00:26,360 --> 00:00:31,150 the signal and unveiling their impact on a program flow. 7 00:00:31,160 --> 00:00:38,180 So without further ado, let's embark on this exciting addition to the realm of instruction, flags 8 00:00:38,180 --> 00:00:39,860 and conditional jumps. 9 00:00:39,860 --> 00:00:44,060 Now we will create a new project folder for this lecture here. 10 00:00:44,300 --> 00:00:50,480 Let's name it the instruction flags and. 11 00:00:51,220 --> 00:00:53,260 And instruction flags and. 12 00:00:54,790 --> 00:00:57,220 Uh, con jumps here. 13 00:01:02,540 --> 00:01:02,990 Yeah. 14 00:01:03,380 --> 00:01:05,030 And jumps here. 15 00:01:05,150 --> 00:01:06,020 That's it. 16 00:01:06,050 --> 00:01:09,470 Now we will here create the default. 17 00:01:09,470 --> 00:01:15,260 Or actually, let's open the terminal here just as a CSM here. 18 00:01:17,030 --> 00:01:18,070 Create a new project. 19 00:01:18,080 --> 00:01:20,270 Let's do the default project here. 20 00:01:20,300 --> 00:01:27,560 Save this in instruction flags and jumps as the project dot ASM. 21 00:01:33,120 --> 00:01:36,780 And here we will start with the g e. 22 00:01:36,850 --> 00:01:40,260 Here this means jump if equal. 23 00:01:40,260 --> 00:01:43,500 So our voyage begins with an introduction. 24 00:01:43,630 --> 00:01:47,380 G is an abbreviation for jump if equal. 25 00:01:47,420 --> 00:01:54,420 Here G is jump if equal. 26 00:01:54,420 --> 00:02:01,080 So this instruction plays a pivotal role in facilitating decisions based on equality conditions. 27 00:02:01,080 --> 00:02:09,810 So it hinges on the zero flag z, F and the key indicator of whether the previous operation resulted 28 00:02:09,810 --> 00:02:11,640 in an equal comparison. 29 00:02:11,640 --> 00:02:17,580 Regardless of whether we are dealing with a signed or unsigned numbers, the g e instruction empowers 30 00:02:17,580 --> 00:02:23,730 us to gracefully navigate program flow when two values are equal. 31 00:02:23,730 --> 00:02:26,360 So this means jump if equal. 32 00:02:26,370 --> 00:02:33,550 So now we will also create an example code for this and I will explain this example code further and 33 00:02:33,550 --> 00:02:34,240 you will learn. 34 00:02:34,690 --> 00:02:38,800 Learn everything you need to know about g jump if equal here. 35 00:02:38,800 --> 00:02:43,030 So section data we will create a two value. 36 00:02:43,750 --> 00:02:50,200 This is the byte with value ten and we will define another byte with the value ten again. 37 00:02:50,200 --> 00:02:56,440 So value one db ten value value two. 38 00:02:57,240 --> 00:02:59,300 Be ten again. 39 00:03:02,740 --> 00:03:07,420 Then and here we will develop our text section here. 40 00:03:07,420 --> 00:03:09,730 In text section we will global. 41 00:03:12,600 --> 00:03:13,470 Global. 42 00:03:14,370 --> 00:03:17,100 Start and in start. 43 00:03:17,990 --> 00:03:18,590 Here. 44 00:03:21,910 --> 00:03:28,930 Start, we will move the value of value one into a register here. 45 00:03:34,630 --> 00:03:35,660 A l. 46 00:03:37,630 --> 00:03:40,120 Uh, value one. 47 00:03:41,550 --> 00:03:43,380 And we will move. 48 00:03:44,250 --> 00:03:46,220 L two. 49 00:03:47,670 --> 00:03:48,870 Value to. 50 00:03:50,120 --> 00:03:56,570 And now we will compare the values in al and bl cmp. 51 00:03:58,010 --> 00:03:58,970 Al. 52 00:03:59,850 --> 00:04:01,160 And Bell. 53 00:04:09,120 --> 00:04:19,200 And this is we wrote this because of the comparing the values in L and L, and we will use G here and 54 00:04:19,200 --> 00:04:22,470 we will write equal font. 55 00:04:22,830 --> 00:04:28,500 So this we are jumping the equal font label if they are equal. 56 00:04:28,500 --> 00:04:32,640 But if they are not equal, we will create this new line here. 57 00:04:32,670 --> 00:04:34,470 Not equal. 58 00:04:34,500 --> 00:04:47,430 So here in this case, your code or code here for not equal case and after the case ends, jump done. 59 00:04:47,460 --> 00:04:50,970 So now we are jumping to the done label. 60 00:04:50,970 --> 00:05:02,760 And if the equal is font here, equal font here and here, you will also your code here. 61 00:05:03,870 --> 00:05:06,570 Here for equal. 62 00:05:07,340 --> 00:05:08,150 Case. 63 00:05:11,310 --> 00:05:12,990 Case and after that. 64 00:05:13,770 --> 00:05:14,460 Again. 65 00:05:18,950 --> 00:05:24,050 And after that, you will need to write your exit code here. 66 00:05:24,140 --> 00:05:32,840 So that's it with our jump if equal instruction here and I'm waiting you in next lecture. 67 00:05:32,840 --> 00:05:40,810 So remember that we wrote this code in 32 bit assembly in ACM x86 32 bit. 68 00:05:40,820 --> 00:05:44,780 So that's why we have two characters instead of three here. 69 00:05:44,780 --> 00:05:50,870 And in next lecture we will also try 64 bit for this testing here. 70 00:05:50,870 --> 00:05:52,370 So I'm waiting you in next lecture.