Switch to full style
PIC Assembly Articles
Post a reply

Perform Division by Shifting to the Right

Wed May 15, 2013 2:06 pm

Divide the 3-byte number stored at 0x10…0x12
Code:

movlw 0x04 
; set loop count to 4
loop bcf STATUS
, C, A ; shift the number to the right 1 place
rrcf 0x12
, F, A ; “
rrcf 0x11
, F, A ; “
rrcf 0x10
, F, A ; “
decfsz WREG
,W,; have we shifted right four places yet?
goto loop ; not yet, continue
 




Post a reply
  Related Posts  to : Perform Division by Shifting to the Right
 rounding performed under integer division     -  
 Perform Multiplication by Shift Left Operations     -  
 can u check tis code to perform union & intersection of list     -