📄 12887.lst
字号:
C51 COMPILER V7.20 12887 06/20/2005 16:55:54 PAGE 1
C51 COMPILER V7.20, COMPILATION OF MODULE 12887
OBJECT MODULE PLACED IN 12887.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 12887.C BROWSE DEBUG OBJECTEXTEND
line level source
1 //#define unsigned char unsigned char
2 //#define uint unsigned int
3 #include <absacc.h>
4 #include <AT89X52.H>
5
6 #define P128870 XBYTE[0xA000] //second
7 #define P128871 XBYTE[0xA001] //second alarm
8 #define P128872 XBYTE[0xA002] //minutes
9 #define P128873 XBYTE[0xA003] //minutes alarm
10 #define P128874 XBYTE[0xA004] //hours
11 #define P128875 XBYTE[0xA005] //hours alarm
12 #define P128876 XBYTE[0xA006] //Day of the week
13 #define P128877 XBYTE[0xA007] //Day of the month
14 #define P128878 XBYTE[0xA008] //month
15 #define P128879 XBYTE[0xA009] //year
16 #define P12887a XBYTE[0xA00A] //A register
17 #define P12887b XBYTE[0xA00B] //B register
18 #define P12887c XBYTE[0xA00C] //C register
19 #define P12887d XBYTE[0xA00D] //D register
20
21 #pragma DISABLE
22
23 void setup12887(unsigned char *p) //set system timer
24 //24hours per day, binary system, P12887b=0x26,AIP
25 //24hours per day, BCD system, P12887b=0x22;
26 {
27 1 unsigned char data i;
28 1 P1_6=!P1_6;
29 1 P12887b=0xa6;//0xa6
30 1 P12887a=0x70;
31 1 P128870=*p++;
32 1 P128871=0xff;
33 1 P128872=*p++;
34 1 P128873=0xff;
35 1 P128874=*p++;
36 1 P128875=0xff;
37 1 //P128876=*p++;//day of the week
38 1 P128877=*p++;
39 1 P128878=*p++;
40 1 P128879=*p++;
41 1 P12887a=0x20;
42 1 P12887b=0x26;//0x16 start clock
43 1 i=P12887c;
44 1 i=P12887d;
45 1 P1_6=!P1_6;
46 1 }
47 //
48 sbit BUSYFLAG = ACC^7;
49
50 void read12887(unsigned char *p) //read system timer
51 {
52 1 unsigned char data i;
53 1 i=ACC;
54 1 //UIP==0 per second, update after 244us
55 1 do{ ACC=P12887a; P1_6=!P1_6;}while(BUSYFLAG);
C51 COMPILER V7.20 12887 06/20/2005 16:55:54 PAGE 2
56 1 *p++=P128879;
57 1 *p++=P128878;
58 1 *p++=P128877;
59 1 *p++=P128874;
60 1 *p++=P128872;
61 1 *p++=P128870;
62 1 //*p++=P128876;//day of the week
63 1 ACC=i;
64 1 i=P12887c;
65 1 }
66
67 void start12887(void) //start clock
68 {
69 1 unsigned char data i;
70 1 P12887b=0xa6;//0xa6
71 1 P12887a=0x70;
72 1 P128871=0xff;
73 1 P128873=0xff;
74 1 P128875=0xff;
75 1 P12887a=0x20;
76 1 P12887b=0x26;//0x26
77 1 i=P12887c;
78 1 i=P12887d;
79 1 P1_6=!P1_6;
80 1 }
81
82
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 373 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 6
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 + -