Education In Pakistan

Papers, Notes, Books & Help For Students

UPDATED EDUCATIONAL NEWS INTERVIEW HELP FOR ALL JOBS ONLINE BOOKS SCHOLARSHIPS AVAILABLE INTERNSHIP JOBS

Tag: VU. CS401-.Computer .Architecture & .Assembly. Language. Programming .Fall. 2010. Mid Term .Paper

VU CS401-Computer Architecture & Assembly Language Programming Fall 2010 Mid Term Paper

.

CS401-Computer Architecture & Assembly Language Programming

Fall 2010 Mid Term Paper

MCQ’s

1. The shift logical right operation inserts

2. After the execution of “PUSH AX” statement

3. The extended ASCII has 256 characters

4. The iAPX88 processor supports _____________modes of memory access.

5. In STOS instruction, the implied source will always be in AL or AX

registers

6. The maximum memory, IAPX88 can access is________.

7. The registers IP, SP, BP, SI, DI, and BX all can contain a ________offset.

8. In the “mov ax, 5” 5 is the __________ operand.

9. In MUL instruction if the source operand is a word then it is multiplied by

register

10. The prevalent and standard format for representation of characters in

computers is

11. which bit sets the character “blinking” on the screen?

12.“mov byte [num1], 5” is _________ instruction.

13. ____ can process blocks of data in one go.

14. In string instructions, CX is always

15. STOS transfers a byte or word from register AL or AX to the string element

addressed by

16. The execution of the instruction “mov word [ES : 0], 0x0741” will print

character “A” on screen, color of the character will be

17. In A4FB:4872 Segment:offset pair the physical address is (both segment

and offset are in hexadecimal): A9822

18. Which of the following operations relating to PUSH is true?

19. If the decimal number “35” is shifted by two bits to left, the new value will

be _________

20. Which of the following flags will be affected by MOVSB?

21. Explain the fuction of rotate right (ROR) instruction

.

The rotate right (ROR) and rotate through carry right (RCR) instructions shift all

the bits toward less significant bit positions, except for the least-significant bit,

which is rotated to the most-significant bit location

22.Why REP prefix is generally not used with LODS instruction?

The lods instruction is unique among the string instructions. We will never use a

repeat prefix with this instruction. Because it copies the byte or word pointed at

by ds:si into the al, ax, or eax register, after which it increments or decrements

the si register by one, two, or four. Repeating this instruction via the repeat prefix

would serve no purpose whatsoever since the accumulator register will be

overwritten each time the lods instruction repeats. At the end of the repeat

operation, the accumulator will contain the last value read from memory.

23.Write all steps of algorithm for printing number 352.

In this technique the first digit printed is the right most one

Divide the number by base (10 in case of decimal)..The remainder after

first division was 3, after second division was 5 and after the third division

was 2.

• The remainder is its right most digit

• Convert the digit to its ASCII representation

• Save this digit on stack

• If the quotient is non-zero repeat the whole process to get the next

.

digit, otherwise stop.

• Pop digits one by one and print on screen left to right. Stack is a Last In First Out

structure so if 3, 5, and 2 are pushed on it, 2, 5, and 3 will come

out in this order.

24. What are the result after performing the instruction (each carry 1

marks )

1. and ax,bx

2. or ax,bx

3. xor ax,bx

Given that ax = 00110011 and bx = 00010001

25. Describe Local Variables?

A local variable is valid within the statement block in which it is defined and

within any nested statement blocks, unless you redefine the variable within the

statement block.

Local variables should be created when the subroutine is called and discarded

afterwards. So that the spaced used by them can be reused for the local variables

of another subroutine. They only have meaning inside the subroutine and no

meaning outside it.

It is important role of the stack to create local variables that are only needed

while the subroutine is in execution and not afterwards. They should not take

permanent space like global variables.

The most convenient place to store these variables is the stack. We need some

special manipulation of the stack for this task. We need to produce a gap in the

stack for our variables.

Are valid only for the duration of the SPL routine

.

Are reset to their initial values or to a value the user passes to the routine, each

time the routine is executed

Cannot have default values

26. Explain the complete operation of Interrupt when it is generated.

Interrupt is the result of an INT instruction (software interrupt) or it is generated

by an external hardware which passes the interrupt number by a different

mechanism. The currently executing instruction is completed, the current value of

FLAGS is pushed on the stack, then the current code segment is pushed, then the

offset of the next instruction is pushed. After this it automatically clears the trap

flag and the interrupt flag to disallow further interrupts until the current routine

finishes. After this it loads the word at nx4 in IP and the word at nx4+2 in CS if

interrupt n was generated. As soon as these values are loaded in CS and IP

execution goes to the start of the interrupt handler. When the handler finishes its

work it uses the IRET instruction to return to the caller. IRET pops IP, then CS, and

then FLAGS. The original value of IF and TF is restored which re-enables further

interrupts

VU CS401-Computer Architecture & Assembly Language Programming Fall 2010 Mid Term Paper

.

CS401-Computer Architecture & Assembly Language Programming

