#include<p16f877a.inc>
num1 equ 0x30
num2 equ 0x31
sum equ 0x32
carry equ 0x33 // Initialization
org 0x00
movlw 0xFF
movwf num1 //Two numbers to be added (FF+0F )
movlw 0x0F
movwf num2
addwf num1, 0
movwf sum // Add the two numbers and keep the result in sum
btfsc STATUS, C
incf carry, 1 //Check the ‘C’ bit in the STATUS register to find whether a carry is generated.
terminate:
goto terminate
end