亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? chapter 11 preprocessor directives -- valvano.htm

?? 嵌入式系統(tǒng)中c的開發(fā)
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0058)http://www.ece.utexas.edu/~valvano/embed/chap11/chap11.htm -->
<HTML><HEAD><TITLE>Chapter 11: Preprocessor Directives -- Valvano</TITLE>
<META http-equiv=content-type content=text/html;charset=iso-8859-1>
<META content="MSHTML 5.50.3825.1300" name=GENERATOR>
<META 
content="StarMax HD:Microsoft Office 98:Templates:Web Pages:Blank Web Page" 
name=Template></HEAD>
<BODY vLink=#800080 link=#0000ff>
<P><!--Developing Embedded Software in C using ICC11/ICC12/Hiware by Jonathan W. Valvano--><B><FONT 
face="Times New Roman,Times" size=4>Chapter 11: Preprocessor 
Directives</FONT></B></P>
<P><B><I><FONT face=Helvetica,Arial>What's in Chapter 11?</FONT></I></B></P>
<DIR>
<P><A 
href="http://www.ece.utexas.edu/~valvano/embed/chap11/chap11.htm#MACRO">Using 
#define to create macros</A><FONT face=Monaco><BR></FONT><A 
href="http://www.ece.utexas.edu/~valvano/embed/chap11/chap11.htm#DEFINITIONS">Using 
#ifdef to implement conditional compilation</A><FONT face=Monaco><BR></FONT><A 
href="http://www.ece.utexas.edu/~valvano/embed/chap11/chap11.htm#INTERPRETER">Using 
#include to load other software modules</A><FONT face=Monaco><BR></FONT><A 
href="http://www.ece.utexas.edu/~valvano/embed/chap11/chap11.htm#PRAGMA">Using 
#pragma to write interrupt software</A></P></DIR>
<P><FONT face="Times New Roman,Times">C compilers incorporate a preprocessing 
phase that alters the source code in various ways before passing it on for 
compiling. Four capabilities are provided by this facility in C. They are: 
</FONT></P>
<UL>
  <P><FONT face="Times New Roman,Times">macro processing <BR>inclusion of text 
  from other files <BR>conditional compiling <BR>in-line assembly language 
  </FONT></P></UL>
<P><FONT face="Times New Roman,Times">The preprocessor is controlled by 
directives which are not part of the C language proper. Each directive begins 
with a <B>#</B>character and is written on a line by itself. Only the 
preprocessor sees these directive lines since it deletes them from the code 
stream after processing them. </FONT></P>
<P><FONT face="Times New Roman,Times">Depending on the compiler, the 
preprocessor may be a separate program or it may be integrated into the compiler 
itself. C has an integrated preprocessor that operates at the front end of its 
single pass algorithm. </FONT></P>
<P><FONT face="Times New Roman,Times"><B><A 
name=MACRO></A></B></FONT><B><I><FONT face=Helvetica,Arial>Macro 
Processing</FONT></I></B></P>
<P><FONT face="Times New Roman,Times">We use macros for three reasons. 1) To 
save time we can define a macro for long sequences that we will need to repeat 
many times. 2) To clarify the meaning of the software we can define a macro 
giving a symbolic name to a hard-to-understand sequence. The I/O port #define 
macros are good examples of this reason. 3) To make the software easy to change, 
we can define a macro such that changing the macro definition, automatically 
updates the entire software. </FONT></P>
<UL>
  <P><CODE>#define Name CharacterString?... </CODE></P></UL>
<P><FONT face="Times New Roman,Times">define names which stand for arbitrary 
strings of text. After such a definition, the preprocessor replaces each 
occurrence of <I>Name</I> (except in string constants and character constants) 
in the source text with <I>CharacterString?...</I>. As C implements this 
facility, the term macro is misleading, since parameterized substitutions are 
not supported. That is, <I>CharacterString?...</I> does not change from one 
substitution to another according to parameters provided with <I>Name</I> in the 
source text. </FONT></P>
<P><FONT face="Times New Roman,Times">C accepts macro definitions only at the 
global level. </FONT></P>
<P><FONT face="Times New Roman,Times">The <I>Name</I> part of a macro definition 
must conform to the standard C naming conventions as described in <A 
href="http://www.ece.utexas.edu/~valvano/embed/chap2/chap2.htm">Chapter 2</A>. 
<I>CharacterString?...</I> begins with the first printable character following 
<I>Name</I> and continues through the last printable character of the line or 
until a comment is reached. </FONT></P>
<P><FONT face="Times New Roman,Times">If <I>CharacterString?...</I> is missing, 
occurrences of <I>Name</I> are simply squeezed out of the text. Name matching is 
based on the whole name (up to 8 characters); part of a name will not match. 
Thus the directive </FONT></P>
<UL>
  <P><CODE>#define size 10</CODE></P></UL>
<P><FONT face="Times New Roman,Times">will change</FONT></P>
<UL>
  <P><CODE>short data[size];</CODE></P></UL>
<P><FONT face="Times New Roman,Times">into</FONT></P>
<UL>
  <P><CODE>short data[10];</CODE></P></UL>
<P>&nbsp;</P>
<P><FONT face="Times New Roman,Times">but it will have no effect on</FONT></P>
<UL>
  <P><CODE>short data[size1];</CODE></P></UL>
<P><FONT face="Times New Roman,Times">Replacement is also performed on 
subsequent <B>#define</B> directives, so that new symbols may be defined in 
terms of preceding ones. </FONT></P>
<P><FONT face="Times New Roman,Times">The most common use of <B>#define</B> 
directives is to give meaningful names to constants; i.e., to define so called 
<I>manifest constants</I>. However, we may replace a name with anything at all, 
a commonly occurring expression or sequence of statements for instance. To 
disable interrupt during a critical section we could implement.</FONT></P>
<DIR>
<P><CODE>#define START_CRITICAL asm(" tpa\n staa %SaveSP\n sei")<BR>#define 
END_CRITICAL asm( ldaa %SaveSP\n tap")<BR>void function(void) {unsigned char 
SaveSP;<BR>&nbsp;&nbsp;&nbsp;&nbsp;START_CRITICAL; /* make atomic, entering 
critical section */<BR>&nbsp;&nbsp;&nbsp;&nbsp; /* we have exclusive access to 
global variables */<BR>&nbsp;&nbsp;&nbsp;&nbsp;END_CRITICAL; /* end critical 
section */<BR>}</CODE></P></DIR>
<ADDRESS><FONT face="Times New Roman,Times">Listing 11.1: Example of 
#define</FONT></ADDRESS>
<P>&nbsp;</P>
<P><FONT face="Times New Roman,Times"><B><A name=CONDITION></A>Conditional 
Compiling</B></FONT></P>
<P><FONT face="Times New Roman,Times">This preprocessing feature lets us 
designate parts of a program which may or may not be compiled depending on 
whether or not certain symbols have been defined. In this way it is possible to 
write into a program optional features which are chosen for inclusion or 
exclusion by simply adding or removing <B>#define </B>directives at the 
beginning of the program. </FONT></P>
<P><FONT face="Times New Roman,Times">When the preprocessor encounters 
</FONT></P>
<UL>
  <P><CODE>#ifdef Name</CODE><FONT face="Times New Roman,Times"> </FONT></P></UL>
<P><FONT face="Times New Roman,Times">it looks to see if the designated name has 
been defined. If not, it throws away the following source lines until it finds a 
matching </FONT></P>
<UL>
  <P><CODE>#else </CODE></P></UL>
<P><FONT face="Times New Roman,Times">or </FONT></P>
<UL>
  <P><CODE>#endif </CODE></P></UL>
