📄 main.lst
字号:
C51 COMPILER V6.23a MAIN 11/13/2002 23:29:37 PAGE 1
C51 COMPILER V6.23a, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c LARGE DEBUG OBJECTEXTEND
stmt 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 #ifdef MONITOR51 /* Debugging with Monitor-51 needs */
char code reserve [3] _at_ 0x23; /* space for serial interrupt if */
#endif /* Stop Exection with Serial Intr. */
9 /* is enabled */
10 /*------------------------------------------------
11 The main C function. Program execution starts
12 here after stack initialization.
13 ------------------------------------------------*/
14 void main (void) {
15 1
16 1 char str1[50],str2[20],*ptr1=str1,*ptr2=str2;
17 1 /*------------------------------------------------
18 1 Setup the serial port for 1200 baud at 16MHz.
19 1 ------------------------------------------------*/
20 1 #ifndef MONITOR51
21 1 SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
22 1 TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
23 1 TH1 = 221; /* TH1: reload value for 1200 baud @ 16MHz */
24 1 TR1 = 1; /* TR1: timer 1 run */
25 1 TI = 1; /* TI: set TI to send first char of UART */
26 1 #endif
27 1 /*------------------------------------------------
28 1 Note that an embedded program never exits (because
29 1 there is no operating system to return to). It
30 1 must loop and execute forever.
31 1 ------------------------------------------------*/
32 1 printf("input str1:");
33 1 gets(str1,20) ;
34 1 printf("input str2:");
35 1 gets(str2,20) ;
36 1 printf("str1------------str2\n") ;
37 1 printf("%s.......%s\n",ptr1,ptr2) ;
38 1 while(*ptr1) ptr1++;/*移动指针到串尾*/
39 1 while(*ptr2) *ptr1++=*ptr2++;/*串连接*/
40 1 *ptr1 ='\0';/*写入串的结束标志*/
41 1 ptr1=str1; ptr2=str2;
42 1 printf("str1------------------ str2\n");
43 1 printf("%s.......%s \n " , ptr1,ptr2) ;
44 1 while (1) {};
45 1 }
46
47
48
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 330 ----
CONSTANT SIZE = 103 ----
XDATA SIZE = ---- 76
PDATA SIZE = ---- ----
C51 COMPILER V6.23a MAIN 11/13/2002 23:29:37 PAGE 2
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 + -