Parsing the radix from "B" for binary, etc..
See also:
Archive:
Code:
;Ken Mathis ;Purpose: Convert an 8 bit number to BCD ;so value can be sent to a 7447 seven segment display driver ;I/O pin hungry, requires 8 bits to send data out. ;temp1 holds binary value ;BCD result in temp1 ;$32 (50 decimal) becomes or %01010000 hex_to_bcd clr temp0 ;clear register convert inc temp0 ;increment number of 10s mov w,#$0A sub temp1,w ;subtract 10 from temp1 snc ;skip next instruction if underflow occurs jmp convert ;repeat mov w,#$A add temp1,w ;restore temp1. number of 1s after restored dec temp0 ;correction to the number of 10s swap temp0 ;swap upper and lower nibble of temp0 add temp1,temp0 ;place number of 10s in upper nibble of temp1 ret ;temp1 now hold BCD value of $32+
file: /Techref/scenix/lib/math/radix/index_sx.htm, 5KB, , updated: 2008/11/23 18:34, local time: 2024/8/22 03:13,
18.227.183.149:LOG IN
|
©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? <A HREF="http://piclist.com/tecHREF/scenix/lib/math/radix/index_sx.htm"> SX Microcontroller Radix Math Methods</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.