CS401 Mid term Paper Solved 2010 - 2

 CS401 (computer architecture and assembly language)


Question No: 1 ( M a r k s: 1 ) http://vuzs.net
The physical address of the stack is obtained by
Ans:► SS:SP combination
► SS:SI combination

► SS:SP combination

► ES:BP combination

► ES:SP combination


Question No: 2 ( M a r k s: 1 ) http://vuzs.net
After the execution of instruction “RET ”
Ans: ► SP is incremented by 2
► SP is incremented by 2

► SP is decremented by 2

► SP is incremented by 1

► SP is decremented by 1


Question No: 3 ( M a r k s: 1 ) http://vuzs.net
The second byte in the word designated for one screen location holds
Ans: ► Character color on the screen

► The dimensions of the screen

► Character position on the screen

► Character color on the screen

► ASCII code of the character


Question No: 4 ( M a r k s: 1 ) http://vuzs.net
REP will always
Ans: ► Decrement CX by 1
► Increment CX by 1

► Increment CX by 2

► Decrement CX by 1

► Decrement CX by 2


Question No: 5 ( M a r k s: 1 ) http://vuzs.net
The basic function of SCAS instruction is to

Ans: ► Compare
► Compare

► Scan

► Sort

► Move data


Question No: 6 ( M a r k s: 1 ) http://vuzs.net
Index registers are used to store __________
Address ►              Ans:
Data ►
Intermediate result ►      
Address ►      
Both data and addresses ►      

Question No: 7 ( M a r k s: 1 ) http://vuzs.net
The bits of the _____________ work independently and individually
flags register Ans:►              
index register ►
base register ►      
flags register ►      
accumulator ►      

Question No: 8 ( M a r k s: 1 ) http://vuzs.net
To convert any digit to its ASCII representation
Ans: ► Add 0x30 in the digit
► Add 0x30 in the digit

► Subtract 0x30 from the digit

► Add 0x61 in the digit

► Subtract 0x61 from the digit


Question No: 9 ( M a r k s: 1 ) http://vuzs.net
When a 32 bit number is divided by a 16 bit number, the quotient is of

Ans ► 4 bits
► 32 bits
► 16 bits
► 8 bits
► 4 bits

Question No: 10 ( M a r k s: 1 ) http://vuzs.net
When a 16 bit number is divided by an 8 bit number, the quotient will be in
Ans:► AL

► AX
► AL
► AH
► DX

Question No: 11 ( M a r k s: 1 ) http://vuzs.net
Which mathematical operation is dominant during the execution of SCAS instruction
Ans: ► Division
► Division

► Multiplication

► Addition

► Subtraction


Question No: 12 ( M a r k s: 1 ) http://vuzs.net
If AX contains decimal -2 and BX contains decimal 2 then after the execution of instructions:
CMP AX, BX
JA label
Ans: ► Zero flag will set
► Jump will be taken

► Zero flag will set

► ZF will contain value -4

► Jump will not be taken


Question No: 13 ( M a r k s: 1 ) http://vuzs.net
The execution of the instruction “mov word [ES : 160], 0x1230” will print a character “0” on the screen at

Ans: ► First column of second row
► Second column of first row
► First column of second row
► Second column of second row
► First column of third row

Question No: 14 ( M a r k s: 1 ) http://vuzs.net
If the direction of the processing of a string is from higher addresses towards lower addresses then
Ans:► DF is cleared
► ZF is cleared

► DF is cleared

► ZF is set

► DF is set


Question No: 15 ( M a r k s: 1 ) http://vuzs.net
The instruction ADC has________ Operand(s)
Ans: ► 3

► 0
► 1
► 2
► 3

Question No: 16 ( M a r k s: 1 ) http://vuzs.net
Which bit of the attributes byte represents the red component of background color ?
Ans: ► 3

► 3
► 4
► 5
► 6

Question No: 17 ( M a r k s: 2 )
What is difference between SHR and SAR instructions?
SHR
The SHR inserts a zero from the left and moves every bit one position to the right and copy the rightmost bit in the carry flag.
SAR
The SAR shift every bit one place to the right with a copy of the most significant bit left at the most significant place. The bit dropped from the right is caught in the carry basket. The sign bit is retained in this operation.

Question No: 18 ( M a r k s: 2 )
For what purpose "INT 1" is reserved ?

Question No: 19 ( M a r k s: 2 )
Define implied operand?

It is always in a particular register say the accumulator. It needs to not be mentioned in the instruction.

Question No: 20 ( M a r k s: 3 )
Describe the working of the CALL instruction with the reference of Stack.

Question No: 21 ( M a r k s: 3 )
Tell the Formula to scroll up the screen


rep movsw scroll up

scrollup: push bp
mov bp,sp
push ax
push cx
push si
push di
push es
push ds
mov ax, 80 ; load chars per row in ax
mul byte [bp+4] ; calculate source position
mov si, ax ; load source position in si
push si ; save position for later use
shl si, 1 ; convert to byte offset
mov cx, 2000 ; number of screen locations
sub cx, ax ; count of words to move
mov ax, 0xb800
mov es, ax ; point es to video base
mov ds, ax ; point ds to video base
xor di, di ; point di to top left column
cld ; set auto increment mode
rep movsw ; scroll up
mov ax, 0x0720 ; space in normal attribute
pop cx ; count of positions to clear
rep stosw ; clear the scrolled space
pop ds
pop es
pop di
pop si
pop cx
pop ax
pop bp
ret 2

Question No: 22 ( M a r k s: 5 )
What is the difference between LES and LDS instructions ?

The string instructions need source and destination in the form of a segment offset pair. LES and LDS load a segment register and a general purpose register from two consecutive memory locations. LES loads ES while LDS loads DS. Both instructions has two parameters, one is the general purpose register to be loaded and the other is the memory location from which to load these registers. The major application of these instructions is when a subroutine receives a segment offset pair as an argument and the pair is to be loaded in a segment and an offset register.

Question No: 23 ( M a r k s: 5 )
Explain the process of ADC?

Normal addition has two operands and the second operand is added to the first operand. However ADC has three operands. The third implied operand is the carry flag. The ADC instruction is specifically placed for extending the capability of ADD. Further more consider an instruction “ADC AX, BX.” Normal addition would have just added BX to AX, however ADC first adds the carry flag to AX and then adds BX to AX. Therefore the last carry is also included in the result. The lower halves of the two numbers to be added are first added with a normal addition. For the upper halves a normal addition would lose track of a possible carry from the lower halves and the answer would be wrong. If a carry was generated it should go to the upper half. Therefore the upper halves are added with an addition with carry instruction.

Leave a Reply

Related Posts Plugin for WordPress, Blogger...