<?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>mulsd Archives - NeuralLantern.com</title>
	<atom:link href="https://www.NeuralLantern.com/tag/mulsd/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.NeuralLantern.com/tag/mulsd/</link>
	<description></description>
	<lastBuildDate>Sun, 15 Feb 2026 03:15:34 +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>mulsd Archives - NeuralLantern.com</title>
	<link>https://www.NeuralLantern.com/tag/mulsd/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>x86-64 Assembly: Floating Point Registers Basics with YASM (MOVSD, MULSD, CVTSI2SD)</title>
		<link>https://www.NeuralLantern.com/x86-64-assembly-floating-point-registers-basics-with-yasm-movsd-mulsd-cvtsi2sd/</link>
					<comments>https://www.NeuralLantern.com/x86-64-assembly-floating-point-registers-basics-with-yasm-movsd-mulsd-cvtsi2sd/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 15 Feb 2026 03:15:33 +0000</pubDate>
				<category><![CDATA[Assembly Language]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[assembly language tutorial]]></category>
		<category><![CDATA[convert integer to float assembly]]></category>
		<category><![CDATA[cvtsi2sd]]></category>
		<category><![CDATA[double precision assembly]]></category>
		<category><![CDATA[ed jorgensen x86 book]]></category>
		<category><![CDATA[floating point registers]]></category>
		<category><![CDATA[movsd]]></category>
		<category><![CDATA[mulsd]]></category>
		<category><![CDATA[nasm yasm floating point]]></category>
		<category><![CDATA[stack alignment assembly]]></category>
		<category><![CDATA[system v abi xmm]]></category>
		<category><![CDATA[x86 assembly floating point]]></category>
		<category><![CDATA[x86-64 assembly]]></category>
		<category><![CDATA[x86-64 linux assembly]]></category>
		<category><![CDATA[xmm registers]]></category>
		<category><![CDATA[xmm0]]></category>
		<category><![CDATA[Yasm tutorial]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=302</guid>

					<description><![CDATA[<p>Learn the basics of floating-point registers (XMM0–XMM15) in x86-64 assembly with YASM. Covers MOVSD, MULSD, CVTSI2SD, ABI rules, why floats return in XMM0 instead of RAX, saving/restoring around calls, and common stack alignment crashes when using printf.</p>
<p>The post <a href="https://www.NeuralLantern.com/x86-64-assembly-floating-point-registers-basics-with-yasm-movsd-mulsd-cvtsi2sd/">x86-64 Assembly: Floating Point Registers Basics with YASM (MOVSD, MULSD, CVTSI2SD)</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="x86-64 Assembly: Floating Point Registers Basics with YASM (MOVSD, MULSD, CVTSI2SD)" width="1380" height="776" src="https://www.youtube.com/embed/0Wcu_7LDw_w?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>Quick but thorough introduction to floating-point registers in x86-64 assembly using YASM.</p>



<p>Learn why XMM0 is special, how to use MOVSD / MULSD / CVTSI2SD, why you must save floats around function calls, and how easy (or sneaky) stack alignment bugs can crash your program.</p>



<p>Live coding + real examples converting integers to doubles and multiplying them.</p>



<p>Great next step after basic integer assembly tutorials.</p>



<p>00:00 Introduction to Floating Point Registers<br>00:28 Why Floating Point Uses Special Registers<br>01:35 Floating Point Return Value in XMM0<br>02:17 XMM Registers Overview XMM0 to XMM15<br>02:48 ABI Rules No Callee-Saved XMM Registers<br>03:16 128-bit XMM Registers Purpose and Size<br>04:00 Ed Jorgensen x86-64 Textbook Reference<br>05:03 Locating XMM Documentation in Textbook<br>05:20 Earthquake &#8211; I am going to die<br>06:24 Chapter 18 Floating Point Instructions<br>07:34 MOVSS vs MOVSD Single vs Double Precision<br>09:11 Understanding SS and SD Instruction Suffixes<br>10:58 MOVSD Example Register to Register<br>11:03 Conversion Instructions CVT Family<br>13:02 Floating Point Arithmetic ADDSD MULSD SUBSD<br>25:48 Program Demo User Input Section<br>26:01 Converting Integer to Double CVTSI2SD<br>26:29 Multiplying by Constant Float MULSD<br>28:56 Saving Result Printing Modified Float<br>31:38 Multiplying User Integer by User Float<br>33:54 Final Result Display Program Summary<br>35:19 Stack Alignment Crash Demonstration<br>36:24 Conclusion Key Takeaways<br>36:52 Outro Subscribe and Thanks</p>



<p>=-=-=-=-=-=-=-=-=</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>



<li>Twitter / X: https://x.com/NeuralLantern</li>



<li>Rumble: https://rumble.com/c/c-3696939</li>



<li>BitChute: https://www.bitchute.com/channel/pg1Pvv5dN4Gt</li>



<li>Daily Motion: https://www.dailymotion.com/neurallantern</li>



<li>Minds: https://www.minds.com/neurallantern/</li>



<li>Odysee: https://odysee.com/@NeuralLantern:5</li>
</ul>



<p>Please show your support!</p>



<ul class="wp-block-list">
<li>Buy me a coffee: https://ko-fi.com/neurallantern</li>



<li>Subscribe + Sharing on Social Media</li>



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



<li>Subscribe to Blog: https://www.NeuralLantern.com</li>



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



<p>Hey there! In this video we&#8217;re going to talk about pointers and dereferencing in a YASM x8664</p>



<p>assembly program, also as a hybrid program so that assembly and C++ can talk to each other</p>



<p>and send each other pointers and send each other data and things like that.</p>



<p>for what pointers are.</p>



<p>I&#8217;m going to write in C++ for a second.</p>



<p>Suppose you have a pointer for an integer.</p>



<p>We&#8217;ll call it P.</p>



<p>Suppose you have an integer by itself.</p>



<p>We&#8217;ll call it A.</p>



<p>Let&#8217;s say that the value of A is 5.</p>



<p>And if you wanted to say that P points to A,</p>



<p>you could say P equals the address of A.</p>



<p>I&#8217;ll put C++ at the top here.</p>



<p>And so now if I set A to 6</p>



<p>then I print P a dereference of P this is not like a full pointers tutorial</p>



<p>but basically by changing a I&#8217;m changing what P thinks it sees as a value</p>



<p>assuming ID reference it I could also let me do a print 6 here I could also</p>



<p>just change the value through P I could say dereference P and I could say equals</p>



<p>would actually print a seven right so you know you can have regular variables global variables</p>



<p>whatever kind of you know memory stuff on the stack and to get a pointer to it you really just</p>



<p>need to get its memory location in c++ it&#8217;s kind of easy syntactically you can see what&#8217;s happening</p>



<p>in assembly you really just need the memory location stored somewhere you could store that</p>



<p>variable that just simply stored the memory location of some other variable.</p>



<p>You could have a 64-bit register store the value of a variable.</p>



<p>Let&#8217;s say we have like a, I don&#8217;t know, my whatever, my number let&#8217;s say inside of assembly.</p>



<p>I&#8217;ll do ASM here and we say it&#8217;s a quad word and it starts off as this number or whatever.</p>



<p>So if you haven&#8217;t seen my previous videos, go see them for the basics of assembly and</p>



<p>of assembly and linking and make files and all that stuff but you know if you</p>



<p>have an assembly program and you have a data section and you define a global</p>



<p>variable like this what you&#8217;re basically saying is I want to take this giant</p>



<p>number and I want to write it into eight bytes that&#8217;s the DQ it says data quad</p>



<p>word I want to write that giant number across eight bytes and then I want to</p>



<p>get a pointer to it stored in the my number symbol so my number is not</p>



<p>actually the value it&#8217;s a pointer to the value so you know later if you want to</p>



<p>you know later if you want to move you know something into a register if you did this</p>



<p>that would move the pointer into rax but if you did this</p>



<p>with deref symbols after it or around it then you would move</p>



<p>maybe i&#8217;ll put that into rex you&#8217;d move that actual number that we specified into rex</p>



<p>into Rx. It&#8217;s important to understand also that pointers are integers even when we&#8217;re pointing to</p>



<p>doubles. So for example sometimes people make this mistake they&#8217;ll say you know my double</p>



<p>and they&#8217;ll say it&#8217;s a quad word meaning this is going to be a 64-bit double precision floating</p>



<p>point number and they&#8217;ll do like 44.55 or whatever. So that is a double and it is in memory</p>



<p>you know what is the symbol of my double remember it&#8217;s supposed to be just a</p>



<p>pointer right it can&#8217;t be an actual double because a memory location is not</p>



<p>a double a memory location is an integer so that means if you wanted to move a</p>



<p>pointer into a register you would only be able to move the pointer into a</p>



<p>regular general purpose register not a floating point register and you should</p>



<p>use the regular movement instructions for just regular general purpose</p>



<p>So keep that in mind if you see a signature like this like let&#8217;s say function F and we have</p>



<p>You know, let&#8217;s say long a and long B and actually let&#8217;s do pointers</p>



<p>Let&#8217;s say long pointer a and long pointer</p>



<p>B and double pointer C all three of those arguments are actually 64 bit integers</p>



<p>Because they&#8217;re all pointers even if one of the pointers points to adult a double</p>



<p>double why did I say dull pointers aren&#8217;t dull they&#8217;re exciting okay so I&#8217;m gonna open up some</p>



<p>code here real fast so usually I don&#8217;t explain my uh my driver I&#8217;m gonna explain it to you this time</p>



<p>because it&#8217;s kind of doing a little bit more than my other videos um again if you don&#8217;t have uh the</p>



<p>knowledge of how to make a make file see my other videos because that&#8217;s explained there for now I&#8217;m</p>



<p>what we really need to do is write a driver and an assembly module for a</p>



<p>hybrid program again hybrid programs covered in other videos so the driver is</p>



<p>pretty easy I&#8217;m just going to copy paste it honestly here and then just kind of</p>



<p>explain it to you the driver is pretty easy we&#8217;re going to do I O stream so we</p>



<p>can print stuff we&#8217;re going to mark an external function called point as extern</p>



<p>C so that just disables name mangling which means the C++ module will be able</p>



<p>will be able to call on this function called point and it won&#8217;t expect that</p>



<p>the point function has its name mangled like C++ does the reason being is that</p>



<p>point is actually going to be in a side it&#8217;s going to be inside assembly where</p>



<p>its name will not be mangled this disables the ability to overload but</p>



<p>that&#8217;s okay we don&#8217;t care it&#8217;s going to take two pointers a pointer to a character</p>



<p>and a pointer to a long since both of those are pointers they&#8217;re both</p>



<p>64-bit integers even the character pointer and then we have a function that is internal to this</p>



<p>module called hey driver print this remember we&#8217;re inside of the driver program right now</p>



<p>so if you look at the bottom it&#8217;s just a function that takes in some pointers</p>



<p>and then prints some stuff so it&#8217;s going to print like it&#8217;s going to print what the string is</p>



<p>it&#8217;s going to print what the long is my dog&#8217;s growling at me i&#8217;m going to ignore him because</p>



<p>i literally just let him pee and poop at this point now he&#8217;s harassing me for treats</p>



<p>now he&#8217;s harassing me for treats he always does this okay so uh the string the long the double</p>



<p>this function expects to receive three pointers to different data types it&#8217;s just going to print</p>



<p>all of them and the point get it the point of this function is we&#8217;re going to go inside of</p>



<p>the assembly module and then have the assembly module call on this function so that we can we</p>



<p>can prove that we can have stuff sent from assembly to c plus plus or c using pointers</p>



<p>using pointers we can have data sent over so anyway that&#8217;s why both of these</p>



<p>are in here the point needs to be marked as no name mangling because point is</p>



<p>inside of assembly which will not name mangle and then hey driver print this</p>



<p>that needs to have name mangling disabled also so that the assembly</p>



<p>module can call on this other than that we&#8217;re just basically inside of a main</p>



<p>saying hey this is the c string we&#8217;re making a c string inside of the main function notice how</p>



<p>this is a local variable so that c string is going to show up on the stack it&#8217;s going to show up in</p>



<p>the area that is owned by main for main stack area same thing for my long that&#8217;s a local variable on</p>



<p>the stack um and but then we can actually send pointers to those pieces of data to another</p>



<p>function in another module you don&#8217;t have to only transport globals or stuff on the heap</p>



<p>or stuff on the heap, you can transport pointers to local variables. Just make sure that by the</p>



<p>time this function finishes, then nowhere else is actually using that data because,</p>



<p>well, being on the stack, once main function or once any function finishes, then its portion of</p>



<p>the stack will be cleaned up and removed and it&#8217;ll be junk data. You&#8217;ll probably get a seg fault.</p>



<p>But for now, we&#8217;re not going to use anything on the stack. We&#8217;re not going to use these local</p>



<p>just going to use them quickly on this call to point and then we&#8217;re going to return to the</p>



<p>operating system and finish the program. So that&#8217;s the driver. Now the hard part. Let&#8217;s do this in</p>



<p>assembly. So for starters, I&#8217;m going to make a data section and just explain it to you very,</p>



<p>very quickly. Again, if you don&#8217;t understand the basics of YASM x86-64 assembly, did I mention</p>



<p>that that&#8217;s what this language is at the beginning of the video? I guess I should put that in the</p>



<p>put that in the description or record an announcement that I can tack on at the beginning</p>



<p>or something. Anyway, so if you don&#8217;t understand how to do this, see my other videos, but basically</p>



<p>we&#8217;re going to make a data section. We&#8217;re going to define some strings. Here&#8217;s like an announcement.</p>



<p>Oh, we&#8217;re inside of, you know, the module now, the assembly module. And now we&#8217;re going to print</p>



<p>the received string. And then we&#8217;re going to make a string that is owned by assembly, which we can</p>



<p>into C++ when we call the function inside of the driver.</p>



<p>So this string is owned by the assembly module.</p>



<p>Notice how these are null terminated strings.</p>



<p>I just have like a comma zero there,</p>



<p>which means I have some extra functions</p>



<p>I&#8217;m gonna paste in that we&#8217;re not really gonna talk about</p>



<p>because they&#8217;ve been discussed in other videos</p>



<p>just so that we can print null terminated strings.</p>



<p>Then I&#8217;ve got a new line here,</p>



<p>you know, carriage return line feed.</p>



<p>And then I&#8217;ve just got some numbers</p>



<p>that are owned by the assembly module.</p>



<p>Then I&#8217;ve got a system write call,</p>



<p>call code one for the system call writes and file descriptor standard output so I</p>



<p>can print just to the terminal again if you don&#8217;t understand this see my other</p>



<p>videos so now let&#8217;s start the actual text section so this is where our</p>



<p>instructions start so we got the text section here and we&#8217;re going to use some</p>



<p>external symbols don&#8217;t worry about these I&#8217;m just using my own little library to</p>



<p>and input integers if you have access to this library use it if you don&#8217;t if you&#8217;re watching</p>



<p>at home and you don&#8217;t have this library then that&#8217;s fine you can use you know printf or</p>



<p>scanf or something like that to get and print floats from and to the user</p>



<p>but yeah I&#8217;m just using that and then I&#8217;m marking an external function here called hey driver print</p>



<p>this if you recall the driver module has a function called hey driver print this so</p>



<p>just allows my assembly code to call on that external function. Okay now next</p>



<p>piece of code. This is going to be… actually I&#8217;m going to paste the print</p>



<p>null terminated string function and related code because it&#8217;s just like a</p>



<p>big giant mess and we&#8217;re mostly going to ignore it. So just to show you what I&#8217;m</p>



<p>doing here I have a function called print null terminated string so that I</p>



<p>can print these strings up here and then I have it rely on a function called</p>



<p>string length that I have implemented up here and all it does is just</p>
<p>The post <a href="https://www.NeuralLantern.com/x86-64-assembly-floating-point-registers-basics-with-yasm-movsd-mulsd-cvtsi2sd/">x86-64 Assembly: Floating Point Registers Basics with YASM (MOVSD, MULSD, CVTSI2SD)</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/x86-64-assembly-floating-point-registers-basics-with-yasm-movsd-mulsd-cvtsi2sd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
