Sunday, March 22, 2009

Microprocessors Interview Questions of part -------12

Microprocessors Interview Questions of part ----12
What is DAS instruction ?
DAS : Decimal Adjust After SubtractionThis instruction converts the binary result of a SUB or SBB instruction in AL to Packed BCD format. It operates only on AL Register.
What is the use of ‘W’ bit in opcode ?.
W bit in op-code : If an instruction in 8086 can operate on either a byte or a word , the op-code includes a W-bit which indicates whether a byte ( W =0 ) or a word (W =1) is being accessed.
Define XLAT instruction used in 8086.
It translates a byte in AL using a table in memory. The offset address is calculated by adding the 8 bit contents of the AL register and the contents of BX register. BX register contains the starting offset address of the Lookup table . After execution , corresponding data memory contents of the lookup table are loaded into the AL register.
What is the use of PUSHF instruction used in 8086 ?
It pushes the flag register contents to the top of the stack. No flags are affected.
Define Inter segment Indirect addressing mode:
It replaces the contents of IP and CS with the contents of two consecutive words in memory that are referenced by using any of the data related addressing modes except immediate and register modes
Define Inter segment addressing mode:
It replaces the contents of IP with part of the instruction and the contents of CS with another part of the instruction.
Define Intra segment Indirect addressing mode:
The effective branch address is the contents of a register or memory location that is accessed using any of the data related addressing modes except the immediate mode. The contents of IP are replaced by the effective branch address.
Define Intra segment direct addressing mode:
The effective branch address is the sum of an 8- or 16 bit displacement and the current contents of IP.
Define Based Indexed addressing mode:
The effective address is the sum of a base register and an index register , both of which are specified by the instruction.It is also called as Base related Indexed addressing.
Define Register relative addressing mode:
The effective address is the sum of an 8- or 16 bit displacement and the contents of a base register or an index register.
Define Register Indirect Addressing mode:
Effective address of the datum is in the base register BX or an index register that is specified by the instruction.
Define Register addressing mode:
Datum is in the register that is specified by the instruction
E.g : MOV CX,AX (16 bit operand)
MOV CL,AL ( 8 bit operand)
When the Overflow flag is set ?
For addition of 16 bits, this flag is set when there is a carry into the MSB and no carry out of the MSB.
Write about the auxiliary carry flag used in 8086 ?
It is set if there is a carry out of bit 3 during an addition or a borrow by bit 3 during a subtraction. This flag is used exclusively for BCD arithmetic.
What is the use of Instruction pointer in 8086 ?
Instruction pointer holds the 16 bit address of the next code byte within the code segment. The value contained in the IP is called effective address or offset. It contains the distance from the base address to the next instruction byte to be fetched.

No comments: