please dont rip this site

PIC Microcontoller Radix Math Method


8bit to extract decimal 1's, 10's, 100's by jsvetlin

jsvetlin-email- shares this code:

;for alternative version you might also want to check http://www.piclist.com/techref/microchip/math/32bmath-ph.htm
;This routine will return the number of decimal 
;hundreds from an 8-bit binary
;Input: w
;Output: w
;RAM:2
;Cycles: 12-24

GETHNDS		movwf	t1
                clrf    w2
gethnds_loop	movlw	.100
		incf	w2,f
		subwf	t1,f
		btfsc	STATUS,C
		goto 	gethnds_loop
		decf	w2,w
		return		
;---
;This routine will return the number of decimal 
;tens from an 8-bit binary
;Loop based, so it might take some time...
;It needs getones too
GETTENS		movwf	t1
                clrf    w2
gettens_loop	movlw	.10
		incf	w2,f
		subwf	t1,f
		btfsc	STATUS,C
		goto 	gettens_loop
		decf	w2,w
		goto	getones

;---
;This routine will return the number of decimal 
;ones from an 8-bit binary	
GETONES		movwf	w2
		movlw	.10
deltens_loop	subwf	w2,f
		btfsc	STATUS,C
		goto 	deltens_loop
		addwf	w2,w	
		return
 
+
file: /techref/microchip/math/radix/b2oth-8b3d-jsv.htm, 1KB, , updated: 2005/10/26 12:30, local time: 2008/12/3 15:32, owner: jsvetlin-email-,
TOP NEW HELP FIND: 
38.103.63.57:LOG IN
©2008 PLEASE DON'T RIP! DO: LINK / DIGG! / MAKE!

 ©2008 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it!
<A HREF="http://massmind.org/techref/microchip/math/radix/b2oth-8b3d-jsv.htm"> 8bit to extract decimal 1's, 10's, 100's </A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be reviewed) Just type in the box and press the Post button. (HTML welcomed!): A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Did you find what you needed?

 

Welcome to massmind.org!

  'What can I do?' - SiCKO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .