Architecture 8085 Notes
Architecture 8085 Notes
Bus is a group of wires or conductors used for communication between processor , memory and i/o
devices.
There are 3 types of buses. 1).Address bus 2). Data bus 3).Control bus
1. Address bus:
Purpose:
1.It is used to transfer the address of either memory or i/o from the processor.
2. It defines the maximum memory that can be connected to a processor given by the
Relation. 2n=N, Where, n= number address line, N= Number of address/memory locations.
Length: It is of 16 bits in length for 8085.
Direction: Address bus is unidirectional
2. Data bus:
Purpose: it is used to transfer data between processor, memory & i/o devices
Length: It is of 8 bits in length for 8085
Direction: Data bus is bidirectional.
Note: there is no separate data bus in 8085, the lower order address lines can be used either as
address or data bus, using a signal known as ALE- address latch enable
If ALE = 1; All 16 lines are used as address lines.
ALE = 0; A15 – A8 - Address Bus
AD7 – AD0 Data bus ( Multiplexed Address/Data Bus).
3. Control bus: It is group of different control, timing & status for various operations of the processor
It doesn’t have any direction as every signal is performing different task
Ex, RD, WR , ALE
Memory: Memory is a group of registers. A Register is a group of flip-flops. A flip- flop is a memory cell
which can store or hold a bit, i.e 0/1. Most of the memories are designed to store or hold 8bits per each
register or memory/address location, therefore memory is represented in terms of Bytes.
** The standard word-length of memory is 8bits or 1 Byte.
Objective Q’s:
1. A microprocessor has _____ address lines, find the maximum memory that can be connected or
interfaced to it.
2. A maximum memory of __________ can be interfaced with a processor, find the address lines
required.
3. It is required to connect a memory of ________ to a processor, find the minimum address lines.
1. Tristate Buffer:
Purpose—Used when more devices are connected to common bus to select one of them.
It is used when many devices are connected to common bus. It is used to amplify or increase the
power or current level of the bus.
It has three states 1). Logic 0 2). Logic 1 3).High impedance state (Z/ Tristate)
In high impedance state, the line doesn’t draw any current from the system.
Circuit symbol of Tristate Buffer:
If E=0; Active/logic 0/1
=1; inactive/z/high impedance state/tri-state
2. Decoder – Logic circuit, which can identify the combination of input signals and selects one of
the output signals. Used in decoding logic of memories & I/O devices.
3. Encoder – Logic circuit which can produce or generate the code of one of the input at o/p.
Used in communication systems and also to interface a keyboard to a computer.
4. Latch—used to hold the lower byte of the address till read / write operations are completed.
Instruction Register:
It is an 8 bit register which contains the opcode of present instruction. It does not contain data.
Instruction decoder and machine cycle encoder:
After the opcode is accessed in to IR, it is decoded in this block with the help of Microprogram. The
number of operations is assigned according to the type of instruction.
Microprogram: It is a program written by chip designer to make the processor to understand what
an instruction is or it indicates the type of operation to be performed for an instruction. It is present
inside the processor. It is also called as control program.
Stack Pointer: SP
It is a 16bit register which contains the address of the data present at the top of stack memory or it
points to top of the stack.
Stack: It is a part of Read/Write memory, used to store temporary data and also the content of
program counter when subroutines are used.
The technique involved in stack is LIFO i.e. Last in First out.
When data is stored in to STACK, SP is decremented, similarly SP is incremented when data is accessed
from stack. Only register pair contents can be stored into stack in 8085, a single register is not possible.
When a RP(register pair) content is stored into stack, first higher nibble is stored and then lower nibble is
stored.
Flag Register:
There are 5 flags or flip-flops in 8085 which give the status after an ALU operation. They are affected by the
content of Accumulator, except in few instructions where they may also be modified for general purpose
instructions like INR R & DCR R( increment and decrement instructions).
D7 D6 D5 D4 D3 D2 D1 D0
S Z X AC X P X CY
Temporary Registers:
W & Z are the two 8 bit temporary registers which cannot be accessible by programmer. They are used by
the processor in some instructions.
I0/ M S1 S0 STATUS
Z 0 0 HALT
0 0 1 M/M Write
0 1 0 M/M Read
0 1 1 Fetch
1 0 1 I/O Write
1 1 0 I/O Read
1 1 1 INTA
Z X X HOLD
Z X X RESET
Z-Tristate state/High impedance state
Reset-in—low active input signal to the processor to reset it. PC= 0000H
Reset out: o/p signal which indicates that the processor is reset. It can be used to reset the i/o devices.
Clock out: o/p pin on which same operating frequency of the processor is available.
Ready: i/p signal to the processor from a slow speed i/o device or memory.
Ready1; Indicates that the I/O device is ready to transfer or receive the data, so mp transfers or receives
data from i/o
0; Indicates that I/O is not ready, so mp waits for the I/O device.
1. Hardware interrupts: There are 5 hardware interrupts in 8085 according to priority. TRAP to INTR
Software interrupts: There are 8 software interrupts, which can be used either as instructions or
along with INTR interrupt. RSTn; n= 0- 7, RST0,
RST 1--RST7
2. Maskable interrupts: Interrupts which can be ignored when they are triggered.
Non-Maskable Interrupts: Interrupts which cannot be ignored when triggered. Ex: TRAP
It must be connected to highly prioritised events in practical applications like power failure issues.
3. Vectored Interrupts: Interrupts which have specific address location in memory to store ISR.
Non-Vectored Interrupts: Interrupts which do not have specific address location in memory.
Ex: INTR
Vector address Type of triggering
1. TRAP/NMI/RST 4.5 0024H Edge & level
2. RST 7.5 ----- 003CH Edge
3. RST 6.5 ----- 0034H Level
4. RST 5.5 ----- 002CH Level
5. INTR- ----- No address Level
INTR---Non-vectored interrupt ( it does not have any specific location ). 8 I/O devices can be
connected by using INTR with the help of priority encoder. It is also known as polled interrupt.
INTA- Interrupt acknowledgement- o/p signal in response to interrupt request. It is required only for
INTR interrupt not for vectored interrupts.
ISR/ISS: It is a program that is executed in response to an interrupt. Every vectored interrupt in 8085 is
allocated 8 bytes in memory to store the corresponding ISR. Programming logic can be used if the length of
program exceeds 15 bytes. In case of vectored interrupt there is a built in logic which loads the PC with the
vector address of the corresponding interrupt.
Assembly level language: Instructions are written in separate words known as mnemonics.
Ex: MOV A,B ADD C
Both assembly and machine level languages are known as low level languages
High level language: They are machine independent. Ex. C, C++, JAVA
Softwares:
Compiler: converts HLL to machine level language, where entire program is converted at a time
Ex; Turbo C, XLC, Javac
Interpreter: HLL—MLL line by line, Ex: M-BASIC
Assembler: Assembly program to Machine code, MASM—Microsoft macro assembler.
Cross Assembler: It translates the opcodes of one processor in to opcodes of another processor.
Loader: converts hexa-decimal code to binary form ( ex; .Exe file) and loads the program into
memory.
Linker : Links the subprograms or header files to the program.
Source code: Assembly program which is written for a certain application.
Object code: o/p of the Assembler ( it is present in hexa-decimal form)
Monitor/ control program: it is a program which is similar to OS (Operating system) software in
microprocessor environment. It takes care of initialization procedure and user interactions. It is present
in the external memory.
It loads the PC with the starting address of actual program when the “enter or execute” key is
pressed.
Note: Programmer cannot load the PC directly with the starting address of program.
Basic steps of execution: 1). Fetch2). Decode 3). Execute
Instruction format:
Every instruction has two parts 1). Opcode 2). Operands.
Opcode: indicates the type of operation to be performed
Operands: It is the data on which operation is to be performed.
Instruction length: Number of bytes an instruction occupies in the memory.
There are 3 types of instructions classified according to the length:
1. 1 byte/word instructions 2. 2 byte/word instructions 3. 3Byte/Word instructions.
After decoding an opcode, the processor understands:
1. Length of instruction 2. Number of operations required for execution depending on the
instruction.
Addressing modes:
These are various formats specifying the operands or they indicate how data is accessed for an
instruction.
1. Immediate Addressing mode: Data is in the instruction. Ex. MVI B, 90H
2. Direct addressing mode: Address of the data is in the instruction. EX. LDA 6000H
3. Indirect addressing mode: Address of the data is present as the content of another register pair
EX. LDAX B
4. Register addressing mode: Data is transferred between registers. EX. MOV B,C
5. Implicit/ Implied addressing mode: Address of the data is in the instruction itself. EX. CMA,RAL
It is the pictorial representation of execution of an instruction with the help of various control ,timing and
status signals.
T-State: it is one subdivision of an operation performed in one clock period.
FCLK= 3 MHz, T=1/f=1/3 x 106 = 0.33µs.
Machine cycle: It is the time required to access memory or i/o (either for read/write).
1 M/c may have 3 to 6 T-States.
Instruction cycle: It is the time required to complete the execution of an instruction.
1I/C may have 1 to 5 machine cycles.
Note: maximum T-State for an instruction in 8085 is 18. Ex. Call 16 bit address—3B,5 M/C’s, 18- T-States.
Instructions in 8085
1. Data transfer or copy instructions: data is transferred from source to destination.
2. Arithmetic instructions:
Perform operations like Addition, subtraction, increment & Decrement.
3. Logical instructions: AND, OR, EX-OR, Compare ,Compliment & Rotate
4. Branching Instructions: Program control is transferred from one location to another
conditionally or unconditionally .Ex: JUMP, CALL , RETURN & RST n.
5. Machine control Instructions: Used for internal machine control operations of processor.
Depending on the type of instruction, the number of operations may one or more.
Fields of an instruction:
ARITHMETIC INSTRUCTIONS
ADD R ADD M ADI 8 bit data
ADC R ADC M ACI 8-bit data
SUB R SUB M SUI 8-bit data
SBB R SBB M SBI 8-bit data
ANA R ANA M ANI 8-bit data
ORA R ORA M ORI 8-bit data
XRA R XRA M XRI 8-bit data
CMP R CMP M CPI 8-bit data
Compliment--CMA – compliment content of accumulator
CMC – Compliment carry ; STC –Set carry---to set carry flag.
ROTATE ---RLC, RAL , RRC , RAR( rotate 1 bit left / right with orwithout carry)
Branching Instructions
JUMP : To transfer control of program from one location to another
There are conditional and unconditional instructions
Conditional: depend on status of flags
Ex: JZ 16bit address(if Z=1, in previous ALU operation, then jump to the address , else go to next
instruction in the program.)
Similarly all flags except AC have the instructions.
JNZ,JC,JNC,JPE,JPO,JM,JP
Unconditional Jump : JMP 16bit address—go to the address mentioned in the instruction without any
condition.
CALL : To call a subroutine within the main program.
Subroutine: A program which performs specific function can be written as a separate program away
from main program. It can be repeatedly used in the main program.
CALL also has conditional and unconditional instructions.
Unconditional CALL:- CALL 16bit address
When CALL (or interrupt is activated) is executed, the steps followed by processor:
1. Store/Save the address of next instruction(PC content) in the stack ,i.e SPSP-2 (so that it can
return from the function or subroutine by using a RET instruction.)
2. Go to the subroutine address and continue the program
Conditional CALL operation is same as unconditional CALL, but flag condition is verified before the
control is transferred.
CZ,CNZ,CC,CNC,CPE,CPO,CM,CP
RETURN: used to return the control of a program from a subroutine or an interrupt service routine.
It also has conditional and unconditional .
Unconditional return RET
When RET is executed:
1. Processor accesses the data(2B) at top of stack in to PC, i.e SPSP+2
2. Program control is transferred to the 16bit address value
For conditional Return instructions also operation is same except that the flags condition is verified
before the transfer.
Ex. RZ,RNZ,RC,RNC,RPE,RPO,RM, RP.
RSTn—Software interrupts , where n=0-7
Also known as 1Byte unconditional CALL instruction.
Operation is similar to CALL instruction.
SPECIAL INSTRUCTIONS
LHLD 16bit address Load HL pair with the data @ 16bit address i.e 2bytes
SHLD 16bit address Store the contents of HL pair @ 16 bit address
PCHL Copy the content of HL pair to PC
Also known as 1B JUMP instruction
SPHL Copy the content of HL to SP
XCHG Exchange the contents of DE & HL pairs
XTHL Exchange the contents at top of the stack with the HL pair.
SP is unchanged
DAD RP Add the contents of Register pair to HL pair. Result is stored in HL Pair
only.
DAA Decimal adjust Accumulator—Used in the BCD conversions.
*This is the only instruction which works with the status of AC flag
Converts 8bit value in Accumulator into two 4bit BCD values.
Applications of Microprocessor:
1. Industrial process and control applications
2. Bio-medical instrumentation
ECG and patient monitoring systems
MRI, CT scanning systems.
3. Military and navigation equipment
Radar control, communication
Satellite and Rover systems in exploration.
4. Educational Institutes i.e laboratory purpose
5. Home appliances like TV, Intelligent washing machines, fridges etc.
6. Automobile industry – Car high end applications like- Anti braking system,
7. Audio speech processing.
8. Electronic gadgets
9. Robotics and neural networks
Assembler directives:
These are hints given to assembler by programmer while writing an assembly language program.
ORG--origin
DB – define byte – 1byte memory space is allocated for the variable.
Ex: x db 12h,34h/ x db 10h dup( )
DW- define word –2bytes space
DQ –define quad word
End –end of program, ENDS—end of segment
1. INTEL 8085 is
a. 16 bit µp b. 8 bit µp c. 4 bit µp d. 32 bit µp
2. Internal memory of 8085 is
a. 64KB b. 0 KB c. Can be of any size d. none
3. If a memory has 2048 registers & 32 bits per location then the capacity of the memory is
a.128B b. 256 B c. 512B d. 8KB
4. The data lines in 8085 processor are multiplexed with address lines.- true or false
5. Result of most of the ALU operations in 8085 is stored in
a. ACC b. In any register c. PC d. SP
6. PC Contains
a. Address of previous instruction b. Address of the data in stack
c. current program d. Address of the next instruction to be executed
7. The technique involved in the stack for 8085 is
a. LIFO b. FIFO c. FILO d. None
8. After the processor is reset. The value in PC & SP are
a. 0000H, 0000H b.FFFFH, 0000H c. 0000H, user defined d. None
9. The sum of A & B, if they have 95H & 7CH. Also find the status of flags.
a. 13H & 84H b. 13H & 11H c. 11H & 15H d. None
10. The operating frequency of 8085 is
a. 6 Mhz b. 3Mhz c. 2 Mhz d. None
11. The correct sequence for execution of an instruction in any processor is
1. opcode fetch 2. Execute 3. Decode
a. 2,3,1 b, 3,2,1 c. 1,3,2 d. No sequence while execution
12. A program is first stored in the processor, then only execution takes place---True / False
13. 8085 follows _____________ architecture for the memory connected to it
a. Harvard b. Princeton c. Both a & b d.none
14. The Multiplexing concept for bus is used in processors in order to
a. Reduce cost of design b. Complexity c. Both a & b d. Multiplexing is done in microcontrollers
15. In DMA operation, the data is transferred
a. Inside the processor only b. Between memory and microprocessor c. Memory and I/O d.none
16. Zero flag in 8085 is ‘0’ if result of some ALU operation is
a. 00H b. FFH only c. Non-zero. d.none
17. one of the following interrupt in 8085 is Non-maskable or cannot be disabled
a. TRAPb. RST 6.5 c. RST 7.5 d. INTR
18. The only PIN in 8085, which can support more than one interrupt is
a. TRAP b. RST 5.5 c. RST 7.5 d. INTR
19. ISR/ISS with respect to interrupts stands for
a. Interrupt Service Range b. In Service route c. Interrupt Service Routine d. None
20. The correct sequence of priority in 8085 for interrupts is
1. TRAP 2. RST 5.5 3. RST 6.5 4.RST 7.5
a. 1,2,3,4 b.4,3,2,1 c. 2,3,4,1 d. 1,4,3,2
21. As compared to Parallel communication, Serial communication is
a. Faster b. Cheaper c. Logical d. Noise free
22. The maximum pins present in 8085 are
a. 50 b.45 c.40 d.100
23. Maximum of length of instruction in 8085 is 3Bytes, where as in 8086 , it is 6bytes. True / False
24. The instruction has two parts ---
a. Opcode & Operands b. 1st part & 2nd part c. 1st version& 2nd version d. None
25. READY pin of the processor, gets the signal from
a. High speed I/O b. Slow speed I/O c. Any one of a/b d. Can be from both a & b
26. Maximum memory that can be connected to 8085 is
a. 64KB b. 128KB c. 8KB d.none
27. The length of Instruction STA 8000H is
a. 2 Bytes b. 3bytes c. Instruction doesn’t have length d.none
Key:
1.B 2.b 3.d 4.TRUE 5.A 6.D 7.A
8.C 9.C 10.A 11.C 12.FALSE 13.B 14.C
15.C 16.C 17.A 18.D 19.C 20.D 21.b
22. C 23. TRUE 24.A 25.B 26.A 27.B 28.C
29.C 30.D 31.A 32. C 33.D 34. A 35.A
36. TRUE 37. C 38. A
40. C 41. D