On 25 Feb 2008 at 21:29, Jim Leonard wrote:
  Although it's the other way round, this is one of
my top five favorite
 gems of all time: 
Yeah, Jim, but we were talking 8080 code here.  Heck, if we extend
the problem to the x86 family, then the original problem solves in 3
instructions as:
(al) = input character ('0'-'9', 'A'-'F')
(al) = on exit, 00h-0fh
sub al,030h
db 0d4h,010h  ; funny aam
db 0d5h,009h  ; funny aad
(not fast, but short)
But let's go back to the OP and his 8080 problem...
Cheers,
Chuck