My CP/M machine is in storage at the moment, but I have the vague
recollection that the single DAA version doesn't work on the 8080, or
possibly the Z80. I know I first used this code on one of those two,
and I spent some time playing around with it. Does this sound familiar
to you?
--jc
Fred Cisin wrote:
> AND
AL,00fh
> ADD AL,090h
> DAA
> ADC AL,040h
> DAA
> RET
>
>
or:
AND AL, 0Fh
DAA
ADD AL, 0F0h
ADC AL, 40h
or:
AND AL, 0Fh
ADD AL, 0
ADC AL,28h
DAA
and, of course, it can be extended to 16 bits with screen display by:
MOV CX, 0404h ; CH and CL are independent
N1: ROL AX, CL
PUSH AX
AND AL, 0Fh
DAA
ADD AL, 0F0h
ADC AL, 40h
MOV AH, 0Eh ;displays char in AL at cursor position
INT 10h
POP AX
DEC CH
JNZ N1
--
Grumpy Ol' Fred cisin at
xenosoft.com