⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 第六章 keil c51例子:hello_c.htm

📁 本文档详细介绍了怎样使用keil软件开发单片机程序
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0056)http://www.51kaifa.com/zxyd/read_z.php?ID=483&BigClass=6 -->
<HTML XMLNS:O><HEAD><TITLE>第六章 Keil C51例子:Hello.c- 无忧电子开发网-在线阅读</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="" name=Keywords><LINK href="第六章 Keil C51例子:Hello_c.files/css.css" 
type=text/css rel=stylesheet>
<SCRIPT language=JavaScript>function fontzoom(size){ document.getElementById('fontzoom').style.fontSize=size+'px'}</SCRIPT>
<!-- <script language="Javascript">document.oncontextmenu=new Function("event.returnValue=false");document.onselectstart=new Function("event.returnValue=false");</script>  --><!-- 限制右键复制 -->
<META content="MSHTML 6.00.2900.2668" name=GENERATOR></HEAD>
<BODY topMargin=10 marginheight="10" marginwidth="10">
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
  <TBODY>
  <TR>
    <TD width="100%">
      <TABLE height=2 cellSpacing=0 cellPadding=0 width="100%" bgColor=#808080 
      border=0>
        <TBODY>
        <TR>
          <TD width="100%"></TD></TR></TBODY></TABLE>
      <TABLE height=80 cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD align=middle width=186><A href="http://www.51kaifa.com/"><IMG 
            height=65 src="第六章 Keil C51例子:Hello_c.files/logo.jpg" width=186 
            border=0></A></TD>
          <TD align=middle width=574>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=bottom width=120><A 
                  href="http://www.51kaifa.com/zxyd/"><IMG height=67 
                  src="第六章 Keil C51例子:Hello_c.files/logo_zxyd.gif" width=120 
                  border=0></A></TD>
                <TD width=454>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD align=middle width="100%" colSpan=3 height=19>
                        <TABLE cellSpacing=0 cellPadding=0 width="100%" 
border=0>
                          <TBODY>
                          <TR>
                            <TD class=xyzx_top align=middle width="100%" 
                            height=19><A 
                              href="http://www.51kaifa.com/hyxw">综合资讯</A> <A 
                              href="http://www.51kaifa.com/jswz">技术文章</A> <A 
                              href="http://www.51kaifa.com/yyfa">原文阅读</A> <A 
                              href="http://www.51kaifa.com/shop">在线商城</A> <A 
                              href="http://www.51kaifa.com/zxxz">下载专区</A> <A 
                              href="http://www.51kaifa.com/datasheet">DATASHEET</A> 
                              <A href="http://www.51kaifa.com/bbs">技术论坛</A> <A 
                              href="http://www.51kaifa.com/MenberInfo">商务频道</A> 
                            </TD></TR></TBODY></TABLE></TD></TR>
                    <TR>
                      <TD width=47 
                      background="第六章 Keil C51例子:Hello_c.files/R_list_3.gif"><IMG 
                        height=54 
                        src="第六章 Keil C51例子:Hello_c.files/R_list_2.gif" width=48 
                        border=0></TD>
                      <TD class=xyzx_top_shadow width=402 
                      background="第六章 Keil C51例子:Hello_c.files/R_list_3.gif">
                        <P style="LINE-HEIGHT: 150%"><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=2">电子技术</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=3">技术资料</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=11">嵌入式系统</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=6">单片机专题</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=10">DSP专题</A><BR><A 
                        class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=8">EDA/PLD专题</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=12">电源技术专题</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=7">电子制作专题</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=4">其他综合</A><FONT 
                        color=#ffffff> | </FONT><A class=xyzx_top2 
                        href="http://www.51kaifa.com/zxyd/list.php?BigClass=13">芯片选型</A><BR></P></TD>
                      <TD width=5><IMG height=54 src="" width=5 
                    border=0></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <TABLE height=4 cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD width="100%"></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width="98%" align=center border=0>
        <TBODY>
        <TR>
          <TD align=middle width="5%" height=25><IMG 
            src="第六章 Keil C51例子:Hello_c.files/R_url.jpg"></TD>
          <TD width="95%">所在的位置:<A href="http://www.51kaifa.com/">首页</A></A> → 
            <A href="http://www.51kaifa.com/zxyd/">在线阅读</A></A> → <A 
            href="http://www.51kaifa.com/zxyd/list.php?BigClass=6">单片机专题</A> → 
            <A 
            href="http://www.51kaifa.com/zxyd/read.php?ID=81">KeilC51使用详解V1.0</A> 
            → <FONT color=#ff9900>正文</FONT> </TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
        <TBODY>
        <TR>
          <TD width="100%" bgColor=#808080 colSpan=3 height=1></TD></TR>
        <TR>
          <TD vAlign=top width=590>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD align=left width="100%"><!-- $sign哪个页面$digit位置$way等h不循环TR;X循环TR;$num显示个数 --></TD></TR></TBODY></TABLE>  

            <TABLE cellSpacing=0 cellPadding=0 width="94%" align=center 
