Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
318 kaklik 1
;/////////////////////////////////////////////////////////////////////////////////
2
;// Code Generator: BoostBasic Compiler - http://www.sourceboost.com
3
;// Version       : 6.70
4
;// License Type  : Pro License
5
;// Limitations   : PIC18 max code size:Unlimited, max RAM banks:Unlimited
6
;/////////////////////////////////////////////////////////////////////////////////
7
 
8
	include "P18F252.inc"
325 kaklik 9
__HEAPSTART                      EQU	0x0000000F ; Start address of heap 
318 kaklik 10
__HEAPEND                        EQU	0x000005FF ; End address of heap 
11
gbl_status                       EQU	0x00000FD8 ; bytes:1
12
gbl_prodl                        EQU	0x00000FF3 ; bytes:1
13
gbl_prodh                        EQU	0x00000FF4 ; bytes:1
14
gbl_porta                        EQU	0x00000F80 ; bytes:1
15
gbl_portb                        EQU	0x00000F81 ; bytes:1
16
gbl_portc                        EQU	0x00000F82 ; bytes:1
17
gbl_lata                         EQU	0x00000F89 ; bytes:1
18
gbl_latb                         EQU	0x00000F8A ; bytes:1
19
gbl_latc                         EQU	0x00000F8B ; bytes:1
20
gbl_trisa                        EQU	0x00000F92 ; bytes:1
21
gbl_trisb                        EQU	0x00000F93 ; bytes:1
22
gbl_trisc                        EQU	0x00000F94 ; bytes:1
23
gbl_pie1                         EQU	0x00000F9D ; bytes:1
24
gbl_pir1                         EQU	0x00000F9E ; bytes:1
25
gbl_ipr1                         EQU	0x00000F9F ; bytes:1
26
gbl_pie2                         EQU	0x00000FA0 ; bytes:1
27
gbl_pir2                         EQU	0x00000FA1 ; bytes:1
28
gbl_ipr2                         EQU	0x00000FA2 ; bytes:1
29
gbl_eecon1                       EQU	0x00000FA6 ; bytes:1
30
gbl_eecon2                       EQU	0x00000FA7 ; bytes:1
31
gbl_eedata                       EQU	0x00000FA8 ; bytes:1
32
gbl_eeadr                        EQU	0x00000FA9 ; bytes:1
33
gbl_rcsta                        EQU	0x00000FAB ; bytes:1
34
gbl_txsta                        EQU	0x00000FAC ; bytes:1
35
gbl_txreg                        EQU	0x00000FAD ; bytes:1
36
gbl_rcreg                        EQU	0x00000FAE ; bytes:1
37
gbl_spbrg                        EQU	0x00000FAF ; bytes:1
38
gbl_t3con                        EQU	0x00000FB1 ; bytes:1
39
gbl_tmr3l                        EQU	0x00000FB2 ; bytes:1
40
gbl_tmr3h                        EQU	0x00000FB3 ; bytes:1
41
gbl_ccp2con                      EQU	0x00000FBA ; bytes:1
42
gbl_ccpr2l                       EQU	0x00000FBB ; bytes:1
43
gbl_ccpr2h                       EQU	0x00000FBC ; bytes:1
44
gbl_ccp1con                      EQU	0x00000FBD ; bytes:1
45
gbl_ccpr1l                       EQU	0x00000FBE ; bytes:1
46
gbl_ccpr1h                       EQU	0x00000FBF ; bytes:1
47
gbl_adcon1                       EQU	0x00000FC1 ; bytes:1
48
gbl_adcon0                       EQU	0x00000FC2 ; bytes:1
49
gbl_adresl                       EQU	0x00000FC3 ; bytes:1
50
gbl_adresh                       EQU	0x00000FC4 ; bytes:1
51
gbl_sspcon2                      EQU	0x00000FC5 ; bytes:1
52
gbl_sspcon1                      EQU	0x00000FC6 ; bytes:1
53
gbl_sspstat                      EQU	0x00000FC7 ; bytes:1
54
gbl_sspadd                       EQU	0x00000FC8 ; bytes:1
55
gbl_sspbuf                       EQU	0x00000FC9 ; bytes:1
56
gbl_t2con                        EQU	0x00000FCA ; bytes:1
57
gbl_pr2                          EQU	0x00000FCB ; bytes:1
58
gbl_tmr2                         EQU	0x00000FCC ; bytes:1
59
gbl_t1con                        EQU	0x00000FCD ; bytes:1
60
gbl_tmr1l                        EQU	0x00000FCE ; bytes:1
61
gbl_tmr1h                        EQU	0x00000FCF ; bytes:1
62
gbl_rcon                         EQU	0x00000FD0 ; bytes:1
63
gbl_wdtcon                       EQU	0x00000FD1 ; bytes:1
64
gbl_lvdcon                       EQU	0x00000FD2 ; bytes:1
65
gbl_osccon                       EQU	0x00000FD3 ; bytes:1
66
gbl_t0con                        EQU	0x00000FD5 ; bytes:1
67
gbl_tmr0l                        EQU	0x00000FD6 ; bytes:1
68
gbl_tmr0h                        EQU	0x00000FD7 ; bytes:1
69
gbl_fsr2l                        EQU	0x00000FD9 ; bytes:1
70
gbl_fsr2h                        EQU	0x00000FDA ; bytes:1
71
gbl_plusw2                       EQU	0x00000FDB ; bytes:1
72
gbl_preinc2                      EQU	0x00000FDC ; bytes:1
73
gbl_postdec2                     EQU	0x00000FDD ; bytes:1
74
gbl_postinc2                     EQU	0x00000FDE ; bytes:1
75
gbl_indf2                        EQU	0x00000FDF ; bytes:1
76
gbl_bsr                          EQU	0x00000FE0 ; bytes:1
77
gbl_fsr1l                        EQU	0x00000FE1 ; bytes:1
78
gbl_fsr1h                        EQU	0x00000FE2 ; bytes:1
79
gbl_plusw1                       EQU	0x00000FE3 ; bytes:1
80
gbl_preinc1                      EQU	0x00000FE4 ; bytes:1
81
gbl_postdec1                     EQU	0x00000FE5 ; bytes:1
82
gbl_postinc1                     EQU	0x00000FE6 ; bytes:1
83
gbl_indf1                        EQU	0x00000FE7 ; bytes:1
84
gbl_wreg                         EQU	0x00000FE8 ; bytes:1
85
gbl_fsr0l                        EQU	0x00000FE9 ; bytes:1
86
gbl_fsr0h                        EQU	0x00000FEA ; bytes:1
87
gbl_plusw0                       EQU	0x00000FEB ; bytes:1
88
gbl_preinc0                      EQU	0x00000FEC ; bytes:1
89
gbl_postdec0                     EQU	0x00000FED ; bytes:1
90
gbl_postinc0                     EQU	0x00000FEE ; bytes:1
91
gbl_indf0                        EQU	0x00000FEF ; bytes:1
92
gbl_intcon3                      EQU	0x00000FF0 ; bytes:1
93
gbl_intcon2                      EQU	0x00000FF1 ; bytes:1
94
gbl_intcon                       EQU	0x00000FF2 ; bytes:1
95
gbl_tablat                       EQU	0x00000FF5 ; bytes:1
96
gbl_tblptrl                      EQU	0x00000FF6 ; bytes:1
97
gbl_tblptrh                      EQU	0x00000FF7 ; bytes:1
98
gbl_tblptru                      EQU	0x00000FF8 ; bytes:1
99
gbl_pcl                          EQU	0x00000FF9 ; bytes:1
100
gbl_pclath                       EQU	0x00000FFA ; bytes:1
101
gbl_pclatu                       EQU	0x00000FFB ; bytes:1
102
gbl_stkptr                       EQU	0x00000FFC ; bytes:1
103
gbl_tosl                         EQU	0x00000FFD ; bytes:1
104
gbl_tosh                         EQU	0x00000FFE ; bytes:1
105
gbl_tosu                         EQU	0x00000FFF ; bytes:1
325 kaklik 106
CompTempVarRet489                EQU	0x0000000D ; bytes:1
107
send_00000_arg_c                 EQU	0x0000000D ; bytes:1
318 kaklik 108
main_1_motors                    EQU	0x00000001 ; bytes:1
109
main_1_sensors                   EQU	0x00000002 ; bytes:1
322 kaklik 110
main_1_leds                      EQU	0x00000003 ; bytes:1
324 kaklik 111
main_1_count                     EQU	0x00000004 ; bytes:4
325 kaklik 112
main_1_cas                       EQU	0x00000008 ; bytes:4
113
CompTempVar491                   EQU	0x0000000C ; bytes:1
114
CompTempVar492                   EQU	0x0000000D ; bytes:1
115
CompTempVar496                   EQU	0x0000000E ; bytes:1
318 kaklik 116
	ORG 0x00000200
