<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Comments for page &quot;系統程式&quot;</title>
		<link>http://sp1.wikidot.com/book/comments/show</link>
		<description></description>
				<copyright></copyright>
		<lastBuildDate>Thu, 17 May 2012 19:25:24 +0000</lastBuildDate>
		
					<item>
				<guid>http://sp1.wikidot.com/book/comments/show#post-1063670</guid>
				<title>(no title)</title>
				<link>http://sp1.wikidot.com/book/comments/show#post-1063670</link>
				<description></description>
				<pubDate>Fri, 18 Mar 2011 14:07:39 +0000</pubDate>
				<wikidot:authorName>Mr.K</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>問題1:<br /> 在你的機器上測試 那些區域變數的位址是由OS處理的虛擬位址<br /> a的位址大於b的位址 是因為a和b是區域變數 執行時期是使用到記憶體的stack部份<br /> 而stack是由高位址往低位址 在陳老師的系統程式書裡P5-19圖5.14(a)<br /> 所以a的位址大於b的位址<br /> 至於你說的little endian是指資料放進記憶體的順序 應該和你問的問題無關</p> <p>問題2:<br /> 通常是由OS處理看它想要安排什麼樣的位址<br /> 想要連續位址 可以對Compiler做設定對齊位址 或是 使用陣列或結構 等…<br /> 但我猜是因為你用64Bits的OS+64Bits的CPU</p> <p>以上我說的不一定全對<br /> 只是就我所知道的給你參考</p> <p>有錯的話還請給予指正<br /> 謝謝</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://sp1.wikidot.com/book/comments/show#post-1063664</guid>
				<title>(no title)</title>
				<link>http://sp1.wikidot.com/book/comments/show#post-1063664</link>
				<description></description>
				<pubDate>Fri, 18 Mar 2011 14:06:22 +0000</pubDate>
				<wikidot:authorName>Mr.K</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>麻煩陳老師幫我刪除這篇多打的留言<br /> 謝謝</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://sp1.wikidot.com/book/comments/show#post-1032101</guid>
				<title>(no title)</title>
				<link>http://sp1.wikidot.com/book/comments/show#post-1032101</link>
				<description></description>
				<pubDate>Mon, 07 Mar 2011 07:46:55 +0000</pubDate>
				<wikidot:authorName>江建安</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>陳老師您好, 拜讀您的大作後開始了C的學習, 然而目前遇到2個疑問是關於記憶體位址和所佔用大小, 懇請解惑, 程式如下</p> <p>#include &lt;stdio.h&gt;;</p> <p>int main() {<br /> //整數變數, 佔用4byte<br /> int a = 0;<br /> //倍精度浮點數, 佔用8byte<br /> double b = 0;<br /> //輸出大小後, 各顯示4與8, 這部分沒問題<br /> printf("大小:\n int: %d\n double: %d\n", sizeof(a), sizeof(b));</p> <p>//輸出a與b的位址<br /> //問題1: 在我的機器上測試, a的位址是22FF44, b的位址是22FF38, 為何a顯示的位址數字大於b?(經查證, 是因為x86採用little endian, 所以順序顛倒, 但不知其所以然)<br /> //問題2: 為何b被定址為與a相差12的位址? 我認為宣告int a佔用了4byte, 表示在a定址後經過了4byte才又定址b, 所以b應該被定址為22FF40, 難道是傳說中的隨機存取機制???)<br /> printf("位址:\n a: %X\n b: %X\n", &amp;a, &amp;b);</p> <p>system("pause");<br /> return 0;<br /> }</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://sp1.wikidot.com/book/comments/show#post-800394</guid>
				<title>歡迎留言</title>
				<link>http://sp1.wikidot.com/book/comments/show#post-800394</link>
				<description></description>
				<pubDate>Fri, 04 Jun 2010 00:22:33 +0000</pubDate>
				<wikidot:authorName>陳鍾誠</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>作者竭誠的歡迎任何人留言!</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>