border=0>
              <TBODY>
              <TR>
                <TD align=middle width="100%"><FONT color=#05006c><B>第六章 Keil 
                  C51例子:Hello.c</B></FONT></TD></TR>
              <TR>
                <TD width="100%" height=6></TD></TR>
              <TR>
                <TD align=middle width="100%" height=18>
                  <TABLE style="BORDER-TOP: #666666 1px solid" height=2 
                  cellSpacing=1 cellPadding=0 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD align=middle width="100%" 
                    bgColor=#dce9fc></TD></TR></TBODY></TABLE></TD></TR>
              <TR>
                <TD width="100%" height=6></TD></TR>
              <TR>
                <TD class=p16 id=fontzoom style="LINE-HEIGHT: 1.5" vAlign=top 
                width="100%" height=300><BR><!--画中画广告开始-->
                  <TABLE cellSpacing=0 cellPadding=0 align=left border=0>
                    <TBODY>
                    <TR>
                      <TD><!-- 广告位 --><!-- $sign哪个页面$digit位置$way等h不循环TR;X循环TR;$num显示个数 --></TD></TR></TBODY></TABLE><!--画中画广告结束-->
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 117.0pt" 
                  align=left><FONT size=2><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体">Hello位于</SPAN><SPAN 
                  lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'">\</SPAN><SPAN 
                  lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体">C51\excmples\Hello\目录,其功能是向串口输出“Hello,world”整个程序如下:</SPAN><SPAN 
                  lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'"><O:P></O:P></SPAN></FONT></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 117.0pt" 
                  align=left><SPAN 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><FONT size=2>#<SPAN 
                  lang=EN-US>pragma DB OE CD<O:P></O:P></SPAN></FONT></SPAN></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 117.0pt" 
                  align=left><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><FONT size=2>#indule 
                  &lt;reg51.h&gt;<O:P></O:P></FONT></SPAN></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 117.0pt" 
                  align=left><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><FONT 
                  size=2>#include&lt;stdio.h&gt;<O:P></O:P></FONT></SPAN></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 117.0pt" 
                  align=left><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><FONT size=2>void 
                  main(void)<O:P></O:P></FONT></SPAN></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 117.0pt" 
                  align=left><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><FONT size=2><SPAN 
                  style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; 
                  </SPAN>{<O:P></O:P></FONT></SPAN></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 81.0pt" 
                  align=left><FONT size=2><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'"><SPAN 
                  style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                  </SPAN></SPAN><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体">SCOn=0x50;<O:P></O:P></SPAN></FONT></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 81.0pt" 
                  align=left><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><FONT size=2><SPAN 
                  style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                  </SPAN>TMOD=0x20<O:P></O:P></FONT></SPAN></P>
                  <P class=MsoNormal 
                  style="TEXT-INDENT: 24pt; TEXT-ALIGN: left; tab-stops: 45.0pt 81.0pt" 
                  align=left><SPAN lang=EN-US 
                  style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><FONT size=2><SPAN 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -