CSc 343 Computer Organization and Programming
Fall Quarter 1997
Quiz #2 (17 October 1997, Friday) with Solutions

  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: _2000H___  BX: __6000H___
    
  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  110100B     _34_ ____ ____ ____
    
    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
    
    (e) SUB   AX,[VARX]   ;VARX IS DEFINED AS A WORD SIZE VARIABLE
    
                           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
    
    
    1. 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 (1020C)
      
    2. What is the ABSOLUTE ADDRESS of the variable VARX
      
        A. 01A4     B. 19A4     C. 101A4     D. 181A4     E. None of the previous
      
        ANSWER: D (181A4)
      
    3. 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 (BE01)
      
    4. 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 (101E)
      


    Raj Sunderraman
    Posted: 20 October, 1997