<P><FONT face="Times New Roman,Times">directive. The <B>#endif </B>directive 
delimits the section of text controlled by <B>#ifdef</B>, and the <B>#else</B> 
directive permits us to split conditional text into true and false parts. The 
first part (<B>#ifdef...#else</B>) is compiled only if the designated name is 
defined, and the second (<B>#else...#endif</B>) only if it is not defined. 
</FONT></P>
<P><FONT face="Times New Roman,Times">The converse of <B>#ifdef</B> is the 
</FONT></P>
<UL>
  <P><CODE>#ifndef Name </CODE></P></UL>
<P><FONT face="Times New Roman,Times">directive. This directive also takes 
matching <B>#else</B> and <B>#endif</B> directives. In this case, however, if 
the designated name is not defined, then the first (<B>#ifndef...#else</B>) or 
only (<B>#ifndef...#endif</B>) section of text is compiled; otherwise, the 
second (<B>#else...#endif</B>), if present, is compiled. </FONT></P>
<P><FONT face="Times New Roman,Times">Nesting of these directives is allowed; 
and there is no limit on the depth of nesting. It is possible, for instance, to 
write something like </FONT></P>
<P><CODE>#ifdef ABC<BR>... /* ABC */<BR>#ifndef DEF<BR>... /* ABC and not DEF 
*/<BR>#else<BR>... /* ABC and DEF */<BR>#endif<BR>... /* ABC */<BR>#else<BR>... 
/* not ABC */<BR>#ifdef HIJ<BR>... /* not ABC but HIJ */<BR>#endif<BR>... /* not 
ABC */<BR>#endif</CODE></P>
<ADDRESS><FONT face="Times New Roman,Times">Listing 11.2: Examples on 
conditional compilation</FONT></ADDRESS>
<P><FONT face="Times New Roman,Times">where the ellipses represent conditionally 
compiled code, and the comments indicate the conditions under which the various 
sections of code are compiled.</FONT></P>
<P><FONT face="Times New Roman,Times">A good application of conditional 
compilation is inserting debugging instrumemts. In this example the only purpose 
of writing to PORTC is assist in performance debugging. Once the system is 
debugged,we can remove all the debugging code, simply by deleting the 
</FONT><CODE>#define Debug 1</CODE><FONT face="Times New Roman,Times"> 
line.</FONT></P>
<P><CODE>#define Debug 1<BR>int Sub(int j){ int i;<BR>#ifdef 
Debug<BR>&nbsp;&nbsp;&nbsp;&nbsp;PORTC|=0x01; /* PC0 set when Sub is entered 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美人体做爰大胆视频| 久久国产麻豆精品| av一本久道久久综合久久鬼色| 欧美电影影音先锋| 亚洲精品中文字幕在线观看| 狠狠狠色丁香婷婷综合激情| 欧美一级日韩一级| 亚洲一区在线观看免费观看电影高清| av不卡一区二区三区| 亚洲国产高清在线观看视频| 国产精品亚洲第一区在线暖暖韩国 | 成人网在线免费视频| 久久精品夜夜夜夜久久| 麻豆高清免费国产一区| 日韩欧美一区二区不卡| 日本不卡在线视频| 日韩欧美国产不卡| 玖玖九九国产精品| 久久精品欧美一区二区三区不卡| 韩日av一区二区| 中文字幕第一页久久| av网站免费线看精品| 亚洲高清一区二区三区| 欧美一级二级三级乱码| 久久精品999| 国产精品无人区| 在线免费亚洲电影| 日韩精品视频网| 久久品道一品道久久精品| av一区二区三区在线| 亚洲一区二三区| 欧美v国产在线一区二区三区| 国产精品一区二区视频| 亚洲婷婷国产精品电影人久久| 色网综合在线观看| 美女网站在线免费欧美精品| 中文字幕免费观看一区| 在线免费观看日本欧美| 另类成人小视频在线| 日本一区二区三区在线观看| 91浏览器入口在线观看| 青青国产91久久久久久| 18欧美乱大交hd1984| 欧美变态tickling挠脚心| 99精品视频一区二区| 麻豆视频观看网址久久| 最新国产成人在线观看| 日韩欧美第一区| 91久久人澡人人添人人爽欧美| 久久不见久久见中文字幕免费| **欧美大码日韩| 国产亚洲精品精华液| 337p亚洲精品色噜噜噜| 色婷婷狠狠综合| 成人免费电影视频| 国产精品亚洲午夜一区二区三区| 香蕉av福利精品导航| 亚洲男女毛片无遮挡| 久久久久久一二三区| 精品91自产拍在线观看一区| 欧美老年两性高潮| 在线欧美小视频| 91麻豆免费观看| 99精品一区二区| 91麻豆国产香蕉久久精品| 成人国产精品免费观看动漫 | 欧美日韩国产高清一区二区三区| 99久久久久免费精品国产| 国产成人啪免费观看软件| 韩日欧美一区二区三区| 久久福利视频一区二区| 麻豆精品一区二区av白丝在线| 日本午夜一区二区| 免费在线观看不卡| 美国欧美日韩国产在线播放| 免费观看日韩av| 精品一区二区三区不卡| 精品无码三级在线观看视频| 精品一区在线看| 高清国产一区二区| 91色婷婷久久久久合中文| 色综合久久久久久久久久久| 色婷婷av一区二区三区大白胸 | 99久久精品免费观看| 色88888久久久久久影院野外 | 国产精品国产三级国产普通话三级| 国产人久久人人人人爽| 国产精品久久久久婷婷二区次| 亚洲女与黑人做爰| 日韩高清一区在线| 国产一区二区美女| 91影院在线免费观看| 欧美精品乱码久久久久久按摩| 日韩精品一区二区在线观看| 国产无遮挡一区二区三区毛片日本| 亚洲欧美日韩小说| 日本午夜一本久久久综合| 国产福利电影一区二区三区| 色综合视频在线观看| 精品欧美乱码久久久久久1区2区| 国产三级精品视频| 亚洲成人av一区二区| 国产成人精品亚洲午夜麻豆| 欧美中文字幕一区| 国产日韩精品一区| 免费不卡在线观看| 91国模大尺度私拍在线视频 | 国内成人精品2018免费看| 99re视频精品| 久久精品免视看| 麻豆免费精品视频| 欧美日韩高清一区二区三区| 久久综合久久综合久久综合| 亚洲成av人在线观看| 91亚洲精品乱码久久久久久蜜桃| 日韩欧美一级二级三级久久久| 亚洲日本va午夜在线影院| 成人性视频网站| 国产丝袜欧美中文另类| 精品一二三四在线| 欧美一级二级三级乱码| 日韩电影免费在线看| 在线观看日韩毛片| 一区二区三区国产精华| 北条麻妃国产九九精品视频| 中文字幕免费一区| 粉嫩蜜臀av国产精品网站| 国产午夜精品久久久久久免费视| 久久er精品视频| 久久亚洲一级片| 国产一区二区三区精品视频| 337p粉嫩大胆噜噜噜噜噜91av| 麻豆国产精品官网| 久久久久久夜精品精品免费| 久久国产综合精品| 国产日产欧产精品推荐色| 成人小视频免费在线观看| 日本一区二区三区视频视频| 成人免费av资源| 一区二区在线观看免费| 在线观看免费视频综合| 三级久久三级久久久| 69堂国产成人免费视频| 乱中年女人伦av一区二区| 久久精品在这里| 色婷婷激情久久| 美女视频黄 久久| 国产精品久久午夜| 欧美性生活久久| 黑人精品欧美一区二区蜜桃| 欧美国产日韩a欧美在线观看| 91久久精品国产91性色tv| 肉肉av福利一精品导航| 久久精品网站免费观看| 色婷婷久久久亚洲一区二区三区| 午夜精品视频一区| 国产香蕉久久精品综合网| 在线亚洲高清视频| 国产在线视频一区二区三区| 国产精品久久久久久久久搜平片 | 国产一区二区毛片| 亚洲综合偷拍欧美一区色| 日韩精品一区二区三区老鸭窝| www.日韩在线| 激情综合五月婷婷| 亚洲超碰精品一区二区| 中日韩av电影| 日韩一级二级三级精品视频| 不卡一区二区三区四区| 免费欧美日韩国产三级电影| 国产精品成人免费在线| 久久久久久久精| 日韩欧美国产1| 3atv一区二区三区| 欧美午夜精品理论片a级按摩| 国产不卡视频在线播放| 午夜精品久久久久久久久久| 中文字幕在线不卡视频| 亚洲精品一区二区在线观看| 欧美精品在欧美一区二区少妇| 播五月开心婷婷综合| 国产a精品视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 成人免费看视频| 狠狠色狠狠色综合| 九九九久久久精品| 免费观看一级欧美片| 日本中文字幕一区二区视频| 亚洲gay无套男同| 亚洲国产精品影院| 午夜精品久久久久影视| 婷婷亚洲久悠悠色悠在线播放| 亚洲午夜av在线| 日本一区中文字幕 | 天使萌一区二区三区免费观看| 一区二区三区.www| 天堂午夜影视日韩欧美一区二区| 午夜天堂影视香蕉久久| 欧美96一区二区免费视频| 蜜桃视频在线观看一区|