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: 2009/11/22 02:21, owner: jsvetlin-email-,
TOP NEW HELP FIND: 
38.107.191.100:LOG IN
©2009 PLEASE DON'T RIP! DO: LINK / DIGG! / MAKE!

 ©2009 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://www.piclist.com/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 visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. 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: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 
SX MASTERS: Eric Smith and Richard Ottosen's SERVID is an intellegent RS232 video terminal (4x20 character display) in one SX chip. See the write up.
  'What can I do?' - SiCKO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .