-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIH.asm
More file actions
776 lines (686 loc) · 15.9 KB
/
Copy pathIH.asm
File metadata and controls
776 lines (686 loc) · 15.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
#make_bin#
#LOAD_SEGMENT=FFFFh#
#LOAD_OFFSET=0000h#
#CS=0000h#
#IP=0000h#
#DS=0000h#
#ES=0000h#
#SS=0000h#
#SP=FFFEh#
#AX=0000h#
#BX=0000h#
#CX=0000h#
#DX=0000h#
#SI=0000h#
#DI=0000h#
#BP=0000h#
; add your code here
jmp st1
db 1022 dup(0)
;IVT end
;Data Segment
ADCA equ 00h ;ADC address bit A = 0
ADCB equ 01h ;ADC address bit B = 0
ADCC equ 02h ;ADC address bit C = 0
Hum_set_min equ 0003h
Hum_set_max equ 0004h
Hum_pres equ 0005h
Temp equ 0006h
DegC equ 0007h
TempBCD equ 0008h
PercH equ 0009h
PerBCD equ 000Ah
HumBCD equ 000Bh
;Data Segment end
prta_55_1 equ 00h ;8255_1 - Humidity & ADCEOC PPI
prtb_55_1 equ 02h
prtc_55_1 equ 04h
creg_55_1 equ 06h
prta_55_2 equ 08h ;8255_2 - Temperature & LCD PPI
prtb_55_2 equ 0Ah
prtc_55_2 equ 0Ch
creg_55_2 equ 0Eh
cnt0_53 equ 10h ;8253
cnt1_53 equ 12h
cnt2_53 equ 14h
creg_53 equ 16h
;main program
st1: cli
; intialize ds, es,ss to start of RAM
mov ax,0200h
mov ds,ax
mov es,ax
mov ss,ax
mov sp,0FFFEH
mov si,ADCA
mov [si],00000000b
mov si,ADCB
mov [si],00000010b
mov si,ADCC
mov [si],00000100b
;Initializing 8253
mov al , 00110110b ;initialising counter 0 in mode 3 with count = 5
out creg_53 , al
mov al , 05h
out cnt0_53 , al
mov al , 00h
out cnt0_53 , al
;8255 Initialize
mov al,92h ; 8255-1 Humidity & ADCEOC port A,B input C output
out creg_55_1,al
mov al, prta_55_1
mov dl, al
mov al,82h ; 8255-2 Temperature & LCD port B input A,C output
out creg_55_2,al
mov al, dl
out prtc_55_2,al
;initializing LCD display.
;create delay of more than 100ms after power on
mov cx, 100
call DELAY_MS
mov al,10010010b
out creg_55_1,al ;initialising 8255_1
SEND 30h, 0, 0, 1
SEND 30h, 0, 0, 5
SEND 30h, 0, 0, 1
SEND 38h, 0, 0, 5
;written the display options.
SEND 8h, 0, 0, 1
SEND 1h, 0, 0, 1
;clear screen and cursor home
SEND 6, 0, 0, 2
;end of initialisation.
;to turn on display
SEND 0Fh, 0, 0, 1
call WORKING_
STI
;/////////////////////Macros
;To change Address on ADC
ADCABCTchange MACRO A
PUSH BX
PUSH DX
PUSH CX
MOV CX, A
; Change ADCA
MOV si, ADCA
mov dl, [si]
XOR DL, 1
MOV [si], dl
;Decide to change ADCB every even address
mov ax, cx
mov dl, 2
div dl
cmp ah, 0
jnz donbT
mov si, ADCB
mov dl, [si]
XOR DL, 1
MOV [si], DL
;Decide to change ADCC every at count 4
donbT: cmp cx, 4
jnz doncT
mov si, ADCC
mov dl, [si]
XOR DL, 1
MOV [si], DL
doncT:
POP CX
POP DX
POP BX
ENDM
ADCABCHchange MACRO A
PUSH BX
PUSH DX
PUSH CX
MOV CX, A
; Change ADCA
MOV si, ADCA
mov dl, [si]
XOR DL, 1
MOV [si], dl
;Decide to change ADCB every even address
mov ax, cx
mov dl, 2
div dl
cmp ah, 0
jnz donbH
mov si, ADCB
mov dl, [si]
XOR DL, 1
MOV [si], DL
;Decide to change ADCC every at count 4
donbH: cmp cx, 4
jnz doncH
mov si, ADCC
mov dl, [si]
XOR DL, 1
MOV [si], DL
doncH:
POP CX
POP DX
POP BX
ENDM
;To send command or data to LCD
SEND MACRO PA_DATA, LCD_E, LCD_RS_RW, DELAY
PUSH CX
PUSH DX
in al, prta_55_1
mov dl, al
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
MOV AL, 0
OR AL, LCD_E ;Temp PC7 - LCD Enable Bit
mov cl, 1
ror al, cl
or al, dl ;PA6 - Relay
OUT prtc_55_2, AL
MOV AL, 0
OR AL, LCD_RS_RW ;Humid PC7 - RS ____ PC6 - R/W
mov cl, 2
ror al, cl
OUT prtc_55_1, AL
MOV AL, 80H ;LCD Enable Bit - Set
or al, dl
OUT prtc_55_2, AL
MOV CX, DELAY ;Delay count
call DELAY_MS
MOV AL, PA_DATA ;PA_DATA to PORTA
OUT prta_55_2, AL
NOP
NOP ;Small Delay
MOV AL, 0 ;LCD Enable Bit - Clear
or al, dl
OUT prtc_55_2, AL
MOV CX, 1 ;Delay count
call DELAY_MS
POP DX
POP CX
ENDM
;//////////////////////End of Macros
START:
;Get Temp values from sensors
in al, prta_55_1
mov dl, al
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
mov al,82h ;Re-initialising 8255-2 Temperature & LCD port B input A,C output
out creg_55_2,al
mov ax,0
mov al, dl ;Reset Port C of Temp ADC
out prtc_55_2, al
mov bx,0
mov cx,0 ; To get values from 5 sensors
X1: ;Initialize ADCT and subsequent Address
mov si, ADCA
mov al, [si] ;BSR address A
out creg_55_2, al
mov si, ADCB ;BSR address B
mov al, [si]
out creg_55_2, al
mov si, ADCC ;BSR address C
mov al, [si]
out creg_55_2, al
inc cx
ADCABCTchange cx
;ALE - Address Latch enable
mov al, 00001011b ;PC5 - ALE = 1
out creg_55_2, al
mov al, 00001001b ;PC4 = Start = 1 pulse
out creg_55_2, al
NOP ;Delay of 3 Machine cycles = 3*200ns
mov al, 00001010b ;PC5 - ALE = 0
out creg_55_2, al
mov al, 00001000b ;PC4 = Start = 0 pulse
out creg_55_2, al
in al, prta_55_1
mov dl, al
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
mov al,82h ; Re-initialising 8255-2 Temp and LCD port B input A, C output
out creg_55_2,al
mov al, 0
or al, dl ;Reset Port C of Temp ADC
out prtc_55_2, al
Y2: ;Wait for EOC
in al, prta_55_1 ;PA0 of 8255 1 is ADCTEOC
and al, 1 ;Mask all but PA0
cmp al, 1 ;if EOC
jnz Y2
;Read Value from ADCT
in al, prta_55_1
mov dl, al
mov al, 8 ;PC3 = ADC Output Enable = 1
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
or al, dl ;Reset Port C of Temp ADC
out prtc_55_2, al
in al, prta_55_1
mov dl, al
mov al, 0 ;PC3 = ADC Output Enable = 0
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
or al, dl ;Reset Port C of Temp ADC
out prtc_55_2, al
in al, prta_55_1
mov dl, al
mov al, 8 ;PC3 = ADC Output Enable = 1
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
or al, dl ;Reset Port C of Temp ADC
out prtc_55_2, al
in al,prtb_55_2 ;Value from ADCT stored in PORTB 8255_Temp
mov ah, 0
add bx,ax ;Sensor values aggregated
;Output Disable
in al, prta_55_1
mov dl, al
mov al, 0 ;PC3 = ADC Output Disable = 0
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
or al, dl ;Reset Port C of Temp ADC
out prtc_55_2, al
cmp cx, 5 ;Check whether 5 sensors read
jnz X1
;//////dividing by 5///////
mov ax,bx
mov bl,5
div bl
mov si, Temp
mov [si], al ; register al has final value - Stored in Temp
;Resetting ADC addresses
MOV DL, 00000000b
mov si, ADCA
MOV [si], DL
MOV DL, 00000010b
mov si, ADCB
MOV [si], DL
MOV DL, 00000100b
mov si, ADCC
MOV [si], DL
;Set Hum_set_min and Hum_set_max according to Temp
;LMT85 Vout is inversely proportional to Temp
;Greater Temp ==> Lower Voltage ==> Lower 8-bit value
;Humidity 30.68mv/%RH and 0% = 0.958V
mov si, Temp ;Check value of Temp stored
mov al, [si]
mov ah, 0
cmp ax, 004Eh ;Temp = 5 degC = 1.527V
jl t1
mov si, Hum_set_min
mov [si], 5Ch ;RH 27.5% = 1.8023V
mov si, Hum_set_max
mov [si], 60h ;RH 30% = 1.879V
jmp rangeset
t1: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 004Ch ;Temp = 10 degC = 1.486V
jl t2
mov si, Hum_set_min
mov [si], 60h ;RH 30% = 1.879V
mov si, Hum_set_max
mov [si], 64h ;RH 32.5% = 1.9557V
jmp rangeset
t2: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 004Ah ;Temp = 15 degC = 1.446V
jl t3
mov si, Hum_set_min
mov [si], 64h ;RH 32.5% = 1.9557V
mov si, Hum_set_max
mov [si], 68h ;RH 35% = 2.0325V
jmp rangeset
t3: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 0048h ;Temp = 20 degC = 1.405V
jl t4
mov si, Hum_set_min
mov [si], 68h ;RH 35% = 2.0325V
mov si, Hum_set_max
mov [si], 6Ch ;RH 38% = 2.1246V
jmp rangeset
t4: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 0046h ;Temp = 25 degC = 1.365V
jl t5
mov si, Hum_set_min
mov [si], 6Ch ;RH 38% = 2.1246V
mov si, Hum_set_max
mov [si], 70h ;RH 40% = 2.186V
jmp rangeset
t5: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 0043h ;Temp = 30 degC = 1.324V
jl t6
mov si, Hum_set_min
mov [si], 70h ;RH 40% = 2.186V
mov si, Hum_set_max
mov [si], 74h ;RH 43% = 2.2781V
jmp rangeset
t6: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 0041h ;Temp = 35 degC = 1.283V
jl t7
mov si, Hum_set_min
mov [si], 74h ;RH 43% = 2.2781V
mov si, Hum_set_max
mov [si], 78h ;RH 45% = 2.3386V
jmp rangeset
t7: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 003Dh ;Temp = 45 degC = 1.201V
jl t8
mov si, Hum_set_min
mov [si], 78h ;RH 45% = 2.3386V
mov si, Hum_set_max
mov [si], 7Ch ;RH 48% = 2.4316V
jmp rangeset
t8: mov si, Temp
mov al, [si]
mov ah, 0
cmp ax, 0039h ;Temp = 55 degC = 1.118V
jl t9
mov si, Hum_set_min
mov [si], 7Ch ;RH 48% = 2.4316V
mov si, Hum_set_max
mov [si], 80h ;RH 50% = 2.493V
jmp rangeset
t9: ;Temp greater than 55degC
mov si, Hum_set_min
mov [si], 80h ;RH 50% = 2.493V
mov si, Hum_set_max
mov [si], 84h ;RH 53% = 2.5851V
rangeset:
;////////////////Humidity!!!!
;Get Humidity values from sensors
mov bx,0
mov cx,0 ; To get values from 7 sensors
mov al,92h ; Re-initialising 8255-1 Humidity & ADCEOC port A,B input C output
out creg_55_1,al
X2: ;Initialize ADCH and subsequent Address
mov si, ADCA
mov al, [si] ;BSR address A
out creg_55_1, al
mov si, ADCB ;BSR address B
mov al, [si]
out creg_55_1, al
mov si, ADCC ;BSR address C
mov al, [si]
out creg_55_1, al
inc cx
ADCABCHchange cx
;ALE - Address Latch enable
mov al, 00001011b ;PC5 - ALE = 1
out creg_55_1, al
mov al, 00001001b ;PC4 = Start = 1 pulse
out creg_55_1, al
NOP ;Delay of 3 Machine cycles = 3*200ns
mov al, 00001010b ;PC5 - ALE = 0
out creg_55_1, al
mov al, 00001000b ;PC4 = Start = 0 pulse
out creg_55_1, al
mov al,92h ; Re-initialising 8255-1 Humidity & ADCEOC port A,B input C output
out creg_55_1,al
mov al, 0
out prtc_55_1, al
Y4: ;Wait for EOC
in al, prta_55_1 ;PA1 of 8255 1 is ADCHEOC
and al, 2 ;Mask all but PA1
cmp al, 2 ;if EOC
jnz Y4
;Read Value from ADCT
mov al, 8h ;PC3 = ADC Output Enable = 1
out prtc_55_1, al
mov al, 0h ;PC3 = ADC Output Enable = 0
out prtc_55_1, al
NOP
mov al, 8h ;PC3 = ADC Output Enable = 1
out prtc_55_1, al
in al,prtb_55_1 ;Value from ADCH stored in PORTB 8255_Hum
mov ah, 0
add bx,ax ;Sensor values aggregated
;Output Disable
mov al, 0h ; PC3 = ADC Output Disable = 0
out prtc_55_1, al
cmp cx, 7 ;Check whether 7 sensors read
jnz X2
;//////dividing by 7///////
mov ax,bx
mov bl,7
div bl
mov si, Hum_pres
mov [si], al ; register al has final value - Stored in Hum_pres
;Resetting ADC addresses
MOV DL, 00000000b
mov si, ADCA
MOV [si], DL
MOV DL, 00000010b
mov si, ADCB
MOV [si], DL
MOV DL, 00000100b
mov si, ADCC
MOV [si], DL
;Glow LED if Hum_pres < Hum_set_min
mov ax, 0
mov bx, 0
mov si, Hum_pres ;Check value of Hum_pres stored
mov al, [si]
mov si, Hum_set_min
mov bl, [si]
cmp ax, bx
jg z2
mov al,82h ;Re-initialising 8255-2 Temperature & LCD port B input A,C output
out creg_55_2,al
mov al, 0 ;PC6 = 0 = Humid ON
out prtc_55_2, al
jmp displaying
z2:;Stop LED if Hum_pres > Hum_set_max
mov ax, 0
mov bx, 0
mov si, Hum_pres ;Check value of Hum_pres stored
mov al, [si]
mov si, Hum_set_max
mov bl, [si]
cmp ax, bx
jl displaying
mov al,82h ;Re-initialising 8255-2 Temperature & LCD port B input A,C output
out creg_55_2,al
mov al, 40h ;PC6 = 1 = Humid OFF
out prtc_55_2, al
displaying:
CALL DISPLAYING_
mov cx, 10
CALL DELAY_MS
jmp START
;/////////////////////////PROCS
DELAY_1_MS PROC NEAR
PUSH CX
MOV CX, 273
delay1: LOOP delay1
POP CX
RET
DELAY_1_MS ENDP
DELAY_MS PROC NEAR
;CX has MS Delay
delay: CALL DELAY_1_MS
LOOP delay
RET
DELAY_MS ENDP
WRITE PROC NEAR
;WRITE ASCII
push cx
push dx
mov cx,1
call DELAY_MS
in al, prta_55_1
mov dl, al
and dl, 40h ;RelayH -> PA6 - 8255H _ 1
mov al, 0H
or al, dl
out prtc_55_2, al ;Disable LCD
mov cx, 1
call DELAY_MS
MOV AL, 80H
out prtc_55_1,al ;writing Rs and Rw
NOP
mov al, 80H
or al, dl
out prtc_55_2, al ;Enable LCD
mov cx, 1
call DELAY_MS
mov al,bl ;ASCII value in BL
out prta_55_2,al
NOP
NOP
mov al, 0H
or al, dl
out prtc_55_2, al ;Disable LCD
mov cx, 1
call DELAY_MS
pop dx
pop cx
RET
WRITE ENDP
CLS PROC NEAR
SEND 1, 0, 0, 2 ;Send 1 for 2 ms
RET
CLS ENDP
WORKING_ PROC NEAR
call CLS
MOV BL, 'S'
CALL WRITE
MOV BL, 'e'
CALL WRITE
MOV BL, 'n'
CALL WRITE
MOV BL, 's'
CALL WRITE
MOV BL, 'i'
CALL WRITE
MOV BL, 'n'
CALL WRITE
MOV BL, 'g'
CALL WRITE
MOV BL, '.'
CALL WRITE
MOV BL, '.'
CALL WRITE
MOV BL, '.'
CALL WRITE
RET
WORKING_ ENDP
DISPLAYING_ PROC NEAR
;Finding Value of Temp in degC
;T = 162*(80-Temp)/(68)
mov si, Temp
mov al, [si] ; register al has final value - Stored in Temp
mov bl, 80
sub bl, al ;bl = 80 - Temp
mov al, bl ;al = 80 - Temp
mov bl, 162
mul bl ;ax = 162*(80-Temp)
mov bl, 68
div bl ;al = 162*(80-Temp)/68
mov bl, 0
add bl, al ;bl = 162*(80-Temp)/68
mov si, DegC ;Temp in degC stored in DegC
mov [si], bl
;ASCII written to LCD
;1 - Converting Decimal to BCD
;BCD = Dec + 6*Dec/10
mov al, bl
mov ah, 0
mov bl, 10
div bl
mov bl, al
mov al, 6
mov ah, 0
mul bl
mov si, DegC
mov bl, [si]
add bl, al
mov si, TempBCD
mov [si], bl
;Storing BCD value
;Writing to LCD
CALL CLS
MOV BL, 'T'
CALL WRITE
MOV BL, ':'
CALL WRITE
mov si, TempBCD
mov bl, [si]
and bl, 0F0h ;Ten's Character
mov cl, 4
ror bl, cl
add bl, 48 ;ASCII value of Ten's character
CALL WRITE
mov si, TempBCD
mov bl, [si]
and bl, 0Fh ;Unit's Character
add bl, 48 ;ASCII value of Unit's character
CALL WRITE
mov bl, 0DFh ;ASCII of Deg symbol
CALL WRITE
mov bl, 'C' ;ASCII of 'C'
CALL WRITE
mov cx, 4
space: mov bl, 20h ;ASCII of Space
CALL WRITE
dec cx
jnz space
;Temp written to LCD
;Finding Value of Humidity in %
;Rh = (Hum_pres-49)*75/118
mov si, Hum_pres
mov al, [si] ; register al has final value - Stored in Hum_pres
mov bl, 49
sub al, bl ;al = Hum_pres - 49
mov bl, 75
mul bl ;ax = 75*(Hum_pres - 49)
mov bl, 118
div bl ;al = 75*(Hum_pres - 49)/118
mov si, PercH ;Humidity in % stored in PercH
mov [si], al
;ASCII written to LCD
;1 - Converting Decimal to BCD
;BCD = Dec + 6*Dec/10
mov ah, 0
mov bl, 10
div bl
mov bl, al
mov al, 6
mov ah, 0
mul bl
mov si, PercH
mov bl, [si]
add bl, al
mov si, HumBCD
mov [si], bl
;Storing BCD value
;Writing to LCD
mov bl, 'R'
CALL WRITE
mov bl, 'H'
CALL WRITE
mov bl, ':'
CALL WRITE
mov si, HumBCD
mov bl, [si]
and bl, 0F0h ;Ten's Character
mov cl, 4
ror bl, cl
add bl, 48 ;ASCII value of Ten's number
CALL WRITE
mov si, HumBCD
mov bl, [si]
and bl, 0Fh ;Unit's Character
add bl, 48 ;ASCII value of Unit's number
CALL WRITE
mov bl, 25h ;ASCII of % symbol
CALL WRITE
mov cx, 500
call DELAY_MS
RET
;Humidity written to LCD
DISPLAYING_ ENDP
;////////////////////END OF PROCS