12-02-2010, 01:06 PM
[FONT="]CS401 MIDTERM FALL2010 [/FONT]
[FONT="] [/FONT]
[FONT="]One screen location corresponds to a[/FONT]
[FONT="] [/FONT]
[FONT="]Byte[/FONT]
[FONT="] [/FONT]
[FONT="]Word[/FONT]
[FONT="] [/FONT]
[FONT="]Double byte[/FONT]
[FONT="] [/FONT]
[FONT="]Double word[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]After the execution of “PUSH AX” statement [/FONT]
[FONT="] [/FONT]
[FONT="]AX register will reside on the stack[/FONT]
[FONT="] [/FONT]
[FONT="]A copy of AX will go on the stack[/FONT]
[FONT="] [/FONT]
[FONT="]The value of AX disappear after moving on stack[/FONT]
[FONT="] [/FONT]
[FONT="]Stack will send an acceptance message[/FONT]
[FONT="] [/FONT]
[FONT="]physical address of the stack is obtained by[/FONT]
[FONT="]SS:SP combination[/FONT]
[FONT="]SS:SI combination [/FONT]
[FONT="] [/FONT]
[FONT="]SS:SP combination[/FONT]
[FONT="] [/FONT]
[FONT="]ES:BP combination[/FONT]
[FONT="] [/FONT]
[FONT="]ES:SP combination[/FONT]
[FONT="]If the address of memory location Num1 is 0117 and its content is 0005 then after execution of the instruction “ mov bx, Num1” bx will contain[/FONT]
[FONT="]0005 [/FONT]
[FONT="]0117 [/FONT]
[FONT="]Num1 [/FONT]
[FONT="]1701[/FONT]
[FONT="] [/FONT]
[FONT="]In STOS instruction, the implied source will always be in[/FONT]
[FONT="] [/FONT]
[FONT="]AL[/FONT][FONT="] or AX registers[/FONT]
[FONT="] [/FONT]
[FONT="]DL or DX registers[/FONT]
[FONT="] [/FONT]
[FONT="]BL or BX registers[/FONT]
[FONT="] [/FONT]
[FONT="]CL or CX registers[/FONT]
[FONT="]The shift logical right operation inserts [/FONT]
[FONT="] [/FONT]
[FONT="]A zero at right [/FONT]
[FONT="] [/FONT]
[FONT="]A zero at left[/FONT]
[FONT="] [/FONT]
[FONT="]A one at right[/FONT]
[FONT="] [/FONT]
[FONT="]A one at right[/FONT]
[FONT="] [/FONT]
[FONT="]R[/FONT][FONT="]E[/FONT][FONT="]P will always[/FONT]
[FONT="]I[/FONT][FONT="]n[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 1[/FONT][FONT="][/FONT]
[FONT="]I[/FONT][FONT="]n[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 2[/FONT][FONT="][/FONT]
[FONT="]D[/FONT][FONT="]e[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 1[/FONT][FONT="][/FONT]
[FONT="]D[/FONT][FONT="]e[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 2[/FONT]
[FONT="] [/FONT]
[FONT="]When an item is pushed on the decrementing stack, the top of the stack is[/FONT]
[FONT="] [/FONT]
[FONT="]First decremented and then element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]First incremented and then element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]Decremented after the element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]Incremented after the element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]assembly the CX register is used normally as a ______________register. [/FONT]
[FONT="]source[/FONT]
[FONT="]counter[/FONT]
[FONT="]index[/FONT]
[FONT="]pointer[/FONT]
[FONT="]Which is the unidirectional bus ?[/FONT]
[FONT="](I) Control Bus[/FONT]
[FONT="](II) Data Bus[/FONT]
[FONT="](III) Address Bus[/FONT]
[FONT="]I only[/FONT]
[FONT="]II only[/FONT]
[FONT="]III only[/FONT]
[FONT="]I and II only[/FONT]
[FONT="] [/FONT]
[FONT="]T[/FONT][FONT="]h[/FONT][FONT="]e basic function of SCAS instruction is to[/FONT]
[FONT="]Compare[/FONT]
[FONT="]S[/FONT][FONT="]can[/FONT][FONT="][/FONT]
[FONT="]S[/FONT][FONT="]o[/FONT][FONT="]rt[/FONT][FONT="][/FONT]
[FONT="]M[/FONT][FONT="]o[/FONT][FONT="]v[/FONT][FONT="]e data[/FONT][FONT="][/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]_______ register holds the address of next instruction is to be executed[/FONT]
[FONT="]Base pointer[/FONT]
[FONT="]Code segment[/FONT]
[FONT="]Source index[/FONT]
[FONT="]Program counter[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]JC and JNC test the ____________ flag.[/FONT]
[FONT="]carry[/FONT]
[FONT="]parity[/FONT]
[FONT="]zero[/FONT]
[FONT="]sign[/FONT]
[FONT="] [/FONT]
[FONT="]A[/FONT][FONT="]f[/FONT][FONT="]te[/FONT][FONT="]r the execution of REP instruction CX will be decremented then which of the following flags will be affected?[/FONT]
[FONT="] [/FONT]
[FONT="]CF[/FONT][FONT="][/FONT]
[FONT="]OF[/FONT]
[FONT="]DF[/FONT][FONT="][/FONT]
[FONT="]N[/FONT][FONT="]o flags will be affected[/FONT]
[FONT="] [/FONT]
[FONT="]In string manipulation whenever an instruction needs a memory source, which of the following will hold the pointer to it?[/FONT]
[FONT="] [/FONT]
[FONT="]ES: DI[/FONT]
[FONT="] [/FONT]
[FONT="]ES: BP[/FONT]
[FONT="] [/FONT]
[FONT="]DS:BP[/FONT]
[FONT="] [/FONT]
[FONT="]DS:SI[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]which bit sets the character "blinking" on the screen?[/FONT]
[FONT="] [/FONT]
[FONT="]5[/FONT]
[FONT="]6[/FONT]
[FONT="]7[/FONT]
[FONT="]8[/FONT]
[FONT="] [/FONT]
[FONT="]If we want to divide a signed number by 2, this operation can better be accomplished by[/FONT]
[FONT="]SHR [/FONT]
[FONT="]SAR[/FONT]
[FONT="]SHL [/FONT]
[FONT="]SAL[/FONT]
[FONT="] [/FONT]
[FONT="]A[/FONT][FONT="]f[/FONT][FONT="]te[/FONT][FONT="]r the execution of STOSWB,the CX wil be……..[/FONT]
[FONT="]I[/FONT][FONT="]n[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]te[/FONT][FONT="]d by 1[/FONT]
[FONT="]Inc[/FONT][FONT="]r[/FONT][FONT="]ement[/FONT][FONT="]e[/FONT][FONT="]d by 2[/FONT]
[FONT="]Decremented by 1[/FONT]
[FONT="]Decremented by 2[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Each screen location corresponds to a word, the lower byte of this word contains ____[/FONT]
[FONT="] [/FONT]
[FONT="]The character code[/FONT]
[FONT="]The attribute byte[/FONT]
[FONT="]The parameters[/FONT]
[FONT="]The dimensions[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT][FONT="]In a video memory, each screen location corresponds to [/FONT]
[FONT="]One byte[/FONT]
[FONT="]Two bytes[/FONT]
[FONT="]Four bytes[/FONT]
[FONT="]Eight bytes[/FONT]
[FONT="] [/FONT][FONT="]Q.[/FONT]
[FONT="]Number2: [/FONT]
[FONT="]IF DF=0 what its represent and IF DF=1 what its represent ?[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="]Relation between RET and CALL is dependent or independent.[/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]Write all steps of algorithm for printing number 352.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]When the instruction "push ax" is executed in decrementing stack how the value of SP will change[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]What is wrong with this program?[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source operand is a word?[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]One screen location corresponds to a[/FONT]
[FONT="] [/FONT]
[FONT="]Byte[/FONT]
[FONT="] [/FONT]
[FONT="]Word[/FONT]
[FONT="] [/FONT]
[FONT="]Double byte[/FONT]
[FONT="] [/FONT]
[FONT="]Double word[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]After the execution of “PUSH AX” statement [/FONT]
[FONT="] [/FONT]
[FONT="]AX register will reside on the stack[/FONT]
[FONT="] [/FONT]
[FONT="]A copy of AX will go on the stack[/FONT]
[FONT="] [/FONT]
[FONT="]The value of AX disappear after moving on stack[/FONT]
[FONT="] [/FONT]
[FONT="]Stack will send an acceptance message[/FONT]
[FONT="] [/FONT]
[FONT="]physical address of the stack is obtained by[/FONT]
[FONT="]SS:SP combination[/FONT]
[FONT="]SS:SI combination [/FONT]
[FONT="] [/FONT]
[FONT="]SS:SP combination[/FONT]
[FONT="] [/FONT]
[FONT="]ES:BP combination[/FONT]
[FONT="] [/FONT]
[FONT="]ES:SP combination[/FONT]
[FONT="]If the address of memory location Num1 is 0117 and its content is 0005 then after execution of the instruction “ mov bx, Num1” bx will contain[/FONT]
[FONT="]0005 [/FONT]
[FONT="]0117 [/FONT]
[FONT="]Num1 [/FONT]
[FONT="]1701[/FONT]
[FONT="] [/FONT]
[FONT="]In STOS instruction, the implied source will always be in[/FONT]
[FONT="] [/FONT]
[FONT="]AL[/FONT][FONT="] or AX registers[/FONT]
[FONT="] [/FONT]
[FONT="]DL or DX registers[/FONT]
[FONT="] [/FONT]
[FONT="]BL or BX registers[/FONT]
[FONT="] [/FONT]
[FONT="]CL or CX registers[/FONT]
[FONT="]The shift logical right operation inserts [/FONT]
[FONT="] [/FONT]
[FONT="]A zero at right [/FONT]
[FONT="] [/FONT]
[FONT="]A zero at left[/FONT]
[FONT="] [/FONT]
[FONT="]A one at right[/FONT]
[FONT="] [/FONT]
[FONT="]A one at right[/FONT]
[FONT="] [/FONT]
[FONT="]R[/FONT][FONT="]E[/FONT][FONT="]P will always[/FONT]
[FONT="]I[/FONT][FONT="]n[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 1[/FONT][FONT="][/FONT]
[FONT="]I[/FONT][FONT="]n[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 2[/FONT][FONT="][/FONT]
[FONT="]D[/FONT][FONT="]e[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 1[/FONT][FONT="][/FONT]
[FONT="]D[/FONT][FONT="]e[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]t CX by 2[/FONT]
[FONT="] [/FONT]
[FONT="]When an item is pushed on the decrementing stack, the top of the stack is[/FONT]
[FONT="] [/FONT]
[FONT="]First decremented and then element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]First incremented and then element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]Decremented after the element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]Incremented after the element copied on to the stack[/FONT]
[FONT="] [/FONT]
[FONT="]assembly the CX register is used normally as a ______________register. [/FONT]
[FONT="]source[/FONT]
[FONT="]counter[/FONT]
[FONT="]index[/FONT]
[FONT="]pointer[/FONT]
[FONT="]Which is the unidirectional bus ?[/FONT]
[FONT="](I) Control Bus[/FONT]
[FONT="](II) Data Bus[/FONT]
[FONT="](III) Address Bus[/FONT]
[FONT="]I only[/FONT]
[FONT="]II only[/FONT]
[FONT="]III only[/FONT]
[FONT="]I and II only[/FONT]
[FONT="] [/FONT]
[FONT="]T[/FONT][FONT="]h[/FONT][FONT="]e basic function of SCAS instruction is to[/FONT]
[FONT="]Compare[/FONT]
[FONT="]S[/FONT][FONT="]can[/FONT][FONT="][/FONT]
[FONT="]S[/FONT][FONT="]o[/FONT][FONT="]rt[/FONT][FONT="][/FONT]
[FONT="]M[/FONT][FONT="]o[/FONT][FONT="]v[/FONT][FONT="]e data[/FONT][FONT="][/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]_______ register holds the address of next instruction is to be executed[/FONT]
[FONT="]Base pointer[/FONT]
[FONT="]Code segment[/FONT]
[FONT="]Source index[/FONT]
[FONT="]Program counter[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]JC and JNC test the ____________ flag.[/FONT]
[FONT="]carry[/FONT]
[FONT="]parity[/FONT]
[FONT="]zero[/FONT]
[FONT="]sign[/FONT]
[FONT="] [/FONT]
[FONT="]A[/FONT][FONT="]f[/FONT][FONT="]te[/FONT][FONT="]r the execution of REP instruction CX will be decremented then which of the following flags will be affected?[/FONT]
[FONT="] [/FONT]
[FONT="]CF[/FONT][FONT="][/FONT]
[FONT="]OF[/FONT]
[FONT="]DF[/FONT][FONT="][/FONT]
[FONT="]N[/FONT][FONT="]o flags will be affected[/FONT]
[FONT="] [/FONT]
[FONT="]In string manipulation whenever an instruction needs a memory source, which of the following will hold the pointer to it?[/FONT]
[FONT="] [/FONT]
[FONT="]ES: DI[/FONT]
[FONT="] [/FONT]
[FONT="]ES: BP[/FONT]
[FONT="] [/FONT]
[FONT="]DS:BP[/FONT]
[FONT="] [/FONT]
[FONT="]DS:SI[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]which bit sets the character "blinking" on the screen?[/FONT]
[FONT="] [/FONT]
[FONT="]5[/FONT]
[FONT="]6[/FONT]
[FONT="]7[/FONT]
[FONT="]8[/FONT]
[FONT="] [/FONT]
[FONT="]If we want to divide a signed number by 2, this operation can better be accomplished by[/FONT]
[FONT="]SHR [/FONT]
[FONT="]SAR[/FONT]
[FONT="]SHL [/FONT]
[FONT="]SAL[/FONT]
[FONT="] [/FONT]
[FONT="]A[/FONT][FONT="]f[/FONT][FONT="]te[/FONT][FONT="]r the execution of STOSWB,the CX wil be……..[/FONT]
[FONT="]I[/FONT][FONT="]n[/FONT][FONT="]c[/FONT][FONT="]r[/FONT][FONT="]e[/FONT][FONT="]m[/FONT][FONT="]e[/FONT][FONT="]n[/FONT][FONT="]te[/FONT][FONT="]d by 1[/FONT]
[FONT="]Inc[/FONT][FONT="]r[/FONT][FONT="]ement[/FONT][FONT="]e[/FONT][FONT="]d by 2[/FONT]
[FONT="]Decremented by 1[/FONT]
[FONT="]Decremented by 2[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Each screen location corresponds to a word, the lower byte of this word contains ____[/FONT]
[FONT="] [/FONT]
[FONT="]The character code[/FONT]
[FONT="]The attribute byte[/FONT]
[FONT="]The parameters[/FONT]
[FONT="]The dimensions[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT][FONT="]In a video memory, each screen location corresponds to [/FONT]
[FONT="]One byte[/FONT]
[FONT="]Two bytes[/FONT]
[FONT="]Four bytes[/FONT]
[FONT="]Eight bytes[/FONT]
[FONT="] [/FONT][FONT="]Q.[/FONT]
[FONT="]Number2: [/FONT]
[FONT="]IF DF=0 what its represent and IF DF=1 what its represent ?[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="]Relation between RET and CALL is dependent or independent.[/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]Write all steps of algorithm for printing number 352.[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]When the instruction "push ax" is executed in decrementing stack how the value of SP will change[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]What is wrong with this program?[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Q.[/FONT]
[FONT="] [/FONT]
[FONT="]Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source operand is a word?[/FONT]
[FONT="] [/FONT]