fork download
  1. #include<p16f877a.inc>
  2. num1 equ 0x30
  3. num2 equ 0x31
  4. sum equ 0x32
  5. carry equ 0x33 // Initialization
  6. org 0x00
  7. movlw 0xFF
  8. movwf num1 //Two numbers to be added (FF+0F )
  9. movlw 0x0F
  10. movwf num2
  11. addwf num1, 0
  12. movwf sum // Add the two numbers and keep the result in sum
  13. btfsc STATUS, C
  14. incf carry, 1 //Check the ā€˜C’ bit in the STATUS register to find whether a carry is generated.
  15. terminate:
  16. goto terminate
  17.  
Success #stdin #stdout 0.03s 25208KB
stdin
Standard input is empty
stdout
#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