117
	GOTO	_startup
118
	ORG 0x00000204
322 kaklik 119
send_00000
120
; { send ; function begin
121
label268438562
122
	BTFSS gbl_pir1,4
123
	BRA	label268438562
124
	MOVF send_00000_arg_c, W
125
	MOVWF gbl_txreg
126
	RETURN
127
; } send function end
128
 
129
	ORG 0x0000020E
318 kaklik 130
receive_00000
131
; { receive ; function begin
132
	BTFSS gbl_rcsta,1
322 kaklik 133
	BRA	label268438551
318 kaklik 134
	BCF gbl_rcsta,4
135
	BSF gbl_rcsta,4
322 kaklik 136
label268438551
318 kaklik 137
	BTFSS gbl_pir1,5
322 kaklik 138
	BRA	label268438551
318 kaklik 139
	MOVF gbl_rcreg, W
140
	MOVWF CompTempVarRet489
141
	RETURN
142
; } receive function end
143
 
144
	ORG 0x00000220
145
main
146
; { main ; function begin
147
	SETF gbl_lata
148
	CLRF gbl_latb
149
	SETF gbl_latc
150
	MOVLW 0xF0
151
	MOVWF gbl_trisa
152
	MOVLW 0x3F
153
	MOVWF gbl_trisb
154
	MOVLW 0x9F
155
	MOVWF gbl_trisc
156
	MOVLW 0xC6
157
	MOVWF gbl_adcon1
158
	MOVLW 0xC0
159
	MOVWF gbl_adcon0
160
	MOVLW 0x40
161
	MOVWF gbl_spbrg
162
	MOVLW 0xFB
163
	ANDWF gbl_txsta, W
164
	MOVWF gbl_txsta
165
	MOVLW 0x20
166
	IORWF gbl_txsta, W
167
	MOVWF gbl_txsta
168
	MOVLW 0x10
169
	IORWF gbl_rcsta, W
170
	MOVWF gbl_rcsta
171
	MOVLW 0x80
172
	IORWF gbl_rcsta, W
173
	MOVWF gbl_rcsta
174
	CLRF main_1_motors
325 kaklik 175
label268438599
322 kaklik 176
	BTFSC gbl_portb,0
325 kaklik 177
	BRA	label268438599
322 kaklik 178
	MOVLW 0xF0
179
	MOVWF main_1_leds
180
	MOVLW 0x80
181
	MOVWF main_1_count
324 kaklik 182
	MOVLW 0x1A
183
	MOVWF main_1_count+D'1'
184
	MOVLW 0x06
185
	MOVWF main_1_count+D'2'
186
	CLRF main_1_count+D'3'
325 kaklik 187
label268438604
324 kaklik 188
	MOVF main_1_count+D'3', W
189
	SUBLW 0x00
325 kaklik 190
	BNZ	label268438605
324 kaklik 191
	MOVF main_1_count+D'2', W
192
	SUBLW 0x00
325 kaklik 193
	BNZ	label268438605
324 kaklik 194
	MOVF main_1_count+D'1', W
195
	SUBLW 0x00
325 kaklik 196
	BNZ	label268438605
322 kaklik 197
	MOVF main_1_count, W
198
	SUBLW 0x00
325 kaklik 199
label268438605
324 kaklik 200
	BTFSC main_1_count+D'3',7
201
	BSF STATUS,C
325 kaklik 202
	BC	label268438609
324 kaklik 203
	MOVLW 0x01
204
	SUBWF main_1_count, W
205
	MOVWF CompTempVar492
206
	MOVLW 0x00
207
	MOVWF CompTempVar496
208
	BTFSS STATUS,C
209
	INCFSZ CompTempVar496, W
210
	SUBWF main_1_count+D'1', F
211
	MOVLW 0x00
212
	MOVWF CompTempVar496
213
	BTFSS STATUS,C
214
	INCFSZ CompTempVar496, W
215
	SUBWF main_1_count+D'2', F
216
	MOVLW 0x00
217
	MOVWF CompTempVar496
218
	BTFSS STATUS,C
219
	INCFSZ CompTempVar496, W
220
	SUBWF main_1_count+D'3', F
221
	MOVF CompTempVar492, W
322 kaklik 222
	MOVWF main_1_count
324 kaklik 223
	MOVLW 0x00
224
	SUBWF main_1_count+D'3', W
325 kaklik 225
	BNZ	label268438621
324 kaklik 226
	MOVLW 0x04
227
	SUBWF main_1_count+D'2', W
325 kaklik 228
	BNZ	label268438621
324 kaklik 229
	MOVLW 0x93
230
	SUBWF main_1_count+D'1', W
325 kaklik 231
	BNZ	label268438621
324 kaklik 232
	MOVLW 0xE0
233
	SUBWF main_1_count, W
325 kaklik 234
label268438621
235
	BNC	label4026532557
324 kaklik 236
	BTFSS main_1_count+D'3',7
325 kaklik 237
	BRA	label268438625
238
label4026532557
322 kaklik 239
	MOVLW 0x01
240
	IORWF main_1_leds, W
241
	MOVWF main_1_leds
325 kaklik 242
label268438625
324 kaklik 243
	MOVLW 0x00
244
	SUBWF main_1_count+D'3', W
325 kaklik 245
	BNZ	label268438627
324 kaklik 246
	MOVLW 0x03
247
	SUBWF main_1_count+D'2', W
325 kaklik 248
	BNZ	label268438627
324 kaklik 249
	MOVLW 0x0D
250
	SUBWF main_1_count+D'1', W
325 kaklik 251
	BNZ	label268438627
324 kaklik 252
	MOVLW 0x40
253
	SUBWF main_1_count, W
325 kaklik 254
label268438627
255
	BNC	label4026532558
324 kaklik 256
	BTFSS main_1_count+D'3',7
325 kaklik 257
	BRA	label268438631
258
label4026532558
322 kaklik 259
	MOVLW 0x02
260
	IORWF main_1_leds, W
261
	MOVWF main_1_leds
325 kaklik 262
label268438631
324 kaklik 263
	MOVLW 0x00
264
	SUBWF main_1_count+D'3', W
325 kaklik 265
	BNZ	label268438633
324 kaklik 266
	MOVLW 0x01
267
	SUBWF main_1_count+D'2', W
325 kaklik 268
	BNZ	label268438633
324 kaklik 269
	MOVLW 0x86
270
	SUBWF main_1_count+D'1', W
325 kaklik 271
	BNZ	label268438633
324 kaklik 272
	MOVLW 0xA0
273
	SUBWF main_1_count, W
325 kaklik 274
label268438633
275
	BNC	label4026532559
324 kaklik 276
	BTFSS main_1_count+D'3',7
325 kaklik 277
	BRA	label268438637
278
label4026532559
322 kaklik 279
	MOVLW 0x04
280
	IORWF main_1_leds, W
281
	MOVWF main_1_leds
325 kaklik 282
label268438637
322 kaklik 283
	MOVF main_1_leds, W
318 kaklik 284
	MOVWF gbl_lata
325 kaklik 285
	BRA	label268438604
286
label268438609
322 kaklik 287
	SETF gbl_lata
325 kaklik 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'
318 kaklik 293
	SETF main_1_sensors
294
	CALL receive_00000
295
	MOVF CompTempVarRet489, W
296
	MOVWF main_1_sensors
321 kaklik 297
	CLRF CompTempVar491
298
	BTFSS main_1_sensors,1
325 kaklik 299
	BRA	label268438647
321 kaklik 300
	BTFSS main_1_sensors,0
325 kaklik 301
	BRA	label268438647
321 kaklik 302
	INCF CompTempVar491, F
325 kaklik 303
label268438647
321 kaklik 304
	MOVF CompTempVar491, F
325 kaklik 305
	BNZ	label268438648
321 kaklik 306
	MOVLW 0x77
307
	MOVWF main_1_motors
325 kaklik 308
label268438648
318 kaklik 309
	BTFSC main_1_sensors,2
325 kaklik 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'
321 kaklik 339
	MOVLW 0xF7
340
	MOVWF main_1_motors
325 kaklik 341
label268438651
318 kaklik 342
	BTFSC main_1_sensors,3
325 kaklik 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'
321 kaklik 372
	MOVLW 0x7F
373
	MOVWF main_1_motors
325 kaklik 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
321 kaklik 382
	MOVF main_1_sensors, W
318 kaklik 383
	MOVWF gbl_lata
384
	MOVF main_1_motors, W
385
	MOVWF send_00000_arg_c
386
	CALL send_00000
325 kaklik 387
	BRA	label268438641
318 kaklik 388
; } main function end
389
 
325 kaklik 390
	ORG 0x000003D6
318 kaklik 391
_startup
392
	GOTO	main
393
	ORG 0x00300000
394
	DW 0xFEFF
395
	DW 0xFEF6
396
	ORG 0x00300004
397
	DW 0xFEFF
398
	DW 0xFFFB
399
	ORG 0x00300008
400
	DW 0x3FF0
401
	DW 0x9FFF
402
	DW 0xBFFF
403
	END