📄 irshou2.lst
字号:
C51 COMPILER V7.06 IRSHOU2 03/25/2008 14:52:10 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE IRSHOU2
OBJECT MODULE PLACED IN irshou2.OBJ
COMPILER INVOKED BY: D:\KIEL C\C51\BIN\C51.EXE irshou2.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include<AT89x55.H>
2 #include <stdio.h>
3 #include <INTRINS.H>
4 //#include "Uart.h"
5 #define uint unsigned int
6 #define uchar unsigned char
7 sbit ir=P1^6;
8 sbit out=P1^7;
9 uchar irdata[4];
10 uchar irdat;
11 uint count;
12 uchar count1,count2;
13 uchar t;
14 bit flag,flag1,flag0;
15 //*********************************
16 //t*2us 4.5ms equ 561 9ms equ 1124 0.56ms equ 69
17 //*********************************
18 void delay(uint t)
19 { while(--t);
20 1 }
21 //*********************************
22 //
23 //*********************************
24
25 uchar irshou()
26 { //uchar data1,BitCnt,i;
27 1
28 1 while(ir==0)
29 1 { count++;
30 2 if(count>250)
31 2 {flag=1;
32 3 }
33 2 if(flag==1)
34 2 {
35 3 // out=0;
36 3 flag=0;
37 3 t=33;
38 3 while(t--)
39 3 { //1
40 4 while(ir==1)
41 4 {count1++;
42 5 if(count1<50)
43 5 {flag1=1;
44 6 }
45 5 if(flag1==1)
46 5 {
47 6 //out=0;
48 6 flag1=0;
49 6 }
50 5 }
51 4 //0
52 4 while(ir==0)
53 4 {count2++;
54 5 if(count2<50)
55 5 {flag0=1;
C51 COMPILER V7.06 IRSHOU2 03/25/2008 14:52:10 PAGE 2
56 6 }
57 5 if(flag0==1)
58 5 {
59 6 out=0;
60 6 flag0=0;
61 6 }
62 5 }
63 4 count1=0;
64 4 count2=0;
65 4 out=1;
66 4
67 4 //return(0);
68 4 }
69 3 }
70 2 }
71 1 return 0;
72 1 }
73
74
75 void uart_init()
76 {
77 1
78 1 SCON = 0xDA; // SCON: mode 1, 8-bit UART, enable rcvr */
79 1 TMOD |= 0x20; // TMOD: timer 1, mode 2, 8-bit reload */
80 1 TH1 = 0xFD; // TH1: reload value for 1200 baud @ 12MHz */
81 1 TR1 = 1; // TR1: timer 1 run */
82 1 TI = 1; // TI: set TI to send first char of UART */
83 1
84 1 }
85
86 void send(unsigned char ch)
87 {SBUF=ch;
88 1 while(TI==0);
89 1 TI=0;
90 1 }
91
92
93 void main()
94 { // uint count;
95 1 // uchar count1=0,count2=0;
96 1 //irdat=0x01;
97 1
98 1 uart_init();
99 1
100 1 // flag=1;
101 1 //send('0'+count);
102 1
103 1 while(1)
104 1 {
105 2
106 2 /// out=0;
107 2
108 2
109 2 count=0;
110 2 irshou();
111 2
112 2 // count1=count/10;
113 2 //count2=count%10;
114 2 // send('0'+count1);
115 2 // send('0'+count2);
116 2 // send('\n');
117 2 count=0;
C51 COMPILER V7.06 IRSHOU2 03/25/2008 14:52:10 PAGE 3
118 2 // out=1;
119 2 // delay(10000);
120 2 //if(count1
121 2 //P2=count1;
122 2 //ComOutChar(count1);
123 2 //irf(irdat);
124 2 //data2<<1;
125 2 //P2=data2;
126 2 //out=1;
127 2
128 2 }
129 1 }
130
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 143 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 10 ----
IDATA SIZE = ---- ----
BIT SIZE = 3 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -