CSc 343                                    Name:___________________________
Computer Organization and Programming
Spring Quarter 1998
Quiz 2 (27 April 1998, Monday)

1. Show the (hex) contents of the AX and BX registers after 
   the following instructions have executed:

  MOV  AX,2000H
  MOV  BX,AX
  ADD  BX,AX
  ADD  BX,AX

AX: __2000___  BX: __6000____

2. List the bytes that would be generated by each of the 
   following directives. Show byte values in hexadecimal, 
   one byte per line. You may not need all the lines provided. 
   Show bytes in the order they will appear in memory.

DB  'ABC'       _41_ _42_ _43_ ____

DB  111100B     _3C_ ____ ____ ____

DW  2 DUP(524)  _0C_ _02_ _0C_ _02_

3. Indicate if the following instructions are valid 
   8086 instruction.

(a) ADD   AX,100      A. Valid     B. Not Valid
    VALID

(b) MOV   AX,BL       A. Valid     B. Not Valid
    NOT VALID

(c) MOV   1,BX        A. Valid     B. Not Valid
    NOT VALID

(d) ADD   CX,DX       A. Valid     B. Not Valid
    VALID

4. Consider the following set of Intel 8086 register 
   contents. All values are given in HEX. All answers 
   are in HEX.  VARX is a variable that is offset 1A4 (hex) 
   into the data segment.

    IP =   020C

    CS =   1000      SP = 0100      AX =  1234

    DS =   1800      BP = 1ACB      BX =  1020

    SS =   2000      SI = 0040      CX =  ABCD

    ES =   2400      DI = 00E0      DX =  01FE


   (a) What is the ABSOLUTE ADDRESS of the next instruction 
       to be executed.

       A. 020C     B. 120C     C. 1020C     D. 20100     

       E. None of the previous
    ANSWER: C

   (b) What is the ABSOLUTE ADDRESS of the variable VARX

       A. 01A4     B. 19A4     C. 101A4     D. 181A4     

       E. None of the previous
    ANSWER: D

   (c) What will be in the AX register after the following 
       instruction is executed:  

        ADD   AX,CX

        A. BE01     B. ABCD     C. 1234      D. 0000      
     
        E. None of the previous
    ANSWER: A

    (d) What will be in the BX register after the following 
        instruction is executed:  

         ADD   BL,DL

         A. 111E     B. 001E     C. 110E      D. 101E      

         E. None of the previous
        ANSWER: D