<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: x86 Assembly for C Programmers 1</title>
	<atom:link href="http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/</link>
	<description>pwning the rainbow since... 2010</description>
	<lastBuildDate>Fri, 06 Jan 2012 22:34:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Robert Bieber</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-491</link>
		<dc:creator>Robert Bieber</dc:creator>
		<pubDate>Fri, 06 Jan 2012 22:34:47 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-491</guid>
		<description>Just a heads up, you define &quot;Word&quot; at the top as 32 bits, but then go on to explain that a DWORD is also 32 bits.  The reason for this is that while a &quot;word&quot; generally speaking fits the definition you gave, in x86 assembly in particular it&#039;s usually used to refer to 2 bytes, even though we&#039;ve moved on to 32 and 64 bit processors.  This is why a DWORD (double word) is the same size as the processor&#039;s actual word size.</description>
		<content:encoded><![CDATA[<p>Just a heads up, you define &#8220;Word&#8221; at the top as 32 bits, but then go on to explain that a DWORD is also 32 bits.  The reason for this is that while a &#8220;word&#8221; generally speaking fits the definition you gave, in x86 assembly in particular it&#8217;s usually used to refer to 2 bytes, even though we&#8217;ve moved on to 32 and 64 bit processors.  This is why a DWORD (double word) is the same size as the processor&#8217;s actual word size.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: endeavormac</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-74</link>
		<dc:creator>endeavormac</dc:creator>
		<pubDate>Tue, 13 Apr 2010 17:14:14 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-74</guid>
		<description>BX is simply the 16 least significant bits of the EBX register. Actually, I&#039;m not entirely sure if it&#039;s the least or most significant bits. In any case, you can use BX to access the 16 (most&#124;least) significant bits of the EBX register (assuming a current 32bit intel CPU).

This url may provide some enlightenment: http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_4/CH04-1.html#HEADING1-42

A short is 16 bits, so make sure your printf string is adjusted (You&#039;ll need %h) http://www.opengroup.org/onlinepubs/000095399/functions/printf.html

So if you want to print out BX, you&#039;ll need to push BX onto the stack, followed by a pointer to a string &quot;%h&quot;, and then call printf. Because BX is only 16 bits and, assuming a 32 bit platform, you&#039;re pushing BX onto a 32 bit word, you may want to mov a 0x0 into that stack space first, or otherwise insure that it is empty, to account for whatever may already be in place of the other 16 bits. I&#039;m not positive that would be necessary, you would have to experiment.

You may have better luck creating a simple C app that does all this and then &quot;gcc source.c -S&quot; to see what you get.</description>
		<content:encoded><![CDATA[<p>BX is simply the 16 least significant bits of the EBX register. Actually, I&#8217;m not entirely sure if it&#8217;s the least or most significant bits. In any case, you can use BX to access the 16 (most|least) significant bits of the EBX register (assuming a current 32bit intel CPU).</p>
<p>This url may provide some enlightenment: <a href="http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_4/CH04-1.html#HEADING1-42" rel="nofollow">http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_4/CH04-1.html#HEADING1-42</a></p>
<p>A short is 16 bits, so make sure your printf string is adjusted (You&#8217;ll need %h) <a href="http://www.opengroup.org/onlinepubs/000095399/functions/printf.html" rel="nofollow">http://www.opengroup.org/onlinepubs/000095399/functions/printf.html</a></p>
<p>So if you want to print out BX, you&#8217;ll need to push BX onto the stack, followed by a pointer to a string &#8220;%h&#8221;, and then call printf. Because BX is only 16 bits and, assuming a 32 bit platform, you&#8217;re pushing BX onto a 32 bit word, you may want to mov a 0&#215;0 into that stack space first, or otherwise insure that it is empty, to account for whatever may already be in place of the other 16 bits. I&#8217;m not positive that would be necessary, you would have to experiment.</p>
<p>You may have better luck creating a simple C app that does all this and then &#8220;gcc source.c -S&#8221; to see what you get.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Min</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-69</link>
		<dc:creator>Min</dc:creator>
		<pubDate>Tue, 06 Apr 2010 07:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-69</guid>
		<description>is there a way to make the output 16 bit instead of 32 bit? For example i want bx instead of ebx</description>
		<content:encoded><![CDATA[<p>is there a way to make the output 16 bit instead of 32 bit? For example i want bx instead of ebx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: inter</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-8</link>
		<dc:creator>inter</dc:creator>
		<pubDate>Thu, 29 Oct 2009 22:49:53 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-8</guid>
		<description>gcc -O0 -g -c one.c
objdump -C -M intel -S one.o

This gives an even better result (asm code with source code side by side).</description>
		<content:encoded><![CDATA[<p>gcc -O0 -g -c one.c<br />
objdump -C -M intel -S one.o</p>
<p>This gives an even better result (asm code with source code side by side).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: endeavormac</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-6</link>
		<dc:creator>endeavormac</dc:creator>
		<pubDate>Fri, 23 Oct 2009 21:13:23 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-6</guid>
		<description>I didn&#039;t know about this feature for gcc, and this is awesome. Thanks!</description>
		<content:encoded><![CDATA[<p>I didn&#8217;t know about this feature for gcc, and this is awesome. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jldugger</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-5</link>
		<dc:creator>jldugger</dc:creator>
		<pubDate>Fri, 23 Oct 2009 20:54:33 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-5</guid>
		<description>gcc -S -masm=intel -o one.asm one.c

For writing your own code, use the compiler instead of the object analyzer. You get jump targets, which is damn handy.


Also stack alignment has more to do with processor design than memory segmentation.</description>
		<content:encoded><![CDATA[<p>gcc -S -masm=intel -o one.asm one.c</p>
<p>For writing your own code, use the compiler instead of the object analyzer. You get jump targets, which is damn handy.</p>
<p>Also stack alignment has more to do with processor design than memory segmentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: drill</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-4</link>
		<dc:creator>drill</dc:creator>
		<pubDate>Fri, 23 Oct 2009 19:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-4</guid>
		<description>Two requests:

1) Give this series its own special tag on your blog so it&#039;s easy to access the whole thing when you&#039;re done ;)

2) some ideas of simple projects a beginner could do that are actually doable
  a) in assembly
  b) by someone with the knowledge level this is aimed at.

I&#039;m bookmarking your site.</description>
		<content:encoded><![CDATA[<p>Two requests:</p>
<p>1) Give this series its own special tag on your blog so it&#8217;s easy to access the whole thing when you&#8217;re done ;)</p>
<p>2) some ideas of simple projects a beginner could do that are actually doable<br />
  a) in assembly<br />
  b) by someone with the knowledge level this is aimed at.</p>
<p>I&#8217;m bookmarking your site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: endeavormac</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-3</link>
		<dc:creator>endeavormac</dc:creator>
		<pubDate>Fri, 23 Oct 2009 16:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-3</guid>
		<description>You are correct, thanks. Correction has been made.</description>
		<content:encoded><![CDATA[<p>You are correct, thanks. Correction has been made.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J</title>
		<link>http://myw3b.net/blog/index.php/2009/10/assembly-for-c-programmers-1/comment-page-1/#comment-2</link>
		<dc:creator>J</dc:creator>
		<pubDate>Fri, 23 Oct 2009 16:11:19 +0000</pubDate>
		<guid isPermaLink="false">http://myw3b.net/blog/?p=7#comment-2</guid>
		<description>Great tutorial :)  I feel like I could just about jump in and start writing.

In the synopsis for the instruction at 80483df, perhaps the line:
0xdf = 0×02...
should read:
0xdf + 0×02
?
I stared at that for a couple of minutes before working it out.</description>
		<content:encoded><![CDATA[<p>Great tutorial :)  I feel like I could just about jump in and start writing.</p>
<p>In the synopsis for the instruction at 80483df, perhaps the line:<br />
0xdf = 0×02&#8230;<br />
should read:<br />
0xdf + 0×02<br />
?<br />
I stared at that for a couple of minutes before working it out.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic (Requested URI is rejected)

Served from: myw3b.net @ 2012-05-19 08:02:04 -->
