23 question16 MCQssome MCQs1. Stack is a _ data structure _____2. Standard ASCII has 128 characters3. Which bit is refer to the red component of foreground color (2 is answer) Which bit is refer to the red component of background color (6 is answer)4.When a 32 bit number is divided by a 16 bit number, the quotient is of (16 bit)5. There are just 5 block processing instructions in 8088.6. After the execution of instruction “RET 2 ” increment or decrement3 question of 2 marksI.write the instruction that copy the offset into the AXII. why we clear the stack.

2 question of 3 marksI. Define implied operand?II. converting of two dimensional memory system of screen into the one dimension

2 question of 5 marks

I. Define Inversion bit selecting and selective bit settig.

II. Question of 5 marks regarding CMPS. below is the answer

CMPS subtracts the source location DS:SI from the destination location ES:DI. Source and Destination are unaffected. SI and DI are updated accordingly. CMPS compares two blocks of memory for equality or inequality of the block. It subtracts byte by byte or word by word. If used with a REPE or a REPNE prefix is repeats as long as the blocks are same or as long as they are different. For example it can be used for find a substring. A substring is a string that is contained in another string. For example “has” is contained in “Mary has a little lamp.” Using CMPS we can do the operation of a complex loop in a single instruction. Only the REPE and REPNE prefixes are meaningful with this instruction

Segment and offset must be given to a far jump. Because, sometimes we may need to go from one code segment to another, and near and short jumps cannot take us there. Far jump must be used and a two byte segment and a two byte offset are given to it. It loads CS with the segment part and IP with the offset part.

Question No: 18 ( Marks: 2 ) What’s your understanding about Incrementing and Decrementing Stack? Whenever an element is pushed on the stack SP is decremented by two and whenever an element is popped on the stack SP is incremented by two.

A decrementing stack moves from higher addresses to lower addresses as elements are added in it while an incrementing stack moves from lower addresses to higher addresses as elements are added.As the 8088 stack works on word sized elements. Single bytes cannot be pushed or popped from the stack.

Question No: 19 ( Marks: 2 ) Number2: IF DF=0 what its represent and IF DF=1 what its represent ?

The direction of movement is controlled with the Direction Flag (DF) in the flags register. If this flag is cleared DF=0, the direction is from lower addresses towards higher addresses and if this flag is set DF=1, the direction is from higher addresses to lower addresses. If DF is cleared, DF = 0 this is called the autoincrement mode of string instruction, and if DF is set, DF=1, this is called the autodecrement mode. There are two instructions to set and clear the direction flag.

Question No: 20 ( Marks: 3 ) What is the Difference between CALL and RET The CALL instruction allows temporary diversion and therefore reusability of code. The word return holds in its meaning that we are to return from where we came and need no explicit destination.Therefore RET takes no arguments and transfers control back to the instruction following the CALL that took us in this subroutine.Question No: 21 ( Marks: 3 ) Tell the Formula to scroll up the screen

Using our basic shifting and rotation instructions we can effectively shift a 32bit number in memory word by word. We cannot shift the whole number at once since our architecture is limited to word operations. The algorithm we use consists of just two instructions and we name it extended shifting.

num1: dd 40000shl word [num1], 1rcl word [num1+2], 1

The DD directive reserves a 32bit space in memory; however the value we placed there will fit in 16bits. So we can safely shift the number left 16 times.The least significant word is accessible at num1 and the most significant word is accessible at num1+2.The two instructions are carefully crafted such that the first one shifts the lower word towards the left and the most significant bit of that word is dropped in carry. With the next instruction we push that dropped bit into the least significant bit of the next word effectively joining the two 16bit words.The final carry after the second instruction will be the most significant bit of the higher word, which for this number will always be zero.