Page 189 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 189

Unit 13: Subroutines


            13.6 Keywords                                                                         Notes


            Exit Sub is use to exit a subroutine, particularly when handling errors.
            Opcode: It is simply a collection of bits.
            Return address: The return address is saved, usually on the process's call stack
            Subroutine_Name is the name of the subroutine and through arguments are optional arguments,
            often called parameters
            VB Script: In this arguments must be supplied in the order specified by the procedure

                            1. Give code for Subroutine call in microprocessor.

                            2. Write the opcode for Restart Sequence.


            13.7 Self-Assessment Questions


             1. A subroutine is a container that holds a series of ………. Statements.
                (a) End Sub                       (b) VBScript
                (c) MsgBox                        (d) None of these
             2. Declare subroutines using the Sub keyword and end them using the ………. Statement.

                (a) End Sub                       (b) VBScript
                (c) MsgBox                        (d) None of these
             3. Which among the following are the valid subroutine names:

                (a) WelcomeTheUser                (b) PrintInvoice
                (c) Meters2Yards                  (d) All of the above
             4. The ………. is simply a collection of bits.
                (a) INTA                          (b) opcode

                (c) EFH                           (d) None of these
             5. When a built-in function is invoked, using this technique, the name in quotes should be in
                ……….
                (a) upper case                    (b) lower case
                (c) middle case                   (d) None of these

             6. The call ………. instructions activate or deactivate the handling of condition traps by an
                associated procedure.
                (a) OFF or ON                     (b) UP and Down

                (c) ON or OFF                     (d) None of these

            13.8 Review Questions

             1.  Explain the definition of Subroutine in brief.
             2.  Describe how to create a Subroutine.





                                             LOVELY PROFESSIONAL UNIVERSITY                                   183
   184   185   186   187   188   189   190   191   192   193   194