Page 396 - FUNDAMENTALS OF COMPUTER
P. 396
NPP
396 Fundamentals of Computers NPP
SUB m, data: Specified data is subtracted SUB m, data: {ZYm©[aV S>mQ>m H$mo S>mQ>m goJ_oÝQ> _|
from contents of memory location m in data _o_moar cmoHo$eZ m Ho$ H$ÝQ>oÝQ²>g go KQ>m`m OmVm h¡& SUB
segment. exeated similar to SUB r , r 2 r , r Ho$ g_mZ hr EŠOrŠ`yQ> {H$`m OmVm h¡&
1
2
1
e.g. SUB [BX], 6FH
SUB [BX], 4A29H
If an 8-bit data is specified memory is a `{X EH$ 8 {~Q> S>mQ>m {ZYm©[aV {H$`m J`m h¡ Vmo _o_moar
byte pointer. And if a 16-bit data is specified EH$ ~mBQ> nm°BÝQ>a h¡ Am¡a `{X EH$ 16 {~Q> S>mQ>m {ZYm©[aV
memory is a word point.
{H$`m J`m h¡ Vmo _o_moar EH$ dS>© nm°BÝQ h¡&
SBB r , r 2
1
SBB r, m
SBB m, r
SBB r, data
SBB m, data
"Subtract with Borrow" Executed exactly ''gãQ´>oŠQ> {dX ~m°amo'' SUB BÝñQ´>ŠeZ Ho$ g_mZ hr
similar to SUB instruction, but borrow flag EŠOrŠ`yQ> {H$`m OmVm h¡ {H$ÝVw ~m°amo âcoJ (CF) ^r KQ>m`m
(CF) is also subtracted. i.e.
OmVm h¡& AWm©V²
(r ) (r ) – (r ) – CF
1
1
2
MUL r: This is a single operand instruc- MUL r: `h EH$ qgJc Am°naoÝS> BÝñQ´>ŠeZ h¡&
tion. Other operand is implied. It supports 8 × AÝ` Am°naoÝS> à`wŠV {H$`o OmVo h¢& `h 8 × 8 VWm 16×16
8 and 16 × 16 unsigned multiplication.
AZgmBÝS> _ëQ>rpßcHo$eZ H$m g_W©Z H$aVm h¡&
* If register r is an 8-bit register, It's con- * `{X a{OñQ>a r EH$ 8-{~Q> a{OñQ>a h¡ Vmo BgHo$
tents are multiplied with the contents of AL H$ÝQ>oÝQ²>g H$mo AL Ho$ H$ÝQ>oÝQ²>g go JwUm {H$`m OmVm h¡ VWm
and the result is placed in AX. i.e. (r) × (AL)
8
= (AX) consider following: n[aUm_ H$mo AX _| aIm OmVm h¡, AWm©V² (r) × (AL) =
8
(AX) {ZåZ{c{IV na {dMma H$a|:
MUL DH
Contents of 8-bit register DH are multi- 8-{~Q> a{OñQ>a DH Ho$ H$ÝQ>oÝQ²>g AL Ho$ H$ÝQ>oÝQ²>g
plied by contents of AL and the result is placed go JwUm {H$`o OmVo h¢ VWm n[aUm_ H$mo AX _| aIm OmVm h¡&
in AX. This is an unsigned multiplication.
`h EH$ AZgmBÝS> JwUZ h¡&
(AX) (DH) × (AL)
*If a 16-bit register is specified its contents * `{X EH$ -16 {~Q> a{OñQ>a {ZYm©[aV {H$`m OmVm h¡
are multiplied by 16-bit register AX and the Vmo BgHo$ H$ÝQ>oÝQ²>g H$mo 16-{~Q> a{OñQ>a AX go JwUm {H$`m
result is placed in (DX) (AX).
OmVm h¡ VWm n[aUm_ H$mo (DX) (AX) _| aIm OmVm h¡&
e.g. MUL CX