CH-3 Instruction Sets and Data Formats ESE Microprocessor EE
CH-3 Instruction Sets and Data Formats ESE Microprocessor EE
(b) complement of accumulator content (d) Moves the contents of HL pair to C register
(c) multiplication of accumulator content by 9 Sol. (b)
(d) rotation of accumulator content three times MOV instruction work like MOV D, S
Sol. (a) D Destination
Since in program instruction RAL is used three S Source
times so content of accumulator is rotated left three So content of source is copied in destination and
times. content of S remains unchanged.
Hence, the correct option is (a).
MOV H, C content of C is copied to H.
Hence, the correct option is (b).
4. Consider the execution of the following
instructions by a 8085 microprocessor :
6. For 8085 microprocessor, the instruction RST6
[ESE-2002]
restarts subroutine at address [ESE-2002]
LXIH, 01FFH
(a) 00H (b) 03H
SHLD 2050H
(c) 30H (d) 33H
After execution the contents of memory locations
Sol. (c)
2050H and 2051H and the registers H and L, will
be To find the address of any RST like RST 6
multiply 6 by 8 then convert it into Hexadecimal as
(a) 2050H FF; 2051H 01; H FF; L
01 6 8 = (48)10 = (30)H.
Hence, the correct option is (c).
(b) 2050H 01; 2051H FF; H FF; L
01
(c) 2050H FF; 2051H 01; H 01; L 7. Examine the following instruction to be executed
FF by a 8085 microprocessor. The input port has an
address of 01H and has a data 05H to input: IN
(d) 2050H FF; 2051H 01; H 00; L
01H ANI 80H After execution of the two
00
instructions the following flag portions may occur :
Sol. (c)
1. Zero flag is set
LXIH, 01FFH H 01 & L FF
2. Zero flag is reset
SHLD 2050H 2050H FF
3. Carry flag is cleared
2051H 01 4. Auxiliary carry flag is set
Hence, the correct option is (c). Select the correct answer using the codes given
below: [ESE-2003]
5. Which one of the following functions is performed (a) 1 and 3 (b) 2, 3 and 4
by the 8085 instruction MOV H, C? [ESE-2002] (c) 1, 3 and 4 (d) 1, 2 and 4
(a) Moves the contents of H register to C Sol. (c)
register
In AND operation CY = 0 and AC = 1 By default
(b) Moves the contents of C register to H
register
(c) Moves the contents of C register to HL pair
D7 D6 D5 D4 D3 D2 D1 D0 SO 37H
+ 56H
1 0 × 1 × 0 × 1 Hence, the correct option is (a).
List-II A B C D
1. Direct addressing (a) 4 1 2 3
2. Register addressing (b) 4 2 1 3
3. Implicit addressing (c) 3 2 1 4
4. Register indirect addressing (d) 3 1 2 4
5. Immediate addressing Sol. (b)
Codes : RAL implicit addressing
A B C D MOV A, M Register indirect, address of
(a) 5 4 1 3 memory location is taken from HL pair.
(b) 4 5 3 1 JMP 3FAOH immediate addressing since
(c) 5 4 2 3 immediate data 3FAO is copied to program
counter.
(d) 4 5 1 3
Sol. (d) LDA 03FCH direct addressing since address of
memory location is directly specified as 03FC in
MOVA, M Content at memory location M
the instruction.
whose address is stored in HL pair (by default) is
Hence, the correct option is (b).
copied to A.
So this is register indirect addressing.
13. Match List-I (Instruction) with List-II (Operation)
LXIH, E400H the data E400 is copied to HL pair
for Intel 8085 and select the correct answer using
directly so this is immediate addressing.
the codes given below : [ESE-2004]
LDA F1CDH the content at location F1CD are
List-I
copied to accumulator so it is a direct addressing
(address is directly given). A. PCHL
List-II Codes :
A B C D
Codes : (a) 3 4 1 2
17. Consider the program given below, which transfer Whole part is executed 10 times and at 11th times
a block of data from one place in memory to JNZ required 7 T states but 3 memory access since
another: condition becomes false.
MVI C, OB H So total memory access
LXI H, 2400H T = 2 + 3 + 3 + 10 [2 + 2 + 1 + 1 + 1 + 3]
LXI D, 3400H + (2 + 2 + 1 + 1 + 1 + 3)
L1: MOV A, M T = 118
STAX D Hence, the correct option is (a).
INR L
INR E 18. Consider the following 8085 instructions:
DCR C ANA A, ORA A, XRA A, SUB A, CMP A
JNZ L1 Now, consider the following statements:
What is the total number of memory accesses 1. All are arithmetic and logic instructions
(including instruction fetches) carried out? 2. All cause the accumulator to be cleared
[ESE-2005] irrespective of its original contents
(a) 118 (b) 140 3. All reset the carry flag
(c) 98 (d) 108 4. All of them are 1-byte instructions
Sol. (a) Which of these statements is/are correct?
MVI C, OBH 2 byte instruction = 2 memory [ESE-2005]
accesses (a) 1, 2, 3 and 4 (b) 2 only
LXI H, 2400H 3 byte instruction = 3 memory (c) 1, 2 and 4 (d) 1, 3 and 4
accesses. Sol. (d)
LXI D, 3400H 3 byte instruction = 3 memory ANA A
accesses
ORA A
L1 : MOV A, M 1 byte instruction = 2 memory
XRA A logical instructions, 1 byte instruction
access (two read)
STAX, D 1 byte instruction = 2 memory access
(1 read + 1 write) Arithmetic instructions, 1 byte instruction
INR L 1 byte instruction = 1 memory access as A – A = (00)H so borrow required at most
INR E 1 byte instruction = 1memory access significant bit
DCR C 1 byte instruction = 1 memory access ( A = A) so CY = 0
JNZ L1 1 byte instruction = 3 SUB A Cleared the content of A
memory access if condition is true/false. but CMP A Content of A remains same as
So from L1 to JNZ till condition is satisfied i.e. till previous to this instruction.
content of C does not zero i.e. till content of C Hence, the correct option is (d).
become 1 i.e. 10 times (as C = OB initially after 10
times decrement it becomes = 1).
1000LXISP, 27FF SP = 27FF (d) Contents of H and L registers are CCH and
BBH, respectively
1003 CALL, 1006
Sol. (d)
11006POPH
LXI H, 2001H : H 20
H 10
LHL D, 2001H : L 01
L 06
L [2001]
HL 1006
L = BBH
So this loop continues till ORA C result in zero i.e. = 28I/O devices
zero flag set so this will happen when content of C = 256I/O devices
become zero. Since initial content of C is (16) 10 so Hence, the correct option is (d).
after 16 times execution of DCX it will become
zero so loop will be executed 16 times.
26. Which one of the following instructions is a 3-byte
Hence, the correct option is (c).
instruction? [ESE-2006]
(a) MVI A (b) LDAXB
24. In 8085, the DAA instruction is used for
(c) JMP 2050 (d) MOV A, M
[ESE-2006]
Sol. (c)
(a) Direct Address Accumulator
JMP 2050 is 3 byte instruction
(b) Double Add Accumulator
1 byte for opcode JMP
(c) Decimal Adjust Accumulator
1 byte for lower address 50
(d) Direct Access Accumulator
1 byte for upper address 20
Sol. (c)
Hence, the correct option is (c).
Sol. (c)
30. Assertion (A) : A subroutine is a program written
91H 91H = 00, by default CY = 0, AC = 0
separately from the main program to perform a
Result zero so zero flag set.
function that occurs repeatedly in the main
program.
Hence, the correct option is (c). Reason (R) : A subroutine can be called by a CALL
instruction. [ESE-2007]
29. Read the following Assembly Language Program (a) Both A and R are true and R is the correct
Segment of 8085 Micro-processor: [ESE-2007] explanation of A
LXI H, 2501 H
(b) Both A and R are true but R is not the correct Hence, the correct option is (a).
explanation of A
(c) A is true but R is false 33. Match List-I (Feature of instruction) with List-II
(d) A is false but R is true (Instruction) and select the correct answer using the
Sol. (b) code given below the lists: [ESE-2008]
Both are correct but R is not explanation of A i.e. List-I List-II
subroutine are written outside the main program A. Maskable 1. RST 5.5
because they required in the program many times interrupt
so if we do not make a subroutine then we have to
B. Signal 2. XTHL
write same instructions again and again and our
C. Instruction 3. SID
program will become lengthy.
D. Memory location 4. RST 6.5 002CH
Hence, the correct option is (b).
Codes :
A B C D
31. The content of the Program Counter of an intel
8085 A microprocessor specifies which one of the (a) 4 1 2 3
following? [ESE-2008] (b) 2 3 4 1
(a) The address of the instruction being executed (c) 4 3 2 1
(b) The address of the instruction executed (d) 2 1 4 3
earlier Sol. (c)
(c) The address of the next instruction to be RST 6.5 and RST 5.5 both are Maskable interrupt.
executed address location of RST 5.5
(d) The number of instructions executed so far = (8 5.5)10 = (44)10 = (2C)16
Sol. (c) XTHL is a instruction which exchanges top of
PC points the location of next instruction to be stack with HL pair.
executed. SID is signal used for serial input data.
Hence, the correct option is (c). Hence, the correct option is (c).
32. In an Intel 8085 A, what is the content of the 34. The stack pointer of an 8085 A microprocessor
Instruction Register (IR)? [ESE-2008] contains ABCDH.
(a) Op-code for the instruction being executed PUSH PSW
(b) Operand for the instruction being executed XTHL
(c) Op-code for the instruction to be executed PUSH D
next
JMP EC75H
(d) Operand for the instruction to be executed
At the end of the execution of the above
next
instructions, what would be the content of the stack
Sol. (a) pointer?
IR contains the opcode for the instruction being [ESE-2008]
executed while PC contains address of next
(a) ABCBH (b) ABCAH
instruction to be executed.
JMP EC75H it has no effect on SP INR and DCR instructions do not effect carry flag
other flags are affected while almost all other
So content of SP = (ABC9)H.
logical and arithmetical operations affect all the
Hence, the correct option is (c). flags.
Hence, the correct option is (c).
35. If the HLT instruction of an Intel 8085 A
microprocessor is executed [ESE-2008]
38. The addressing mode used in the instruction JMP
(a) the microprocessor is disconnected from the F347 H in case of an Intel 8085 A microprocessor
system bus till the RESET is pressed. is which one of the following? [ESE-2008]
(b) the microprocessor halts the execution of the (a) Direct (b) Register-indirect
program and returns to the monitor.
(c) Implicit (d) Immediate
(c) the microprocessor enters into a HALT state
Sol. (d)
and the buses are tri-stated.
JMP F347 H this is a immediate addressing as the
(d) the microprocessor reloads the program
immediate data F347H is copied to program
counter from the locations 0024H and
counter.
0025H.
Hence, the correct option is (d).
Sol. (c)
On execution of HLT microprocessor finishes
executing current instructions and halts any further 39. Which one is the indirect addressing mode in the
execution and address and data buses are place in following instructions? [ESE-2008]
high impedance state (i.e. tri state). (a) LXIH2050H (b) MOV A, B
Hence, the correct option is (c). (c) LDAXB (d) LDA 2050H
HLT INR A
when we go inside the loop 1st time What are the contents of A and PSW registers after
ADDB A = 30H = (00110000)2, CY = 0 executing the above set of instructions in sequence?
48. For which one of the following, the instruction 50. The opcode for the instruction "Add Immediately
XRA A in 8085 microprocessor can be used?[ESE- to Accumulator with carry" in 8085 microprocessor
2009] is
(a) Set the carry flag [ESE-2010]
(b) Set the zero flag (a) ADI (b) ACI
(c) Reset the carry flag and clear the (c) ADC (d) ADD
accumulator
Sol. ()
(d) Transfer FFH to the accumulator
Hence, the correct option is ().
Sol. (c)
AA=0 51. The content of the programme counter of an 8085
It will clear the accumulator content and CY and microprocessor is [ESE-2010]
AC are reset. (a) the total number of instructions in the
Hence, the correct option is (c). program already executed.
(b) the total number of times a subroutine is
49. MVI A, AAH called.
ORI FFH (c) the memory address of the instruction that is
being currently executed.
RRC
(d) the memory address of the instruction that is
RRC
to be executed next.
CMC
(c) Initialized automatically by microprocessor Reason (R) : PUSH and POP instructions are used
(d) Used to point to stack memory area to send or retrieve the data from the STACK.
Sol. (c) (a) Both A and R are true and R is the correct
explanation of A
Program counter points the next memory address to
be fetched and initialized automatically by (b) Both A and R are true but R is not the correct
microprocessor and is 16-bit register. explanation of A
Hence, the correct option is (c). (c) A is true but R is false
(d) A is false but R is true
56. While a program is being executed in an Intel 8085 Sol. (b)
microprocessor, the program counter of the Stack is used to temporarily store the data. PUSH
microprocessor contains: [ESE-2011] and POP instructions are used to send or retrieve
(a) The memory address of the instruction that is the data from stack. So A & R, both are correct but
being currently executed. R is not the reason for A.
(b) The memory address of the instruction that is Hence, the correct option is (b).
to be executed next.
(c) The number of instructions that have already 59. The instruction that exchanges top of stack with
been executed. HL, pair is
(d) The total number of instructions in the [ESE-2012]
current program still to be executed. (a) XTHL (b) SPHL
Sol. (b) (c) PUSHH (d) POSH
PC contains address of next instruction that is to be Sol. (a)
executed. The instruction XTHL exchange H and L with top
Hence, the correct option is (b). of stack. The contents of the L are exchanged with
the stack location pointed out by the contents of the
stack pointer register are exchanged with the next
57. In 8085 microprocessor, during PUSH/PSW
stack location (SP + 1); however, the contents of
operation, stack pointer is [ESE-2011]
the stack pointer register are not altered.
(a) Decremented by one
Hence, the correct option is (a).
(b) Decremented by two
(c) Incremented by one
60. The following instruction copies a byte of data
(d) Incremented by two
from the accumulator into the memory address
Sol. (b) given in the instruction [ESE-2012]
PUSH PSW, during PUSH SP is always (a) STA address (b) LDAX B
decremented by two.
(c) LHLD address (d) LDA address
Hence, the correct option is (b).
Sol. (a)
STA : (store accumulator direct) in this instruction
58. Assertion (A) : STACK is used to temporarily store the contents of the accumulator are copied to a
the data in a RAM locations specified by the memory location specified by the operand.
programmer in main program. [ESE-2011]
Hence, the correct option is (a).
Sol. (d) 68. Find the content of the accumulator after the
RLC rotate left without carry execution of the following program: [ESE-2013]
MVI A, FOH
ORI FFH
XRI FOH
(a) 00H (b) F0H
(c) 0FH (d) FFH
As per RLC instruction only 'CY' is affected and Sol. (c)
remaining unchanged.
Hence, the correct option is (d).
71. Statement (I): Program counter is a register that (c) Indirect addressing
contains the address of the next instruction to be (d) Immediate addressing
executed. Sol. (c)
Statement (II): IR (Instruction Register) is not CMP M (compare memory with accumulator) The
accessible to programmer. [ESE-2013] addressing mode is 'register indirect'.
(a) Both Statement (I) and Statement (II) are Hence, the correct option is (c).
individually true and Statement (II) is the
correct explanation of Statement (I).
74. Which of the following 8085 instruction will
(b) Both Statement (I) and Statement (II) are require maximum T-states for execution? [ESE-
individually true but Statement (II) is not the 2014]
correct explanation of Statement (I).
(a) XRI byte (b) STA address
(c) Statement (I) is true but Statement (II) is
(c) CALL address (d) JMP address
false.
Sol. (c)
(d) Statement (I) is false but Statement (II) is
true. CALL address
(a) RET (b) PCHL 78. Which of the following data transfer is not possible
(c) POP PSW (d) DAD SP in microprocessor? [ESE-2014]
Sol. (a) (a) Memory to accumulator
POP (pop the content of register pair, which was (b) Accumulator to memory
saved, from the stack). (c) Memory to memory
The content of the register pair, which was (d) I/O device to accumulator
saved earlier is moved from the stack to the Sol. (c)
register pair. In a microprocessor system or in a computer data
RET instruction is used at the end of a subroutine. transfer takes place between two devices such as
Before the execution of a subroutine the address of microprocessor and memory, micro processor and
the next instruction of the main program is saved I/O devices, and memory and I/O device. But
address from the stack to the program counter. The where as data transfer between memory to memory
content of the stack pointer is incremented by 2 to is not possible in microprocessor.
indicate the new stack top. Then the program jumps Hence, the correct option is (c).
to the instruction of the main program next to
CALL instruction which called the subroutine.
79. Statement (I) : Branch instructions in a
Hence, the correct option is (a).
microprocessor are used to change the sequence of
program.
77. LOADER is a program that [ESE-2014] Statement (II) : All logical instructions are branch
(a) loads the memories and generates a hex file instructions. [ESE-2014]
(b) loads the hex file and coverts to the Codes :
executable file (a) Both Statement (I) and Statement (II) are
(c) loads the COM file and generates the binary individually true and Statement (II) is the
code correct explanation of Statement (I).
(d) loads english like command and generates (b) Both Statement (I) and Statement (II) are
the binary code individually true but Statement (II) is not the
Sol. (b) correct explanation of Statement (I).
A LOADER is a program which loads object code (c) Statement (I) is true but Statement (II) is
into system memory. It can accept programs in false.
absolute or re-locatable format. If the actual (d) Statement (I) is false but Statement (II) is
address of instructions and data are given by the true.
programmer, i.e. the program is in the absolute Sol. ()
format, the loader simply loads the program into
Hence, the correct option is ().
memory. If programs are in relocatable format the
specific memory addresses are assigned by the
locator before the loader loads the program in to 80. When a program is being executed in an 8085
memory. microprocessor, its program counter contains
Hence, the correct option is (b). [ESE-2015]
(a) the memory address as the instruction that is
to be executed next.
87. Among the given instructions, the one which (a) 1 and 2 only (b) 1, 2, 3 and 4
affects maximum number of flags is (c) 5 only (d) 1 only
[ESE-2015]
Sol. (d)
(a) RAL (b) POP PSW
INTR is non-vectored so no specific location.
(c) XRA A (d) DCR A
Hence, the correct option is (d).
Sol. (c)
RAL : affects only carry flag
90. The instruction JNC 16-bit refers to jump to 16 -bit
POP PSW : affects no flag address if [ESE-2016]
XRA A : affects all flag (a) Sign flag is set (b) CY flag is reset
DCR A : affects all except carry flag (c) Zero flag is set (d) Parity flag is reset
Hence, the correct option is (c). Sol. (b)
JNC 16 bit address
88. Consider the following statements: Jump if no carry / if CY = 0 i.e., reset.
1. Auxiliary carry flag is used only by the DAA Hence, the correct option is (b).
and DAS instruction.
2. Zero flag is set to 1 if the two operands
91. Which one of the following statements is correct
compared are equal.
regarding the instruction CMP A? [ESE-2016]
3. All conditional jumps are long type jumps.
(a) Compare accumulator with register A
Which of the above statements are correct?
(b) Compare accumulator with memory
[ESE-2016]
(c) Compare accumulator with register H
(a) 1, 2 and 3 (b) 1 and 2 only
(d) This instruction does not exist
(c) 1 and 3 only (d) 2 and 3 only
Sol. (a)
Sol. (b)
CMP A Compare accumulator with itself i.e.,
AC Auxiliary carry flags status is used only in register 'A'.
DAA {DAS}
Hence, the correct option is (a).
Decimal adjust after additions {subtraction}
All conditional jumps are short jumps z = 1 if data
92. The instruction RET executes with the following
is same when compared.
series of machine cycle [ESE-2016]
Hence, the correct option is (b).
(a) Fetch, read, write
(b) Fetch, write, write
89. Consider the following interrupts for 8085
(c) Fetch, read, read
microprocessor:
(d) Fetch, read
1. INTR 2. RST 5.5
Sol. (c)
3. RST 6.5 4. RST 7.5
RET Unconditional returns
5. TRAP
1 B instruction, 3 machine cycles (Fetch, Read,
If the interrupt is to be vectored to any memory
Read), 10 T-states.
location then which of the above interrupt is/are
correct? [ESE-2016] Read operations are from state memory.
P=1 [ESE-2021]
94. Which of the following instructions of 8085 are the (c) Instruction register
examples of implied addressing? [ESE-2019] (d) Input/output register
1. CMA Sol. (b)
2. IN byte Accumulator contains one of the operand in
3. RET most of the ALU operations and result is also
stored in accumulator.
(a) 1, 2 and 3 (b) 1 and 2 only
Program Counter (PC) is a register in the
(c) 2 and 3 only (d) 1 and 3 only
processor which has the address of the next
Sol. (d)
instruction to be executed from memory.
CMA : Implicit/Implied as the instruction does not
It is a digital counter needed for faster
have any operands and address of operand is in
execution of tasks as well as for tracking the
mnemonics itself.
current execution point.
RET: Indirect//mplied
Instruction Register (IR) is a special purpose
Hence, the correct option is (d). register, which is used to receive the 8 -bit
opcode portion of an instruction. It is not
95. Which one of the following is the correct sequence accessible to the programmer.
of steps for executing an instruction during CPU's Hence, the correct option is (b).
processing? [ESE-2020]
97. Which one of the following addressing mode leads 99. Which one of the following is NOT a general
to poor programming practice? [ESE-2021] operation of machine cycle in a central processing
(a) Direct addressing mode unit? [ESE-2021]
(b) Indirect addressing mode (a) Fetch (b) Decode
(c) Immediate addressing mode (c) Return (d) Store
(d) Implied addressing mode Sol. (c)
Sol. () Basic operations are Fetch, Read and Write/ Store.
return is an instruction used in a subroutine in order
Hence, the correct option is ().
to return to the main program.
Hence, the correct option is (c).
98. Which one of the following is not correct for the
AAA instruction in 8086 microprocessors?
[ESE-2021]
(a) It works only on the AL register.
(b) It updates AF and CF.
(c) It checks the result for correct unpacked
BCD.
(d) It updates all the flags.
Sol. (b)
ASCII adjust (accumulator) after addition is used to
convert result of addition of two unpacked BCD
digits to a valued two digit BCD number.
AL of AX is default register to hold operand.
Actually it adds 6 internally and converters the
result two valid BCD.
E is not BCD (0 to 9)
So add 6
6 = (20)10
(20)10 = (14)16
It affect carry flag and auxiliary carry flag. Hence it
checks AF and CF.
Hence, the correct option is (b).