0% found this document useful (0 votes)
37 views4 pages

PIC Program For Division

This document contains PIC microcontroller programs written in assembly language that demonstrate various arithmetic and logical operations. There are programs for addition, subtraction, multiplication, division, square wave generation, logical NOT, logical OR, and logical AND operations. Each program utilizes PIC registers and instructions to perform the intended operation and store or output the result.

Uploaded by

karpaga prasanna
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views4 pages

PIC Program For Division

This document contains PIC microcontroller programs written in assembly language that demonstrate various arithmetic and logical operations. There are programs for addition, subtraction, multiplication, division, square wave generation, logical NOT, logical OR, and logical AND operations. Each program utilizes PIC registers and instructions to perform the intended operation and store or output the result.

Uploaded by

karpaga prasanna
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 4

PIC program for addition

include <p18F8720.inc> TEMP EQU 0X10 ORG 0x00 MOVLW H'10' MOVWF TEMP MOVLW H'5' ADDWF TEMP,1 goto $ END

PIC program for division


#include<p16C74A.inc> TEMP1 EQU 0x10 TEMP2 EQU 0x20 STATUS EQU H'03' ORG 0x00 CLRF TEMP2 MOVLW H'10' MOVWF TEMP1 MOVLW H'5' LOOP1:SUBWF TEMP1,1 BTFSS STATUS,0 GOTO LOOP2 INCF TEMP2 GOTO LOOP1 LOOP2: GOTO $

END

PIC program for multiplication


#include<p16C74A.inc> TEMP1 EQU 0x10 TEMP2 EQU 0X20 ORG 0x00 MOVLW H'10' MOVWF TEMP1 MOVLW H'5' MOVWF TEMP2 DECF TEMP1,1 LOOP:ADDWF TEMP2,1 DECFSZ TEMP1,1 GOTO LOOP MOVF TEMP2,1 END

PIC program for subtraction


PROCESSOR 16C74A #include<p16C74A.inc> TEMP EQU H'10' ORG 0X00 MOVLW H'10' MOVWF TEMP MOVLW H'5' SUBWF TEMP,1 GOTO $

END

PIC program for square wave


#include<p16f877A.inc> ORG 0x00 banksel TRISD clrf TRISD banksel PORTD movlw 0xff movwf PORTD loop:nop nop comf PORTD,1 goto loop END

PIC program for logical NOT operation


#include<p16f877a.inc> org 0x00 movlw 0x06 movwf 0x20 comf 0x20,1 end

PIC program for logical OR operation


#include<p16f877a.inc> org 0x00 movlw 0x02

movwf 0x20 movlw 0x04 iorwf 0x20,1 end

PIC program for logical AND operation


#include<p16f877a.inc> org 0x00 movlw 0x77 movwf 0x20 movlw 0x12 andwf 0x20,1 end

You might also like