C51.rar
源代码在线查看: 3-8.lst
C51 COMPILER V7.09 3_8 08/25/2005 09:46:36 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE 3_8
OBJECT MODULE PLACED IN 3-8.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 3-8.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include
2 #include
3 #include
4 void main (void) {
5 1
6 1 double pi,t;
7 1 long int n,s;
8 1 t=1.0;
9 1 n=1;
10 1 s=1;
11 1 pi=0.0;
12 1
13 1 SCON = 0x50;
14 1 TMOD |= 0x20;
15 1 TH1 = 0xf3;
16 1 TR1 = 1;
17 1 TI = 1;
18 1 while(fabs(t)>=1e-6)
19 1 {
20 2 pi=pi+t;
21 2 n=n+2;
22 2 s=-s;
23 2 t=(float)(s)/(float)(n);
24 2 }
25 1 pi=pi*4.0;
26 1 printf("pi=%lf\n",pi);
27 1 while (1) {};
28 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 242 ----
CONSTANT SIZE = 8 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 16
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)