This1 too, but is shorter...

cmp al, 0Ah ; set or clear carry flag
sbb ecx, ecx ; if carry(CY) is set(CY=1) ecx= -1 else (CY=0) ecx=0
and ecx, 7 ; if CY=1 ecx=7 else ecx=0
xor ecx, 37h ; if CY=1 ecx=30h else ecx=37h
add eax, ecx ; add 30h or 37h

cmp al,10
sbb al,69h
Posted on 2001-07-23 00:19:34 by The Svin
impressive! i just can't believe it! i thought SBB was nonesense. but unfortunately, you can get carryflag by that. here, you use it in advantage of turning it into hex.
Posted on 2001-07-23 08:37:33 by disease_2000