Page 392 - FUNDAMENTALS OF COMPUTER
P. 392

NPP













                   392                          Fundamentals of Computers                          NPP


                                                   (r )                      (r )
                                                     1
                                                                     2
                     r  and r  can be any 8-bit registers.   ·   r VWm r H$moB© ^r 8-{~Q> a{OñQ>a hmo gH$Vo h¢&
                       1     2                                     1    2
                                              e.g.    XCHG      AL, CH
                      Contents of AL and CH are exchanged.        AL VWm CH Ho$ H§$Q>|Q²>g EŠgM|O hmo JE h¢&
                     r  and r  both can be 16-bit General register;  ·  r VWm r XmoZm| 16-{~Q> OZac a{OñQ>a hmo gH$Vo
                       1    2                                      1    2
                                                                  h¢,
                                              e.g.    XCHG   AX, SI.
                     Neither r  nor r  can be segment register.  · Z Vmo r Am¡a Zm hr r goJ_|Q> a{OñQ>a hmo gH$Vo h¢&
                              1
                                    2
                                                                       1
                                                                                 2
                      XCHG m,r: Exchange contents of memory       XCHG m,r:  _o_moar cmoHo$eZ m VWm a{OñQ>a r Ho$
                  location m and contents of register r.      H§$Q>|Q²>g EŠgM|O H$a|& AWm©V² XCHG [BX],  AL
                                              e.g.    XCHG  [BX], AL

                     Register r cannot be segment register.  · a{OñQ>a r goJ_|Q> a{OñQ>a Zht hmo gH$Vm&
                     The segment register for physical address  ·  DS _| {\${OH$c ES´>og H¡$ëŠ`ycoeZ hoVw goJ_|Q> a{OñQ>a
                      calculation is DS.                          h¡&

                     No  flags are affected with XCHG  instr-  ·  XCHG B§ñQ´>ŠeZ Ho$ gmW H$moB© ^r âc¡J A\o$ŠQ> Zht
                      uction.                                     hmoJm&
                     XCHG  r, m  can also be executed in the  ·  XCHG r, m Bgr àH$ma EŠOrŠ`yQ> {H$E Om gH|$Jo&
                      same way.
                   5.4.2 Data Manipulation  Instructions 5.4.2 S>mQ>m ‘o{ZnwboeZ BÝñQ´>³eÝg
                      ADD r , r : Add the contents of register r 1  ADD r , r : a{OñQ>a r VWm r Ho$ H$ÝQ>oÝQ²>g H$mo
                               2
                            1
                                                                                    1
                                                                                          2
                                                                           2
                                                                        1
                  and r  and put the result in register r .   Omo‹S>| VWm n[aUm_ H$mo a{OñQ>a r _| aI|&
                                                    1
                       2
                                                                                      1
                                                  (r )           (r ) + (r )
                                                                 1
                                                                      2
                                                   1
                     r  and  r   can  be  any 8-bit registers or  ·  r VWm r H$moB© ^r 8-{~Q> `m 16-{~Q> a{OñQ>a hmo
                                                                   1
                                                                        2
                       1
                              2
                      16-bit register.                            gH$Vo h¢&
                     Neither r  nor r  can be segment registers.  · Z Vmo r Am¡a Z hr r goJ_oÝQ> a{OñQ>a hmo gH$Vo h¢&
                              1     2                                  1         2
                                         e.g.         ADD  AL, BL
                                                      ADD  AX, BX
                                                      ADD  AX, SI
                     Contents of r  remain unchanged.        ·   r Ho$ H$ÝQ>oÝQ> An[ad{V©V ahVo h¢&
                                                                   2
                                  2
                      ADD m, r: Contents of register r and the    ADD m, r: a{OñQ>a r Ho$ H$ÝQ>oÝQ> VWm S>mQ>m goJ_oÝQ>
                  memory  m in Data  segment  are added and   _| _o_moar m Omo‹S>o OmVo h¢ VWm n[aUm_ H$mo _o_moar _| aIm
                  result is placed in the memory. Only Effective
                  address is specified in the instruction. The de-  OmVm h¡& Ho$dc à^mdr ES´>og H$mo hr BÝñQ´>ŠeZ _| {ZYm©[aV
   387   388   389   390   391   392   393   394   395   396   397