Fall 2010 Mid Term Paper

MCQ’s

1. The shift logical right operation inserts

2. After the execution of “PUSH AX” statement

3. The extended ASCII has 256 characters

4. The iAPX88 processor supports _____________modes of memory access.

5. In STOS instruction, the implied source will always be in AL or AX

registers

6. The maximum memory, IAPX88 can access is________.

7. The registers IP, SP, BP, SI, DI, and BX all can contain a ________offset.

8. In the “mov ax, 5” 5 is the __________ operand.

9. In MUL instruction if the source operand is a word then it is multiplied by

register

10. The prevalent and standard format for representation of characters in

computers is

11. which bit sets the character “blinking” on the screen?

12.“mov byte [num1], 5” is _________ instruction.

13. ____ can process blocks of data in one go.

14. In string instructions, CX is always

15. STOS transfers a byte or word from register AL or AX to the string element

addressed by

16. The execution of the instruction “mov word [ES : 0], 0x0741” will print

character “A” on screen, color of the character will be

17. In A4FB:4872 Segment:offset pair the physical address is (both segment

and offset are in hexadecimal): A9822

18. Which of the following operations relating to PUSH is true?

19. If the decimal number “35” is shifted by two bits to left, the new value will

be _________

20. Which of the following flags will be affected by MOVSB?

21. Explain the fuction of rotate right (ROR) instruction

.

The rotate right (ROR) and rotate through carry right (RCR) instructions shift all

the bits toward less significant bit positions, except for the least-significant bit,

which is rotated to the most-significant bit location

22.Why REP prefix is generally not used with LODS instruction?

The lods instruction is unique among the string instructions. We will never use a

repeat prefix with this instruction. Because it copies the byte or word pointed at

by ds:si into the al, ax, or eax register, after which it increments or decrements

the si register by one, two, or four. Repeating this instruction via the repeat prefix

would serve no purpose whatsoever since the accumulator register will be

overwritten each time the lods instruction repeats. At the end of the repeat

operation, the accumulator will contain the last value read from memory.

23.Write all steps of algorithm for printing number 352.

In this technique the first digit printed is the right most one

Divide the number by base (10 in case of decimal)..The remainder after

first division was 3, after second division was 5 and after the third division

was 2.

• The remainder is its right most digit

• Convert the digit to its ASCII representation

• Save this digit on stack

• If the quotient is non-zero repeat the whole process to get the next

.

digit, otherwise stop.

• Pop digits one by one and print on screen left to right. Stack is a Last In First Out

structure so if 3, 5, and 2 are pushed on it, 2, 5, and 3 will come

out in this order.

24. What are the result after performing the instruction (each carry 1

marks )

1. and ax,bx

2. or ax,bx

3. xor ax,bx

Given that ax = 00110011 and bx = 00010001

25. Describe Local Variables?

A local variable is valid within the statement block in which it is defined and

within any nested statement blocks, unless you redefine the variable within the

statement block.

Local variables should be created when the subroutine is called and discarded

afterwards. So that the spaced used by them can be reused for the local variables

of another subroutine. They only have meaning inside the subroutine and no

meaning outside it.

It is important role of the stack to create local variables that are only needed

while the subroutine is in execution and not afterwards. They should not take

permanent space like global variables.

The most convenient place to store these variables is the stack. We need some

special manipulation of the stack for this task. We need to produce a gap in the

stack for our variables.

Are valid only for the duration of the SPL routine

.

Are reset to their initial values or to a value the user passes to the routine, each

time the routine is executed

Cannot have default values

26. Explain the complete operation of Interrupt when it is generated.

Interrupt is the result of an INT instruction (software interrupt) or it is generated

by an external hardware which passes the interrupt number by a different

mechanism. The currently executing instruction is completed, the current value of

FLAGS is pushed on the stack, then the current code segment is pushed, then the

offset of the next instruction is pushed. After this it automatically clears the trap

flag and the interrupt flag to disallow further interrupts until the current routine

finishes. After this it loads the word at nx4 in IP and the word at nx4+2 in CS if

interrupt n was generated. As soon as these values are loaded in CS and IP

execution goes to the start of the interrupt handler. When the handler finishes its

work it uses the IRET instruction to return to the caller. IRET pops IP, then CS, and

then FLAGS. The original value of IF and TF is restored which re-enables further

interrupts

VU CS401-Computer Architecture & Assembly Language Programming Fall 2010 Mid Term Paper

.

CS401-Computer Architecture & Assembly Language Programming

Fall 2010 Mid Term Paper

1. One screen location corresponds to a

Byte

Word

Double byte

Double word

2. After the execution of “PUSH AX” statement

AX register will reside on the stack

A copy of AX will go on the stack

The value of AX disappear after moving on stack

Stack will send an acceptance message

3. physical address of the stack is obtained by

SS:SP combination

SS:SI combination

SS:SP combination

ES:BP combination

ES:SP combination

.

4. 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

0005

0117

Num1

1701

5. In STOS instruction, the implied source will always be in

AL or AX registers

DL or DX registers

