Header Ads Widget

Instruction Set and Programming

1. The instruction, MOV AX, 0005H belongs to the address mode

a) register

b) direct

c) immediate

d) register relative

Answer: c

Explanation: In Immediate addressing mode, immediate data is a part of instruction and appears in the form of successive byte or bytes.

 

2. The instruction, MOV AX, 1234H is an example of

a) register addressing mode

b) direct addressing mode

c) immediate addressing mode

d) based indexed addressing mode

Answer: c

Explanation: Since immediate data is present in the instruction.

 

3. The instruction, MOV AX, [2500H] is an example of

a) immediate addressing mode

b) direct addressing mode

c) indirect addressing mode

d) register addressing mode

Answer: b

Explanation: Since the address is directly specified in the instruction as a part of it.

 

4. If the data is present in a register and it is referred using the particular register, then it is

a) direct addressing mode

b) register addressing mode

c) indexed addressing mode

d) immediate addressing mode

Answer: b

Explanation: Since register is used to refer the address.

 

5. The instruction, MOV AX,[BX] is an example of

a) direct addressing mode

b) register addressing mode

c) register relative addressing mode

d) register indirect addressing mode

Answer: d

Explanation: Since the register used to refer to the address is accessed indirectly.

 

6. If the offset of the operand is stored in one of the index registers, then it is

a) based indexed addressing mode

b) relative based indexed addressing mode

c) indexed addressing mode

d) none of the mentioned

Answer: c

Explanation: In the indexed addressing mode, the offset of an operand is stored and in the rest of them, address is stored.

 

7. The addressing mode that is used in unconditional branch instructions is

a) intrasegment direct addressing mode

b) intrasegment indirect addressing mode

c) intrasegment direct and indirect addressing mode

d) intersegment direct addressing mode

Answer: b

Explanation: In intrasegment indirect mode, the branch address is found as the content of a register or a memory location.

 

8. If the location to which the control is to be transferred lies in a different segment other than the current one, then the mode is called

a) intrasegment mode

b) intersegment direct mode

c) intersegment indirect mode

d) intersegment direct and indirect mode

Answer: d

Explanation: In intersegment mode, the control to be transferred lies in a different segment.

 

9. The instruction, JMP 5000H:2000H;

is an example of

a) intrasegment direct mode

b) intrasegment indirect mode

c) intersegment direct mode

d) intersegment indirect mode

Answer: c

Explanation: Since in intersegment direct mode, the address to which the control is to be transferred is in a different segment.

 

10. The contents of a base register are added to the contents of index register in

a) indexed addressing mode

b) based indexed addressing mode

c) relative based indexed addressing mode

d) based indexed and relative based indexed addressing mode

Answer: d

Explanation: The effective address is formed by adding the contents of both base and index registers to a default segment.

 

11. The instruction that is used to transfer the data from source operand to destination operand is

a) data copy/transfer instruction

b) branch instruction

c) arithmetic/logical instruction

d) string instruction

Answer: a

Explanation: These instructions are used to copy and transfer the instructions.

 

12. Which of the following is not a data copy/transfer instruction?

a) MOV

b) PUSH

c) DAS

d) POP

Answer: c

Explanation: DAS (Decimal Adjust after Subtraction) is an arithmetic instruction.

 

13. The instructions that involve various string manipulation operations are

a) branch instructions

b) flag manipulation instructions

c) shift and rotate instructions

d) string instructions

Answer: d

Explanation: The string instructions perform operations on strings such as load, move, scan, compare etc.

 

14. Which of the following instruction is not valid?

a) MOV AX, BX

b) MOV DS, 5000H

c) MOV AX, 5000H

d) PUSH AX

Answer: b

Explanation: Both the source and destination operands cannot be memory locations except for string instructions.

 

15. In PUSH instruction, after each execution of the instruction, the stack pointer is

a) incremented by 1

b) decremented by 1

c) incremented by 2

d) decremented by 2

Answer: d

Explanation: The actual current stack-top is always occupied by the previously pushed data. So, the push operation decrements SP by 2 and then stores the two bytes contents of the operand onto the stack.

 

16. The instruction that pushes the contents of the specified register/memory location on to the stack is

a) PUSHF

b) POPF

c) PUSH

d) POP

Answer: c

Explanation: Since PUSH operation transfers data to stack from a register or memory location.

 

17. In POP instruction, after each execution of the instruction, the stack pointer is

a) incremented by 1

b) decremented by 1

c) incremented by 2

d) decremented by 2

Answer: c

Explanation: The actual current stack top is poped into the specific operand as the contents of stack top memory is stored in AL&SP and further contents of the memory location pointed to by SP are copied to AH & SP.

 

18. The instructions that are used for reading an input port and writing an output port respectively are

a) MOV, XCHG

b) MOV, IN

c) IN, MOV

d) IN, OUT

Answer: d

Explanation: The address of the input/output port may be specified directly or indirectly.

Example for input port: IN AX, DX; This instruction reads data from a 16-bit port whose address is in DX and stores it in AX

Example for output port: OUT 03H, AL; This sends data available in AL to a port whose address is 03H.

 

19. The instruction that is used for finding out the codes in case of code conversion problems is

a) XCHG

b) XLAT

c) XOR

d) JCXZ

Answer: b

Explanation: The translate(XLAT) instruction is used to find codes.

 

20. The instruction that loads effective address formed by destination operand into the specified source register is

a) LEA

b) LDS

c) LES

d) LAHF

Answer: a

Explanation: The instruction, LEA loads effective address and is more useful for assembly language rather than for machine language.

 

21. The instruction that loads the AH register with the lower byte of the flag register is

a) SAHF

b) AH

c) LAHF

d) PUSHF

Answer: c

Explanation: The instruction LAHF(Load AH from a lower byte of Flag) may be used to observe the status of all the condition code flags(except overflow flag) at a time.

 

22. The instruction that pushes the flag register on to the stack is

a) PUSH

b) POP

c) PUSHF

d) POPF

Answer: c

Explanation: The instruction PUSHF(push flags to stack) pushes the flag register on to the stack.

 

23. The instruction that loads the flag register completely from the word contents of the memory location is

a) PUSH

b) POP

c) PUSHF

d) POPF

Answer: d

Explanation: POPF is pop flags to stack.

 

24. The instruction that adds immediate data/contents of the memory location specified in an instruction/register to the contents of another register/memory location is

a) SUB

b) ADD

c) MUL

d) DIV

Answer: b

Explanation: ADD instruction adds the data.

 

25. The instruction that supports addition when carry exists is

a) ADD

b) ADC

c) ADD & ADC

d) None of the mentioned

Answer: b

Explanation: ADC(Add with Carry) instruction performs the same operation as ADD operation, but adds the carry flag bit to the result.

This set of Microprocessor Multiple Choice Questions & Answers (MCQs) focuses on “Segmentation”.

 

26. The instruction, “INC” increases the contents of the specified register or memory location by

a) 2

b) 0

c) 1

d) 3

Answer: c

Explanation: This instruction adds 1 to the contents of the operand and so increments by 1.

 

27. The instruction that subtracts 1 from the contents of the specified register/memory location is

a) INC

b) SUBB

c) SUB

d) DEC

Answer: d

Explanation: The DEC instruction decrements the contents of a specified register/memory location by 1.

 

28. The instruction that enables subtraction with borrow is

a) DEC

b) SUB

c) SBB

d) None of the mentioned

Answer: c

Explanation: The SBB instruction subtracts the source operand and the borrow flag from the destination operand.

 

29. The flag that acts as Borrow flag in the instruction, SBB is

a) direction flag

b) carry flag

c) parity flag

d) trap flag

Answer: b

Explanation: If borrow exists in the subtraction operation performed then carry flag is set.

 

30. In general, the source operand of an instruction can be

a) memory location

b) register

c) immediate data

d) all of the mentioned

Answer: d

Explanation: The source operand is the element which is data or data stored memory location on which operation is performed.

 

31. In general, the destination operand of an instruction can be

a) memory location

b) register

c) immediate data

d) memory location and register

Answer: d

Explanation: Since the destination should be able to store the data, immediate data cannot be considered as a destination operand.

 

32. The instruction, CMP to compare source and destination operands it performs

a) addition

b) subtraction

c) division

d) multiplication

Answer: b

Explanation: For comparison, the instruction CMP subtracts source operand from destination operand.

 

33. During comparison operation, the result of comparing or subtraction is stored in

a) memory

b) registers

c) stack

d) no where

Answer: d

Explanation: The result of subtraction operation is not stored anywhere during a comparison.

 

34. The instruction that converts the result in an unpacked decimal digits is

a) AAA

b) AAS

c) AAM

d) All of the mentioned

Answer: d

Explanation: All the ASCII adjust instructions give result in unpacked decimal form and so are called as “Unpacked BCD arithmetic instructions”.

 

35. Which of the following is a mnemonic?

a) ADD

b) ADC

c) AAA

d) ADD & ADC

Answer: c

