<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>control flow assembly Archives - NeuralLantern.com</title>
	<atom:link href="https://www.NeuralLantern.com/tag/control-flow-assembly/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.NeuralLantern.com/tag/control-flow-assembly/</link>
	<description></description>
	<lastBuildDate>Sun, 04 Jan 2026 18:55:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.NeuralLantern.com/wp-content/uploads/2025/04/cropped-2025-04-04-Lantern-03-32x32.png</url>
	<title>control flow assembly Archives - NeuralLantern.com</title>
	<link>https://www.NeuralLantern.com/tag/control-flow-assembly/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Complex If-ElseIf-Else in x86-64 YASM Assembly &#8211; Full Guide with Code Examples</title>
		<link>https://www.NeuralLantern.com/complex-if-elseif-else-in-x86-64-yasm-assembly-full-guide-with-code-examples/</link>
					<comments>https://www.NeuralLantern.com/complex-if-elseif-else-in-x86-64-yasm-assembly-full-guide-with-code-examples/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 04 Jan 2026 18:55:39 +0000</pubDate>
				<category><![CDATA[Assembly Language]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[assembly language if statement]]></category>
		<category><![CDATA[assembly language tutorial]]></category>
		<category><![CDATA[assembly programming]]></category>
		<category><![CDATA[chained if else assembly]]></category>
		<category><![CDATA[cmp instruction]]></category>
		<category><![CDATA[conditional branching assembly]]></category>
		<category><![CDATA[control flow assembly]]></category>
		<category><![CDATA[if else assembly]]></category>
		<category><![CDATA[intel assembly]]></category>
		<category><![CDATA[je jmp assembly]]></category>
		<category><![CDATA[low level programming]]></category>
		<category><![CDATA[nasm assembly]]></category>
		<category><![CDATA[x86 assembly tutorial]]></category>
		<category><![CDATA[x86-64 assembly]]></category>
		<category><![CDATA[Yasm assembly]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=275</guid>

					<description><![CDATA[<p>Step-by-step x86-64 YASM assembly tutorial showing how to implement complex if-else and if-elseif-else control flow structures with multiple chained conditions, proper labels, conditional jumps, and fall-through logic. Includes complete working code and live execution.</p>
<p>The post <a href="https://www.NeuralLantern.com/complex-if-elseif-else-in-x86-64-yasm-assembly-full-guide-with-code-examples/">Complex If-ElseIf-Else in x86-64 YASM Assembly &#8211; Full Guide with Code Examples</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Complex If-ElseIf-Else in x86-64 YASM Assembly - Full Guide with Code Examples" width="1380" height="776" src="https://www.youtube.com/embed/G7am7avKi9w?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>In this in-depth x86-64 assembly tutorial using YASM, we dive deep into implementing complex if-else and if-elseif-else control structures from scratch. Starting with the fundamentals of conditional branching, we build up to full chained if-elseif-else blocks with multiple conditions &#8211; exactly how high-level languages handle them under the hood.</p>



<p>You&#8217;ll see real working code that:</p>



<ul class="wp-block-list">
<li>Takes user integer input</li>



<li>Tests against specific values (5, 6, etc.)</li>



<li>Handles greater-than/less-than comparisons</li>



<li>Properly branches so only one block executes</li>



<li>Uses labels, cmp, conditional jumps (je, jl), and unconditional jumps (jmp) correctly</li>
</ul>



<p>We cover the classic pattern: compare to conditional jump to true block to execute true code to jmp to end to false block falls through or jumps in. Everything is shown step-by-step with live compilation and runtime demos.</p>



<p>Perfect for anyone learning low-level programming, reverse engineering, or wanting to understand how compilers translate if-else chains into machine code. Prerequisites: basic conditional jumps (see my earlier videos).</p>



<p>Code shown works on Linux x86-64 with YASM/NASM syntax. Grab the concepts and apply them anywhere.</p>



<p>Introduction to If-Else in Assembly 00:00:00<br>Explaining the If-Else Design Pattern 00:00:56<br>Drawing the Basic If-Else Flow 00:01:01<br>Comparison and Conditional Jumps 00:02:30<br>Labels for True and False Blocks 00:03:07<br>Unconditional Jump to End 00:04:50<br>Diagram of Execution Flow 00:05:51<br>Alternative Pattern with Inverted Jump 00:07:00<br>Recapping the If-Else Pattern 00:08:45<br>Starting the Code Example 00:09:16<br>Setting Up Input and Strings 00:09:40<br>Calling External Functions 00:10:57<br>Entry Point and Prologue 00:11:40<br>Asking User for Integer Input 00:13:09<br>Creating the if_test Function 00:14:56<br>Preserving Callee-Saved Registers 00:15:51<br>Printing Begin Message 00:17:03<br>Implementing Simple If Block 00:18:29<br>Comparison and je Jump 00:19:18<br>True Block: Equality Message 00:21:08<br>Testing Simple If Examples 00:23:48<br>Transition to If-Else Blocks 00:24:21<br>Creating if_else_test Function 00:24:47<br>Setting Up Complex If-Else 00:26:25<br>First If: Equal to 5 00:27:22<br>True Block for Equal 5 00:28:33<br>Else If: Equal to 6 00:30:29<br>Else If: Less Than 10 00:34:17<br>Final Else Block 00:37:33<br>Done Label and Goodbye 00:38:23<br>Recap of Full Flow 00:39:06<br>Live Demo of All Branches 00:40:54<br>Signed vs Unsigned Jumps Note 00:43:38<br>Recommended Assembly Book 00:44:12<br>Conditional Jump Families 00:45:05<br>Closing and Practice Advice 00:46:48</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hello there.</p>



<p>In this video we&#8217;re going to talk about implementing simple if-else blocks in YASM x86-64 assembly.</p>



<p>Although if you&#8217;re writing in a different assembly language, this video will probably</p>



<p>still be useful to you because I&#8217;m going to explain the design pattern or how we can achieve</p>



<p>that at the assembly level.</p>



<p>So x86-64 YASM assembly, also known as AMD64 YASM assembly.</p>



<p>So if you have not seen my other videos about how to do conditional branching in the first</p>



<p>place, you probably want to go check that first because that knowledge is required for</p>



<p>this video.</p>



<p>There&#8217;s also a lot of other stuff that I&#8217;m just not going to explain in this video, such</p>



<p>as creating a make file, you know, compiling and linking your executable and so forth.</p>



<p>So see my other videos where all those concepts are explained already.</p>



<p>how to implement a simple if-else block.</p>



<p>So for starters, maybe let me draw a little bit.</p>



<p>Suppose we had, let me get rid of this thing</p>



<p>and then I&#8217;ll just do a regular notepad.</p>



<p>Suppose we had a higher level language,</p>



<p>just so you know what I&#8217;m talking about.</p>



<p>Suppose we had a higher level language</p>



<p>and we wanted to say if, you know, some expression is true.</p>



<p>We wanted to say if expression is true,</p>



<p>then print, you know, it was true.</p>



<p>Anybody remember that old movie, Little Nicky?</p>



<p>Somebody got exploded and then the guy next to him goes it&#8217;s not true</p>



<p>Okay, it was not true</p>



<p>So this is the basic idea of what we&#8217;re going to implement in assembly</p>



<p>I&#8217;m going to write a full program for assembly to show you this but um</p>



<p>You know you&#8217;re in C++ you&#8217;re in C you&#8217;re in I don&#8217;t know whatever language you&#8217;re in and</p>



<p>You obviously know how to use if-else blocks at this point hopefully</p>



<p>And now we&#8217;re going to just try to figure out how to implement them in assembly</p>



<p>So it&#8217;s important to understand that really under the hood</p>



<p>really under the hood there&#8217;s a bunch of stuff happening surprise right okay so</p>



<p>first off we look at this expression which could be I don&#8217;t know let&#8217;s say</p>



<p>five is greater than ten or a is equal to B or whatever it is that you put in</p>



<p>there you could make a very complicated expression we&#8217;re going to use simple</p>



<p>expressions for this video so if we&#8217;re comparing a to B we&#8217;ll end up using the</p>



<p>compare instruction remember there are two steps to conditional branching and</p>



<p>in YASM we first use the compare instruction against two operands and then that will end up</p>



<p>filling up the rflags register so that we can later conditionally jump based on the results</p>



<p>of the comparison. So we do a comparison and then you can imagine that the beginning of this</p>



<p>you know the the true body notice how it has a scope I&#8217;m going to just put this brace on another</p>



<p>line here to indicate that there is a scope from line four to six indicating all this code in here</p>



<p>in here is executed only if the if statement was true and then all of this other stuff is executed</p>



<p>only if the original comparison was false right so you can imagine now label is something like</p>



<p>my if was true so we can make a label for where that body starts and another label for where the</p>



<p>label is something like if was false and then what will happen is we can use a</p>



<p>conditional jump instruction after we do our comparison maybe I should put to</p>



<p>compare right here oh I&#8217;m using I&#8217;m using assembly style comments I should</p>



<p>be using a C style comments if I&#8217;m actually writing C++ here let me just do</p>



<p>that okay so this is the comparison instruction here and then here&#8217;s the</p>



<p>here and then here&#8217;s the beginning of the body of stuff to execute if it was true you can imagine</p>



<p>that there could be many statements here um if it was true or if it was false</p>



<p>just to prove to you that we can execute like a full body of stuff so we have a label that</p>



<p>designates when that body starts and then we have another label designating when the else body</p>



<p>starts and then we should have a label that uh that designates when the whole thing is over</p>



<p>label is something like if and or if is done or something like that so basically what we want to</p>



<p>do is to implement an if else a simple if else in assembly we&#8217;re going to say let&#8217;s do a comparison</p>



<p>and then we&#8217;ll do a conditional jump where are we going to conditionally jump well if the comparison</p>



<p>was true label. And then what will happen is execution will fall through.</p>



<p>When it reaches the end, we want to have another jump statement that unconditionally jumps</p>



<p>to the end of the if statement. If we didn&#8217;t, then whenever the expression was true,</p>



<p>we would end up executing all of the true statements and then it would fall through</p>



<p>to all of the false statements or the not true statements. So we have to have many jumps in here</p>



<p>let&#8217;s get into the body and then let&#8217;s finish and jump out of the body on the other hand if the</p>



<p>expression was false then our jump instruction is going to jump you know over the true body so</p>



<p>it&#8217;s not even going to do that at all it&#8217;s going to execute all of the else stuff and then it&#8217;s</p>



<p>you know sometimes a good idea if you have another jump here that just jumps to the end but you can</p>



<p>kind of see by the way i&#8217;ve written this out that there&#8217;s not going to be anything between the end</p>



<p>you know place where we&#8217;re finished with everything which means we don&#8217;t really</p>



<p>need an unconditional jump at the end of the else body we can just let the</p>



<p>execution fall through so maybe if I can draw a little diagram here I&#8217;ll say I</p>



<p>don&#8217;t know I&#8217;ll do like if put it in a little bubble and we&#8217;ll say that if it</p>



<p>was false we jump to one place and if it was true we jump to another place</p>



<p>we jump to another place.</p>



<p>I hope you&#8217;ve already started to understand this by now.</p>



<p>So we&#8217;ll say if the expression is true, we jump here.</p>



<p>If the expression is false, we jump over here.</p>



<p>And so true would be saying, let&#8217;s jump to the if was true.</p>



<p>So we&#8217;re going to jump to if was,</p>



<p>I&#8217;ll put a T there because I&#8217;m running out of space.</p>



<p>If was true.</p>



<p>was I&#8217;ll put an F false and then at the end of the true we jump to the done</p>



<p>label so I&#8217;m just gonna put done maybe down here</p>



<p>so at the end of the true we just unconditionally jump to the done area</p>



<p>and then at the end of the false we jump unconditionally to the done area as well</p>



<p>here&#8217;s something interesting though when we have a comparison instruction and</p>



<p>conditional branch instruction let&#8217;s say uh let&#8217;s say a equals b we did that comparison and then we</p>



<p>wanted to jump into the true area if a equals b was true so that means we&#8217;ll say jump</p>



<p>equal so if a is equal to b after we compare well let&#8217;s say a comma b we&#8217;re going to use registers</p>



<p>when we come to the code we&#8217;ll say compare a and b and then jump if they&#8217;re equal to some label</p>



<p>but the conditional branching instructions they only jump to one</p>



<p>potential place or fall through so if the comparison was false meaning if those</p>



<p>two things were not equal then we&#8217;re not going to actually be able to jump to a</p>



<p>different label we&#8217;re going to simply fall through to the next instruction so</p>



<p>in that case the very next instruction would get executed let&#8217;s just put a jump</p>



<p>was</p>



<p>false.</p>



<p>Meaning</p>



<p>we compare A and B</p>



<p>and if the two things are equal</p>



<p>we&#8217;ll jump into the true block.</p>



<p>Otherwise we fall through to the next instruction</p>



<p>which</p>



<p>that&#8217;s a very poorly written J</p>



<p>but we&#8217;re going to unconditionally jump to false.</p>



<p>So if we did not</p>



<p>jump to the true area we fall through to the next</p>



<p>instruction where we will always</p>



<p>jump to false and that implements the diagram</p>



<p>that implements the diagram that you see up above.</p>



<p>I mean, you know, if we have if statement, we compare,</p>



<p>maybe I&#8217;ll do, you know, A equals B.</p>



<p>We jumped to true, if was true.</p>



<p>And otherwise we end up falling through</p>



<p>and then jumping to if was false.</p>



<p>And then at the end of both of those,</p>



<p>we have an unconditional jump instruction</p>



<p>that jumps to the done.</p>



<p>So I&#8217;ll put JMP down here just to let you know,</p>



<p>you know, at the end of each of these blocks,</p>



<p>that they are jumping out of themselves at the very end to the done area maybe</p>



<p>I&#8217;ll put an arrow here so that we know both of these jumps end up jumping to</p>



<p>the done area that&#8217;s the basic idea for how to implement an if-else block a very</p>



<p>basic one we&#8217;re gonna do more complicated ones later but for now we</p>



<p>kind of have the idea down I think let&#8217;s look at some code dang I blew 10 minutes</p>



<p>already on that okay so I&#8217;m gonna copy paste some code from my solution here</p>



<p>code for my solution here this again this is not like a beginner&#8217;s assembly</p>



<p>video if you need to learn how to write assembly in the first place how to</p>



<p>compile you know link create a make file and so forth you need to see my other</p>



<p>videos first but for now we&#8217;re just going to assume that you know how to</p>



<p>make a data section in Yasm and we&#8217;re gonna say let&#8217;s make a bunch of strings</p>



<p>so first I&#8217;m gonna ask the user for an integer and then I&#8217;m gonna make a bunch</p>



<p>of decisions like I&#8217;m gonna do you know an if-else block to test what kind of</p>



<p>what kind of number they put you know did they make a number that uh</p>



<p>equal one if it was equal to something oh did I ask twice I can&#8217;t remember what I&#8217;m doing</p>



<p>but basically we&#8217;re going to print something if their number was equal to something else</p>



<p>we&#8217;re going to print uh something if their number that they inputted was equal to five we&#8217;re going</p>



<p>to print something else if their number was equal to six we&#8217;re going to print again something else</p>



<p>a bunch of stuff and then wait isn&#8217;t this the complicated example oh no i think i am using code</p>



<p>for my more complicated example else less than 10 i don&#8217;t know maybe this is the simple one</p>



<p>let&#8217;s double check i guess if i put more complicated code in here you&#8217;ll probably be happy</p>



<p>but whatever i thought this was going to be a simple example so i&#8217;m just defining strings at</p>



<p>codes stuff that is covered in other videos now i&#8217;m going to start my text section so my text</p>



<p>section begins with a declaration that i&#8217;m going to use two external functions so this video is</p>



<p>not about this library that takes input and sends output i have other videos for that but basically</p>



<p>i&#8217;m just using a library that lets you type an integer into the terminal and then it will print</p>



<p>a different number to the terminal for you so you can imagine if you wanted to follow along</p>



<p>imagine if you wanted to follow along with this code at home and you don&#8217;t</p>



<p>have this library you can just hard code your numbers just to prove to yourself</p>



<p>that you can get it to work or you can use a different library if you have a</p>



<p>hybrid program and you&#8217;re linking against GCC you can just use scanf and</p>



<p>printf pretty much those take a little bit more work to do but you can do it</p>



<p>anyway so our entry point is going to be called if tester it&#8217;s a function called</p>



<p>Again, this is a hybrid program and hybrid programs are not covered in this video, but you can imagine that there is a C++ module elsewhere in my source that is just going to call on a function called if tester.</p>



<p>And so that&#8217;s why I&#8217;m marking this as global so that other modules in my program can call on if tester.</p>



<p>So it&#8217;s just a little label that we can jump into or in this case call into.</p>



<p>Let me go down to the bottom of that.</p>



<p>We&#8217;ll put a return statement at the very end.</p>



<p>very end so now this is officially a function and notice how i made a note here that says r12 is</p>



<p>the user&#8217;s inputted integer so that means i&#8217;m going to be using r12 and since r12 is designated</p>



<p>in the abi the application binary interface as callee saved or callee preserved that means i</p>



<p>have to do a push pop pair to preserve it or i&#8217;ll get in lots and lots of trouble my program will</p>



<p>prologue which my favorite book also calls the prologue and then I&#8217;m going to</p>



<p>say epilogue and so now we have a function that basically doesn&#8217;t do</p>



<p>anything but we can at least jump into it let&#8217;s see if this compiles as is I</p>



<p>think it probably will yeah so the driver just says hello that&#8217;s the C++</p>



<p>program with the actual main function and it calls my if tester function but</p>



<p>nothing happens the if tester function returns control to the driver and then</p>



<p>the driver just says okay i got control back so nothing really happened so now let&#8217;s ask the user</p>



<p>for some input so again this is not a video about this library or how to print with this with system</p>



<p>calls see my other videos if you need help on that but basically we&#8217;re going to print a message to</p>



<p>the user hey please input an integer and then we&#8217;re going to call on a library function that</p>



<p>lets them type in a number and then returns it to us in rax we&#8217;re then going to store it</p>



<p>well just basic stuff right so if I run this again it&#8217;s going to ask for an</p>



<p>integer please enter an integer if I can type that and then nothing else happens</p>



<p>okay now we can kind of start making more decisions so I&#8217;m going to let&#8217;s see</p>



<p>if test if test if test okay so what I need to do now is run another function</p>



<p>called if tests several times and I&#8217;m going to compare the number that the</p>



<p>times and I&#8217;m going to compare the number that the user inputted so remember r12 is the user&#8217;s</p>



<p>input so I&#8217;m going to load that as the first argument of a function call and then I&#8217;m going</p>



<p>to load the number five as the second argument of a function call probably not a great idea to hard</p>



<p>code numbers in your assembly you should probably define them up in the globals or the the data</p>



<p>section at least as just regular defines and not numbers in memory but I&#8217;m going to just keep these</p>



<p>So three times we&#8217;re gonna call if test and then also another function called CRLF. So first I&#8217;m gonna paste in</p>



<p>CRLF</p>



<p>Where the heck is that? Oh, dude?</p>



<p>Again, this is not a video about the basics</p>



<p>So you&#8217;re just gonna have to trust me or go watch my other videos if you don&#8217;t understand what I&#8217;m doing here</p>



<p>But I have a function called</p>



<p>CRLF and its whole job in life is just to print a new line for me just because I like to do it that way</p>



<p>handles the CRLF call. Now let&#8217;s make another function called if test.</p>



<p>So I&#8217;m going to start that by designating its label right after this block of</p>



<p>code here, maybe before CRLF.</p>



<p>So we have like a basic if test function and here&#8217;s my prototype just to remind</p>



<p>myself what I&#8217;m going to be doing.</p>



<p>It&#8217;s going to take an input and it&#8217;s going to take another input for a test</p>



<p>against me. So the first one is like the user&#8217;s input.</p>



<p>The second one is the number that I want to test it against.</p>



<p>number that I want to test it against they&#8217;re both longs which means they are both integers</p>



<p>which means the incoming arguments are going to be rdi and rsi if you&#8217;re respecting the abi</p>



<p>and then some notes to remind myself I&#8217;m going to be using r12 and r13 inside of this function so</p>



<p>I&#8217;m going to start by putting a return statement there since that is what it takes to make a label</p>



<p>into a return into into a function then I&#8217;m going to preserve the callee saved registers again if</p>



<p>don&#8217;t know what i&#8217;m talking about see my other videos we&#8217;re going to push r12 and push r13 so</p>



<p>that they are not ruined for the caller we call this the prolog then at the very bottom of the</p>



<p>function we have the epilog which just restores uh the registers in reverse order you&#8217;ve got to</p>



<p>do it in reverse order see my other videos if you don&#8217;t understand why okay so that&#8217;s basically a</p>



<p>function that can get called it doesn&#8217;t do anything let me double check that the program still actually</p>



<p>works. 66 and nothing happens. We just printed CRLF a bunch of times. Okay, so now we&#8217;re ready</p>



<p>to continue. So let&#8217;s grab the function arguments. Remember we were going to use R12 and R13 for the</p>



<p>user&#8217;s input and the number we will test against. Those came into our function with RDI and RSI.</p>



<p>So I&#8217;m just going to copy those two incoming arguments into R12 and R13. And you&#8217;re supposed</p>



<p>keep the user&#8217;s input in RDI then the moment I call any other function or system call I&#8217;m just</p>



<p>going to lose that data so I&#8217;m going to keep it inside of R12 and R13 so I grab the function</p>



<p>arguments and then I print a begin message just to let the user know that we&#8217;re going to start</p>



<p>you know making tests against our number so this is just basically a message saying hey begin the</p>



<p>if test and then print what we&#8217;re going to check against so the next thing is</p>



<p>I&#8217;m going to let the user know what the second incoming argument was.</p>



<p>If you look at R13 here, that was RSI, which was the second argument.</p>



<p>So the test against me number.</p>



<p>So we&#8217;re going to check the user&#8217;s input against whatever we called for the second argument.</p>



<p>So I just wanted to print it out.</p>



<p>You know, like we&#8217;re testing your number against whatever.</p>



<p>So that means I need to make another call to my little printing library here.</p>



<p>To RDI which is the first argument notice how we already we already destroyed RDI. That&#8217;s why I&#8217;m keeping the input in our 12 and our 13</p>



<p>And then we&#8217;re gonna make that call and we can just assume everything will go according to plan at that point and then</p>



<p>Then we&#8217;re gonna print a special message only if something actually happens</p>



<p>So we&#8217;re gonna implement the if else block in a moment. Let me just run this real fast</p>



<p>and then it says we&#8217;re calling the function three times and we&#8217;re saying the basic test has begun</p>



<p>we&#8217;ll test against this number five so we&#8217;re testing your input against five and then six and</p>



<p>then seven and then we didn&#8217;t actually do anything we&#8217;re about to okay so then the next thing is we&#8217;re</p>



<p>going to print a special message only if the user entered the right number so first off remember we</p>



<p>see if else block and converting it into assembly so i&#8217;m sort of placing that in comments for you</p>



<p>so the comparison instruction i i didn&#8217;t want to put the r12 equals r13 inside of the same comment</p>



<p>that lines up with the the compare instruction because the compare instruction as i&#8217;ve said in</p>



<p>other videos already it doesn&#8217;t actually check to see if something&#8217;s equal it just makes a bunch of</p>



<p>called r flags with information that we can later use to decide if the two things were equal or not</p>



<p>equal or greater than or less than or whatever so that&#8217;s why i chose to put that on on the next line</p>



<p>so at this point we&#8217;re saying if those two things were equal and that&#8217;s how i implement the expression</p>



<p>in the middle then let&#8217;s jump to a special label called if test if was equal so you can come up</p>



<p>with any scheme you want for your labels but for me when i have when i have sub labels inside of a</p>



<p>when i have sub labels inside of a function i like to just suffix the function&#8217;s name with an</p>



<p>underscore and then start thinking of sub labels after that so everything&#8217;s like kind of clean</p>



<p>there&#8217;s less chance of overlap in labels if you have like a giant module with tons of functions</p>



<p>so i&#8217;m going to say this is like my main if that i&#8217;m checking and uh i&#8217;m going to jump to a label</p>



<p>called was equal meaning you know this evaluated to true that means that should be the true part</p>



<p>block let&#8217;s see do i still have that code here yeah right so here i&#8217;m going to jump to</p>



<p>the true block so you know if was true in the first example that we talked about so i&#8217;m going</p>



<p>to say if it&#8217;s if those things were equal jump to the code for the true block okay that means i</p>



<p>actually need the true block uh but i guess we&#8217;re going to set that up in a second otherwise if that</p>



<p>did not jump away it means that those two things are not equal so i said i should jump to the</p>



<p>I should jump to the else block or the false block.</p>



<p>Wait, do I have else in this example?</p>



<p>Oh, okay, okay.</p>



<p>This first thing that we&#8217;re looking at is only if.</p>



<p>So we don&#8217;t even have an else block yet.</p>



<p>We&#8217;re going to do that as the second example.</p>



<p>So we&#8217;re basically going to jump to the done area</p>



<p>if we didn&#8217;t jump into the true area.</p>



<p>And then at the end of the true area,</p>



<p>we can either jump to the done area</p>



<p>or we can let the execution fall through.</p>



<p>fall through okay so now that means i need if was equal and if i just copy paste a big giant</p>



<p>block of code and try to explain it to you real fast let&#8217;s do this</p>



<p>okay so we were going to jump to if was equal if r12 was equal to r13 and then um</p>



<p>we uh have this you know label here and notice how i&#8217;ve kind of like put a brace here indicating</p>



<p>like put a brace here indicating hey this is the beginning of the true block body you should</p>



<p>consider doing this too when you&#8217;re first learning and even after you&#8217;ve learned because let&#8217;s face</p>



<p>it assembly is tough and so in the true area i&#8217;m just going to print the equality message i&#8217;m going</p>



<p>to say hey your number was equal to you know whatever and then uh i&#8217;m going to actually print</p>



<p>the let&#8217;s see r13 number so that was uh i think the number to compare against the test against</p>



<p>against me number so that means here in this message we&#8217;re going to say hey your number was</p>



<p>equal to the number that we tested against so then otherwise let&#8217;s see or sorry after that</p>



<p>we&#8217;ll print the suffix of the message um and so you know i just i just like to make pretty</p>



<p>pretty uh printed messages so let&#8217;s see where&#8217;s the suffix here i can&#8217;t even find it um how about</p>



<p>oh i should have put suffix instead of the number two that would have been better so what i wanted</p>



<p>to do is say your input was equal to and then print the number and then after that print an</p>



<p>exclamation just to prove to you how easy it is to to make a pretty message that&#8217;s formatted nicely</p>



<p>for the user um or your professor or whoever so uh you know you basically just print a number and</p>



<p>then you or sorry you print the prefix and then you print the number and then you print the suffix</p>



<p>suffix and then that&#8217;s the end of the true body and then since we&#8217;re done with the true body we</p>



<p>can basically just say all right now we&#8217;re done with the if so the next instruction that follows</p>



<p>is the done area again looking back at the example here that would be sort of like here after the</p>



<p>whole entire block was finished we&#8217;re ignoring the else in this code but you can imagine we&#8217;ll do</p>



<p>that soon so if the user&#8217;s number matched something we execute a true body if not we jump to the done</p>



<p>to the done area and if the user&#8217;s uh number did not match then we just immediately jump to the</p>



<p>done area so that we don&#8217;t do the true area and then we write comments to ourselves to help us</p>



<p>remember oh look here&#8217;s like the comparison and then here&#8217;s the body of true and then uh the done</p>



<p>area is like we could put another comment if we want we could say like this is done but i kind of</p>



<p>think like i kind of think the label is self-explanatory so let&#8217;s see if this worked it&#8217;s</p>



<p>was talking too fast we&#8217;ll run it and we&#8217;ll say 44. okay so nothing matched any of the numbers so</p>



<p>let&#8217;s type the number six so that we get a little message on the second one so i&#8217;m going to type the</p>



<p>number six and you can see it did not match the number five and it did match the number six so</p>



<p>we got that true block executing when we called on that function where the number to compare to</p>



<p>nothing there. So now we know simple if blocks.</p>



<p>The next thing we&#8217;re going to do is if else blocks.</p>



<p>All right.</p>



<p>So let&#8217;s see.</p>



<p>Not sure if I&#8217;m going to cut the video and split this up into multiple parts.</p>



<p>Probably would have been a smart idea.</p>



<p>Let me know if I ended up doing it.</p>



<p>We&#8217;re at about 25 minutes now.</p>



<p>But anyway,</p>



<p>so now we&#8217;re going to look at if else blocks.</p>



<p>if else blocks.</p>



<p>So I&#8217;m going to start off with another function.</p>



<p>I&#8217;m going to call it if else test.</p>



<p>So here&#8217;s the tester.</p>



<p>It called on if test.</p>



<p>And then I&#8217;m going to, you know, I had the if test function that I did previously.</p>



<p>And so now we&#8217;re just going to make an if else test function.</p>



<p>The if else test, it just has one input, one argument for input.</p>



<p>And we&#8217;re going to just sort of compare it against different values.</p>



<p>of compare it against different values we&#8217;re not going to call this multiple times with different</p>



<p>values to compare against so that means let&#8217;s see we only need to use one register so</p>



<p>i&#8217;ve designated r12 as the user&#8217;s input so that&#8217;s where we&#8217;re going to store it which means we</p>



<p>should preserve it in the prologue so i&#8217;m going to push r12 and then again if you don&#8217;t understand</p>



<p>some of the basic stuff that i&#8217;m that i&#8217;m skipping over see my other videos where i explained</p>



<p>to know to actually have this kind of a program. So I&#8217;m going to have a function that enters and</p>



<p>it returns at the end. It uses R12 so we will preserve it with a push pop pair.</p>



<p>And then the first thing that I should do is grab the user&#8217;s input from the first argument.</p>



<p>And if you&#8217;re respecting the ABI that means it should come from RDI. So I&#8217;m going to move RDI</p>



<p>somebody remind me that the first part of the program has to actually call this function or</p>



<p>nothing will happen. So we&#8217;re going to say hello. That&#8217;s just a simple message that we talked about</p>



<p>before. And then now we&#8217;re going to actually implement the if else block. So it&#8217;s like a</p>



<p>little bit more complicated than just the simple if block. It&#8217;s going to be this whole example that</p>



<p>we talked about before. Let me see. Maybe I should add the calls to this block real fast. So we have</p>



<p>to this block real fast so we have the if tester and then run the complex if else tests</p>



<p>right before r12 okay let me just double check that i&#8217;m making a call at the right spot here</p>



<p>so we have r12 and 7 and then epilog okay so now finally in our program we&#8217;re going to have a call</p>



<p>to um the if else test function that we&#8217;re just making right now</p>



<p>Okay, so we have that.</p>



<p>And let me find that source again real fast.</p>



<p>If else test, we got the prologue.</p>



<p>We take their input and then we say hello.</p>



<p>Okay, so now we need another label that begins the if block.</p>



<p>So what we&#8217;re doing is we&#8217;re checking to see if the user&#8217;s input was equal to five.</p>



<p>And then we&#8217;re going to say something if it was.</p>



<p>And otherwise, we&#8217;re going to do an else block on that.</p>



<p>block on that so again i like to write my comparison instructions with a blank expression</p>



<p>in terms of the c equivalent comment so notice how the we&#8217;re checking to see if r12 is equal to</p>



<p>five i put that on the next block because we&#8217;re going to jump to the to the true part of the if</p>



<p>block if it equals five so that&#8217;s why i put that there the comparison instruction pretty much just</p>



<p>compares r12 with five sets a bunch of values into the r flags registers so that we can later</p>



<p>so that we can later conditionally jump if we want to.</p>



<p>So basically we&#8217;ll jump to the true place if that was true.</p>



<p>And then if not, execution falls through to the next statement,</p>



<p>which will just jump to the else place.</p>



<p>So we need more labels is what I&#8217;m saying.</p>



<p>So now we need a body for if the statement was true</p>



<p>or the expression was true,</p>



<p>we want to be able to execute the true portion of the if block.</p>



<p>the if block so that&#8217;s this right here so we&#8217;re going to jump to if it did equal to five you</p>



<p>could imagine you know making a better label instead of equal five you could say first if</p>



<p>first else if complicated block true scope or true block or something but i just put equal to five</p>



<p>basically saying we&#8217;ll execute this code if it was equal to five so again we&#8217;re just kind of like</p>



<p>into this label equal five if r12 was indeed equal to five so that means if it was we execute</p>



<p>all this code right here we know we&#8217;re finished when we have the very last line saying let&#8217;s jump</p>



<p>to finish the the if else block again just just to clarify</p>



<p>we do the comparison first and if the comparison was true then we&#8217;ll jump into the true area so</p>



<p>you know we&#8217;ll jump into the true area and then all of these uh instructions get executed</p>



<p>instructions get executed but if we don&#8217;t have a way to jump out of that block then whoops</p>



<p>all of the else statements are going to get executed too right so we don&#8217;t want that</p>



<p>we don&#8217;t want to execute both the true and the false statements we want to have a jump instruction</p>



<p>at the very end i&#8217;ll put jmp just so that we jump to the to the end of the if else block</p>



<p>you know jump to the place where it&#8217;s just all over and finished</p>



<p>Okay, so now I&#8217;m going to look at, whoops, turn that off.</p>



<p>So we have equal five.</p>



<p>So we&#8217;re going to jump to if else test if done.</p>



<p>Let me just double check to make sure I&#8217;m not forgetting anything.</p>



<p>Oh, we need to jump here.</p>



<p>Basically meaning we&#8217;re going to jump into the else portion.</p>



<p>So here we covered jumping into the true portion, you know, the regular top block.</p>



<p>Now here we&#8217;re going to jump into the else portion.</p>



<p>We need a label and some code for that.</p>



<p>code for that so this is the else six begin i copy that oh man it&#8217;s starting to get kind of</p>



<p>hectic in my brain here the copy pasting is worse than actually writing the program</p>



<p>so uh if the comparison was not equal like if r12 was not equal then execution falls through</p>



<p>to line 216 and then we unconditionally jump to the l6 begin area which is like down here</p>



<p>like down here and then we&#8217;ll print something else.</p>



<p>We&#8217;ll, oh, we&#8217;ll, we&#8217;ll check again.</p>



<p>So we&#8217;re doing like, um, if else, if else.</p>



<p>Okay. So originally when I was talking about the, uh,</p>



<p>if else block, I didn&#8217;t do a,</p>



<p>I didn&#8217;t do like a very complex if else statement.</p>



<p>We&#8217;ll say a is greater than B something like that.</p>



<p>So I&#8217;ll just put a more code here just so you know that we can do if else,</p>



<p>if else blocks but just you know again keep in mind that every scope here that you&#8217;re going to</p>



<p>try to run based on some condition you just make it its own label and make sure that at the very</p>



<p>end of the scope you jump away so that you reach the very end of all this stuff because just as a</p>



<p>quick review if we are just writing in c or c plus plus only one of these blocks is going to execute</p>



<p>right like if a is equal to b then only that first block will execute the second and third blocks</p>



<p>will not execute it&#8217;ll jump after that all the way down to line 21 only if a does not equal b</p>



<p>do we even have the chance of checking to see if a is more than b if it&#8217;s false then we&#8217;ll have the</p>



<p>chance to check the else and if it&#8217;s true we will only execute the code in the line 12 block you</p>



<p>know imagine there are more statements there and when that block is done then we will jump to line</p>



<p>to b and a is not greater than b so just a quick uh you know c plus plus uh you know design pattern</p>



<p>review if else block review so we have like an else if here we&#8217;re going to say check if the input</p>



<p>was equal to six so we just do the same thing that we did before we compare r12 the user&#8217;s input with</p>



<p>six we jump if they were equal to the else if equals true block and if not execution falls</p>



<p>Less than 10 begin block. So this is going to be like really complicated</p>



<p>How many lines did I actually I think I got excited when I wrote this</p>



<p>Okay, else if equal six true</p>



<p>My challenge to you is to come up with labels that are like way easier than the labels that I came up with</p>



<p>All right, so we&#8217;re gonna do this I</p>



<p>Can almost guarantee that when I&#8217;m done copy pasting everything something is not going to compile because I forgot a label somewhere</p>



<p>Else if equals six true, okay</p>



<p>equals six true okay so what&#8217;s happening here again um uh so at this point you know the first</p>



<p>if uh expression was not true r12 was definitely not equal to five so we jumped down to else if</p>



<p>equal six begin which was here and so then we just make another comparison to see well okay it was</p>



<p>those two things weren&#8217;t equal it wasn&#8217;t equal to five so let&#8217;s check to see if it was equal to six</p>



<p>to yet another scope.</p>



<p>If it was false, we go down to line 237</p>



<p>and jump to yet another scope.</p>



<p>So here is what will get executed</p>



<p>if R12 was indeed equal to six,</p>



<p>and then we&#8217;re just basically gonna say it to the user</p>



<p>and then jump to the done label,</p>



<p>meaning like we&#8217;re totally done with our if else block.</p>



<p>Notice how the first if here,</p>



<p>when it was totally finished, it jumped to the done area.</p>



<p>this else if block is also jumping down to the if done area.</p>



<p>So eventually we&#8217;re going to need that label.</p>



<p>Okay.</p>



<p>So then next we&#8217;re going to check to see if the user&#8217;s input was equal to a 10.</p>



<p>So like kind of the same thing here.</p>



<p>We&#8217;re going to do another copy paste and we&#8217;re going to say, all right.</p>



<p>So if the user&#8217;s input was not equal to, let&#8217;s see,</p>



<p>if it was not equal to five, then we jump down here for our next comparison.</p>



<p>comparison we check to see if it&#8217;s equal to six if it was not equal to six then we jump down to</p>



<p>the less 10 begin line which is like all the way down here we do another comparison to see all right</p>



<p>well is it less than 10 you know if it was not equal to five or not equal to six then we check</p>



<p>is it less than 10 if it uh if it is then we uh jump to the else if equal less 10 true block which</p>



<p>I made this way too complicated. I realize that now, but it&#8217;s too late. I&#8217;m going for it, man.</p>



<p>Anyway, so if that statement is true, if R12 was indeed less than 10, then we jump to this block</p>



<p>and we basically just say that to the user and then we jump to the done. So finally, notice how</p>



<p>this part right here on line 259, it&#8217;s basically saying if R12 was not less than 10, then we&#8217;ll</p>



<p>then we&#8217;ll jump somewhere else notice how it&#8217;s just else right so this is like the very the very</p>



<p>bottom so i think the way that i wrote this uh code is uh we have two else ifs right we have like</p>



<p>an if five else if six else if less than 10 so maybe i could do something like this um if r12</p>



<p>r12 I think I said six just now right hopefully I actually did say six</p>



<p>otherwise if r12 is less than 10 then do some stuff otherwise if nothing else</p>



<p>matched then we&#8217;ll execute you know this block right here so again remember</p>



<p>every single scope has to have its own label so that you know where to jump and</p>



<p>it&#8217;s also a really really smart idea for every single scope to have you know</p>



<p>to have a little jump instruction that jumps past all of the if else if else if else stuff</p>



<p>so we&#8217;ll say like you know label you know done so that we can make sure that only one of these</p>



<p>blocks actually executes which is how you&#8217;re supposed to imagine c and c plus plus work</p>



<p>um and so it&#8217;s just complicated because there&#8217;s a lot of stuff to copy paste but you can just</p>



<p>still see you know only one of these blocks ever is supposed to execute so we give the first one</p>



<p>we jump into it if it&#8217;s true if it&#8217;s not true then we give the second one a chance</p>



<p>we jump into it if it&#8217;s true if not we jump to compare the third one if it&#8217;s true then we jump</p>



<p>to its scope if not we jump to the else and the else always executes if nothing else above</p>



<p>was true so that&#8217;s the basic idea here oh dear i&#8217;ve probably lost my place</p>



<p>looks like i just copy pasted less 10 true which was this right here so</p>



<p>so um less than true or less than 10 true okay so we told the user your stuff is less than 10</p>



<p>and then we jumped to the done area so that means we are probably working on the else area okay let</p>



<p>me grab that so now finally we&#8217;re going to have the else area which is going to you know finish</p>



<p>this all up that&#8217;s going to be after the if done so if nothing else matched then we will end up</p>



<p>nothing else matched then we will end up jumping to the else area and then we&#8217;ll basically</p>



<p>just tell the user none of the conditions seemed to have applied and then even at the</p>



<p>end of the else block even though you could probably get away with just letting execution</p>



<p>fall through just to save yourself one instruction you know you could comment that out assuming</p>



<p>you were sure that the very next instruction was the beginning of the done area but otherwise</p>



<p>I&#8217;m just going to play it safe and jump directly there then we have to make the actual done</p>



<p>So, just so you know, a label doesn&#8217;t have to have any instructions.</p>



<p>We could have something like this, if else test say goodbye.</p>



<p>We could have two labels right next to each other and one doesn&#8217;t actually have instructions.</p>



<p>That&#8217;s totally fine.</p>



<p>If you jumped to the done area, then execution would just fall through to the next valid</p>



<p>instruction which could go through another label.</p>



<p>So you know, we could have a say goodbye label and an if done label.</p>



<p>if done label, I&#8217;m just going to have the goodbye stuff happening inside of the done.</p>



<p>But for clarity&#8217;s sake, you might want to keep that label in there that I just deleted.</p>



<p>And all that we need to do at the very end when we&#8217;re done with everything is just say goodbye.</p>



<p>So I&#8217;m just printing a message.</p>



<p>So just to do a quick recap here, let&#8217;s see.</p>



<p>We come in with the user&#8217;s input as R12.</p>



<p>We ask, does R12 equal five?</p>



<p>If that&#8217;s true, we&#8217;ll say that it was equal to 5, and then we&#8217;ll go to the done area,</p>



<p>meaning we&#8217;ll skip past all the other blocks for the if-else block, or all the other scopes.</p>



<p>But if that did not equal 5, then we&#8217;ll fall through to that jump instruction,</p>



<p>which takes us to the next test, which is going to be our else-if equals 6.</p>



<p>So we are checking now to see if R12 is equal to 6.</p>



<p>If that&#8217;s true, we jump to this next block.</p>



<p>Why do we need to jump to a block that&#8217;s so close?</p>



<p>Well, if we don&#8217;t, then we&#8217;re going to end up definitely jumping to the next comparison</p>



<p>and you know, that wouldn&#8217;t work.</p>



<p>So we&#8217;re just kind of jumping over this unconditional jump statement and we&#8217;re saying, all right,</p>



<p>your input was definitely equal to six.</p>



<p>And then we&#8217;re jumping to the done area just past everything.</p>



<p>But if that wasn&#8217;t true, then we hit this unconditional jump that takes us to the next</p>



<p>comparison to see if the user&#8217;s input was less than 10.</p>



<p>You know, if that&#8217;s true, then we go to the true area to print another message and then</p>



<p>go to the done area.</p>



<p>If it was false, we fall through to the else jump, which will take us to here.</p>



<p>And notice how the else scope doesn&#8217;t actually make any comparisons because, you know, when</p>



<p>you have like an if else, sorry, when you have an if else if else if else if, you know,</p>



<p>any number of else if blocks, the else will always be executed if nothing above it actually</p>



<p>did execute.</p>



<p>execute so if you have an else block that means something will execute so we&#8217;re not doing any</p>



<p>comparisons we&#8217;re just saying you know when that scope is done we&#8217;re just going to jump to the done</p>



<p>area so all of these different scopes they&#8217;re jumping to the done area when they finish and</p>



<p>the done area is just this label right here where we say goodbye and that&#8217;s it let&#8217;s see did i copy</p>



<p>paste everything that i was supposed to i think so probably so let&#8217;s run the program and see if it</p>



<p>All right, it at least compiled.</p>



<p>So the basic if test, that was the first part of either this video or the previous video,</p>



<p>depending on whether I chose to split this up.</p>



<p>So let me comment out those calls real fast.</p>



<p>So I&#8217;m going to just comment out these calls real quick so we can only deal with the complicated</p>



<p>if else block.</p>



<p>So I&#8217;m going to enter like a three.</p>



<p>Whoops, let me do it again.</p>



<p>Three.</p>



<p>And so begin the if else test.</p>



<p>test your input was definitely less than 10 and then we end the if-else test so notice how only</p>



<p>one scope executed three was definitely less than 10 what other numbers did we have let me write</p>



<p>them down somewhere so I don&#8217;t forget oh they&#8217;re written down right here so we entered a three</p>



<p>which was definitely not a five and not a six so that&#8217;s why the less than 10 block executed maybe</p>



<p>only the first scope should execute so it says your input was equal to five notice how it didn&#8217;t</p>



<p>mention that it was a six or less than ten and then if we do a six it should just tell us that</p>



<p>we have a six it will not mention the five it will not mention the ten so we did we did five</p>



<p>already and then we did six and we did like a two which was less than ten we could also do a one</p>



<p>which was less than ten we can do anything that was less than ten and then the else would be if</p>



<p>And then the else would be if our input is probably like 11 or greater,</p>



<p>meaning it&#8217;s not less than 10 and it&#8217;s also not five or six.</p>



<p>Just we can see the else block.</p>



<p>So I&#8217;m going to do 11, which is the first number that should trigger the else block.</p>



<p>And it says no conditions were satisfied,</p>



<p>which was the message inside of our else block.</p>



<p>Let me just show you that again real fast.</p>



<p>This was the else block.</p>



<p>So message if else else or labeling on my port, I realize that.</p>



<p>But it basically says no conditions were satisfied.</p>



<p>The if else else.</p>



<p>I think that&#8217;s basically everything that I wanted to show you.</p>



<p>At this point, you should feel like you&#8217;re starting to become an expert at complicated</p>



<p>if else if else blocks, converting those from a higher level language into assembly.</p>



<p>assembly and I honestly recommend that you practice this like crazy while you&#8217;re trying</p>



<p>to get more used to it but you know hopefully you have everything you need at this point</p>



<p>keep in mind I&#8217;ve said this at the beginning I&#8217;ve actually I think I said this in a different video</p>



<p>when we use these branching instructions notice how I have jump equal to where&#8217;s that less than</p>



<p>yeah notice how I have a instruction jump less than the the family of conditional branching</p>



<p>conditional branching instructions that compares less than greater than less than or equal to</p>



<p>greater than or equal to the ones that I&#8217;m using here apply to signed integers and they won&#8217;t</p>



<p>necessarily work with unsigned integers and they won&#8217;t work with floats if you compare floats later</p>



<p>so just keep that in mind let me pull up my favorite book again real fast</p>



<p>where what the heck is that book oh dude where&#8217;s my document viewer document viewer can I get</p>



<p>document viewer can I get there there we go so I guess I didn&#8217;t introduce this</p>



<p>book at the beginning of this video but I probably should have this is my</p>



<p>favorite assembly book you can turn yourself into an expert with this book</p>



<p>by just on its own it&#8217;s open source and free the author gives this away he&#8217;s a</p>



<p>genius the person who wrote this book is a dr. Ed Jorgensen he&#8217;s a professor he</p>



<p>wrote this for his own classes and again it&#8217;s like a free open source book you</p>



<p>download a copy from his website if you look this up and and convert yourself</p>



<p>into an expert so let me collapse everything here and then I&#8217;ll go to</p>



<p>instruction set overview control instructions conditional control</p>



<p>instructions and I just want you to see real fast just as a recap I talked about</p>



<p>this in a previous video but when it comes to comparing things and checking</p>



<p>operands because if you want to see if two operands are equal you just check to see if</p>



<p>all of their bits are equal you don&#8217;t even really care whether they&#8217;re both integers or not</p>



<p>on the other hand notice how there is like a family here jump less than jump less than equal</p>



<p>to jump greater than jump greater than equal to that those instructions apply only if your</p>



<p>if they are unsigned or if you&#8217;re using floats for your comparisons you have to use this other family</p>



<p>of jump conditional branching instructions called jump below jump below equal jump above jump above</p>



<p>equal and i&#8217;m sure you can infer that jump below is the same thing as jump less than right jump</p>



<p>less than or equal to is the same thing as jump below or equal to it&#8217;s just that you need to use</p>



<p>a different instruction uh if you&#8217;re using signed integers or floats versus sorry sorry</p>



<p>a versus sorry sorry you need to use different instructions if you&#8217;re using signed integers</p>



<p>versus unsigned integers or floats so keep that in mind the code demo that i just showed you it&#8217;s</p>



<p>for signed integers if you were going to use unsigned integers or floats you would this</p>



<p>program wouldn&#8217;t work for you you&#8217;d need to replace my my branching instructions with the</p>



<p>the unsigned versions which i mean they work the same thing you&#8217;re still going to do a comparison</p>



<p>it still works. Anyway, so after having shown you that and making sure that everything actually</p>



<p>did work, I think we&#8217;ve talked about everything that we need to for this video. So yeah, I hope</p>



<p>you feel like an expert practice this on your own, you know, write your own programs just to make</p>



<p>sure you know how to convert a higher level language block into an assembly block. And you</p>



<p>should be on your way. Thank you for watching this video. I hope you learned a little bit of</p>



<p>bit of stuff and had a little bit of fun tell your friends and i&#8217;ll see you in the next video</p>



<p>hey everybody thanks for watching this video again from the bottom of my heart i really</p>



<p>appreciate it i do hope you did learn something and have some fun uh if you could do me a please</p>



<p>a small little favor could you please subscribe and follow this channel or these videos or whatever</p>



<p>it is you do on the current social media website that you&#8217;re looking at right now</p>



<p>It would really mean the world to me and it&#8217;ll help make more videos and grow this community.</p>



<p>So we&#8217;ll be able to do more videos, longer videos, better videos, or just I&#8217;ll be able to keep making videos in general.</p>



<p>So please do me a kindness and subscribe.</p>



<p>You know, sometimes I&#8217;m sleeping in the middle of the night and I just wake up because I know somebody subscribed or followed.</p>



<p>It just wakes me up and I get filled with joy.</p>



<p>That&#8217;s exactly what happens every single time.</p>



<p>So you could do it as a nice favor to me or you could troll me if you want to just wake me up in the middle of the night.</p>



<p>just wake me up in the middle of the night just subscribe and then I&#8217;ll just wake up I promise</p>



<p>that&#8217;s what will happen also uh if you look at the middle of the screen right now you should see a</p>



<p>QR code which you can scan in order to go to the website which I think is also named somewhere at</p>



<p>the bottom of this video and it&#8217;ll take you to my main website where you can just kind of like see</p>



<p>all the videos I published and the services and tutorials and things that I offer and all that</p>



<p>for clarifications or errata or just future videos that you want to see please leave a comment or if</p>



<p>you just want to say hey what&#8217;s up what&#8217;s going on you know just send me a comment whatever I</p>



<p>also wake up for those in the middle of the night I get I wake up in a cold sweat and I&#8217;m like</p>



<p>it would really it really mean the world to me I would really appreciate it so again thank you so</p>



<p>much for watching this video and enjoy the cool music as as I fade into the darkness which is</p>



<p>the darkness which is coming for us all.</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/complex-if-elseif-else-in-x86-64-yasm-assembly-full-guide-with-code-examples/">Complex If-ElseIf-Else in x86-64 YASM Assembly &#8211; Full Guide with Code Examples</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/complex-if-elseif-else-in-x86-64-yasm-assembly-full-guide-with-code-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
