hello,
After reading the posting of Stefan I wrote another multiplying routine.
It is probably both longer and slower than Stefan's. Anyways here goes:
in :BC,DE
OUT :HL=BC*DE
CHANGE :AF,B
MUL16 LD A,C
INC A
PUSH AF
LD A,B
LABEL0: LD B,8
LABEL1: SLA L
RL H
RLA
JR,NC LABEL2:
ADD HL,DE
LABEL2: DJNZ LABEL1:
POP AF
CP C
RET,Z
LD A,C
PUSH AF
JR LABEL0:
*warning* I didn't test this routine, and I don't have my docs here, so it
just might me totally wrong. I replaced double instructions (SLA L & RL H,
DEC A & JP NZ) for single ones. Have a nice day, greetinx Henk