<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>大坡3D软件开发 - 汇编编译器</title><link>http://blog.csdn.net/caimouse/category/281237.aspx</link><description>参考ＮＡＳＭ的设计与实现</description><dc:language>zh-CN</dc:language><lastUpdateTime>Tue, 22 Apr 2008 21:18:49 GMT</lastUpdateTime><ttl>60</ttl><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(69)全局变量的初始化</title><link>http://blog.csdn.net/caimouse/archive/2007/08/31/1767691.aspx</link><pubDate>Fri, 31 Aug 2007 22:07:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/31/1767691.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1767691.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/31/1767691.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1767691.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1767691</trackback:ping><description>前面已经介绍了全局函数和全局变量的声明处理，但全局变量的初始化，还没有详细地分析，现在就来干这件事情。比如编写C的程序，有如下的代码：&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1767691.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(68)内存分配链表</title><link>http://blog.csdn.net/caimouse/archive/2007/08/26/1759392.aspx</link><pubDate>Sun, 26 Aug 2007 11:35:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/26/1759392.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1759392.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/26/1759392.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1759392.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1759392</trackback:ping><description>LCC采用大块内存的方法，那它分配内存也是比较特殊的，它的源程序如下：
&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1759392.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(67)删除内存链表</title><link>http://blog.csdn.net/caimouse/archive/2007/08/23/1756684.aspx</link><pubDate>Thu, 23 Aug 2007 21:50:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/23/1756684.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1756684.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/23/1756684.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1756684.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1756684</trackback:ping><description>LCC的内存分配是使用先分配大块内存，然后再从大块内存里分配出来小块内存，这样减少调用malloc的次数，当然也就减少调用函数free释放内存的次数，以便提高LCC的内存管理的性能。&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1756684.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(66)DAG树分析例子 </title><link>http://blog.csdn.net/caimouse/archive/2007/08/13/1741748.aspx</link><pubDate>Mon, 13 Aug 2007 22:47:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/13/1741748.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1741748.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/13/1741748.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1741748.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1741748</trackback:ping><description>前面已经介绍创建分析树，下面就来详细地说明一个例子，看看到底生成什么样的分析树，C源程序如下：&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1741748.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(65)后端接口的结构注释</title><link>http://blog.csdn.net/caimouse/archive/2007/08/11/1738376.aspx</link><pubDate>Sat, 11 Aug 2007 19:20:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/11/1738376.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1738376.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/11/1738376.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1738376.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1738376</trackback:ping><description>因为LCC后端可以生成不同机器结构的代码，所以需要定义后端的接口结构，当不同的模块实现这些接口时，就可以实现不同的机器代码生成。下面就是这个接口的结构定义注释。
&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1738376.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(64)符号表的结构注释</title><link>http://blog.csdn.net/caimouse/archive/2007/08/10/1737480.aspx</link><pubDate>Fri, 10 Aug 2007 21:32:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/10/1737480.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1737480.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/10/1737480.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1737480.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1737480</trackback:ping><description>符号表是用来保存每个符号信息的，因为编译器分析源程序的过程会生成很多符号的属性，后端根据这些属性来生成合适的指令和代码的格式。&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1737480.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(63)创建DAG森林的源程序</title><link>http://blog.csdn.net/caimouse/archive/2007/08/09/1735308.aspx</link><pubDate>Thu, 09 Aug 2007 21:55:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/09/1735308.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1735308.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/09/1735308.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1735308.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1735308</trackback:ping><description>创建DAG森林.
&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1735308.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(62)生成常量树节点的流程</title><link>http://blog.csdn.net/caimouse/archive/2007/08/07/1730738.aspx</link><pubDate>Tue, 07 Aug 2007 21:45:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/07/1730738.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1730738.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/07/1730738.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1730738.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1730738</trackback:ping><description>在LCC里分析下面的语句:
#005  int nTest1 = 1;
&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1730738.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(61)复合语句的代码块流程</title><link>http://blog.csdn.net/caimouse/archive/2007/08/03/1725083.aspx</link><pubDate>Fri, 03 Aug 2007 20:39:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/08/03/1725083.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1725083.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/08/03/1725083.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1725083.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1725083</trackback:ping><description>LCC编译器要分析下面的程序，大体流程是这样的。&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1725083.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(60)代码表的结构 </title><link>http://blog.csdn.net/caimouse/archive/2007/07/27/1712881.aspx</link><pubDate>Fri, 27 Jul 2007 23:10:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/07/27/1712881.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1712881.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/07/27/1712881.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1712881.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1712881</trackback:ping><description>在LCC里使用代码表来表示代码块，前端把所有代码属性放到代码表里，后端根据代码表来生成代码，它的结构如下：&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1712881.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(59)代码生成的源程序注释</title><link>http://blog.csdn.net/caimouse/archive/2007/07/22/1702182.aspx</link><pubDate>Sun, 22 Jul 2007 17:18:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/07/22/1702182.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1702182.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/07/22/1702182.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1702182.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1702182</trackback:ping><description>下面详细地注释了gen.c的源程序，这样看起来就比较容易理解，希望对你有所帮助。&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1702182.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(58)后端使用的节点结构</title><link>http://blog.csdn.net/caimouse/archive/2007/07/21/1701630.aspx</link><pubDate>Sat, 21 Jul 2007 21:29:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/07/21/1701630.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1701630.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/07/21/1701630.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1701630.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1701630</trackback:ping><description>在LCC编译器后端，主要使用下面的节点结构来标识代码属性。&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1701630.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(57)不同目标代码生成的接口结构</title><link>http://blog.csdn.net/caimouse/archive/2007/07/20/1700917.aspx</link><pubDate>Fri, 20 Jul 2007 21:00:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/07/20/1700917.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1700917.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/07/20/1700917.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1700917.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1700917</trackback:ping><description>LCC为了生成不同机器的目标代码，它提供了一个接口给后端的代码生成，以便可以只修改后端，就可以达到生成不同的机器代码。&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1700917.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(56)寄存器分配的属性结构</title><link>http://blog.csdn.net/caimouse/archive/2007/07/17/1696021.aspx</link><pubDate>Tue, 17 Jul 2007 22:15:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/07/17/1696021.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1696021.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/07/17/1696021.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1696021.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1696021</trackback:ping><description>现在详细地分析寄存器分配的属性结构，它的定义如下：&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1696021.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>caimouse</dc:creator><title>LCC编译器的源程序分析(55)最终代码的生成</title><link>http://blog.csdn.net/caimouse/archive/2007/07/16/1694072.aspx</link><pubDate>Mon, 16 Jul 2007 21:41:00 GMT</pubDate><guid>http://blog.csdn.net/caimouse/archive/2007/07/16/1694072.aspx</guid><wfw:comment>http://blog.csdn.net/caimouse/comments/1694072.aspx</wfw:comment><comments>http://blog.csdn.net/caimouse/archive/2007/07/16/1694072.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/caimouse/comments/commentRss/1694072.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1694072</trackback:ping><description>上次已经说明了怎么样选择合适的指令，现在就来介绍生成最终的代码，如下：
#010 mov dword [ebp + -12], 1
其实生成上面的代码是通过后面的语句来构造出来的，它的过程如下：
ASGNI4(ADDRLP4(nTest1), CNSTI4(1))
stmt: ASGNI4(addr,rc) / mov dword %0, %1
addr: base / [%0]
base: ADDRLP4 / ebp + %a
rc: con / %0
con: CNSTI4 / %a&lt;img src ="http://blog.csdn.net/caimouse/aggbug/1694072.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>