CSCI 360 Spring 2014

Sample Questions for Final Exam


Part I. Multiple Choice

Select the answer that is most correct

1. The maximum value for D in a D(X,B) address is _____ bytes.

   a. 1000
   b. 5000
   c. 4096
   d. 4095
   e. there is no limit

2. The instruction L  2,5 will

   a. copy the contents of register 5 into register 2
   b. copy the contents of register 2 into register 5
   c. abend the program with a specification exception
   d. put the value 00000005 into register 2
   e. load 4 bytes into register 2 from address 000005

3. Which of the following is the best instruction to insert one byte
   from storage area FLAG into the LEFTMOST byte of a register?

   a. IC   3,FLAG
   b. L    3,FLAG
   c. LH   3,FLAG
   d. ICM  3,B'0001',FLAG
   e. ICM  3,B'1000',FLAG

4. Which of the following will initialize register 5 to 0?

   a. ZAP  5,5
   b. XR   5,5
   c. XC   5,5
   d. MVC  5,=X'0'
   e. all of the above will initialize register 5 to 0

5. Which of the following system variables is used to create unique
   labels for storage areas and branches?

   a. &SYSUNIQUE
   b. &SYSCNT
   c. &SYSNDX
   d. &SYSLIST
   e. &SYSGLOBAL

6. Which of the following statements about logical operations is true?

   a. ANDing a bit with 0 sets the bit to 0
   b. ORing a bit with 1 always changes the bit to its opposite value
   c. XORing a bit with 0 sets the bit to 1
   d. ANDing a bit with 1 sets the bit to 1
   e. XORing a bit with 0 sets the bit to 0

7. The register save area for standard linkage conventions is

   a. 16 fullwords long
   b. 18 fullwords long
   c. 18 bytes long
   d. 16 bytes long
   e. none of the above

8. A typical use of the EX instruction is to

   a. Move a variable length string of characters from one area to another
   b. Establish addressibility for a DSECT
   c. Reload registers before returning to a calling routine
   d. Call an external subroutine
   e. None of the above

9. Global set symbols must be declared before local set symbols

   a. true      b. false

Part II. Short Answer

  1. Multiply the contents of register 3 by 64 without altering/referencing another register.

  2. Define a scan table that can be used to find the first occurrence of a non-digit.

  3. Write the code to compare an unknown number of bytes pointed to by register 8 with the contents of FIELD. FIELD may be smaller, bigger, or the same size as the bytes pointed to by register 8. The length of the field pointed to by register 8 is stored in register 3. Be sure to give the instruction required to actually perform the comparison.

  4. Define a scan table that can be used to change digits. 0 will become 9, 1 will become 8, 2 will become 7,...and vice versa.

  5. Using the scan table defined in the previous question, change all of the digits in the 12 byte string stored at STRING.

  6. Change bits 2, 4, and 6 of the byte at BYTE to 1.

  7. Swap the contents of registers 7 and 11 without referencing another register or using a storage area.

  8. Clearly and precisely describe the contents of the following registers BEFORE the standard linkage of an external subroutine has been executed.

  9. register 1:

    register 13:

    register 14:

    register 15:

  10. Clearly and precisely describe the contents of the following registers AFTER the standard linkage of an external subroutine has been executed.

  11. register 1:

    register 13:

    register 14:

    register 15:

  12. Clearly and precisely describe the (possible) contents of the following upon exit from an external subroutine.

  13. register 0:

    register 13:

    register 14:

    register 15: