CSc 343 Computer Organization and Programming
Fall Quarter 1997
Quiz #3 (14 November 1997, Friday) with Solutions

  1. What attribute byte specifies a character that is to be displayed in gray on green background without blinking (Give answer in hex).
        28H
    
    
    
  2. How much video memory does the video mode 12H need to store one screen?
       640x480x0.5 = 153,600 bytes
    
    
  3. When INT 21H Function 2 displays a single character on the screen, which register holds the character to be displayed?
       DL
    
    
  4. Correct any errors in the following example:
      mov  ah,9     ; string output function
      mov  dx,message
      int  21h
    
    message db  'Hello World!'
    
    
    There are two errors. The corrected code is:
      mov  ah,9    ; string output function
      lea  dx,message
      int 21h
    
    message db 'Hello World!','$'
    
    
  5. The following example uses DOS service routine for keyboard input. Which variable holds the number of keys actually typed and which label points to the first keystroke?
      mov  ah,0Ah
      lea  dx,label1
      int  21h              Variable holding number of keystrokes: label2
    
    label0 db 20
    label1 db 20            Label pointing to first keystroke:     label3
    label2 db 20
    label3 db 20 dup(' ')
    
    
  6. Suppose that the data segment contains the following (hex) bytes, starting at offset 0:
      00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
     ------------------------------------------------
    | 30|31|32|33|34|35|36|37|38|39|3A|3B|3C|3D|3E|3F|
     ------------------------------------------------
    
    Assume that the DS and ES registers both point to the beginning of the data segment. Show the (hex) contents of the CX, SI, and DI registers after all of the following instructions are executed. Also show the final contents of the data segment using the boxes provided.
      CLD                          CX: 00H
      MOV  CX,4
      MOV  SI,02H                  SI: 0AH
      MOV  DI,08H
      REP  MOVSW                   DI: 10H
    
    
      00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 
     ------------------------------------------------
    | 30|31|32|33|34|35|36|37|32|33|34|35|36|37|32|33|
     ------------------------------------------------
    
    


Raj Sunderraman
Posted: 19 November, 1997