Page 402 - FUNDAMENTALS OF COMPUTER
P. 402

402                          Fundamentals of Computers                          NPP


                                                       [ S I]
                                                       [SI + 1]    IP
                                                       [SI + 2]
                                                       [SI + 3]    CS

                     But remember the sequence of PUSH. First  · {H$ÝVw PUSH H$s {gŠd|g `mX aI|& nhco CS H$mo
                      CS is pushed and loaded then IP is pushed   ^oOm OmVm h¡ VWm BgHo$ níMmV² IP H$mo ^oOm VWm
                      and loaded.                                 cmoS> {H$`m OmVm h¡&
                                                             RET
                      Return to Calling Program: This instruc-    H$m°qcJ àmoJ«m_ ‘| dmngr: `h BÝñQ´>ŠeZ EH$ g~éQ>rZ
                  tion is used  to return to the  main program  go _w»` àmoJ«m_ _| dmng AmZo Ho$ {cE Cn`moJ {H$`m OmVm h¡
                  from a subroutine which was called by CALL
                  Instruction. Therefore it is used at the end of  {Ogo CALL B§ñQ´>³eZ H$m°c {H$`m J`m Wm& Bg{cE `h
                  subroutine.                                 g~éQ>rZ Ho$ AÝV _| Cn`moJ {H$`m OmVm h¡&
                     For Intrasegment CALL following opera-  · BÝQ´>mgoJ_oÝQ>  CALL _| {ZåZ{c{IV  Am°naoeÝg
                      tions take place: NPP                       hmoVo h¢:

                      "IP is loaded from top of the stack"        IP ñQ>¡H$ Ho$ Q>m°n go cmoS> {H$`m OmVm h¡&
                      It is equivalent to POP IP.                 `h POP IP Ho$ g_H$j h¡&
                     For Intersegment CALL following opera-  · BÝQ>agoJ_oÝQ>  CALL _| {ZåZ{c{IV  Am°naoeÝg
                      tions take place:                           hmoVo h¢:
                      1. IP is loaded from top of stack.          1. IP ñQ>¡H$ Ho$ Q>m°n go cmoS> {H$`m OmVm h¡&

                         (POP  IP)                                (POP  IP)
                      2. CS is loaded from top of stack           2. CS ñQ>¡H$ Ho$ Q>m°n go cmoS> {H$`m OmVm h¡&
                         (POP  CS)                                (POP  CS)
                      JMP d  /  JMP d :  Jump; Unconditional      JMP d  / JMP d … Oån; {ZYm©[aV 8 {~Q> `m 16
                            8
                                     16
                                                                       8
                                                                               16
                  jump to specified 8-bit  or 16-bit  signed dis-  {~Q> gmBÝS> {S>gßcog_oÝQ> Ho$ {cE AZH$ÊS>reZc Oån h¡&
                  placement. The specified displacement is added  {ZYm©[aV {S>gßcog_oÝQ> IP Ho$ H$ÝQ>oÝQ²>g _| Omo‹S>m OmVm h¡&
                  to contents of IP. Thus,
                                                              Bg àH$ma:
                                                    IP ⇐ IP ± displacement
                     In both the cases CS remains unchanged  · XmoZm| pñW{V`m| _| CS An[ad{V©V ahVm h¡, Bg[cE
                      therefore it is an example of Intrasegment  `h BÝQ>agoJ_oÝQ> ~«mÝM BÝñQ´>ŠeZ H$m CXmhaU h¡&
                      branch instruction.

                     Label can be specified in place of displace-  · {S>gßcog_oÝQ> Ho$ ñWmZ na co~c {ZYm©[aV {H$`m Om
                      ment e.g.                                   gH$Vm h¡&

                                                         JMP   NEXT
                                                         JMP   START
   397   398   399   400   401   402   403   404   405   406   407