please dont rip this site

PIC Microcontoller Radix Math Method

Binary to ASCII hexadecimal

By: spampaulswork~NOSPAM~ at

here are a couple of BIN to ASCII converters I wrote, might be useful.
; Routine:BINtoASCII
; Input Registers:BUFFER
; Output Registers: ASCII_MSW, ASCII_LSW
; Internal Registers:None
; CALLS:None
; Function: Receives a binary number in the input register BUFFER. This 
; is then converted into two ASCII output bytes.
BINtoASCII	CLRF	ASCII_MSW	;Clear output registers
		SWAPF	BUFFER,W	;Get upper nibble
		ANDLW	h'0F'		;Mask off unwanted bits
		MOVLW 	10		;For BCD lower nibble only (lower 4 bits)
		MOVLW 	h'30'		;If numerical add ascii value (-10)
		BTFSC 	StatusREG,C
		MOVLW 	h'37'		;If alphabetical, then add a different ascii value (-10)
		ADDWF 	ASCII_MSW,1	;save in output reg
		MOVF	BUFFER,W	;get lower nibble of input byte
		ANDLW	h'0F'		;mask off unwanted data
		MOVLW 	10		
		MOVLW 	h'30'
		BTFSC 	StatusREG,C
		MOVLW 	h'37'
		ADDWF 	ASCII_LSW,1	;and save in output reg
		retlw   0

file: /Techref/microchip/math/radix/b2a-8b2d-pw.htm, 2KB, , updated: 2004/6/28 17:35, local time: 2024/7/13 18:07,

 ©2024 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=""> PIC Microcontoller Radix Math Method Binary to ASCII hexadecimal</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 a nice message (short messages are blocked as spam) 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?


Welcome to!


Welcome to!