Div assembler language of command

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_29983883/article/details/102636232

div is a division instruction, should be used with caution div dividing,
1) the divisor: 8-bit and 16-bit, or in memory reg
2) the dividend: Default in dividend: AX or AX on default and DX, if the divisor is 8, a 16-bit dividend, the default on the AX, if the divisor is a 16-bit, 32-bit dividend is then placed in the DX and AX, AX lower 16-bit, 16-bit high discharge DX
3) results: If the divisor 8-bit, the result put the AL business, AH put the remainder, if the divisor is 16, AX put business, DX put the remainder

div byte ptr [bx + si + 8]
Meaning: (al) = (ax) / ((ds) * 16 + (bx) + (si) +8) quotient
(al) = (ax) / ((ds ) * 16 + (bx) + (si) +8) remainder

div word ptr [bx + si + 8]
Meaning: (ax) = (ax) / ((ds) * 16 + (bx) + (si) +8) quotient
(dx) = (ax) / ((ds ) * 16 + (bx) + (si) +8) remainder

Guess you like

Origin blog.csdn.net/qq_29983883/article/details/102636232