Subversion Repositories svnkaklik

Rev

Rev 324 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 324 Rev 325
Line 4... Line 4...
4
;// License Type  : Pro License
4
;// License Type  : Pro License
5
;// Limitations   : PIC18 max code size:Unlimited, max RAM banks:Unlimited
5
;// Limitations   : PIC18 max code size:Unlimited, max RAM banks:Unlimited
6
;/////////////////////////////////////////////////////////////////////////////////
6
;/////////////////////////////////////////////////////////////////////////////////
7
 
7
 
8
	include "P18F252.inc"
8
	include "P18F252.inc"
9
__HEAPSTART                      EQU	0x0000000B ; Start address of heap 
9
__HEAPSTART                      EQU	0x0000000F ; Start address of heap 
10
__HEAPEND                        EQU	0x000005FF ; End address of heap 
10
__HEAPEND                        EQU	0x000005FF ; End address of heap 
11
gbl_status                       EQU	0x00000FD8 ; bytes:1
11
gbl_status                       EQU	0x00000FD8 ; bytes:1
12
gbl_prodl                        EQU	0x00000FF3 ; bytes:1
12
gbl_prodl                        EQU	0x00000FF3 ; bytes:1
13
gbl_prodh                        EQU	0x00000FF4 ; bytes:1
13
gbl_prodh                        EQU	0x00000FF4 ; bytes:1
14
gbl_porta                        EQU	0x00000F80 ; bytes:1
14
gbl_porta                        EQU	0x00000F80 ; bytes:1
Line 101... Line 101...
101
gbl_pclatu                       EQU	0x00000FFB ; bytes:1
101
gbl_pclatu                       EQU	0x00000FFB ; bytes:1
102
gbl_stkptr                       EQU	0x00000FFC ; bytes:1
102
gbl_stkptr                       EQU	0x00000FFC ; bytes:1
103
gbl_tosl                         EQU	0x00000FFD ; bytes:1
103
gbl_tosl                         EQU	0x00000FFD ; bytes:1
104
gbl_tosh                         EQU	0x00000FFE ; bytes:1
104
gbl_tosh                         EQU	0x00000FFE ; bytes:1
105
gbl_tosu                         EQU	0x00000FFF ; bytes:1
105
gbl_tosu                         EQU	0x00000FFF ; bytes:1
106
CompTempVarRet489                EQU	0x00000009 ; bytes:1
106
CompTempVarRet489                EQU	0x0000000D ; bytes:1
107
send_00000_arg_c                 EQU	0x00000009 ; bytes:1
107
send_00000_arg_c                 EQU	0x0000000D ; bytes:1
108
main_1_motors                    EQU	0x00000001 ; bytes:1
108
main_1_motors                    EQU	0x00000001 ; bytes:1
109
main_1_sensors                   EQU	0x00000002 ; bytes:1
109
main_1_sensors                   EQU	0x00000002 ; bytes:1
110
main_1_leds                      EQU	0x00000003 ; bytes:1
110
main_1_leds                      EQU	0x00000003 ; bytes:1
111
main_1_count                     EQU	0x00000004 ; bytes:4
111
main_1_count                     EQU	0x00000004 ; bytes:4
-
 
112
main_1_cas                       EQU	0x00000008 ; bytes:4
112
CompTempVar491                   EQU	0x00000008 ; bytes:1
113
CompTempVar491                   EQU	0x0000000C ; bytes:1
113
CompTempVar492                   EQU	0x00000009 ; bytes:1
114
CompTempVar492                   EQU	0x0000000D ; bytes:1
114
CompTempVar496                   EQU	0x0000000A ; bytes:1
115
CompTempVar496                   EQU	0x0000000E ; bytes:1
115
	ORG 0x00000200
116
	ORG 0x00000200
116
	GOTO	_startup
117
	GOTO	_startup
117
	ORG 0x00000204
118
	ORG 0x00000204
