Page 394 - FUNDAMENTALS OF COMPUTER
P. 394

NPP













                   394                          Fundamentals of Computers                          NPP


                                                  r   → (r ) + (r ) + CF
                                                   1
                                                         1
                                                                2
                                        ADC r , data  (r )        (r )   +  data + CF
                                              1
                                                                   1
                                                       1
                                       ADC m  data (m)           [m] +  data + CF
                                               1
                      INC r: Increment contents of register r by  INC r: a{OñQ>a r Ho$ H$ÝQ>oÝQ²>g H$mo 1 ~‹T>mVm h¡ VWm
                  one and place the result in the same register.  n[aUm_ H$mo Cgr a{OñQ>a _| aIVm h¡&
                                                  (r)           (r)  + 1
                     Register r can be any 8-bit or 16-bit general  · a{OñQ>a r H$moB© ^r 8 {~Q> `m 16 {~Q> a{OñQ>a hmo
                      Register.                                   gH$Vm h¡&
                     Register r can not be a segment register.  · a{OñQ>a r EH$ goJ_oÝQ> a{OñQ>a Zht hmo gH$Vm h¡&
                     CF (carry flag) is not affected.        ·   CF (Ho$ar âcoJ) à^m{dV Zht hmoVm h¡&
                      INC m: Increment contents of memory m       INC m: S>mQ>m goJ_oÝQ> _| _o_moar m Ho$ H$ÝQ>oÝQ²>g _|
                  in  data segment  and place  the  result in  the  d¥{Õ H$aVm h¡ VWm n[aUm_ H$mo Cgr ñWmZ _| aIVm h¡&
                  same location.
                      Assembler Directives can be used to indi-   Agoå~ca S>mBaopŠQ>ìg `h g§Ho$V H$aZo Ho$ {cE Cn`moJ
                  cate whether memory points to a byte (single  {H$`o Om gH$Vo h¢ {H$ Š`m _o_moar EH$ ~mBQ> (qgJc cmoHo$eZ)
                  location) or a word (two locations).
                                                              `m EH$ dS>© (Qy> cmoHo$eÝg) H$m g§Ho$V H$aVr h¡&
                                              e.g.  INC     BYTE    PTR   [BX]
                      BYTE PTR     is  an assembler directive     BYTE PTR EH$ Agoå~ca S>mBaopŠQ>d h¡ Omo g§Ho$V
                  which  indicates that  the  memory location  in  H$aVm h¡ {H$ ñŠd¡`a ~«oHo$Q> _| _o_moar cmoHo$eZ EH$ ~mBQ> H$mo
                  square bracket points to a byte which is to be
                  incremented by 1 and the result must be placed  B§{JV H$aVm h¡ {Ogo 1 ~‹T>m`m OmZm h¡ VWm [aOëQ> H$mo
                  in the same location.                       Cgr ñWmZ _| aIZm hmoVm h¡&
                      Consider following instruction:             {ZåZ{c{IV BÝñQ´>ŠeZ na {dMma H$a|:
                                                  INC     WORD    PTR    [BX]
                      WORD PTR  is an Assembler Directive         WORD PTR EH$ Agoå~ca S>mBaopŠQ>d h¡ Omo g§Ho$V
                  which indicates that the memory location in  H$aVm h¡ {H$ ñŠd¡`a ~«oHo$Q> _| _o_moar cmoHo$eZ EH$ 16 {~Q>
                  square bracket  points to a 16-bit word or
                  two  bytes.  This word is  placed  at effective  dS>© `m Xmo ~mBQ> H$mo B§{JV H$aVm h¡& `h dS>© EH$ à^mdr
                  address [BX]  and  [BX + 1]. This word is to  ES´>og [BX] VWm [BX +1] na aIm OmVm h¡& `h dS>© 1
                  be incre-mented by 1 and the result must be  BÝH«$s_oÝQ> {H$`m OmZm h¡ VWm n[aUm_ H$mo Cgr ñWmZ na
                  placed in the same location. Default segment
                  register is DS.                             aIZm hmoVm h¡& {S>\$m°ëQ> goJ_oÝQ> a{OñQ>a DS h¡&
                      DEC r: Decrement contents of register r by  DEC r: a{OñQ>a r Ho$ H$ÝQ>oÝQ²>g H$mo 1 KQ>mVm h¡
                  1 and place the result in the same register. Reg-  VWm n[aUm_ H$mo Cgr a{OñQ>a _| aIVm h¡& a{OñQ>a r
                  ister r can be any 8-bit or 16-bit register except
                  segment register.                           goJ_oÝQ> a{OñQ>a H$mo N>mo‹S>H$a H$moB© ^r 8 {~Q> `m 16 {~Q>
                                                              a{OñQ>a hmo gH$Vm h¡&
                                                   (r)         (r)    1
                       CF is not affected.                        CF à^m{dV Zht hmoVm h¡&
   389   390   391   392   393   394   395   396   397   398   399