Explanation: AAA is a mnemonic. It doesn’t have either a source or destination operand.

 

36. The instruction in which adjustment is made before performing the operation is

a) AAA

b) AAS

c) AAM

d) AAD

Answer: d

Explanation: The AAD instruction converts two unpacked BCD digits in AH and AL to the equivalent binary number in AL. This adjustment must be made before dividing the two unpacked BCD digits.

 

37. The expansion of DAA is

a) decimal adjust after addition

b) decimal adjust before addition

c) decimal adjust accumulator

d) decimal adjust auxiliary

Answer: c

Explanation: This instruction performs conversion operation.

 

38. The instruction that is used to convert the result of the addition of two packed BCD numbers to a valid BCD number is

a) DAA

b) DAS

c) AAA

d) AAS

Answer: a

Explanation: In this conversion, the result has to be only in AL.

 

39. The ROR instruction rotates the contents of the destination operand to

a) left

b) right

c) left and then right

d) right and then left

Answer: b

Explanation: ROR stands for Rotate Right without carry. so, the instruction rotates right.

 

40. The instruction, “INC” increases the contents of the specified register or memory location by

a) 2

b) 0

c) 1

d) 3

Answer: c

Explanation: This instruction adds 1 to the contents of the operand and so increments by 1.

 

41. The instruction that subtracts 1 from the contents of the specified register/memory location is

a) INC

b) SUBB

c) SUB

d) DEC

Answer: d

Explanation: The DEC instruction decrements the contents of a specified register/memory location by 1.

 

42. The instruction that enables subtraction with borrow is

a) DEC

b) SUB

c) SBB

d) None of the mentioned

Answer: c

Explanation: The SBB instruction subtracts the source operand and the borrow flag from the destination operand.

 

43. The flag that acts as Borrow flag in the instruction, SBB is

a) direction flag

b) carry flag

c) parity flag

d) trap flag

Answer: b

Explanation: If borrow exists in the subtraction operation performed then carry flag is set.

 

44. In general, the source operand of an instruction can be

a) memory location

b) register

c) immediate data

d) all of the mentioned

Answer: d

Explanation: The source operand is the element which is data or data stored memory location on which operation is performed.

 

45. In general, the destination operand of an instruction can be

a) memory location

b) register

c) immediate data

d) memory location and register

Answer: d

Explanation: Since the destination should be able to store the data, immediate data cannot be considered as a destination operand.

 

46. The instruction, CMP to compare source and destination operands it performs

a) addition

b) subtraction

c) division

d) multiplication

Answer: b

Explanation: For comparison, the instruction CMP subtracts source operand from destination operand.

 

47. During comparison operation, the result of comparing or subtraction is stored in

a) memory

b) registers

c) stack

d) no where

Answer: d

Explanation: The result of subtraction operation is not stored anywhere during a comparison.

 

48. The instruction that converts the result in an unpacked decimal digits is

a) AAA

b) AAS

c) AAM

d) All of the mentioned

Answer: d

Explanation: All the ASCII adjust instructions give result in unpacked decimal form and so are called as “Unpacked BCD arithmetic instructions”.

 

49. Which of the following is a mnemonic?

a) ADD

b) ADC

c) AAA

d) ADD & ADC

Answer: c

Explanation: AAA is a mnemonic. It doesn’t have either a source or destination operand.

 

50. The instruction in which adjustment is made before performing the operation is

a) AAA

b) AAS

c) AAM

d) AAD

Answer: d

Explanation: The AAD instruction converts two unpacked BCD digits in AH and AL to the equivalent binary number in AL. This adjustment must be made before dividing the two unpacked BCD digits.

 

51. The expansion of DAA is

a) decimal adjust after addition

b) decimal adjust before addition

c) decimal adjust accumulator

d) decimal adjust auxiliary

Answer: c

Explanation: This instruction performs conversion operation.

 

52. The instruction that is used to convert the result of the addition of two packed BCD numbers to a valid BCD number is

a) DAA

b) DAS

c) AAA

d) AAS

Answer: a

Explanation: In this conversion, the result has to be only in AL.

 

53. The ROR instruction rotates the contents of the destination operand to

a) left

b) right

c) left and then right

d) right and then left

Answer: b

Explanation: ROR stands for Rotate Right without carry. so, the instruction rotates right.

 

54. The mnemonic that is placed before the arithmetic operation is performed is

a) AAA

b) AAS

c) AAM

d) AAD

Answer: d

Explanation: The AAD instruction converts two unpacked BCD digits in AH and AL to the equivalent binary number in AL.

 

55. The Carry flag is undefined after performing the operation

a) AAA

b) ADC

c) AAM

d) AAD

Answer: d

Explanation: Since the operation, AAD is performed before division operation is performed, the carry flag, auxiliary flag and overflow flag are undefined.

 

56. The instruction that performs logical AND operation and the result of the operation is not available is

a) AAA

b) AND

c) TEST

d) XOR

Answer: c

Explanation: In the TEST instruction, the logical AND operation is performed and the result is not stored but flags are affected.

 

57. In the RCL instruction, the contents of the destination operand undergo function as

a) carry flag is pushed into LSB & MSB is pushed into the carry flag

b) carry flag is pushed into MSB & LSB is pushed into the carry flag

c) auxiliary flag is pushed into LSB & MSB is pushed into the carry flag

d) parity flag is pushed into MSB & LSB is pushed into the carry flag

Answer: a

Explanation: In RCL(Rotate right through carry), for each operation, the carry flag is pushed into LSB and the MSB of the operand is pushed into carry flag.

58. The instruction that is used as prefix to an instruction to execute it repeatedly until the CX register becomes zero is

a) SCAS

b) REP

c) CMPS

d) STOS

Answer: b

Explanation: The instruction to which the REP is prefix, is executed repeatedly until CX register becomes zero. When CX becomes zero, the execution proceeds to the next instruction in sequence.

59. Match the following

A) MOvSB/SW       1) loads AL/AX register by content of a string

B) CMPS           2) moves a string of bytes stored in source to destination

C) SCAS           3) compares two strings of bytes or words whose length is stored in CX register

D) LODS           4) scans a string of bytes or words

a) A-3,B-4,C-2,D-1

b) A-2,B-1,C-4,D-3

c) A-2,B-3,C-1,D-4

d) A-2,B-3,C-4,D-1

Answer: d

Explanation: By using the string instructions, the operations on strings can be performed.

 

60. The instructions that are used to call a subroutine from the main program and return to the main program after execution of called function are

a) CALL, JMP

b) JMP, IRET

c) CALL, RET

d) JMP, RET

Answer: c

Explanation: At each CALL instruction, the IP and CS of the next instruction are pushed onto the stack, before the control is transferred to the procedure. At the end of the procedure, the RET instruction must be executed to retrieve the stored contents of IP & CS registers from a stack.

 

61. The instruction that unconditionally transfers the control of execution to the specified address is

a) CALL

b) JMP

c) RET

d) IRET

Answer: b

Explanation: In this the control transfers to the address specified in the instruction and flags are not affected by this instruction.

 

62. Which instruction cannot force the 8086 processor out of ‘halt’ state?

a) Interrupt request

b) Reset

c) Both interrupt request and reset

d) Hold

Answer: d

Explanation: Only an interrupt request or Reset will force the 8086 processor to come out of the ‘halt’ state.

 

63. NOP instruction introduces

a) Address

b) Delay

c) Memory location

d) None of the mentioned

Answer: b

Explanation: NOP is the No operation. It means that the processor performs no operation for the clock cycle and thus there exists a delay.

 

64. Which of the following is not a machine controlled instruction?

a) HLT

b) CLC

c) LOCK

d) ESC

Answer: b

Explanation: Since CLC is a flag manipulation instruction where CLC stands for Clear Carry Flag.

This set of Microprocessor Multiple Choice Questions & Answers (MCQs) focuses on “Assembler Directives and Operators”.

 

65. The assembler directives which are the hints using some predefined alphabetical strings are given to

a) processor

b) memory

c) assembler

d) processor & assembler

Answer: c

Explanation: These directives help the assembler to correctly understand the assembly language programs to prepare the codes.

 

66. The directive used to inform the assembler, the names of the logical segments to be assumed for different segments used in the program is

a) ASSUME

b) SEGMENT

c) SHORT

d) DB

Answer: a

Explanation: In ALP, each segment is given a name by using the directive ASSUME

SYNTAX: ASSUME segment:segment_name

Eg: ASSUME CS:Code

here CS is the Code segment and code is the name assumed to the segment.

 

67. Match the following

a) DB          1) used to direct the assembler to reserve only 10-bytes

b) DT          2) used to direct the assembler to reserve only 4 words

c) DW          3) used to direct the assembler to reserve byte or bytes

d) DQ          4) used to direct the assembler to reserve words

a) a-3, b-2, c-4, d-1

b) a-2, b-3, c-1, d-4

c) a-3, b-1, c-2, d-4

d) a-3, b-1, c-4, d-2

