Page 398 - FUNDAMENTALS OF COMPUTER
P. 398
NPP
398 Fundamentals of Computers NPP
IDIV r / IDIV m: Signed division of an IDIV r / IDIV m: `h {ZYm©[aV a{OñQ>a `m _o_moar
Implied operand by the contents of specified Ho$ H$ÝQ>oÝQ²>g Ûmam à`wŠV EH$ Am°naoÝS> H$m gmBÝS> {S>drOZ
register or memory, executed similar to DIV.
h¡& DIV Ho$ g_mZ hr EŠOrŠ`yQ> hmoVm h¡&
NEG r: Negate ; take two's complement of NEG r: {ZYm©[aV a{OñQ>a Ho$ H$ÝQ>oÝQ²>g H$m 2's
contents of specified register and put in the H$m°påßc_oÝQ> coVm h¡ VWm Cgr a{OñQ>a _| aIVm h¡&
same register.
Register r can be 8 -bit or 16-bit general · a{OñQ>a r 8 {~Q> `m 16 {~Q> OZac a{OñQ>a hmo gH$Vm
register. e.g. NEG AH will be executed as: h¡& CXmhaU, NEG AH {ZåZ àH$ma EŠOrŠ`yQ> hmoJm:
( )AH ← ( AH ) 1+
Similarly NEG BX will give: Bgr àH$ma NEG BX XoJm:
( )BX ← ( ) 1+
BX
NEG m: Negate the contents of memory; NEG m: _o_moar Ho$ H$ÝQ>oÝQ²>g H$mo {ZJoQ> H$aVm h¡;
Take 2's Complement of Contents of specified {ZYm©[aV _o_moar cmoHo$eZ Ho$ H$ÝQ>oÝQ²>g H$m 2's H$m°påßc_oÝQ>
memory location and put the result is some coVm h¡ VWm n[aUm_ H$mo Cgr _o_moar cmoHo$eZ _| aIVm h¡&
memory location.
m ← m + 1
e.g. NEG BYTE PTR [4002]
This instruction is for taking 2's Comple- `h BÝñQ´>ŠeZ S>mQ>m goJ_oÝQ> _| [4002] na g§J«{hV
ment of a byte stored at [4002] in data segment. EH$ ~mBQ> H$m 2's H$m°påßc_oÝQ> coZo Ho$ {cE h¡& n[aUm_ H$mo
The result is placed in the same location. Cgr _oo_moar cmoHo$eZ _| aIm OmVm h¡&
NEG WORD PTR [BX]
This instruction is used for taking 2's `h BÝñQ´>ŠeZ [BX] VWm [BX+1] na g§J«{hV EH$
Complement of a 16-bit number stored at [BX] 16 {~Q> g§»`m H$m 2's H$m°påßc_oÝQ> coZo Ho$ {cE Cn`moJ
and [BX + 1] in Data segment. The result is {H$`m OmVm h¡& n[aUm_ H$mo Cgr cmoHo$eZ _| aIm OmVm h¡&
placed in the same locations.
CMP r , r : Compare r and r . A subtrac- CMP r , r : r VWm r H$s VwcZm H$aVm h¡& EH$
2
1
2
1
1
2
1
2
tion operation is performed. gãQ´>oŠeZ Am°naoeZ gånÝZ {H$`m OmVm h¡&
(r ) – (r )
1
2
But the result is not placed anywhere {H$ÝVw n[aUm_ H$mo H$ht Zht aIm OmVm h¡&
Contents of bath r and r remain · r VWm r Ho$ H$ÝQ>oÝQ²>g An[ad{V©V ahVo h¢&
2
1
1
2
unchanged.
Flags are modified to reflect result by · gãQ´>oŠeZ Ûmam n[aUm_ àX{e©V H$aZo Ho$ {cE âco½g
subtraction: _mo{S>\$m` {H$`o OmVo h¢…