test_1.lst
来自「一个基于C51开发的计价秤」· LST 代码 · 共 64 行
LST
64 行
C51 COMPILER V7.50 TEST_1 05/08/2006 16:20:00 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE TEST_1
OBJECT MODULE PLACED IN test_1.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE test_1.c OPTIMIZE(9,SPEED) DEBUG OBJECTEXTEND
line level source
1 #include <reg52.h>
2 #include <stdio.h>
3 #include <math.h>
4 #define PI 3.1415926
5 #define Local_Latitude 0
6 #define Local_Height 0.0
7 #define Destination_Latitude 90
8 #define Destination_Height 1000
9
10 float Weight_Calibrated(float temp_Weight)
11 {
12 1 float g1,g2,x,y;
13 1 x=Local_Latitude/180.0;
14 1 y=Destination_Latitude/180.0;
15 1 x=x*3.1415926;
16 1 y=y*3.1415926;
17 1 g1=9.780318*(1+0.005324*(sin(x)*sin(x))-0.0000059*(sin(2*x)*sin(2*x)))+(-0.3086*0.00005*Local_Height);
18 1 g2=9.780318*(1+0.005324*(sin(y)*sin(y))-0.0000059*(sin(2*y)*sin(2*y)))+(-0.3086*0.00005*Destination_Heigh
-t);
19 1 return temp_Weight*(g2/g1);
20 1 }
21
22 #ifdef MONITOR51 /* Debugging with Monitor-51 needs */
char code reserve [3] _at_ 0x23; /* space for serial interrupt if */
#endif
25
26 main()
27 {
28 1 float weight1=0,weight2=19.99;
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 weight1=Weight_Calibrated(weight2);
38 1 while(1);
39 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 407 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 16
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?