118
send_00000
119
send_00000
119
; { send ; function begin
120
; { send ; function begin
Line 169... Line 170...
169
	MOVWF gbl_rcsta
170
	MOVWF gbl_rcsta
170
	MOVLW 0x80
171
	MOVLW 0x80
171
	IORWF gbl_rcsta, W
172
	IORWF gbl_rcsta, W
172
	MOVWF gbl_rcsta
173
	MOVWF gbl_rcsta
173
	CLRF main_1_motors
174
	CLRF main_1_motors
174
label268438598
175
label268438599
175
	BTFSC gbl_portb,0
176
	BTFSC gbl_portb,0
176
	BRA	label268438598
177
	BRA	label268438599
177
	MOVLW 0xF0
178
	MOVLW 0xF0
178
	MOVWF main_1_leds
179
	MOVWF main_1_leds
179
	MOVLW 0x80
180
	MOVLW 0x80
180
	MOVWF main_1_count
181
	MOVWF main_1_count
181
	MOVLW 0x1A
182
	MOVLW 0x1A
182
	MOVWF main_1_count+D'1'
183
	MOVWF main_1_count+D'1'
183
	MOVLW 0x06
184
	MOVLW 0x06
184
	MOVWF main_1_count+D'2'
185
	MOVWF main_1_count+D'2'
185
	CLRF main_1_count+D'3'
186
	CLRF main_1_count+D'3'
186
label268438603
187
label268438604
187
	MOVF main_1_count+D'3', W
188
	MOVF main_1_count+D'3', W
188
	SUBLW 0x00
189
	SUBLW 0x00
189
	BNZ	label268438604
190
	BNZ	label268438605
190
	MOVF main_1_count+D'2', W
191
	MOVF main_1_count+D'2', W
191
	SUBLW 0x00
192
	SUBLW 0x00
192
	BNZ	label268438604
193
	BNZ	label268438605
193
	MOVF main_1_count+D'1', W
194
	MOVF main_1_count+D'1', W
194
	SUBLW 0x00
195
	SUBLW 0x00
195
	BNZ	label268438604
196
	BNZ	label268438605
196
	MOVF main_1_count, W
197
	MOVF main_1_count, W
197
	SUBLW 0x00
198
	SUBLW 0x00
198
label268438604
199
label268438605
199
	BTFSC main_1_count+D'3',7
200
	BTFSC main_1_count+D'3',7
200
	BSF STATUS,C
201
	BSF STATUS,C
201
	BC	label268438608
202
	BC	label268438609
202
	MOVLW 0x01
203
	MOVLW 0x01
203
	SUBWF main_1_count, W
204
	SUBWF main_1_count, W
204
	MOVWF CompTempVar492
205
	MOVWF CompTempVar492
205
	MOVLW 0x00
206
	MOVLW 0x00
206
	MOVWF CompTempVar496
207
	MOVWF CompTempVar496
Line 219... Line 220...
219
	SUBWF main_1_count+D'3', F
220
	SUBWF main_1_count+D'3', F
220
	MOVF CompTempVar492, W
221
	MOVF CompTempVar492, W
221
	MOVWF main_1_count
222
	MOVWF main_1_count
222
	MOVLW 0x00
223
	MOVLW 0x00
223
	SUBWF main_1_count+D'3', W
224
	SUBWF main_1_count+D'3', W
224
	BNZ	label268438620
225
	BNZ	label268438621
225
	MOVLW 0x04
226
	MOVLW 0x04
226
	SUBWF main_1_count+D'2', W
227
	SUBWF main_1_count+D'2', W
227
	BNZ	label268438620
228
	BNZ	label268438621
228
	MOVLW 0x93
229
	MOVLW 0x93
229
	SUBWF main_1_count+D'1', W
230
	SUBWF main_1_count+D'1', W
230
	BNZ	label268438620
231
	BNZ	label268438621
231
	MOVLW 0xE0
232
	MOVLW 0xE0
232
	SUBWF main_1_count, W
233
	SUBWF main_1_count, W
233
label268438620
234
label268438621
234
	BNC	label4026532500
235
	BNC	label4026532557
235
	BTFSS main_1_count+D'3',7
236
	BTFSS main_1_count+D'3',7
236
	BRA	label268438624
237
	BRA	label268438625
237
label4026532500
238
label4026532557
238
	MOVLW 0x01
239
	MOVLW 0x01
239
	IORWF main_1_leds, W
240
	IORWF main_1_leds, W
240
	MOVWF main_1_leds
241
	MOVWF main_1_leds
241
label268438624
242
label268438625
242
	MOVLW 0x00
243
	MOVLW 0x00
243
	SUBWF main_1_count+D'3', W
244
	SUBWF main_1_count+D'3', W
244
	BNZ	label268438626
245
	BNZ	label268438627
245
	MOVLW 0x03
246
	MOVLW 0x03
246
	SUBWF main_1_count+D'2', W
247
	SUBWF main_1_count+D'2', W
247
	BNZ	label268438626
248
	BNZ	label268438627
248
	MOVLW 0x0D
249
	MOVLW 0x0D
249
	SUBWF main_1_count+D'1', W
250
	SUBWF main_1_count+D'1', W
250
	BNZ	label268438626
251
	BNZ	label268438627
251
	MOVLW 0x40
252
	MOVLW 0x40
252
	SUBWF main_1_count, W
253
	SUBWF main_1_count, W
253
label268438626
254
label268438627
254
	BNC	label4026532501
255
	BNC	label4026532558
255
	BTFSS main_1_count+D'3',7
256
	BTFSS main_1_count+D'3',7
256
	BRA	label268438630
257
	BRA	label268438631
257
label4026532501
258
label4026532558
258
	MOVLW 0x02
259
	MOVLW 0x02
259
	IORWF main_1_leds, W
260
	IORWF main_1_leds, W
260
	MOVWF main_1_leds
261
	MOVWF main_1_leds
261
label268438630
262
label268438631
262
	MOVLW 0x00
263
	MOVLW 0x00
263
	SUBWF main_1_count+D'3', W
264
	SUBWF main_1_count+D'3', W
264
	BNZ	label268438632
265
	BNZ	label268438633
265
	MOVLW 0x01
266
	MOVLW 0x01
266
	SUBWF main_1_count+D'2', W
267
	SUBWF main_1_count+D'2', W
267
	BNZ	label268438632
268
	BNZ	label268438633
268
	MOVLW 0x86
269
	MOVLW 0x86
269
	SUBWF main_1_count+D'1', W
270
	SUBWF main_1_count+D'1', W
270
	BNZ	label268438632
271
	BNZ	label268438633
271
	MOVLW 0xA0
272
	MOVLW 0xA0
272
	SUBWF main_1_count, W
273
	SUBWF main_1_count, W
273
label268438632
274
label268438633
274
	BNC	label4026532502
275
	BNC	label4026532559
275
	BTFSS main_1_count+D'3',7
276
	BTFSS main_1_count+D'3',7
276
	BRA	label268438636
277
	BRA	label268438637
277
label4026532502
278
label4026532559
278
	MOVLW 0x04
279
	MOVLW 0x04
279
	IORWF main_1_leds, W
280
	IORWF main_1_leds, W
280
	MOVWF main_1_leds
281
	MOVWF main_1_leds
281
label268438636
282
label268438637
282
	MOVF main_1_leds, W
283
	MOVF main_1_leds, W
283
	MOVWF gbl_lata
284
	MOVWF gbl_lata
284
	BRA	label268438603
285
	BRA	label268438604
285
label268438608
286
label268438609
286
	SETF gbl_lata
287
	SETF gbl_lata
287
label268438640
288
label268438641
-
 
289
	CLRF main_1_cas
-
 
290
	CLRF main_1_cas+D'1'
-
 
291
	CLRF main_1_cas+D'2'
-
 
292
	CLRF main_1_cas+D'3'
288
	SETF main_1_sensors
293
	SETF main_1_sensors
289
	CALL receive_00000
294
	CALL receive_00000
290
	MOVF CompTempVarRet489, W
295
	MOVF CompTempVarRet489, W
291
	MOVWF main_1_sensors
296
	MOVWF main_1_sensors
292
	CLRF CompTempVar491
297
	CLRF CompTempVar491
293
	BTFSS main_1_sensors,1
298
	BTFSS main_1_sensors,1
294
	BRA	label268438645
299
	BRA	label268438647
295
	BTFSS main_1_sensors,0
300
	BTFSS main_1_sensors,0
296
	BRA	label268438645
301
	BRA	label268438647
297
	INCF CompTempVar491, F
302
	INCF CompTempVar491, F
298
label268438645
303
label268438647
299
	MOVF CompTempVar491, F
304
	MOVF CompTempVar491, F
300
	BNZ	label268438646
305
	BNZ	label268438648
301
	MOVLW 0x77
306
	MOVLW 0x77
302
	MOVWF main_1_motors
307
	MOVWF main_1_motors
303
label268438646
308
label268438648
304
	BTFSC main_1_sensors,2
309
	BTFSC main_1_sensors,2
305
	BRA	label268438649
310
	BRA	label268438651
-
 
311
	MOVLW 0x00
-
 
312
	SUBWF main_1_cas+D'3', W
-
 
313
	BNZ	label268438653
-
 
314
	MOVLW 0x06
-
 
315
	SUBWF main_1_cas+D'2', W
-
 
316
	BNZ	label268438653
-
 
317
	MOVLW 0x1A
-
 
318
	SUBWF main_1_cas+D'1', W
-
 
319
	BNZ	label268438653
-
 
320
	MOVLW 0x80
-
 
321
	SUBWF main_1_cas, W
-
 
322
label268438653
-
 
323
	BNC	label4026532563
-
 
324
	BTFSS main_1_cas+D'3',7
-
 
325
	BRA	label4026532566
-
 
326
label4026532563
-
 
327
	INCF main_1_cas, F
-
 
328
	BTFSC STATUS,Z
-
 
329
	INCF main_1_cas+D'1', F
-
 
330
	BTFSC STATUS,Z
-
 
331
	INCF main_1_cas+D'2', F
-
 
332
	BTFSC STATUS,Z
-
 
333
	INCF main_1_cas+D'3', F
-
 
334
label4026532566
-
 
335
	CLRF main_1_cas
-
 
336
	CLRF main_1_cas+D'1'
-
 
337
	CLRF main_1_cas+D'2'
-
 
338
	CLRF main_1_cas+D'3'
306
	MOVLW 0xF7
339
	MOVLW 0xF7
307
	MOVWF main_1_motors
340
	MOVWF main_1_motors
308
label268438649
341
label268438651
309
	BTFSC main_1_sensors,3
342
	BTFSC main_1_sensors,3
310
	BRA	label268438652
343
	BRA	label268438668
-
 
344
	MOVLW 0x00
-
 
345
	SUBWF main_1_cas+D'3', W
-
 
346
	BNZ	label268438670
-
 
347
	MOVLW 0x06
-
 
348
	SUBWF main_1_cas+D'2', W
-
 
349
	BNZ	label268438670
-
 
350
	MOVLW 0x1A
-
 
351
	SUBWF main_1_cas+D'1', W
-
 
352
	BNZ	label268438670
-
 
353
	MOVLW 0x80
-
 
354
	SUBWF main_1_cas, W
-
 
355
label268438670
-
 
356
	BNC	label4026532568
-
 
357
	BTFSS main_1_cas+D'3',7
-
 
358
	BRA	label4026532571
-
 
359
label4026532568
-
 
360
	INCF main_1_cas, F
-
 
361
	BTFSC STATUS,Z
-
 
362
	INCF main_1_cas+D'1', F
-
 
363
	BTFSC STATUS,Z
-
 
364
	INCF main_1_cas+D'2', F
-
 
365
	BTFSC STATUS,Z
-
 
366
	INCF main_1_cas+D'3', F
-
 
367
label4026532571
-
 
368
	CLRF main_1_cas
-
 
369
	CLRF main_1_cas+D'1'
-
 
370
	CLRF main_1_cas+D'2'
-
 
371
	CLRF main_1_cas+D'3'
311
	MOVLW 0x7F
372
	MOVLW 0x7F
312
	MOVWF main_1_motors
373
	MOVWF main_1_motors
313
label268438652
374
label268438668
-
 
375
	INCF main_1_cas, F
-
 
376
	BTFSC STATUS,Z
-
 
377
	INCF main_1_cas+D'1', F
-
 
378
	BTFSC STATUS,Z
-
 
379
	INCF main_1_cas+D'2', F
-
 
380
	BTFSC STATUS,Z
-
 
381
	INCF main_1_cas+D'3', F
314
	MOVF main_1_sensors, W
382
	MOVF main_1_sensors, W
315
	MOVWF gbl_lata
383
	MOVWF gbl_lata
316
	MOVF main_1_motors, W
384
	MOVF main_1_motors, W
317
	MOVWF send_00000_arg_c
385
	MOVWF send_00000_arg_c
318
	CALL send_00000
386
	CALL send_00000
319
	BRA	label268438640
387
	BRA	label268438641
320
; } main function end
388
; } main function end
321
 
389
 
322
	ORG 0x0000035C
390
	ORG 0x000003D6
323
_startup
391
_startup
324
	GOTO	main
392
	GOTO	main
325
	ORG 0x00300000
393
	ORG 0x00300000
326
	DW 0xFEFF
394
	DW 0xFEFF
327
	DW 0xFEF6
395
	DW 0xFEF6