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

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

?? chapter 1 program structure -- valvano.htm

?? 用c語言開發嵌入實時系統
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
operators. We begin with the assignment operator. Notice that in the line 
</FONT><CODE>x=1;</CODE><FONT face="Times New Roman,Times"> x is on the left 
hand side of the = . This specifies the address of x is the destination of 
assignment. On the other hand, in the line </FONT><CODE>z=x;</CODE><FONT 
face="Times New Roman,Times"> x is on the right hand side of the = . This 
specifies the value of x will be assigned into the variable z. Also remember 
that the line </FONT><CODE>z=x;</CODE><FONT face="Times New Roman,Times"> 
creates two copies of the data. The original value remains in x, while z also 
contains this value.</FONT></P>
<P><CODE>int x,y,z; /* Three variables */<BR>void Example(void){ 
<BR>&nbsp;&nbsp;&nbsp;x=1; &nbsp;&nbsp;&nbsp;&nbsp;/* set the value of x to 1 */ 
<BR>&nbsp;&nbsp;&nbsp;y=2;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;/* set the value of y 
to 2 */ <BR>&nbsp;&nbsp;&nbsp;z=x; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* set the 
value of z to the value of x (both are 1) */ 
&nbsp;<BR>&nbsp;&nbsp;&nbsp;x=y=z=0;&nbsp;&nbsp;/* all all three to 
zero&nbsp;&nbsp; */ &nbsp;&nbsp;<BR>}</CODE></P>
<ADDRESS><FONT face="Times New Roman,Times">Listing 1-2: Simple program 
illustrating C arithmetic operators</FONT></ADDRESS>
<P><FONT face="Times New Roman,Times">Next we will introduce the arithmetic 
operations addition, subtraction, multiplication and division. The standard 
arithmetic precedence apply. </FONT>For a detailed description of these 
operations, see <A 
href="http://www.ece.utexas.edu/~valvano/embed/chap5/chap5.htm">Chapter 
5</A>.</P>
<P><CODE>int x,y,z; /* Three variables */<BR>void Example(void){ 
<BR>&nbsp;&nbsp;&nbsp;x=1; y=2; /* set the values of x and y */ 
<BR>&nbsp;&nbsp;&nbsp;z=x+4*y; &nbsp;/* arithmetic operation */ 
&nbsp;<BR>&nbsp;&nbsp;&nbsp;x++; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* same as 
x=x+1;&nbsp;&nbsp; */ &nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;y--; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* same as y=y-1;&nbsp;&nbsp; */ 
&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;x=y&lt;&lt;2; &nbsp;/* left shift same as 
x=4*y;&nbsp;&nbsp; */ &nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;z=y&gt;&gt;2; 
&nbsp;/* right shift same as x=y/4;&nbsp; */ 
&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;y+=2; &nbsp;&nbsp;&nbsp;&nbsp;/* same as 
y=y+2;&nbsp;&nbsp; */ &nbsp;&nbsp;<BR>}</CODE></P>
<ADDRESS><FONT face="Times New Roman,Times">Listing 1-3: Simple program 
illustrating C arithmetic operators</FONT></ADDRESS>
<P>Next we will introduce a simple conditional control structure. PORTB is an 
output port, and PORTE is an input port on the 6811. For more information on 
input/output ports see chapter 3 of <U>Embedded Microcomputer Systems: Real Time 
Interfacing</U> by Jonathan W. Valvano, Brooks/Cole Publishing Co., 1999. The 
expression <CODE>PORTE&amp;0x04</CODE> will return 0 if PORTE bit 2 is 0 and 
will return a 4 if PORTE bit 2 is 1. The expression 
<CODE>(PORTE&amp;0x04)==0</CODE> will return TRUE if PORTE bit 2 is 0 and will 
return a FALSE if PORTE bit 2 is 1. The statement immediately following the 
<CODE>if</CODE> will be executed if the condition is TRUE. The <CODE>else</CODE> 
statement is optional. </P>
<P><CODE>#define PORTB *(unsigned char volatile *)(0x1004)<BR>#define PORTE 
*(unsigned char volatile *)(0x100A)<BR>void Example(void){ 
<BR>&nbsp;&nbsp;&nbsp;if((PORTE&amp;0x04)==0){ /* test bit 2 of PORTE */ 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PORTB=0;} &nbsp;/* if PORTE bit 2 is 0, 
then make PORTB=0 */ &nbsp;<BR>&nbsp;&nbsp;&nbsp;else{ 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PORTB=100;} &nbsp;/* if PORTE bit 0 is 
not 0, then make PORTB=100 */ <BR>}</CODE></P>
<ADDRESS><FONT face="Times New Roman,Times">Listing 1.4: Simple program 
illustrating the C if else control structure</FONT></ADDRESS>
<P>PORTA bit 3 is another output pin on the 6811. Like the <CODE>if</CODE> 
statement, the <CODE>while</CODE> statement has a conditional test (i.e., 
returns a TRUE/FALSE). The statement immediately following the 
<CODE>while</CODE> will be executed over and over until the conditional test 
becomes FALSE. </P>
<P><CODE>#define PORTA *(unsigned char volatile *)(0x1000)<BR>#define PORTB 
*(unsigned char volatile *)(0x1004)<BR>void Example(void){ /* loop until PORTB 
equals 200 */ 
<BR>&nbsp;&nbsp;&nbsp;PORTB=0;<BR>&nbsp;&nbsp;&nbsp;while(PORTB!=200){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PORTA 
= PORTA^0x08;} &nbsp;/* toggle PORTA bit 3 output 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PORTB++;} &nbsp;/* increment PORTB 
output */ &nbsp;<BR>}</CODE></P>
<ADDRESS><FONT face="Times New Roman,Times">Listing 1.5: Simple program 
illustrating the C while control structure</FONT></ADDRESS>
<P>The <CODE>for</CODE> control structure has three parts and a body. 
<CODE>for(part1;part2;part3){body;} </CODE>The first part <CODE>PORTB=0</CODE> 
is executed once at the beginning. Then the body <CODE>PORTA = 
PORTA^0x08;</CODE> is executed, followed by the third part <CODE>PORTB++</CODE>. 
The second part <CODE>PORTB!=200</CODE> is a conditional. The body and third 
part are repeated until the conditional is FALSE. For a more detailed 
description of the control structures, see <A 
href="http://www.ece.utexas.edu/~valvano/embed/chap6/chap6.htm">Chapter 
6</A>.</P>
<P><CODE>#define PORTB *(unsigned char volatile *)(0x1004)<BR>void 
Example(void){ /* loop until PORTB equals 200 */ 
<BR>&nbsp;&nbsp;&nbsp;for(PORTB=0;PORTB!=200;PORTB++){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PORTA 
= PORTA^0x08;} &nbsp;/* toggle PORTA bit 3 output */<BR>&nbsp;&nbsp;&nbsp;} 
&nbsp; &nbsp;<BR>}</CODE></P>
<ADDRESS><FONT face="Times New Roman,Times">Listing 1.6: Simple program 
illustrating the C for loop control structure</FONT></ADDRESS>
<ADDRESS>&nbsp;</ADDRESS>
<P><B><I><FONT face=Helvetica,Arial><A 
name=PRECEDENCE></A>Precedence</FONT></I></B></P>
<P>As with all programming languages the order of the tokens is important. There 
are two issues to consider when evaluating complex statements. The 
<B>precedence</B> of the operator determines which operations are performed 
first. In the following example, the 2*x is performed first because * has higher 
precedence than + and =. The addition is performed second because + has higher 
precedence than =. The assignment = is performed last. Sometimes we use 
parentheses to clarify the meaning of the expression, even when they are not 
needed. Therefore, the line <B>z=y+2*x;</B> could also have been written 
<B>z=2*x+y;</B> or <B>z=y+(2*x);</B> or <B>z=(2*x)+y;</B>.</P>
<DIR>
<P><CODE>int example(int x, int y){ int z; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;z=y+2*x;<BR>&nbsp;&nbsp;&nbsp; 
return(z);<BR>}</CODE></P></DIR>
<P>The second issue is the <B>associativity</B>. Associativity determines the 
left to right or right to left order of evaluation when multiple operations of 
the precedence are combined. For example + and - have the same precedence, so 
how do we evaluate the following?</P>
<DIR>
<P><CODE>z=y-2+x;</CODE></P></DIR>
<P>We know that + and - associate the left to right, this function is the same 
as <B>z=(y-2)+x;</B>. Meaning the subtraction is performed first because it is 
more to the left than the addition. Most operations associate left to right, but 
the following table illustrates that some operators associate right to left.</P>
<P>
<TABLE border=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD vAlign=top width="17%">Precedence </TD>
    <TD vAlign=top width="55%">Operators</TD>
    <TD vAlign=top width="28%">Associativity</TD></TR>
  <TR>
    <TD vAlign=top width="17%">highest</TD>
    <TD vAlign=top width="55%">() <CODE>&nbsp;</CODE>[]<CODE> &nbsp;</CODE>. 
      <CODE>&nbsp;</CODE>-&gt; <CODE>&nbsp;</CODE>++(postfix) <CODE>&nbsp; 
      </CODE>--(postfix)</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">++(prefix) <CODE>&nbsp;</CODE>--(prefix) 
      <CODE>&nbsp; </CODE>!~ <B>sizeof</B>(type)<CODE> 
      </CODE>+(unary)<CODE>&nbsp; </CODE>-(unary) &amp;(address)<CODE> 
      </CODE>*(dereference)</TD>
    <TD vAlign=top width="28%">right to left</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">*<CODE>&nbsp;&nbsp;</CODE> / 
      <CODE>&nbsp;&nbsp;</CODE>%</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">+ <CODE>&nbsp;&nbsp;</CODE>-</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">&lt;&lt; <CODE>&nbsp;&nbsp;</CODE>&gt;&gt;</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">&lt; <CODE>&nbsp;&nbsp;</CODE> &lt;= 
      <CODE>&nbsp;&nbsp;</CODE>&gt; <CODE>&nbsp;&nbsp;</CODE>&gt;=</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">==<CODE>&nbsp;&nbsp;</CODE>!=</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">&amp;</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">^</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">|</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">&amp;&amp;</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">||</TD>
    <TD vAlign=top width="28%">left to right</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">? :</TD>
    <TD vAlign=top width="28%">right to left</TD></TR>
  <TR>
    <TD vAlign=top width="17%">&nbsp;</TD>
    <TD vAlign=top width="55%">= <CODE>&nbsp;&nbsp;</CODE>+= 
      <CODE>&nbsp;&nbsp;</CODE>-=<CODE> &nbsp;</CODE>*=<CODE> 
      &nbsp;</CODE>/=<CODE> &nbsp;</CODE>%= <CODE>&nbsp;</CODE>&lt;&lt;=<CODE> 
      &nbsp;</CODE>&gt;&gt;= <CODE>&nbsp;</CODE>|= <CODE>&nbsp;</CODE>&amp;= 
      <CODE>&nbsp;</CODE>^= </TD>
    <TD vAlign=top width="28%">right to left</TD></TR>
  <TR>
    <TD vAlign=top width="17%">lowest</TD>
    <TD vAlign=center width="55%">,</TD>
    <TD vAlign=center width="28%">left to right</TD></TR></TBODY></TABLE></P>
