CSCI 360 Sample Exam 1

PART I: MULTIPLE CHOICE

Write the letter of the correct answer. (2 points each)

_____ 1. A field defined as DC CL3'32' will contain __________ in machine code.

  1. 000020
  2. F3F240
  3. F3F2FO
  4. 200000

_____ 2. The absolute address 23D507 would be aligned on a fullword boundary.

  1. true
  2. false
  3. sometimes
  4. cannot be determined

_____ 3. What is the smallest unit of memory that has its own address?

  1. a fullword
  2. a bit
  3. a byte
  4. a doubleword

_____ 4. How many bits in a fullword?

  1. 16
  2. 32
  3. 8
  4. 64

_____ 5. Under the EBCDIC coding system, each character requires ________ to represent it in the computer.

  1. 4 bits
  2. 1 fullword
  3. 8 bytes
  4. 1 byte

_____ 6. If your program abends with an interrupt code of 0004, this means what?

  1. boundary alignment error
  2. you tried to access an address outside of your program area
  3. you tried to access an address outside of any actual memory location
  4. you have tried to execute an invalid op code

_____ 7. Register 5 = 00000022 and register 7 = 00000014. What absolute address will the D(X,B) address 19(7,5) resolve to?

  1. 000055
  2. 000031
  3. 000049
  4. 000073

_____ 8. If your program abends with an interrupt code of 0009, this means what?

  1. boundary alignment error
  2. you tried to access an address outside of your program area
  3. you tried to access an address outside of any actual memory location
  4. you have tried to divide by zero

_____ 9. The instruction LR 5,4 will

  1. copy the contents of register 5 into register 4
  2. abend the program with a specification error
  3. put 4 into register 5
  4. copy the contents of register 4 into register 5

_____ 10. A field defined as DC F'29' will contain __________ in machine code.

  1. 0000001D
  2. 00000029
  3. 29
  4. 1D

PART II: ENCODING/DECODING

Fill in the blanks on the assembly listing below (27 points total):

(1 point each)        (2 points each)        (2 points each)
LOCATION COUNTER      MACHINE                SOURCE
    VALUE             LANGUAGE               LANGUAGE

000000                                       EXAM      CSECT
000000                                                 USING EXAM,15

_______________       5850 F018                        _____________________

_______________       ___________________              L     7,NUM2

_______________       1A75                             _____________________

_______________       ___________________              LR    2,7

_______________       ___________________              S     2,NUM4

_______________       ___________________              ST    2,RESULT

_______________       07FE                             _____________________

000018                ___________________              NUM1      DC    F'38'

_______________       0000001B                         NUM2      DC    F'27'

_______________       ___________________              TEXT      DC    C'ABCD'

000024                0000001C                         NUM4      DC    F'28'
000028                                                 RESULT    DS    F
                                                                 END   EXAM

PART III: DEBUGGING

Answer the following questions using the ASSIST COMPLETION DUMP given below. All ‘address’ should be given in hexadecimal. (12 points, 2 for each answer)

ASSIST COMPLETION DUMP

PSW AT ABEND  FFC50009  4000000C

REGS 0-3         F4F4F4F4    F4F4F4F4    00000000    F4F4F4F4
REGS 4-7         00000000    00000017    F4F4F4F4    F4F4F4F4
REGS 8-11        F4F4F4F4    F4F4F4F4    F4F4F4F4    F4F4F4F4
REGS 12-15       F4F4F4F4    00000028    FFFE7960    00000000

USER STORAGE

000000        1B225850    F0185C40    F01C1D42    5040F024
000010        5050F020    07FEF5F5    00000017    00000001
000020        F5F5F5F5    F5F5F5F5    F5F5F5F5    00000000
000030        F5F5F5F5    F5F5F5F5    F5F5F5F5    F5F5F5F5
000040        F5F5F5F5    F5F5F5F5    F5F5F5F5    F5F5F5F5
000050        F5F5F5F5    F5F5F5F5    F5F5F5F5    F5F5F5F5
  1. What is the address of the instruction that WOULD HAVE BEEN EXECUTED NEXT had the program not ABENDed?

  2. What is the length (in bytes) of the instruction that caused the ABEND?

  3. What was the condition code at ABEND (give a decimal number)?

  4. What is the address of the instruction that caused the ABEND?

  5. What type of program interrupt occurred (give the name)?

  6. Why did the program ABEND? Be as specific as possible.

PART IV. SHORT CODING (3 points each)

Write assembly language instructions to perform the following tasks. Define ANY extra storage you use. You may use register equates if you wish. Inefficient code will not receive full credit.

  1. Add five to register 3.

  2. Save the contents of register 6 in a storage area labeled RESULT, also define the storage area RESULT.

  3. Test the contents of registers 4 and 5. Branch to the label ENDIF1 if the contents of register 4 are greater than or equal to the contents of register 5.

  4. Multiply the contents of register 5 by –1.

  5. Set register 4 equal to zero.

PART V. LONG CODING (23 points)

Write a COMPLETE assembler program (including all storage areas) to read in an unknown number of 80 byte records. Each record contains a single integer number in EBCDIC character format. You may assume that the number is always present and is a valid integer.

Your program should calculate the average of all of the numbers read in. Print the average (with an appropriate label) starting at the top of a new page. Inefficient code will not receive full credit.