please dont rip this site

SX Microcontroller Radix Math Method


4 bit (and 8 bit) to ASCII Hex

4bit-ASCIIHex:		;***** UNTESTED!!!
	mov temp, w		;save the value
	mov w, #-09
	add w, temp		;compare temp with 9
	mov w, #'A'		;assume it will be more (no change to compare flags)
	snc			;if it was less
	 mov w, #'0'		;correct the offset
	add w, temp		;add the offset to the value
	ret
See: Compareing values in the "X < Y" section "fr < n" subsection for an explination of how the comparison works. For 8 bits you have to call that twice:
8bit-ASCIIHex:		;***** UNTESTED!!!
	mov w, <>byte		;w is byte with upper and lower nibbles reversed
	and w, #15		;mask off the upper (was lower) 4 bits
	call 4bit-ASCIIHex	;convert that nibble to ASCII Hex
	call Output		;and send it off to where ever
	mov w, byte		;now get the actual value
	and w, #15		;mask off the upper (really) 4 bits
	call 4bit-ASCIIHex	;convert this nibble to ASCII Hex
	call Output		;and send it off.

See also:


file: /Techref/scenix/lib/math/radix/b2a-4b1ah-jn.htm, 1KB, , updated: 2004/6/10 13:40, local time: 2012/2/10 13:48,
TOP NEW HELP FIND: 
38.107.179.231:LOG IN

 ©2012 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! / MAKE! / 

<A HREF="http://www.piclist.com/techref/scenix/lib/math/radix/b2a-4b1ah-jn.htm"> SX Microcontroller Radix Math Method - Binary to BCD half-packed 8 bit to 3 digit</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?

  cover THE book for getting started with the PIC uC! 5 stars at Amazon.com Now available from piclist.com for $34.95 ($7.50 S&H)
 
miSim DE is an excellent, portable and powerful IDE for developing PIC applications.
The only consistant, simple to use yet powerful development environment. It simulates real-world devices via virtual component "plugins" (LED,LCD,key,motor,TV,etc) in real time, has a syntax highlighting editor, macro assembler and disassembler. Regular updates and third-party plugins keep this software ahead of any other PIC IDE.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .