Subversion Repositories svnkaklik

Rev

Rev 410 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

Rev 410 Rev 659
1
CCS PCW C Compiler, Version 3.110, 15448
1
CCS PCW C Compiler, Version 3.110, 15448
2
 
2
 
3
               Filename: d:\@kaklik\programy\pic_c\ps2mys\main.LST
3
               Filename: d:\@kaklik\programy\pic_c\ps2mys\main.LST
4
 
4
 
5
               ROM used: 273 (27%)
5
               ROM used: 273 (27%)
6
                         Largest free fragment is 751
6
                         Largest free fragment is 751
7
               RAM used: 9 (13%) at main() level
7
               RAM used: 9 (13%) at main() level
8
                         12 (18%) worst case
8
                         12 (18%) worst case
9
               Stack:    1 locations
9
               Stack:    1 locations
10
 
10
 
11
*
11
*
12
0000:  MOVLW  00
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
13
0001:  MOVWF  0A
14
0002:  GOTO   0D1
14
0002:  GOTO   0D1
15
0003:  NOP
15
0003:  NOP
16
....................  #include "D:\@Kaklik\programy\PIC_C\PS2mys\main.h" 
16
....................  #include "D:\@Kaklik\programy\PIC_C\PS2mys\main.h" 
17
....................  #include <16F84.h> 
17
....................  #include <16F84.h> 
18
....................  //////// Standard Header file for the PIC16F84 device ////////////////  
18
....................  //////// Standard Header file for the PIC16F84 device ////////////////  
19
.................... #device PIC16F84  
19
.................... #device PIC16F84  
20
.................... #list  
20
.................... #list  
21
....................  
21
....................  
22
.................... #use delay(clock=4000000)  
22
.................... #use delay(clock=4000000)  
23
0004:  MOVLW  16
23
0004:  MOVLW  16
24
0005:  MOVWF  04
24
0005:  MOVWF  04
25
0006:  MOVF   00,W
25
0006:  MOVF   00,W
26
0007:  BTFSC  03.2
26
0007:  BTFSC  03.2
27
0008:  GOTO   018
27
0008:  GOTO   018
28
0009:  MOVLW  01
28
0009:  MOVLW  01
29
000A:  MOVWF  0D
29
000A:  MOVWF  0D
30
000B:  CLRF   0C
30
000B:  CLRF   0C
31
000C:  DECFSZ 0C,F
31
000C:  DECFSZ 0C,F
32
000D:  GOTO   00C
32
000D:  GOTO   00C
33
000E:  DECFSZ 0D,F
33
000E:  DECFSZ 0D,F
34
000F:  GOTO   00B
34
000F:  GOTO   00B
35
0010:  MOVLW  4A
35
0010:  MOVLW  4A
36
0011:  MOVWF  0C
36
0011:  MOVWF  0C
37
0012:  DECFSZ 0C,F
37
0012:  DECFSZ 0C,F
38
0013:  GOTO   012
38
0013:  GOTO   012
39
0014:  NOP
39
0014:  NOP
40
0015:  NOP
40
0015:  NOP
41
0016:  DECFSZ 00,F
41
0016:  DECFSZ 00,F
42
0017:  GOTO   009
42
0017:  GOTO   009
43
0018:  GOTO   0DB (RETURN)
43
0018:  GOTO   0DB (RETURN)
44
.................... #fuses XT,NOWDT  
44
.................... #fuses XT,NOWDT  
45
....................   
45
....................   
46
.................... #DEFINE  DATA     PIN_B0      // musi byt definovan kanal DATA  
46
.................... #DEFINE  DATA     PIN_B0      // musi byt definovan kanal DATA  
47
.................... #DEFINE  CLK      PIN_B1      // a taky hodiny CLK  
47
.................... #DEFINE  CLK      PIN_B1      // a taky hodiny CLK  
48
....................   
48
....................   
49
.................... #define  PRVNI    1000                 // nastaveni prodlevy pred zacatkem vysilani bajtu  
49
.................... #define  PRVNI    1000                 // nastaveni prodlevy pred zacatkem vysilani bajtu  
50
.................... #define  DRUHY    2  
50
.................... #define  DRUHY    2  
51
.................... #define  TRETI    DRUHY  
51
.................... #define  TRETI    DRUHY  
52
....................   
52
....................   
53
.................... // prikazy  
53
.................... // prikazy  
54
.................... #define  RESET                   0xFF  
54
.................... #define  RESET                   0xFF  
55
.................... #define  ENABLE_DATA_REPORTING   0xF4  
55
.................... #define  ENABLE_DATA_REPORTING   0xF4  
56
.................... #define  READ_DATA               0xEB  
56
.................... #define  READ_DATA               0xEB  
57
.................... #define  STATUS_REQUEST          0xE9  
57
.................... #define  STATUS_REQUEST          0xE9  
58
.................... #define  SET_REMOTE_MODE         0xF0  
58
.................... #define  SET_REMOTE_MODE         0xF0  
59
.................... #define  SET_STREAM_MODE         0xEA  
59
.................... #define  SET_STREAM_MODE         0xEA  
60
.................... #define  GET_DEVICE_ID           0xF2  
60
.................... #define  GET_DEVICE_ID           0xF2  
61
....................   
61
....................   
62
.................... #DEFINE  LED_yellow      PIN_A3  
62
.................... #DEFINE  LED_yellow      PIN_A3  
63
.................... #DEFINE  LED_red  PIN_A2  
63
.................... #DEFINE  LED_red  PIN_A2  
64
....................   
64
....................   
65
.................... #DEFINE  BLIK     120            // doba rozsviceni led  
65
.................... #DEFINE  BLIK     120            // doba rozsviceni led  
66
....................  
66
....................  
67
.................... #include "PS2.c" 
67
.................... #include "PS2.c" 
68
....................  // Modul pro komunikaci s Mysi  
68
....................  // Modul pro komunikaci s Mysi  
69
....................   
69
....................   
70
.................... void send(byte command)  
70
.................... void send(byte command)  
71
.................... {  
71
.................... {  
72
....................    int n;  
72
....................    int n;  
73
0019:  CLRF   17
73
0019:  CLRF   17
74
....................    int parity=0;  
74
....................    int parity=0;  
75
....................   
75
....................   
76
....................    //Request-to-send  
76
....................    //Request-to-send  
77
....................    output_float(DATA);  
77
....................    output_float(DATA);  
78
001A:  BSF    03.5
78
001A:  BSF    03.5
79
001B:  BSF    06.0
79
001B:  BSF    06.0
80
....................    output_low(CLK);  
80
....................    output_low(CLK);  
81
001C:  BCF    06.1
81
001C:  BCF    06.1
82
001D:  BCF    03.5
82
001D:  BCF    03.5
83
001E:  BCF    06.1
83
001E:  BCF    06.1
84
....................    delay_us(100);  
84
....................    delay_us(100);  
85
001F:  MOVLW  21
85
001F:  MOVLW  21
86
0020:  MOVWF  0C
86
0020:  MOVWF  0C
87
0021:  DECFSZ 0C,F
87
0021:  DECFSZ 0C,F
88
0022:  GOTO   021
88
0022:  GOTO   021
89
....................    // start bit  
89
....................    // start bit  
90
....................    output_low(DATA);  
90
....................    output_low(DATA);  
91
0023:  BSF    03.5
91
0023:  BSF    03.5
92
0024:  BCF    06.0
92
0024:  BCF    06.0
93
0025:  BCF    03.5
93
0025:  BCF    03.5
94
0026:  BCF    06.0
94
0026:  BCF    06.0
95
....................    delay_us(20);  
95
....................    delay_us(20);  
96
0027:  MOVLW  06
96
0027:  MOVLW  06
97
0028:  MOVWF  0C
97
0028:  MOVWF  0C
98
0029:  DECFSZ 0C,F
98
0029:  DECFSZ 0C,F
99
002A:  GOTO   029
99
002A:  GOTO   029
100
002B:  NOP
100
002B:  NOP
101
....................    while(!input(CLK));  
101
....................    while(!input(CLK));  
102
002C:  BSF    03.5
102
002C:  BSF    03.5
103
002D:  BSF    06.1
103
002D:  BSF    06.1
104
002E:  BCF    03.5
104
002E:  BCF    03.5
105
002F:  BTFSS  06.1
105
002F:  BTFSS  06.1
106
0030:  GOTO   02C
106
0030:  GOTO   02C
107
....................    // 8 bitu  
107
....................    // 8 bitu  
108
....................    for(n=0; n<8; n++)  
108
....................    for(n=0; n<8; n++)  
109
0031:  CLRF   16
109
0031:  CLRF   16
110
0032:  MOVF   16,W
110
0032:  MOVF   16,W
111
0033:  SUBLW  07
111
0033:  SUBLW  07
112
0034:  BTFSS  03.0
112
0034:  BTFSS  03.0
113
0035:  GOTO   052
113
0035:  GOTO   052
114
....................    {  
114
....................    {  
115
....................       while(input(CLK));  
115
....................       while(input(CLK));  
116
0036:  BSF    03.5
116
0036:  BSF    03.5
117
0037:  BSF    06.1
117
0037:  BSF    06.1
118
0038:  BCF    03.5
118
0038:  BCF    03.5
119
0039:  BTFSC  06.1
119
0039:  BTFSC  06.1
120
003A:  GOTO   036
120
003A:  GOTO   036
121
....................       output_bit(DATA, command & 1);  
121
....................       output_bit(DATA, command & 1);  
122
003B:  MOVF   15,W
122
003B:  MOVF   15,W
123
003C:  ANDLW  01
123
003C:  ANDLW  01
124
003D:  XORLW  00
124
003D:  XORLW  00
125
003E:  BTFSS  03.2
125
003E:  BTFSS  03.2
126
003F:  GOTO   042
126
003F:  GOTO   042
127
0040:  BCF    06.0
127
0040:  BCF    06.0
128
0041:  GOTO   043
128
0041:  GOTO   043
129
0042:  BSF    06.0
129
0042:  BSF    06.0
130
0043:  BSF    03.5
130
0043:  BSF    03.5
131
0044:  BCF    06.0
131
0044:  BCF    06.0
132
....................       parity += command & 1;  
132
....................       parity += command & 1;  
133
0045:  BCF    03.5
133
0045:  BCF    03.5
134
0046:  MOVF   15,W
134
0046:  MOVF   15,W
135
0047:  ANDLW  01
135
0047:  ANDLW  01
136
0048:  ADDWF  17,F
136
0048:  ADDWF  17,F
137
....................       command>>=1;  
137
....................       command>>=1;  
138
0049:  BCF    03.0
138
0049:  BCF    03.0
139
004A:  RRF    15,F
139
004A:  RRF    15,F
140
....................       while(!input(CLK));  
140
....................       while(!input(CLK));  
141
004B:  BSF    03.5
141
004B:  BSF    03.5
142
004C:  BSF    06.1
142
004C:  BSF    06.1
143
004D:  BCF    03.5
143
004D:  BCF    03.5
144
004E:  BTFSS  06.1
144
004E:  BTFSS  06.1
145
004F:  GOTO   04B
145
004F:  GOTO   04B
146
....................    };  
146
....................    };  
147
0050:  INCF   16,F
147
0050:  INCF   16,F
148
0051:  GOTO   032
148
0051:  GOTO   032
149
....................    // parita  
149
....................    // parita  
150
....................    while(input(CLK));  
150
....................    while(input(CLK));  
151
0052:  BSF    03.5
151
0052:  BSF    03.5
152
0053:  BSF    06.1
152
0053:  BSF    06.1
153
0054:  BCF    03.5
153
0054:  BCF    03.5
154
0055:  BTFSC  06.1
154
0055:  BTFSC  06.1
155
0056:  GOTO   052
155
0056:  GOTO   052
156
....................    output_bit(DATA, ~parity & 1);  
156
....................    output_bit(DATA, ~parity & 1);  
157
0057:  MOVF   17,W
157
0057:  MOVF   17,W
158
0058:  XORLW  FF
158
0058:  XORLW  FF
159
0059:  ANDLW  01
159
0059:  ANDLW  01
160
005A:  XORLW  00
160
005A:  XORLW  00
161
005B:  BTFSS  03.2
161
005B:  BTFSS  03.2
162
005C:  GOTO   05F
162
005C:  GOTO   05F
163
005D:  BCF    06.0
163
005D:  BCF    06.0
164
005E:  GOTO   060
164
005E:  GOTO   060
165
005F:  BSF    06.0
165
005F:  BSF    06.0
166
0060:  BSF    03.5
166
0060:  BSF    03.5
167
0061:  BCF    06.0
167
0061:  BCF    06.0
168
....................    while(!input(CLK));  
168
....................    while(!input(CLK));  
169
0062:  BSF    06.1
169
0062:  BSF    06.1
170
0063:  BCF    03.5
170
0063:  BCF    03.5
171
0064:  BTFSC  06.1
171
0064:  BTFSC  06.1
172
0065:  GOTO   068
172
0065:  GOTO   068
173
0066:  BSF    03.5
173
0066:  BSF    03.5
174
0067:  GOTO   062
174
0067:  GOTO   062
175
0068:  GOTO   069
175
0068:  GOTO   069
176
....................    // stop bit  
176
....................    // stop bit  
177
....................    while(input(CLK));  
177
....................    while(input(CLK));  
178
0069:  BSF    03.5
178
0069:  BSF    03.5
179
006A:  BSF    06.1
179
006A:  BSF    06.1
180
006B:  BCF    03.5
180
006B:  BCF    03.5
181
006C:  BTFSC  06.1
181
006C:  BTFSC  06.1
182
006D:  GOTO   069
182
006D:  GOTO   069
183
....................    output_bit(DATA, 1);  
183
....................    output_bit(DATA, 1);  
184
006E:  BSF    06.0
184
006E:  BSF    06.0
185
006F:  BSF    03.5
185
006F:  BSF    03.5
186
0070:  BCF    06.0
186
0070:  BCF    06.0
187
....................    while(!input(CLK));  
187
....................    while(!input(CLK));  
188
0071:  BSF    06.1
188
0071:  BSF    06.1
189
0072:  BCF    03.5
189
0072:  BCF    03.5
190
0073:  BTFSC  06.1
190
0073:  BTFSC  06.1
191
0074:  GOTO   077
191
0074:  GOTO   077
192
0075:  BSF    03.5
192
0075:  BSF    03.5
193
0076:  GOTO   071
193
0076:  GOTO   071
194
0077:  GOTO   078
194
0077:  GOTO   078
195
....................    output_float(DATA);  
195
....................    output_float(DATA);  
196
0078:  BSF    03.5
196
0078:  BSF    03.5
197
0079:  BSF    06.0
197
0079:  BSF    06.0
198
007A:  BCF    03.5
198
007A:  BCF    03.5
199
007B:  GOTO   0E0 (RETURN)
199
007B:  GOTO   0E0 (RETURN)
200
.................... }  
200
.................... }  
201
....................   
201
....................   
202
....................   
202
....................   
203
.................... int8 read_byte(int8 const poradi)  
203
.................... int8 read_byte(int8 const poradi)  
204
.................... {  
204
.................... {  
205
.................... int8 bajt;  
205
.................... int8 bajt;  
206
.................... int8 i;  
206
.................... int8 i;  
207
....................   
207
....................   
208
....................    // cekani na komunikacni klid  
208
....................    // cekani na komunikacni klid  
209
....................    for (i=0; i<poradi; i++)  
209
....................    for (i=0; i<poradi; i++)  
210
007C:  CLRF   16
210
007C:  CLRF   16
211
007D:  SUBWF  16,W
211
007D:  SUBWF  16,W
212
007E:  BTFSC  03.0
212
007E:  BTFSC  03.0
213
007F:  GOTO   08D
213
007F:  GOTO   08D
214
....................    {  
214
....................    {  
215
....................       if (!input(CLK) || !input(DATA)) i=0;  
215
....................       if (!input(CLK) || !input(DATA)) i=0;  
216
0080:  BSF    03.5
216
0080:  BSF    03.5
217
0081:  BSF    06.1
217
0081:  BSF    06.1
218
0082:  BCF    03.5
218
0082:  BCF    03.5
219
0083:  BTFSS  06.1
219
0083:  BTFSS  06.1
220
0084:  GOTO   08A
220
0084:  GOTO   08A
221
0085:  BSF    03.5
221
0085:  BSF    03.5
222
0086:  BSF    06.0
222
0086:  BSF    06.0
223
0087:  BCF    03.5
223
0087:  BCF    03.5
224
0088:  BTFSC  06.0
224
0088:  BTFSC  06.0
225
0089:  GOTO   08B
225
0089:  GOTO   08B
226
008A:  CLRF   16
226
008A:  CLRF   16
227
....................    };  
227
....................    };  
228
008B:  INCF   16,F
228
008B:  INCF   16,F
229
008C:  GOTO   07D
229
008C:  GOTO   07D
230
....................   
230
....................   
231
....................    // cekani na startbit  
231
....................    // cekani na startbit  
232
....................    while(input(CLK) || input(DATA));  
232
....................    while(input(CLK) || input(DATA));  
233
008D:  BSF    03.5
233
008D:  BSF    03.5
234
008E:  BSF    06.1
234
008E:  BSF    06.1
235
008F:  BCF    03.5
235
008F:  BCF    03.5
236
0090:  BTFSC  06.1
236
0090:  BTFSC  06.1
237
0091:  GOTO   08D
237
0091:  GOTO   08D
238
0092:  BSF    03.5
238
0092:  BSF    03.5
239
0093:  BSF    06.0
239
0093:  BSF    06.0
240
0094:  BCF    03.5
240
0094:  BCF    03.5
241
0095:  BTFSC  06.0
241
0095:  BTFSC  06.0
242
0096:  GOTO   08D
242
0096:  GOTO   08D
243
....................    while(!input(CLK));  
243
....................    while(!input(CLK));  
244
0097:  BSF    03.5
244
0097:  BSF    03.5
245
0098:  BSF    06.1
245
0098:  BSF    06.1
246
0099:  BCF    03.5
246
0099:  BCF    03.5
247
009A:  BTFSS  06.1
247
009A:  BTFSS  06.1
248
009B:  GOTO   097
248
009B:  GOTO   097
249
....................   
249
....................   
250
....................    bajt = 0;  
250
....................    bajt = 0;  
251
009C:  CLRF   15
251
009C:  CLRF   15
252
....................    for(i=0; i<8; i++)  
252
....................    for(i=0; i<8; i++)  
253
009D:  CLRF   16
253
009D:  CLRF   16
254
009E:  MOVF   16,W
254
009E:  MOVF   16,W
255
009F:  SUBLW  07
255
009F:  SUBLW  07
256
00A0:  BTFSS  03.0
256
00A0:  BTFSS  03.0
257
00A1:  GOTO   0BD
257
00A1:  GOTO   0BD
258
....................    {  
258
....................    {  
259
....................       while(input(CLK));   // ceka na nulu hodin  
259
....................       while(input(CLK));   // ceka na nulu hodin  
260
00A2:  BSF    03.5
260
00A2:  BSF    03.5
261
00A3:  BSF    06.1
261
00A3:  BSF    06.1
262
00A4:  BCF    03.5
262
00A4:  BCF    03.5
263
00A5:  BTFSC  06.1
263
00A5:  BTFSC  06.1
264
00A6:  GOTO   0A2
264
00A6:  GOTO   0A2
265
....................   
265
....................   
266
....................       bajt >>= 1;  
266
....................       bajt >>= 1;  
267
00A7:  BCF    03.0
267
00A7:  BCF    03.0
268
00A8:  RRF    15,F
268
00A8:  RRF    15,F
269
....................       bajt |= input(DATA) << 7;  
269
....................       bajt |= input(DATA) << 7;  
270
00A9:  BSF    03.5
270
00A9:  BSF    03.5
271
00AA:  BSF    06.0
271
00AA:  BSF    06.0
272
00AB:  MOVLW  00
272
00AB:  MOVLW  00
273
00AC:  BCF    03.5
273
00AC:  BCF    03.5
274
00AD:  BTFSC  06.0
274
00AD:  BTFSC  06.0
275
00AE:  MOVLW  01
275
00AE:  MOVLW  01
276
00AF:  MOVWF  0C
276
00AF:  MOVWF  0C
277
00B0:  RRF    0C,W
277
00B0:  RRF    0C,W
278
00B1:  CLRF   0C
278
00B1:  CLRF   0C
279
00B2:  BTFSC  03.0
279
00B2:  BTFSC  03.0
280
00B3:  BSF    0C.7
280
00B3:  BSF    0C.7
281
00B4:  MOVF   0C,W
281
00B4:  MOVF   0C,W
282
00B5:  IORWF  15,F
282
00B5:  IORWF  15,F
283
....................   
283
....................   
284
....................       while(!input(CLK));  // ceka na jednicku hodin  
284
....................       while(!input(CLK));  // ceka na jednicku hodin  
285
00B6:  BSF    03.5
285
00B6:  BSF    03.5
286
00B7:  BSF    06.1
286
00B7:  BSF    06.1
287
00B8:  BCF    03.5
287
00B8:  BCF    03.5
288
00B9:  BTFSS  06.1
288
00B9:  BTFSS  06.1
289
00BA:  GOTO   0B6
289
00BA:  GOTO   0B6
290
....................    };  
290
....................    };  
291
00BB:  INCF   16,F
291
00BB:  INCF   16,F
292
00BC:  GOTO   09E
292
00BC:  GOTO   09E
293
....................    return (bajt);  
293
....................    return (bajt);  
294
00BD:  MOVF   15,W
294
00BD:  MOVF   15,W
295
00BE:  MOVWF  0D
295
00BE:  MOVWF  0D
296
00BF:  RETLW  00
296
00BF:  RETLW  00
297
.................... }  
297
.................... }  
298
....................   
298
....................   
299
....................   
299
....................   
300
.................... /*void read_all_byte(int8*st,*nd,*rd)           // precte 3 bajty  
300
.................... /*void read_all_byte(int8*st,*nd,*rd)           // precte 3 bajty  
301
.................... {  
301
.................... {  
302
.................... int8 i;  
302
.................... int8 i;  
303
....................   
303
....................   
304
.................... //   *st=read_byte(1st);  
304
.................... //   *st=read_byte(1st);  
305
....................   
305
....................   
306
....................    // cekani na startbit  
306
....................    // cekani na startbit  
307
....................    while(input(CLK) || input(DATA));  
307
....................    while(input(CLK) || input(DATA));  
308
....................    while(!input(CLK));  
308
....................    while(!input(CLK));  
309
....................    *nd = 0;  
309
....................    *nd = 0;  
310
....................    for(i=0; i<8; i++)  
310
....................    for(i=0; i<8; i++)  
311
....................    {  
311
....................    {  
312
....................       while(input(CLK));   // ceka na nulu hodin  
312
....................       while(input(CLK));   // ceka na nulu hodin  
313
....................   
313
....................   
314
....................       *nd |= input(DATA) << 7;  
314
....................       *nd |= input(DATA) << 7;  
315
....................       *nd >>= 1;  
315
....................       *nd >>= 1;  
316
....................   
316
....................   
317
....................       while(!input(CLK));  // ceka na jednicku hodin  
317
....................       while(!input(CLK));  // ceka na jednicku hodin  
318
....................    };  
318
....................    };  
319
....................   
319
....................   
320
....................    // cekani na startbit  
320
....................    // cekani na startbit  
321
....................    while(input(CLK) || input(DATA));  
321
....................    while(input(CLK) || input(DATA));  
322
....................    while(!input(CLK));  
322
....................    while(!input(CLK));  
323
....................    *rd = 0;  
323
....................    *rd = 0;  
324
....................    for(i=0; i<8; i++)  
324
....................    for(i=0; i<8; i++)  
325
....................    {  
325
....................    {  
326
....................       while(input(CLK));   // ceka na nulu hodin  
326
....................       while(input(CLK));   // ceka na nulu hodin  
327
....................   
327
....................   
328
....................       *rd |= input(DATA) << 7;  
328
....................       *rd |= input(DATA) << 7;  
329
....................       *rd >>= 1;  
329
....................       *rd >>= 1;  
330
....................   
330
....................   
331
....................       while(!input(CLK));  // ceka na jednicku hodin  
331
....................       while(!input(CLK));  // ceka na jednicku hodin  
332
....................    };  
332
....................    };  
333
.................... }*/  
333
.................... }*/  
334
....................  
334
....................  
335
....................   
335
....................   
336
.................... #define SIGN_X 4  
336
.................... #define SIGN_X 4  
337
....................   
337
....................   
338
.................... void trigger()  
338
.................... void trigger()  
339
.................... {  
339
.................... {  
340
....................    output_high(PIN_A0);  
340
....................    output_high(PIN_A0);  
341
00C0:  BSF    03.5
341
00C0:  BSF    03.5
342
00C1:  BCF    05.0
342
00C1:  BCF    05.0
343
00C2:  BCF    03.5
343
00C2:  BCF    03.5
344
00C3:  BSF    05.0
344
00C3:  BSF    05.0
345
....................    output_low(PIN_A0);  
345
....................    output_low(PIN_A0);  
346
00C4:  BSF    03.5
346
00C4:  BSF    03.5
347
00C5:  BCF    05.0
347
00C5:  BCF    05.0
348
00C6:  BCF    03.5
348
00C6:  BCF    03.5
349
00C7:  BCF    05.0
349
00C7:  BCF    05.0
350
....................    delay_us(100);  
350
....................    delay_us(100);  
351
00C8:  MOVLW  21
351
00C8:  MOVLW  21
352
00C9:  MOVWF  0C
352
00C9:  MOVWF  0C
353
00CA:  DECFSZ 0C,F
353
00CA:  DECFSZ 0C,F
354
00CB:  GOTO   0CA
354
00CB:  GOTO   0CA
355
....................    output_high(PIN_A0);  
355
....................    output_high(PIN_A0);  
356
00CC:  BSF    03.5
356
00CC:  BSF    03.5
357
00CD:  BCF    05.0
357
00CD:  BCF    05.0
358
00CE:  BCF    03.5
358
00CE:  BCF    03.5
359
00CF:  BSF    05.0
359
00CF:  BSF    05.0
360
00D0:  GOTO   0FC (RETURN)
360
00D0:  GOTO   0FC (RETURN)
361
.................... }  
361
.................... }  
362
....................   
362
....................   
363
.................... void flash_red()                             // blikne ledkou  
363
.................... void flash_red()                             // blikne ledkou  
364
.................... {  
364
.................... {  
365
....................    output_high(LED_red);  
365
....................    output_high(LED_red);  
366
....................    Delay_ms(BLIK);  
366
....................    Delay_ms(BLIK);  
367
....................    output_low(LED_red);  
367
....................    output_low(LED_red);  
368
.................... }  
368
.................... }  
369
....................   
369
....................   
370
.................... void flash_yellow()                             // blikne ledkou  
370
.................... void flash_yellow()                             // blikne ledkou  
371
.................... {  
371
.................... {  
372
....................    output_high(LED_yellow);  
372
....................    output_high(LED_yellow);  
373
....................    Delay_ms(BLIK);  
373
....................    Delay_ms(BLIK);  
374
....................    output_low(LED_yellow);  
374
....................    output_low(LED_yellow);  
375
.................... }  
375
.................... }  
376
....................   
376
....................   
377
.................... void main()  
377
.................... void main()  
378
.................... {  
378
.................... {  
379
.................... int8 X,y,tl=0;  
379
.................... int8 X,y,tl=0;  
380
*
380
*
381
00D4:  CLRF   11
381
00D4:  CLRF   11
382
00D5:  CLRF   14
382
00D5:  CLRF   14
383
.................... int8 X_old,y_old,tl_old=0;  
383
.................... int8 X_old,y_old,tl_old=0;  
384
*
384
*
385
00D1:  CLRF   04
385
00D1:  CLRF   04
386
00D2:  MOVLW  1F
386
00D2:  MOVLW  1F
387
00D3:  ANDWF  03,F
387
00D3:  ANDWF  03,F
388
....................   
388
....................   
389
....................    Delay_ms(500);  
389
....................    Delay_ms(500);  
390
*
390
*
391
00D6:  MOVLW  02
391
00D6:  MOVLW  02
392
00D7:  MOVWF  15
392
00D7:  MOVWF  15
393
00D8:  MOVLW  FA
393
00D8:  MOVLW  FA
394
00D9:  MOVWF  16
394
00D9:  MOVWF  16
395
00DA:  GOTO   004
395
00DA:  GOTO   004
396
00DB:  DECFSZ 15,F
396
00DB:  DECFSZ 15,F
397
00DC:  GOTO   0D8
397
00DC:  GOTO   0D8
398
....................    send(ENABLE_DATA_REPORTING);  
398
....................    send(ENABLE_DATA_REPORTING);  
399
00DD:  MOVLW  F4
399
00DD:  MOVLW  F4
400
00DE:  MOVWF  15
400
00DE:  MOVWF  15
401
00DF:  GOTO   019
401
00DF:  GOTO   019
402
....................   
402
....................   
403
....................    while(true)  
403
....................    while(true)  
404
....................    {  
404
....................    {  
405
....................       tl = read_byte(PRVNI);  
405
....................       tl = read_byte(PRVNI);  
406
00E0:  MOVLW  E8
406
00E0:  MOVLW  E8
407
00E1:  BSF    03.5
407
00E1:  BSF    03.5
408
00E2:  BSF    03.6
408
00E2:  BSF    03.6
409
00E3:  MOVWF  7F
409
00E3:  MOVWF  7F
410
00E4:  BCF    03.5
410
00E4:  BCF    03.5
411
00E5:  BCF    03.6
411
00E5:  BCF    03.6
412
00E6:  CALL   07C
412
00E6:  CALL   07C
413
00E7:  MOVF   0D,W
413
00E7:  MOVF   0D,W
414
00E8:  MOVWF  11
414
00E8:  MOVWF  11
415
....................        x = read_byte(DRUHY);  
415
....................        x = read_byte(DRUHY);  
416
00E9:  MOVLW  02
416
00E9:  MOVLW  02
417
00EA:  BSF    03.5
417
00EA:  BSF    03.5
418
00EB:  BSF    03.6
418
00EB:  BSF    03.6
419
00EC:  MOVWF  7F
419
00EC:  MOVWF  7F
420
00ED:  BCF    03.5
420
00ED:  BCF    03.5
421
00EE:  BCF    03.6
421
00EE:  BCF    03.6
422
00EF:  CALL   07C
422
00EF:  CALL   07C
423
00F0:  MOVF   0D,W
423
00F0:  MOVF   0D,W
424
00F1:  MOVWF  0F
424
00F1:  MOVWF  0F
425
....................        y = read_byte(TRETI);  
425
....................        y = read_byte(TRETI);  
426
00F2:  MOVLW  02
426
00F2:  MOVLW  02
427
00F3:  BSF    03.5
427
00F3:  BSF    03.5
428
00F4:  BSF    03.6
428
00F4:  BSF    03.6
429
00F5:  MOVWF  7F
429
00F5:  MOVWF  7F
430
00F6:  BCF    03.5
430
00F6:  BCF    03.5
431
00F7:  BCF    03.6
431
00F7:  BCF    03.6
432
00F8:  CALL   07C
432
00F8:  CALL   07C
433
00F9:  MOVF   0D,W
433
00F9:  MOVF   0D,W
434
00FA:  MOVWF  10
434
00FA:  MOVWF  10
435
....................       trigger();  
435
....................       trigger();  
436
00FB:  GOTO   0C0
436
00FB:  GOTO   0C0
437
....................   
437
....................   
438
....................   
438
....................   
439
....................       if (bit_test(tl, SIGN_X))  
439
....................       if (bit_test(tl, SIGN_X))  
440
00FC:  BTFSS  11.4
440
00FC:  BTFSS  11.4
441
00FD:  GOTO   107
441
00FD:  GOTO   107
442
....................       {  
442
....................       {  
443
....................          output_high(LED_red);  
443
....................          output_high(LED_red);  
444
00FE:  BSF    03.5
444
00FE:  BSF    03.5
445
00FF:  BCF    05.2
445
00FF:  BCF    05.2
446
0100:  BCF    03.5
446
0100:  BCF    03.5
447
0101:  BSF    05.2
447
0101:  BSF    05.2
448
....................          output_low(LED_yellow);  
448
....................          output_low(LED_yellow);  
449
0102:  BSF    03.5
449
0102:  BSF    03.5
450
0103:  BCF    05.3
450
0103:  BCF    05.3
451
0104:  BCF    03.5
451
0104:  BCF    03.5
452
0105:  BCF    05.3
452
0105:  BCF    05.3
453
....................       }  
453
....................       }  
454
....................       else  
454
....................       else  
455
0106:  GOTO   10F
455
0106:  GOTO   10F
456
....................       {  
456
....................       {  
457
....................          output_high(LED_yellow);  
457
....................          output_high(LED_yellow);  
458
0107:  BSF    03.5
458
0107:  BSF    03.5
459
0108:  BCF    05.3
459
0108:  BCF    05.3
460
0109:  BCF    03.5
460
0109:  BCF    03.5
461
010A:  BSF    05.3
461
010A:  BSF    05.3
462
....................          output_low(LED_red);  
462
....................          output_low(LED_red);  
463
010B:  BSF    03.5
463
010B:  BSF    03.5
464
010C:  BCF    05.2
464
010C:  BCF    05.2
465
010D:  BCF    03.5
465
010D:  BCF    03.5
466
010E:  BCF    05.2
466
010E:  BCF    05.2
467
....................       }  
467
....................       }  
468
....................    }  
468
....................    }  
469
010F:  GOTO   0E0
469
010F:  GOTO   0E0
470
.................... }  
470
.................... }  
471
....................   
471
....................   
472
0110:  SLEEP
472
0110:  SLEEP
473
....................   
473
....................   
474
....................  
474
....................