tstrpos.lst

来自「单片及c语言轻松入门的随书光盘」· LST 代码 · 共 44 行

LST
44
字号
C51 COMPILER V7.06   TSTRPOS                                                               09/29/2005 15:19:14 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE TSTRPOS
OBJECT MODULE PLACED IN tstrpos.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE tstrpos.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include <reg52.h>
   2          #include <string.h>
   3          #include <stdio.h> /* 为使用printf函数而加入 */
   4          void tst_strpos (void) {
   5   1              char text [] = "Search this string for  blanks";
   6   1              int i;
   7   1              i = strpos (text, ' ');
   8   1              if (i == -1)
   9   1                      printf ("No spaces found in %s\n", text);
  10   1              else
  11   1                      printf ("Found a space at offset %d\n", i);
  12   1      }void main()
  13          {       SCON  = 0x50;    /* SCON: mode 1, 8-bit UART, enable rcvr    */
  14   1              TMOD |= 0x20;    /* TMOD: timer 1, mode 2, 8-bit reload      */
  15   1              TH1   = 0xf3;    /* TH1:  reload value for 2400 baud         */
  16   1              TR1   = 1;       /* TR1:  timer 1 run                        */
  17   1              TI    = 1;       /* TI:   set TI to send first char of UART  */
  18   1              for(;;)
  19   1                      tst_strpos();
  20   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     95    ----
   CONSTANT SIZE    =     81    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----      32
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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