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

📄 hello.lst

📁 8051实现232串口控制的最简单程序,仅用于学习及熟悉232串口的基本控制
💻 LST
字号:
C51 COMPILER V7.10   HELLO                                                                 09/12/2005 00:44:52 PAGE 1   


C51 COMPILER V7.10, COMPILATION OF MODULE HELLO
OBJECT MODULE PLACED IN hello.OBJ
COMPILER INVOKED BY: E:\Program Files\Keil\C51\BIN\C51.EXE hello.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <REG52.H>                /* special function register declarations   */
   2                                            /* for the intended 8051 derivative         */
   3          
   4          #include <stdio.h>                /* prototype declarations for I/O functions */
   5          
   6          /*------------------------------------------------
   7          The main C function.  Program execution starts
   8          here after stack initialization.
   9          ------------------------------------------------*/
  10          void delay(unsigned char i);
  11          
  12          void main (void) {
  13   1      
  14   1      #ifndef MONITOR51
  15   1          SCON  = 0x50;                       /* SCON: mode 1, 8-bit UART, enable rcvr      */
  16   1          TMOD |= 0x20;               /* TMOD: timer 1, mode 2, 8-bit reload        */
  17   1          TH1   = 0xfd;               /* TH1:  reload value for 9600 baud @ 11.0592MHz   */
  18   1          TR1   = 1;                  /* TR1:  timer 1 run                          */
  19   1          TI    = 1;                  /* TI:   set TI to send first char of UART    */
  20   1      #endif
  21   1      
  22   1      /*------------------------------------------------
  23   1      Note that an embedded program never exits (because
  24   1      there is no operating system to return to).  It
  25   1      must loop and execute forever.
  26   1      ------------------------------------------------*/
  27   1        while (1) {
  28   2          P1 ^= 0x01;                     /* Toggle P1.0 each time we print */
  29   2          printf ("Hello World\n");   /* Print "Hello World" */
  30   2              delay(10);
  31   2        }
  32   1      }
  33          
  34          void delay(unsigned char i)
  35          {
  36   1              unsigned char j;
  37   1              for(i; i > 0; i--)
  38   1                      for(j = 200; j > 0; j--);
  39   1      }
  40          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     46    ----
   CONSTANT SIZE    =     13    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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