<P><I>Table 1-4: Precedence and associativity determine the order of 
operation</I></P>
<P><I><FONT face="Times New Roman,Times">"When confused about precedence (and 
aren't we all) add parentheses to clarify the expression."</FONT></I></P>
<P><I><B><FONT face=Helvetica,Arial><A 
name=COMMENTS></A>Comments</FONT></B></I></P>
<P>There are two types of comments. The first type explains how to use the 
software. These comments are usually placed at the top of the file, within the 
header file, or at the start of a function. The reader of these comments will be 
writing software that uses or calls these routines. Lines 1 and 12 in the above 
<A 
href="http://www.ece.utexas.edu/~valvano/embed/chap1/chap1.htm#LISTING">listing</A> 
are examples of this type of comment. The second type of comments assists a 
future programmer (ourselves included) in changing, debugging or extending these 
routines. We usually place these comments within the body of the functions. The 
comments on the right of each line in the above <A 
href="http://www.ece.utexas.edu/~valvano/embed/chap1/chap1.htm#LISTING">listing</A> 
are examples of the second type. For more information on writing good comments 
see chapter 2 of <U>Embedded Microcomputer Systems: Real Time Interfacing</U> by 
Jonathan W. Valvano, Brooks/Cole Publishing Co., 1999.</P>
<P>Comments begin with the<CODE> /*</CODE> sequence and end with the 
<CODE>*/</CODE> sequence. They may extend over multiple lines as well as exist 
in the middle of statements. The following is the same as 
<CODE>BAUD=0x30;</CODE></P>
<DIR>
<P><CODE>BAUD /*specifies transmission rate*/=0x30/*9600 
bits/sec*/;</CODE></P></DIR>
<P>ICC11 and ICC12 do allow for the use of C++ style comments (see <A 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品第1页| 国产一区二区不卡在线| 国产a视频精品免费观看| 色综合久久66| 亚洲精品在线网站| 亚洲中国最大av网站| 国产精品自拍在线| 欧美日韩亚洲综合一区| 国产精品福利一区二区| 国内精品在线播放| 3atv在线一区二区三区| 一区二区三区影院| www.成人在线| 久久精品视频在线看| 免费成人深夜小野草| 91极品美女在线| 日本一区二区三级电影在线观看| 日本欧美加勒比视频| 91视频www| 国产精品私房写真福利视频| 激情图区综合网| 日韩精品在线一区二区| 婷婷国产在线综合| 在线一区二区三区四区五区| 最新日韩av在线| 国产成人免费av在线| 精品久久国产97色综合| 免费观看成人av| 欧美一区二区视频在线观看2022| 亚洲国产精品一区二区www| 91在线视频免费观看| 国产精品久久久久毛片软件| 国产成人免费视频| 国产欧美日韩麻豆91| 国产在线精品一区二区三区不卡| 日韩午夜在线观看| 奇米888四色在线精品| 51午夜精品国产| 天天做天天摸天天爽国产一区| 欧美视频在线观看一区二区| 亚洲自拍偷拍欧美| 欧美日韩电影在线播放| 亚洲国产精品一区二区www| 欧美亚洲综合色| 亚洲高清视频中文字幕| 欧美日韩精品一区二区三区蜜桃| 亚洲一区在线视频观看| 国产精品妹子av| 成人黄色免费短视频| 中文字幕一区二区在线播放| 99精品久久只有精品| 日韩久久一区二区| 91久久免费观看| 亚洲成人你懂的| 在线播放视频一区| 三级在线观看一区二区| 日韩欧美精品三级| 国产又粗又猛又爽又黄91精品| 久久综合九色综合97婷婷女人| 国产在线一区二区综合免费视频| 久久精品免视看| 99久久精品免费精品国产| 亚洲免费观看高清在线观看| 欧洲精品中文字幕| 日韩激情av在线| 91精品中文字幕一区二区三区| 麻豆精品国产91久久久久久| 亚洲精品一线二线三线无人区| 国产精品夜夜爽| 亚洲视频小说图片| 欧美三级电影网站| 久久精品国产精品青草| 久久久久国产精品人| 99精品一区二区| 亚洲va欧美va天堂v国产综合| 日韩欧美黄色影院| 国产jizzjizz一区二区| 亚洲欧洲日韩一区二区三区| 欧美在线你懂得| 另类欧美日韩国产在线| 国产精品无遮挡| 色偷偷成人一区二区三区91 | 欧美一区二区大片| 国产精品综合av一区二区国产馆| 精品99久久久久久| 91首页免费视频| 婷婷激情综合网| 久久久蜜桃精品| 一本色道久久综合亚洲精品按摩| 婷婷开心久久网| 日本一区二区三区四区在线视频| 欧美影院一区二区三区| 国产麻豆成人精品| 一区二区三区电影在线播| 成人免费看黄yyy456| 五月婷婷久久综合| 国产欧美在线观看一区| 欧美色大人视频| 国产成人免费在线观看| 亚洲超丰满肉感bbw| 国产欧美日韩中文久久| 欧美精品黑人性xxxx| 成人美女视频在线观看| 日本麻豆一区二区三区视频| 国产精品久久久久aaaa樱花| 91精品国产91久久综合桃花| 成人av在线电影| 蜜臀精品一区二区三区在线观看| 国产精品久久久久一区 | www.在线欧美| 蜜臀久久久久久久| 亚洲色图视频免费播放| 精品91自产拍在线观看一区| 精品视频1区2区3区| 成人在线一区二区三区| 日本aⅴ免费视频一区二区三区| 一区在线观看免费| xnxx国产精品| 欧美情侣在线播放| 97成人超碰视| 国产精品一区二区男女羞羞无遮挡| 亚洲国产精品久久久久秋霞影院| 国产欧美日韩精品在线| 欧美mv和日韩mv的网站| 欧美三级中文字幕| 99精品热视频| 国产成人午夜高潮毛片| 精一区二区三区| 玉米视频成人免费看| 国产日韩亚洲欧美综合| 欧美成人a视频| 欧美日韩高清在线播放| 色噜噜狠狠一区二区三区果冻| 国产大陆亚洲精品国产| 久久爱另类一区二区小说| 午夜视频一区在线观看| 一区二区三区中文在线观看| 国产精品女同互慰在线看| 2023国产一二三区日本精品2022| 91精品福利在线一区二区三区 | va亚洲va日韩不卡在线观看| 久久99精品久久久久久| 亚洲影院免费观看| 亚洲老妇xxxxxx| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 久久你懂得1024| 欧美精品一区二区三区蜜桃视频| 欧美一区二区三区性视频| 欧美日韩国产一二三| 欧美伊人久久大香线蕉综合69| 91在线看国产| 91丨porny丨国产入口| 91一区二区在线| 丁香亚洲综合激情啪啪综合| 国产黄色精品网站| 国产高清精品在线| 国产高清久久久久| 高清不卡在线观看| 粉嫩蜜臀av国产精品网站| 国产高清精品在线| 成人中文字幕在线| 不卡一区在线观看| 99久久久久免费精品国产| 99久久99久久久精品齐齐| 成人深夜视频在线观看| 成人免费精品视频| 91在线视频网址| 欧美亚洲国产一区二区三区va| 在线免费观看成人短视频| 欧美在线视频日韩| 欧美片在线播放| 欧美一级午夜免费电影| 欧美成人精品福利| 中文成人av在线| 亚洲色欲色欲www在线观看| 亚洲一级二级在线| 日韩av一区二区三区四区| 久久精品久久久精品美女| 国产一区二区三区免费看| 从欧美一区二区三区| 91首页免费视频| 欧美三级韩国三级日本一级| 日韩一区二区在线看片| 精品99久久久久久| 亚洲欧洲99久久| 亚洲午夜久久久久久久久久久| 亚洲1区2区3区4区| 精品一区二区久久久| 成人综合日日夜夜| 欧美视频在线观看一区二区| 欧美一区二区三区四区视频| 久久久久久久久久久久电影| 中文字幕一区在线观看| 亚洲va韩国va欧美va精品| 蜜臂av日日欢夜夜爽一区| 国产aⅴ精品一区二区三区色成熟| 色欧美日韩亚洲| 欧美一区二区视频在线观看| 国产视频一区在线观看| 一级女性全黄久久生活片免费|