BL or BX registers

CL or CX registers

6. The shift logical right operation inserts

A zero at right

A zero at left

A one at right

A one at right

7. REP will always

Increment CX by 1

Increment CX by 2

Decrement CX by 1

Decrement CX by 2

.

8. When an item is pushed on the decrementing stack, the top of the stack is

First decremented and then element copied on to the stack

First incremented and then element copied on to the stack

Decremented after the element copied on to the stack

Incremented after the element copied on to the stack

9. assembly the CX register is used normally as a ______________register.

source

counter

index

pointer

10. Which is the unidirectional bus ?

(I) Control Bus

(II) Data Bus

(III) Address Bus

I only

II only

III only

I and II only

11. The basic function of SCAS instruction is to

Compare

Scan

Sort

Move data

.

12. _______ register holds the address of next instruction is to be executed

Base pointer

Code segment

Source index

Program counter

13. JC and JNC test the ____________ flag.

carry

parity

zero

sign

14. After the execution of REP instruction CX will be decremented then which of the

following flags will be affected?

CF

OF

DF

No flags will be affected

15. In string manipulation whenever an instruction needs a memory source, which of

the following will hold the pointer to it?

ES: DI

ES: BP

DS:BP

DS:SI

16. which bit sets the character “blinking” on the screen?

5

.

6

7

8

17. If we want to divide a signed number by 2, this operation can better be

accomplished by

SHR

SAR

SHL

SAL

18. After the execution of STOSWB,the CX wil be……..

Incremented by 1

Incremented by 2

Decremented by 1

Decremented by 2

19. Each screen location corresponds to a word, the lower byte of this word contains

____

The character code

The attribute byte

The parameters

The dimensions

20. In a video memory, each screen location corresponds to

One byte

Two bytes

Four bytes

Eight bytes

Q.

Number2:

.

IF DF=0 what its represent and IF DF=1 what its represent ?

Q.

Relation between RET and CALL is dependent or independent.

Q.

Write all steps of algorithm for printing number 352.

Q.

When the instruction “push ax” is executed in decrementing stack how the value of SP

will change

Q.

What is wrong with this program?

Q.

.

Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source

operand is a word? .

CS401-Computer Architecture & Assembly Language Programming

Fall 2010 Mid Term Paper

1. One screen location corresponds to a

Byte

Word

Double byte

Double word

2. After the execution of “PUSH AX” statement

AX register will reside on the stack

A copy of AX will go on the stack

The value of AX disappear after moving on stack

Stack will send an acceptance message

3. physical address of the stack is obtained by

SS:SP combination

SS:SI combination

SS:SP combination

ES:BP combination

ES:SP combination

.

4. 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

0005

0117

Num1

1701

5. In STOS instruction, the implied source will always be in

AL or AX registers

DL or DX registers

BL or BX registers

CL or CX registers

6. The shift logical right operation inserts

A zero at right

A zero at left

A one at right

A one at right

7. REP will always

Increment CX by 1

Increment CX by 2

Decrement CX by 1

Decrement CX by 2

.

8. When an item is pushed on the decrementing stack, the top of the stack is

First decremented and then element copied on to the stack

First incremented and then element copied on to the stack

Decremented after the element copied on to the stack

Incremented after the element copied on to the stack

9. assembly the CX register is used normally as a ______________register.

source

counter

index

pointer

10. Which is the unidirectional bus ?

(I) Control Bus

(II) Data Bus

(III) Address Bus

I only

II only

III only

I and II only

11. The basic function of SCAS instruction is to

Compare

Scan

Sort

Move data

.

12. _______ register holds the address of next instruction is to be executed

Base pointer

Code segment

Source index

Program counter

13. JC and JNC test the ____________ flag.

carry

parity

zero

sign

14. After the execution of REP instruction CX will be decremented then which of the

following flags will be affected?

CF

OF

DF

No flags will be affected

15. In string manipulation whenever an instruction needs a memory source, which of

the following will hold the pointer to it?

ES: DI

ES: BP

DS:BP

DS:SI

16. which bit sets the character “blinking” on the screen?

5

.

6

7

8

17. If we want to divide a signed number by 2, this operation can better be

accomplished by

SHR

SAR

SHL

SAL

18. After the execution of STOSWB,the CX wil be……..

Incremented by 1

Incremented by 2

Decremented by 1

Decremented by 2

19. Each screen location corresponds to a word, the lower byte of this word contains

____

The character code

The attribute byte

The parameters

The dimensions

20. In a video memory, each screen location corresponds to

One byte

Two bytes

Four bytes

Eight bytes

Q.

Number2:

.

IF DF=0 what its represent and IF DF=1 what its represent ?

Q.

Relation between RET and CALL is dependent or independent.

Q.

Write all steps of algorithm for printing number 352.

Q.

When the instruction “push ax” is executed in decrementing stack how the value of SP

will change

Q.

What is wrong with this program?

Q.

.

Explain MUL instruction in both cases (i) if the source operand is byte (ii) if the source

operand is a word?

Education In Pakistan © 2016