
Instruction Set
4-64
IMUL
IMUL
Operation It Performs
if (operands() == 1)
/* multiply multiplicand with accumulator */
{
if (size(
multiplicand) == 8)
/* signed byte multiplication */
{
temp =
multiplicand * AL;
if (size(temp) == size(AL))
/* byte result */
{
/* store result */
AL = temp;
if (AL < 0)
/* extend sign into AX */
AH = 0xFF;
else
AH = 0x00;
/* clear overflow and carry flags */
OF = CF = 0;
}
else
/* word result */
{
/* store result */
AX = temp;
/* set overflow and carry flags */
OF = CF = 1;
}
}
if (size(
multiplicand) == 16)
/* signed word multiplication */
{
temp =
multiplicand * AX;
if (size(temp) == size(AX))
/* word result */
{
/* store result */
AX = temp;
if (AX < 0)
/* extend sign into DX */
DX = 0xFF;
else
DX = 0x00;
/* clear overflow and carry flags */
OF = CF = 0;
}
else
/* doubleword result */
{
/* store result */
DX::AX = temp;
/* set overflow and carry flags */
OF = CF = 1;
}
}
}
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...