Page 406 - FUNDAMENTALS OF COMPUTER
P. 406

NPP













                   406                          Fundamentals of Computers                          NPP


                                                           DEC  CX
                                                           JNZ    d 8

                     But  no  flags are affected  by LOOP    · {H$ÝVw LOOP BÝñQ´>ŠeZ go H$moB© ^r âcoJ à^m{dV
                      instruction.                                Zht hmoVm h¡&

                                               LOOPE d  8    Loop while equal
                                        or     LOOZ d 8      Loop while zero.

                     It decrements CX by  one  and  jumps to  · `h CX _| 1 KQ>mVm h¡ VWm {ZYm©[aV {S>gßcog_oÝQ>
                      specified displacement d  only when         d _| Oån H$aVm h¡ O~ (CX) ≠ 0 VWm ZF = 1.
                                               8
                      (CX) ≠  0 and ZF = 1.                        8
                     It may be used just after compare instruc-  · Bgo H$åno`a BÝñQ´>ŠeZ Ho$ R>rH$ ~mX _| Cn`moJ {H$`m
                      tion. Program control will jump to speci-   Om gH$Vm h¡& àmoJ«m_ H$ÝQ´>moc {ZYm©[aV {S>gßcog_oÝQ>
                      fied displacement only when (CX)  ≠  0 and
                      both the operands are equal.                na Oån H$aoJm O~ (CX) ≠ 0 VWm XmoZm| Am°naoÝS²>g
                                                                  ~am~a h¢&
                                                      LOOPNE d  8
                                               or     LOOPNZ d   8
                      Loop while not  equal  or  Loop while no    byn O~  g_mZ Z hmo `m byn O~  Zmo Oramo hmo& d na
                                                                                                    8
                  zero. Jump at d  only when, (CX)  ≠ 0 and ZF =  Oån H$aoJm O~ (CX) ≠ 0 VWm ZF = 0 {H$ÝVw nhco CX _|
                                8
                  0. But first decrement CX by 1.
                                                              1 KQ>mVm h¡&
                                                   JCXZ d : Jump if (CX) = 0
                                                          8
                      This instruction is used just before starting  `h BÝñQ´>ŠeZ narjU H$aZo Ho$ {cE cyn Ho$ àmaå^
                  the  Loop  to  test  whether the  count in CX is  hmoZo Ho$ R>rH$ nhco Cn`moJ {H$`m OmVm h¡ {H$ Š`m CX _|
                  zero.
                                                              g§»`m eyÝ` h¡&
                  Interrupt Instruction (Software Interrupts) BÝQ>aßQ> BÝñQ´>ŠeZ (gm°âQ>do`a BÝQ>aßQ²>g)
                      Software Interrupts  are  similar to CALL   gm°âQ>do`a BÝQ>aßQ²>g CALL BÝñQ´>ŠeZ Ho$ g_mZ
                  instructions except that the  contents of  flag  hmooVo h¢, AÝVa `h h¡ {H$ âcoJ a{OñQ>a Ho$ H$ÝQ>oÝQ²>g ^r
                  Register also pushed on to stack.
                                                              ñQ>¡H$ na ^oOo OmVo h¢&
                                                            INT n
                                                      where, n = 0 to 255
                                                      : Interrupt type n;
                      Flags, CS and IP contents are pushed on     âco½g, CS VWm IP ñQ>¡H$ na ^oOo OmVo h¢& CS VWm
                  stack. CS and  IP both are loaded  from  four  IP XmoZm| {\${OH$c ES´>og 4n na àmaå^ hmoZo dmco Mma
                  locations starting  at  physical  address 4n.
                                                              cmoHo$eÝg go cmoS> {H$`o OmVo h¢&
                      Following  sequence of operations take      Am°naoeÝg H$m {ZåZ{c{IV {gŠdoÝg hmoVm h¡:
                  place:
                  1.  Flag Register is pushed on the stack.   1. âcoJ a{OñQ>a H$mo ñQ>¡H$ na ^oOm OmVm h¡&
                  2.  IF ← 0, TF ← 0 (Both IF and TF are cleared)  2.  IF ← 0, TF ← 0 (IF VWm TF XmoZm| Šcr`a hmo OmVo h¢)
   401   402   403   404   405   406   407   408   409   410   411