📄 hello.lst
字号:
C51 COMPILER V7.50 HELLO 08/03/2006 16:15:46 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE HELLO
OBJECT MODULE PLACED IN HELLO.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE HELLO.C DEBUG OBJECTEXTEND
line level source
1 /*------------------------------------------------------------------------------
2 HELLO.C
3
4 Copyright 1995-1999 Keil Software, Inc.
5 ------------------------------------------------------------------------------*/
6
7 #include <REG52.H> /* special function register declarations */
8 /* for the intended 8051 derivative */
9
10 #include <stdio.h> /* prototype declarations for I/O functions */
11 #include <stddef.h> /* prototype declarations for I/O functions */
12
13 #ifdef MONITOR51 /* Debugging with Monitor-51 needs */
char code reserve [3] _at_ 0x23; /* space for serial interrupt if */
#endif /* Stop Exection with Serial Intr. */
16 /* is enabled */
17
18
19 /*------------------------------------------------
20 The main C function. Program execution starts
21 here after stack initialization.
22 ------------------------------------------------*/
23 void main (void) {
24 1
25 1 int c;
26 1
27 1 /*------------------------------------------------
28 1 Setup the serial port for 1200 baud at 16MHz.
29 1 ------------------------------------------------*/
30 1 #ifndef MONITOR51
31 1 SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
32 1 TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
33 1 TH1 = 221; /* TH1: reload value for 1200 baud @ 16MHz */
34 1 TR1 = 1; /* TR1: timer 1 run */
35 1 TI = 1; /* TI: set TI to send first char of UART */
36 1 #endif
37 1
38 1 /*------------------------------------------------
39 1 Note that an embedded program never exits (because
40 1 there is no operating system to return to). It
41 1 must loop and execute forever.
42 1 ------------------------------------------------*/
43 1 while (1)
44 1 {
45 2 getkey();
46 2 printf ("You entered : %s\n",c); /* Print "Hello World" */
47 2
48 2 if( ( c=getchar() ) != 0x1B )
49 2 {
50 3 printf ("You entered : %s\n",c); /* Print "Hello World" */
51 3 }
52 2 else
53 2 {
54 3 printf ("NULL KEY\n"); /* Print "Hello World" */
55 3 }
C51 COMPILER V7.50 HELLO 08/03/2006 16:15:46 PAGE 2
56 2 }
57 1 }
58
59
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 77 ----
CONSTANT SIZE = 28 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 2
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 + -