No exact or substring matches. trying for part
'Andy's Annual Challenge #2: 10-Bit Binary-to-BCD '
|A couple of days ago, someone (I don't remember who) asked for a 10-Bit
binary-to-BCD converter. Below is the best converter I could come up
with. It'll actually do a little more than 10 bits; it works on all
binary inputs from 0 to 1285.
Since it's that time of year again, I'm offering to buy a beer for the
first person who a) can explain how the code works, and b) will be at
the Embedded Systems Conference on Tuesday, September 12th.
If you won't be attending the Conference, post an explanation anyway...
I'll drink your beer for you.
REGA EQU [any file register]
REGB EQU [any file register]
REGC EQU [any file register]
; Enter with 10-bit binary number in REGB:REGC (high 2 bits in bits
; 1 and 0 of REGB, low 8 bits in REGC). Exits with BCD equivalent
; in REGA:REGB (thousands/hundreds digits in REGA, tens/ones in
;Executes in 113 cycles.
BIN2BCD MOVLW 00000001B
B2BLOOP RLF REGC
P.S. Terry Rudersdorfer solved last year's "Square Root" challenge,
posted on the Microchip BBS. Is he on the PICLIST? Maybe he can make
Andrew Warren - ix.netcom.comfastfwd
Fast Forward Engineering, Vista, California
More... (looser matching)
- Last day of these posts
- In 1995
, 1996 only
- New search...