CSCI 360 More sample Exam 1 Questions

Decimal, Binary, and Hexadecimal Number Systems

Convert the following UNSIGNED numbers:

Decimal                      Binary                     Hexadecimal
1236                 ________________________    ______________________

__________________        10 0001 1010           ______________________

__________________   ________________________              3058



Do the following UNSIGNED integer arithmetic:

BINARY:        1  1  0  1  1                    1  0  0  0  0  1
            +     1  1  1  0                  -    1  1  1  0  1



HEXADECIMAL       2  A  F  9                    4  9  C  3  E
               +  4  1  8  D                 -  3  B  8  7  0



Do the following two's complement arithmetic and determine if overflow
occurred:

                  3  2  8  A  C  1  0  5          7  8  E  E  B  C  0  5
               +  7  F  8  4  6  9  5  1       -  2  0  0  9  8  7  0  1

Dump Reading

Answer the following questions using the given PSW and memory contents. Be sure to give the address answers in hexadecimal.

PSW AT ABEND     FFC50006 A0000018

REGS 0-3      F4F4F4F4    F4F4F4F4    F4F4F4F4    000009A1
REGS 4-7      F4F4F4F4    F4F4F4F4    F4F4F4F4    F4F4F4F4
REGS 8-11     F4F4F4F4    F4F4F4F4    F4F4F4F4    F4F4F4F4
REGS 12-15    F4F4F4F4    00000078    FFFE7960    00000000

USER STORAGE
000000   5830F048 5A30F04C 5A30F050 5A30F054 5B30F058 5A30F05E 5B30F074 5030F060
000020   5830F06C 5A30F070 5030F068 5830F060 5B30F068 5030F064 E1600000 0000E060
000040   F0480030 07FEF5F5 00000695 00000156 000001BD 00000069 00000070 0000012C
000060   F5F5F5F5 F5F5F5F5 F5F5F5F5 00000447 00000159 000000F7 F5F5F5F5 00000000
000080   F5F5F5F5 F5F5F5F5 F5F5F5F5 F5F5F5F5 F5F5F5F5 F5F5F5F5 F5F5F5F5 F5F5F5F5
  1. What is the address of the instruction that would have been executed next had the program not abended on the current instruction?

    ________________________________________________________________

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

    ________________________________________________________________

  3. What is the condition code (in decimal)?

    ________________________________________________________________

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

    ________________________________________________________________

  5. What type of program interrupt occurred?

    Number __________________ Name _______________________________

  6. Write the instruction that caused the abend in EXPLICIT assembler language.

    ________________________________________________________________

  7. Explain, in detail, why the program abended.

    ________________________________________________________________

Encoding / Decoding

Fill in the blanks in the assembly listing below, using IMPLICIT addressing where possible:

LOCATION
COUNTER               MACHINE                    SOURCE
VALUE (HEX)           LANGUAGE                   LANGUAGE
                                                 
000000                                           TEST     CSECT
000000                                                    USING TEST,15
000000                ______________________              L     3,NUM1
                                                 
_________________     5C20 F02C                           _______________________
                                                 
_________________     ______________________              D     2,FOURFIVE
                                                 
_________________     ______________________              LR    4,2
                                                 
_________________     1A44                                _______________________
                                                 
_________________     5940 F030                           _______________________
                                                 
_________________     ______________________              BC    B'0100',AROUND
                                                 
_________________     ______________________              LA    3,1(,3)
                                                 
_________________     5030 F038                  AROUND   _______________________
                                                 
_________________     ______________________              LNR   5,3
                                                 
_________________     ______________________              ST    5,NQ
                                                 
_________________     07FE                                _______________________
                                                 
_________________     ______________________     NUM1     DC    F'1685'
                                                 
_________________     00000001                   ONE      DC    F'1'
                                                 
_________________     ______________________     FOURFIVE DC    F'45'
                                                 
_________________     ______________________     TWOFIVE  DC    2C'5'
                                                 
000038                ______________________     Q        DS    F
                                                 
_________________     ______________________     NQ       DS    F
                                                          END TEST  ,

Execution of instruction

Using the provided register and storage contents, show the complete contents (n hexadecimal) after execution of the instruction. Results are NOT cumulative.

REGS 0-3      00000004    000000F9    00000000    000000A1
REGS 4-7      FFFFFFFF    FFFFFFED    00000010    FF00014A
REGS 8-11     07007007    00000000    FFFFFFFF    00000060
REGS 12-15    F4F4F4F4    00000078    FFFE7960    00000000

USER STORAGE
000000   5830F048 5A30F04C 5A30F050 5A30F054 5B30F058 5A30F05E 5B30F074 5030F060
000020   5830F06C 5A30F070 5030F068 5830F060 5B30F068 5030F064 E1600000 0000E060
000040   F0480030 07FEF5F5 00000695 00000156 000001BD 00000069 00000070 0000012C
000060   F5F5F5F5 F5F5F5F5 F5F5F5F5 00000447 00000159 000000F7 F5F5F5F5 00000000
000080   F1F1F1F1 F2F2F2F2 F3F3F3F3 F4F4F4F4 F5F5F5F5 F6F6F6F6 F7F7F7F7 F8F8F8F8


AR    6,1         Reg 6  = ______________________


M     2,=F'3'     Reg 2  = ______________________   Reg 3 = ____________________


LA    11,52(,11)  Reg 11 = ______________________


LPR   8,5         Reg 8  = ______________________


DR    4,0         Reg 4  = ______________________   Reg 5 = ____________________


L     1,12(6,0)   Reg 1  = ______________________

Short Answer

For questions 1 - 6, write the assembly instructions to perform the following tasks. (Be sure to define any extra storage that you may need). Use literals where possible.

  1. Show two ways to initialize register 4 to the value 9.

  2. Put the four bytes starting at address 12 (in decimal) into register 5.

  3. Put the contents of register 9 into storage starting at address 88 (in hexadecimal).

  4. Branch to the label HERE if the condition code is 1 or 3.

  5. Put the value 146 into register 6 without using a literal.

  6. Compare the contents of registers 4 and 8.

For questions 7 - 10, answer the following questions.

  1. a) Assuming signed numbers, is 5FFFFFF7 positive or negative?

  2. b) How can you tell?

  3. Calculate the following D(X,B) address.

  4. Register 0 = 00000005   Register 4 = 00000009
      
    24(4,0) = _________________________________________ (in hexadecimal)
  5. a) What registers will be multiplied using the following code?.

  6.      MR    8,5

    b) Where will the answer be stored?

  7. a) Where is the dividend located in the following divide instruction?.

  8.      DR    2,5

    b) Where will the remainder be after execution of the instruction?