Microprocessor 8085 - Two Mark Questions
Microprocessor 8085 - Two Mark Questions
Microprocessor 8085 - Two Mark Questions
{
{
a ?
?
???
?? ?
?
??
?
???
?
8085 has Von Neumann architecture. It was derived after the name of mathematician
John Von Neumann. It.s having 16 address bus and 8 bit data bus.it can access 2^16 individual
memory location.
?
? ?? ?
?
?!??!??
??"??
?
2^14=16384
????
?
?
?
?
This register is used to store 8-bit data and to perform arithmetic and logical operations.
The result of an operation is stored in the accumulator.
%???
&'?! ?
?
The ALU includes five flip-flops, which are set or reset after an operation according to
data conditions of the result in the accumulator and other registers. They are called Zero(Z),
Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags.
Typical system uses a number of busses, collection of wires, which transmit binary
numbers, one bit per wire. A typical microprocessor communicates with memory and other
devices (input and output) using three busses: Address Bus, Data Bus and Control Bus.
(?) ?
c
The Address Bus consists of 16 wires, therefore Its "width" is 16 bits. A 16 bit Address
bus can identify 2^16=65536 memory locations i.e. 0000000000000000 up to
1111111111111111. Because memory consists of boxes, each with a unique address, the size of
the address bus determines the size of memory, which can be used. To communicate with
memory the microprocessor sends an address on the address bus, eg 0000000000000011 (3 in
decimal), to the memory. The memory the selects box number 3 for reading or writing data.
Address bus is unidirectional, ie numbers only sent from microprocessor to memory, not other
way.
{?) ?
Data Bus: carries .8-bit data., in binary form, between ìP and other external units, such as
memory. The Data Bus typically consists of 8 wires. Data bus used to transmit "data", i.e.
information, results of arithmetic, etc, between memory and ìP. Bus is bi-directional. Size of the
data bus determines what arithmetic can be done. If only 8 bits wide then largest number is
11111111 (255 in decimal). Data Bus also carries instructions from memory to the
microprocessor. Size of the bus therefore limits the number of possible instructions to 256, each
specified by a separate number.
* ?) ?
It is a group of various single lines used to provide control and synchronization signals. ìP
generates different control signals for different operations. These signals are used to identify the
device with which the ìP wants to communicate.
In microcomputer system the peripherals are connected in parallel between address bus and data
bus. Because of tri stated interfacing devices, peripherals do not load the system buses. Processor
communicates with one peripheral or device at a time by enabling the tri state line of the
interfacing peripheral or device. Tri state logic is critical to proper functioning of the
microcomputer.
?
??? &?
??
? ?%$!?&?
?
Because SP points to the beginning of stack memory (LXI SP 8000H) which is 16-bits.
c
Also PC points to the memory locations (16-bits) of the instructions to be excecuted to maintain
the proper sequence of execution of program.
A????
????
'?-'?? ? +?
-'?? ? +?
1/? &'?? ? ? +?
'?? ? #? ?
Rd = Destination register, Rs = Source register, M =Memory location pointed out by HL register
pair, reg =Regiser, data = 8-bit data.
????
?
?-/'?2/'?/3?
?
-?/ ??-/.?
RIM is a multipurpose instruction used to read the status of interrupts 7.5, 6.5, 5.5 and to read
serial input data bit. RIM loads 8-bit data in the accumulator with the following interpretation:
c
Actually RIM does the following three tasks:
ù? Read the interrupt mask (bit 2, 1, 0).
ù? Identify pending interrupts (bit 6, 5, 4).
ù? Receive serial input data bit (bit 7).
2?/ ?.?
SIM is a multipurpose interrupt used to implement the 8085 interrupts (RST 7.5, 6.5, 5.5) and
serial data output. SIM interprets the accumulator content as follows:
* Reset RST 7.5 (bit 4). This is mainly used to overwrite RST 7.5 without serving it.
* To implement serial I/O (bit 7, 6). If bit 6 = 1 is used to enable serial I/O and bit 7 is used to
transmit serial output data bit.
The contents of the input port designated in the operand are read and loaded into the
accumulator. The operand is an 8-bit address. During execution, this port address is duplicated in
the lower order and higher order address buses. Any one of the sets of address lines can be
decoded to enable the input port.
????
?
&???
?
The 8085 has 5 flags represented by 5 bits of the flag register which are set or reset after
an operation according to data conditions of the result (of that operation) stored in the
accumulator and other registers.
?????????????????????????????? ?
They are:-
c
Sign flag (S):- For D7=1 or 0, S=set (result is unsigned) or reset (result is signed).
Zero flag (Z):- For the result containing 00H, Z=set, for non zero result Z=reset.
Auxiliary carry flag (Ac):- For any result generating a carry / borrow in the D3 bit position and
passing it to D4 bit position, Ac=set. Else it is reset.
Parity flag (P):- For a result containg even number of 1s there is even parity and odd number of
1s there is odd parity.
Carry flag (Cy):- For the result generating any carry Cy is set else reset.
#??? &?{(?
?
?
To make a fast data transfer, the MPU releases the control of its buses to DMA. DMA
acts as an external device and the active high input signal HOLD goes HIGH when the DMA is
requesting to the MPU to use its buses. After receiving the HOLD request from DMA, the MPU
releases the buses in the following machine cycle and generates an active high output signal
HLDA indicating the release of buses. Once the DMA gains that control, it acts in the role of the
MPU for data transfer.
"???42?
?
PSW (Program Status Word) represents the contents of the accumulator and the flag
register together considering the accumulator as the high order and flag as the low order register
as if it is the AF register pair. For example POP PSW.
c
%?
???!?
,??? ?,
? ? ?
?*48?
Interrupt Request (INTR, pin 10, it is an input signal to ìP). It goes high when the
external devices want to communicate.
Yes, it can be used, if an accurate clock frequency is not required. Also, the component
cost is low compared to LC or Crystal.
The Quality factor is also defined, as Q. So it is a number, which reflects the lossness of a
circuit. Higher the Q, the lower are the losses.
c
decoding logic.? is less and sometimes it can be eliminated.?
3. Higher cost for decoding circuit.? 3. Less cost for decoding circuit.?
4. No Multiple addresses.? 4. It has a advantage of multiple addresses.?
5. Used in large systems? 5. Used in small systems?
#?????
?&?&?
?
The timing diagram provides information regarding the status of various signals, when a
machine cycle is executed. The knowledge of timing diagram is essential for system designer to
select matched peripheral devices like memories, latches, ports etc from a microprocessor
system.
+?(,&?
?
??
?
?
1. Communication at high data rate in real world environment.
2. Differential data transmission offers superior performance.
3. Differential signals can help induced noise signals.
?????
? ?
?
?
RLC ± Rotate Accumulator Left
RRC- Rotate Accumulator Right
RAL ± Rotate Accumulator Left through Carry
RAR - Rotate Accumulator Right through Carry
c
?
1. Bit set/Reset mode
2. I/O modes
a)mode 0 : Simple input/output
b)mode 1 : Input/output with handshake
c)mode 2 : Bi-directional I/O data transfer
#?5?
?
?
?
$!?
It is used:
i. For measurements, display and control of current, voltage, temperature, pressure, etc.
ii. For traffic control and industrial tool control.
iii. For speed control of machines.
#????
?
??
? The accumulator is the register associated with the ALU operations and sometimes I/O
operations. It is an integral part of ALU. It holds one of data to be processed by ALU. It also
temporarily stores the result of the operation performed by the ALU.
c
All the signals of 8085 can be classified into 6 groups
O? Address bus
O? Data bus
O? Control and status signals
O? Power supply and frequency signals
O? Externally initiated signals
O? Serial I/O ports
* Store data temporarily during execution in the defined R/W memory locations called
the stack
#?2?, ,? ?
??!???
#A?{
?
?
'?
?
??$
c
The ALE is used to latch the lower order address so that it can be available in T2 and T3
and used for identifying the memory address. During T1 the ALE goes high, the latch is
transparent ie, the output changes according to the input data, so the output of the latch is the
lower order address. When ALE goes low the lower order address is latched until the next ALE.
O? Opcode fetch
O? Memory read
O? Memory write
O? I/O read
O? I/O write
O? Interrupt acknowledge
O? Bus idle
HOLD indicates that a peripheral such as DMA controller is requesting the use of address
bus, data bus and control bus. READY is used to delay the microprocessor read or write cycles
until a slow responding peripheral is ready to send or accept data.SID is used to accept serial data
bit by bit
The instructions of 8085 can be categorized into the following five categories
LDA copies the data byte into accumulator from the memory location specified by the
16-bit address. STA copies the data byte from the accumulator in the memory location specified
by 16-bit address. DAA changes the contents of the accumulator from binary to 4-bit BCD
digits.
"%?67??
?
?
??7
c
O? Two byte instruction -MVI A,39H
O? Three byte instruction -JMP 2345H
?
The various formats of specifying the operands are called addressing modes, it is used to
access the operands or data. The different types are as follows
O? Immediate addressing
O? Register addressing
O? Direct addressing
O? Indirect addressing
O? Implicit addressing
It is used to increase the driving capacity of the data bus. The data bus of a
microcomputer system is bi-directional, so it requires a buffer that allows the data to flow in both
directions.
?
?
-&
?
>?
-&
) -&
* -&
{? -&
6 -&
? -&
5 -&
2
?4 %
4 &?
%
*
?{
?
??7?
??
The stack is a group of memory locations in the R/W memory that is used for the
temporary storage of binary information during the execution of the program. The stack related
instructions are PUSH & POP
c
The XRA A instruction is used to clear the contents of the Accumulator and store the
value 00H.
*(55 482
482 ? ?
? *(55? ? 7
? ?
&? ? ?
?
?
? ? ,? ?
? ? %$!? ?
? ?
?
? ? &?
? 7? ? *(55? ?
? ??
?
?
? ? 482 ? ?
? *(55? ? 7
? ?
7
? ?
?
? ??
?!?
? ??
?
!?
Microcontroller is a device that includes microprocessor; memory and I/O signal lines on
a single chip, fabricated using VLSI technology. Microcomputer is a computer that is designed
using microprocessor as its CPU. It includes microprocessor, memory and I/O.
"?{
?a&
The flags are used to reflect the data conditions in the accumulator. The 8085 flags are S-
Sign flag, Z-Zero flag, AC-Auxiliary carry flag, P-Parity flag, CYCarry flag, D7 D6 D5 D4 D3
D2 D1 D0.
When the first m/c code of an instruction is fetched and decoded in the instruction
register, the microprocessor recognizes the number of bytes required to fetch the entire
instruction. For example MVI A, Data, the second byte is always considered as data. If the data
byte is omitted by mistake whatever is in that memory location will be considered as data & the
byte after the ³data´ will be treated as the next instruction.
%?* ?-6??404
-6 ?404
1.RET transfers the 1.POP transfers the contents of
contents of the top two the top two locations of the
locations of the stack to the stack to the specified register
c
PC pair
+???!
The assembler translates the assembly language program text which is given as input to
the assembler to their binary equivalents known as object code. The time required to translate the
assembly code to object code is called access time. The assembler checks for syntax errors &
displays them before giving the object code.
The loader copies the program into the computer¶s main memory at load time and begins
the program execution at execution time.
A linker is a program used to join together several object files into one large object file.
For large programs it is more efficient to divide the large program modules into smaller modules.
Each module is individually written, tested & debugged. When all the modules work they are
linked together to form a large functioning program.
Interrupt means to break the sequence of operation. While the CPU is executing a
program an interrupt breaks the normal sequence of execution of instructions & diverts its
execution to some other program. This program to which the control is transferred is called the
interrupt service routine.
%???
&
c
An interface is a shared boundary between the devices which involves sharing
information. Interfacing is the process of making two different systems communicate with each
other.
a) I.O Mode
%????
?
?{(??&
Each DMA channel has one DMA address register. The function of this register is to
store the address of the starting memory location, which will be accessed by the DMA channel.
Thus the starting address of the memory block that will be accessed by the device is first loaded
in the DMA address register of the channel. Naturally, the device that wants to transfer data over
a DMA channel, will access the block of memory with the starting address stored in the DMA
Address Register.
The control words written to control register specify an I/O function for each I.O port.
The bit D7 of the control word determines either the I/O function of the BSR function.
Port-A : 8-bits
Port-B : 8-bits
Port-CU : 4-bits
Port-CL : 4-bits
%?{
c
1. In this device address is 16- 1. In this device address is 8-
bit. Thus bit. Thus Ao
Ao to A15 lines are used to to A7 or A8 to A15 lines are
generate the used to
device address generate device address.
2. MEMR and MEMW control
2. IOR and IOW control
signals
signals are used
are used to control read and
to control read and write I/O
write I/O
operations.
operations.
3. Instructions available are
3. Instructions available are IN
LDA,STA,MOV R,M , ADD
and OUT.
M etc
4. Data transfer is between any 4. Data transfer is between
register accumulator
and I/O device. and I/O device.
5. Decoding 16-bit address 5. Decoding 8-bit address will
may require require
more hardware. less hardware.
c
? ??
?&.
The assignment of memory addresses to various registers in a memory chip is called as?
memory mapping.
/A0?&.
The assignment of addresses to various I/O devices in the memory chip is called as I/O
mapping.
+??? ?
&?!
The flag register reflects the results of logical and arithmetic instructions. The flag
register digits D0, D2, D4, D6, D7 and D11 are modified according to the result of the execution
of logical and arithmetic instruction. These are called as status flag bits.
The bits D8 and D9 namely, trap flag (TF) and interrupt flag (IF) bits, are used for
controlling machine operation and thus they are called control flags.
c
Accumulator register, Temporary register, Instruction register, Stack Pointer, Program
Counter are the various registers in 8085 .
+????, ?
&? ??
Sign flag, Zero flag, Auxillary flag, Parity flag, Carry flag.
Stack pointer is a special purpose 16-bit register in the Microprocessor, which holds the
address of the top of the stack.
Program counter holds the address of either the first byte of the next instruction to be
fetched for execution or the address of the next byte of a multi byte instruction, which has not
been completely fetched. In both the cases it gets incremented automatically one by one as the
instruction bytes get fetched. Also Program register keeps the address of the next instruction.
LIFO (Last In First Out) stack is used in 8085.In this type of Stack the last stored
information can be retrieved first.
The Micro Processor enters into Halt-State and the buses are tri-stated.
A bus is a group of conducting lines that carriers data, address, & control signals.
Three Logic Levels are used and they are High, Low, High impedance state. The high
and low are normal logic levels & high impedance state is electrical open circuit conditions. Tri-
state logic has a third line called enable line.
?:,??7?
? ??
c
"??? ?
???2
?
+?3??
A???
?
?
?
A????-2?
??-(4
Flag is called as Low order register & Accumulator is called as High order Register.
Keyboards, Floppy disk are the examples of input devices. Printer, LED / LCD display,
CRT Monitor are the examples of output devices.
Yes, it can be used, if an accurate clock frequency is not required. Also, the component
cost is low compared to LC or Crystal.
Because of high stability, large Q (Quality Factor) & the frequency that doesn¶t drift with
aging. Crystal is used as a clock source most of the times.
c
A?
? ?? ?,$,??
The Quality factor is also defined, as Q. So it is a number, which reflects the lossness of a
circuit. Higher the Q, the lower are the losses.
An interrupt that can be turned off by the programmer is known as Maskable interrupt.
Non-Maskable interrupts are used in critical events. Such as Power failure, Emergency,
Shut off etc.,
?:,?7?
?!?
?:,?7?
?3 $!? ?
? ?&
"?67??
c
A JMP instruction permanently changes the program counter. A CALL instruction leaves
information on the stack so that the original program execution sequence can be resumed.
?? The IN instruction is used to move data from an I/O port into the accumulator. The OUT
instruction is used to move data from the accumulator to an I/O port. The IN & OUT instructions
are used only on microprocessor, which use a separate address space for interfacing.
%????
?!??
?? ?
A rotate instruction is a closed loop instruction. That is, the data moved out at one end is
put back in at the other end. The shift instruction loses the data that is moved out of the last bit
locations.
12 address lines.
O? DI ( Disable Interrupts )
O? EI ( Enable Interrupts )
O? RIM ( Read Interrupt Masks )
O? SIM ( Set Interrupt Masks )
c
Polling or device polling is a process which identifies the device that has interrupted the
microprocessor.
The 8085 microprocessor has five interrupt inputs. They are TRAP, RST 7.5, RST 6.5,
RST 5.5, and INTR. These interrupts have a fixed priority of interrupt service. If two or more
interrupts go high at the same time, the 8085 will service them on priority basis. The TRAP has
the highest priority followed by RST 7.5, RST 6.5, RST 5.5. The priority of interrupts in 8085 is
shown in the table.
-(4
-2?+
-2?% #
-2? "
/3-
? The 8085 has 5 interrupt signals; they are INTR, RST7.5, RST6.5, RST5.5 and TRAP
? The primary function of memory interfacing is that the microprocessor should be able to
read from and write into a given register of a memory chip. To perform these operations the
microprocessor should
c
??????????0 ?
?&
+????
? ? ???
1) The 8-bit port is bi-directional and additionally a 5-bit control port is available.
2) Three I/O lines are available at port C, viz PC2-PC0.
3) Inputs and outputs are both latched.
4) The 5-bit control port C (PC3=PC7) is used for generating/accepting handshake signals for the
8-bit data transfer on port A.
c
&?{&?
/
?? 3 ?
?A
?
? 3 ?
??$? 3?
?
?
1. MVI A, 8-bit 2 7 Opcode Fetch,
Memory Read
2. STA address 4 13 Opcode
fetch,MR,MR,MW
3. LXI rp,data(16) 3 10 OF,MR,MR
4. LHLD 16-bit 5 16 OF,MR,MR,MW,MW
5. MVI M,data(8) 3 10 OF,MR,MW
6. CMP reg(8) 1 4 OF
7. ADD reg(8) 1 4 OF
8. CMA 1 4 OF
9. CMC 1 4 OF
10. ADD M 2 7 OF,MR
11. CMP M 2 7 OF,MR
12. LDA address 4 13 OF,MR,MR,MR
13. DAD rp 3 10 OF,Bus Idle,Bus Idle
14. INR M 3 10 OF,MR,MW
15. XTHL 5 16 OF,MR,MR,MW,MW
16. JMP address3 3 10 OF,MR,MR
17. J condition 2 7 OF,MR
18. PUSH rp 3 10 OF,MW,MW
19. POP rp 3 10 OF,MR,MR
20. CALL address 5 18 OF,MR,MR,MW,MW
21. RET 3 10 OF,MR,MR
22. RST 3 12 OF,Mw,MW
23. MOV r,M 2 7 OF,MR
24. MOV M,r 2 7 OF,MW
25. IN address 3 10 OF,MR,I/O Read
26. OUT address 3 10 OF,MR,I/O Write
c