Answer: d

Explanation: These directives are used for allocating memory locations in the available memory.

 

68. The directive that marks the end of an assembly language program is

a) ENDS

b) END

c) ENDS & END

d) None of the mentioned

Answer: b

Explanation: The directive END is used to denote the completion of the program.

 

69. The directive that marks the end of a logical segment is

a) ENDS

b) END

c) ENDS & END

d) None of the mentioned

Answer: a

Explanation: The directive ENDS is used to end a segment where as the directive END is used to end the program.

 

70. The directive that updates the location counter to the next even address while executing a series of instructions is

a) EVN

b) EVEN

c) EVNE

d) EQU

Answer: b

Explanation: The directive updates location counter to next even address if the current location counter contents are not even.

 

71. The directive that directs the assembler to start the memory allotment for a particular segment/block/code from the declared address is

a) OFFSET

b) LABEL

c) ORG

d) GROUP

Answer: c

Explanation: If an ORG is written then the assembler initiates the location counter to keep the track of allotted address for the module as mentioned in the directive.

If the directive is not present, then the location counter is initialized to 0000H.

 

72. The directive that marks the starting of the logical segment is

a) SEG

b) SEGMENT

c) SEG & SEGMENT

d) PROC

Answer: b

Explanation: The directive SEGMENT indicates the beginning of the segment.

 

73. The recurrence of the numerical values or constants in a program code is reduced by

a) ASSUME

b) LOCAL

c) LABEL

d) EQU

Answer: d

Explanation: In this, the recurring/repeating value is assigned with a label. The label is placed instead of the numerical value in the entire program code.

 

74. The labels or constants that can be used by any module in the program is possible when they are declared as

a) PUBLIC

b) LOCAL

c) GLOBAL

d) Either PUBLIC or GLOBAL

Answer: c

Explanation: The labels, constants, variables, procedures declared as GLOBAL can be used by any module in the program.

 

75. If a number of instructions are repeating through the main program, then to reduce the length of the program, __________ is used.

a) procedure

b) subroutine

c) macro

d) none of the mentioned

Answer: c

Explanation: For a certain number of instructions that are repeated in the main program, when macro is defined then the code of a program is reduced by placing the name of the macro at which the set of instructions are needed to be repeated.

 

76. The process of assigning a label or macroname to the string is called

a) initialising macro

b) initialising string macro

c) defining a string macro

d) defining a macro

Answer: d

Explanation: The process of assigning a label to the string is called defining a macro.

 

77. A macro within a macro is called

a) macro-within-macro

b) nested macro

c) macro-in-macro

d) none of the mentioned

Answer: b

Explanation: A macro may be called from inside a macro. This type of macro is called nested macro.

 

78. A macro can be defined as

a) beginning of a program

b) end of a program

c) after initialisation of program

d) anywhere in a program

Answer: d

Explanation: A macro can be defined anywhere in a program.

 

79. A macro can be used as ________

a) in data segment

b) to represent directives

c) to represent statements

d) all of the mentioned

Answer: d

Explanation: A macro may be used in data segment and can also be used to represent statements and directives.

 

80. The end of a macro can be represented by the directive.

a) END

b) ENDS

c) ENDM

d) ENDD

Answer: c

Explanation: The ENDM directive marks the end of the instructions or statements sequence assigned with the macro name.

 

81. Inserting the statements and instructions represented by macro, directly at the place of the macroname, in the program, is known as

a) calling a macro

b) inserting a macro

c) initializing a macro

d) none of the mentioned

Answer: a

Explanation: Inserting the statements and instructions at the place of macroname, in the program, is known as calling a macro.

 

82. The time required for execution of a macro is ________ that of the procedure.

a) greater than

b) less than

c) equal to

d) none of the mentioned

Answer: b

Explanation: The time required for execution of a macro is less than that of procedure as it does not contain CALL and RET instructions as the procedures do.

 

83. Which of the following statements is incorrect?

a) complete code of instruction string is inserted at each place, wherever the macroname appears

b) macro requires less time of execution than that of procedure

c) macro uses stack memory

d) macroname can be anything except registers and mnemonics

Answer: c

Explanation: Macro does not require stack memory and hence has less time for execution.

 

84. The beginning of the macro can be represented as

a) START

b) BEGIN

c) MACRO

d) None of the mentioned

Answer: c

Explanation: The beginning of the macro is represented as macroname followed by the directive MACRO.

SYNTAX: macroname MACRO

EXAMPLE: STRINGS MACRO.


 

Post a Comment

0 Comments