《单片机c程序设计及应用实列》一书的源代
源代码在线查看: main.lst
C51 COMPILER V6.23a MAIN 11/22/2002 01:18:45 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 /* special function register declarations */
2 /* for the intended 8051 derivative */
3
4 #include /* 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
15 #define TxDATA (unsigned char xdata *)0x1000
16 void initial(void);
17 unsigned char xdata *p;
18
19 int i=0;
20 main()
21 {
22 1 initial();
23 1 p=TxDATA;
24 1 ACC=p[0];
25 1 SBUF=ACC;
26 1
27 1 while(1)
28 1 {
29 2 if(i 30 2 }
31 1 }
32
33
34 void initial(void)
35 {
36 1 IE=0x00; //中断禁止
37 1 TCON=0x05;
38 1 TMOD=0x20; //定时器1为自动装入(auto-load)方式
39 1
40 1 PCON=0; //SMOD(PCON.7)=1时,baudrate doubled.//smod=1 (11M晶振时为0)
41 1
42 1 SCON=0xD0; //串行口工作方式 : 9位UART, 波特率可变
43 1 TH1=0xf3;
44 1 TL1=0xf3; //
45 1 PCON=0x80|PCON; //波特率设置 : 9600 baud(E8--24MHZ)
46 1 TR1=1; //启动定时器1
47 1 }
48
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 126 ----
CONSTANT SIZE = 3 ----
XDATA SIZE = 4 ----
PDATA SIZE = ---- ----
C51 COMPILER V6.23a MAIN 11/22/2002 01:18:45 PAGE 2
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)