Also:
See also:
Archive:
Comments:
Questions:
Convert the Hex digits to binary (16bits) and then convert the binary to ASCII.
Apply one of the "2 digit Hex to Binary 8 bits" routines to the first two hex digits and then again to the second, thereby producing two 8 bit values that are then passed to any one of the "16bit to ASCII Decimal 5 digits" routines. +
See:
+;some code snippets that someone might find useful... ;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/index.htm, 13KB, , updated: 2008/8/12 13:31, local time: 2008/12/1 10:28,
38.103.63.55:LOG IN
|
| ©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://www.sxlist.com/techref/microchip/math/radix/index.htm"> PIC Microcontoller Radix Math Methods</A> |
| Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
|
.