Advertisement
Guest User

Untitled

a guest
Mar 5th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pic 16 0.39 KB | None | 0 0
  1. processor 16f877
  2. include<p16f877.inc>
  3.  
  4. res1 equ h'23'
  5. res2 equ h'22'
  6.  
  7. org 0h
  8. goto inicio
  9. org 04h
  10.  
  11. inicio:
  12.     clrf W; Limpia W
  13.     incf 0x21, 1
  14.     goto mult ; Ve a multiplicar
  15.  
  16. mult:
  17.     movf 0x20, w
  18.     addwf res1, f ; res += int1
  19.  
  20.     btfsc STATUS, C ; Ve si carry está en 1
  21.     incf res2, f ; Aumenta parte superior del resultado
  22.  
  23.     decfsz 0x21 ; num2--, checa si es cero
  24.     goto mult
  25.     end
  26.  
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement