CSc 343
Computer Organization and Programming
Fall Quarter 1997
Quiz #3 (14 November 1997, Friday) with Solutions
28H
640x480x0.5 = 153,600 bytes
DL
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!','$'
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(' ')
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| ------------------------------------------------