Professional Documents
Culture Documents
Micro Practical
Micro Practical
Tel. : 2228072477
A Practical Handbook on
FOR FY B.Sc IT
Prepared By:-
VISHESH SHRIVASTAVA
B.E. Elec. & Tele
Lecturer B.Sc.IT
1. Address Bus .
2. Data Bus.
3. Control and Status signal.
4. Power supply and Frequency signals.
5. Externally Initiated signal.
6. Serial input output port.
1. ADDRESS BUS:-
The Address bus is a group of 16 lines generally identified as A 0 to A15. The address bus is
unidirectional bits flows in one direction, But the 8085 has eight signal lines which are
unidirectional and used as a higher order address.
2. DATA BUS:-
The data bus is a group of eight lines used for data flow. These lines are bidirectional. The
signal lines AD0 to AD7 are bidirectional they serve a dual purpose. They are used as a low
order address bus as well as data bus. In executing an instruction during the earlier part of
the cycle these lines are used as low order address bus . And during the later part of the
cycle these lines are used as data bus.
ALE:-
This is a positive going pulse generated every time the 8085 begins an operation(machine
cycle);it indicates that the bits on AD7- AD0 are address bits. This signal is used primarily to
latch the low -order address from multiplexed bus and generate a separate set of eight
address lines,A7-A0.
WR (Write):-
This is a write control signal (active low) This signal indicates that the data on data bus are
to be written in to a selected I/O or memory device .
IO/M :-
This is the status signal used to differentiate between I/O and memory operation. When it
is high it indicates I/o operation and when it is low it indicates memory operation.
S1 and S0 :-
These status signals are similar to IO/M can identified various operations but they are
really used in small systems.
X1, X1:- A crystal is connected to these pins the frequency is internally divided by two.
CLK:-
Clock Output: This signal can be used as the system clock for other devices.
INTR :-
INTR is maskable 8080A compatible interrupt. When the interrupt occurs the processor
fetches from the bus one instruction, usually one of these instructions:
RST5.5 :
It is a maskable interrupt. When this interrupt is received the processor saves the contents of
the PC register into stack and branches to 2CH (hexadecimal) address.
It is a maskable interrupt. When this interrupt is received the processor saves the contents of
the PC register into stack and branches to 34h (hexadecimal) address.
RST7.5 :-
It a maskable interrupt. When this interrupt is received the processor saves the contents of
the PC register into stack and branches to 3Ch (hexadecimal) address.
TRAP:-
Trap is a non-maskable interrupt. When this interrupt is received the processor saves the
contents of the PC register into stack and branches to 24h (hexadecimal) address. All
maskable interrupts can be enabled or disabled using EI and DI instructions. RST 5.5, RST6.5
and RST7.5 interrupts can be enabled or disabled individually using SIM instruction
HOLD:-
This signal indicates that peripherals such as a DMA controller is requesting the use of the
address and data busses.
HLDA:-
Hold Acknowledgement: This signal Acknowledge the HOLD request.
READY:-
This signal is used to delay the microprocessor read or write cycles until as slow responding
peripheral is ready to sent or accept data
X1 1 40 VCC
X2 2 39 Hold
Reset Out 3 38 HLDA
SOD 4 37 CLK (OUT)
SID 5 36 RESET IN
Trap 6 35 Ready
RST 7.5 7 34 IO/M
RST 6.5 8 33 S1
RST 5.5 9 32 RD
INTR 10 31 WR
INTA 11 30 ALE
AD0 12 29 S0
AD1 13 28 A15
AD2 14 27 A14
AD3 15 26 A13
AD4 16 25 A12
AD5 17 24 A11
AD6 18 23 A10
AD7 19 22 A9
VSS 20 21 A8
8 11 Output
INTA Interrupt Acknowledgement
9 12 to AD0 to AD7 Address Data Bus Bidirectional
19
10 20 Vss Power Supply, Ground Connection Input
EXPERIMENT NO. 2
Theory:-
The 8085 microprocessor architecture is shown in figure . It includes the ALU, Timing and
Control, Instruction Register and Decoder, Register Array, Interrupt Control and Serial I/O
control.
Control Unit:-
Generates signals within uP to carry out the instruction, which has been decoded. In reality
causes certain connections between blocks of the uP to be opened or closed, so that data
goes where it is required, and so that ALU operations occur.
Accumulator :-
The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU). 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 accumulator is also identified as register A.
Flags:-
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; they are listed in the Table and their bit
positions in the flag register are shown in the Figure below. The most commonly used flags are
Zero, Carry, and Sign. The microprocessor
uses these flags to test data conditions.
For example, after an addition of two numbers, if the sum in the accumulator id larger than
eight bits, the flip-flop uses to indicate a carry -- called the Carry flag (CY) – is set to one.
When an arithmetic operation results in zero, the flip-flop called the Zero(Z) flag is set to one.
The first Figure shows an 8-bit register, called the flag register, adjacent to the accumulator.
However, it is not used as a register; five bit positions out of eight are used to store the
outputs of the five flip-flops. The flags are
stored in the 8-bit register so that the programmer can examine these flags (data conditions)
by accessing the register through an instruction.
These flags have critical importance in the decision-making process of the micro-processor.
The conditions (set or reset) of the flags are tested through the software instructions. For
example, the instruction JC (Jump on Carry) is implemented to change the sequence of a
program when CY flag is set. The thorough understanding of flag is essential in writing
assembly language programs.
Instruction Register/Decoder :-
Temporary store for the current instruction of a program. Latest instruction sent here from
memory prior to execution. Decoder then takes instruction and ‘decodes’ or interprets the
instruction. Decoded instruction then passed to next stage.
Control Generator:-
Generates signals within uP to carry out the instruction which has been decoded. In reality
causes certain connections between blocks of the uP to be opened or closed, so that data
goes where it is required, and so that ALU operations occur.
Register Selector:-
Address Bus
One wire for each bit, therefore 16 bits = 16 wires. Binary number carried alerts memory to
‘open’ the designated box. Data (binary) can then be put in or taken out.The Address Bus
consists of 16 wires, therefore 16 bits. Its "width" is 16 bits. A16 bit binary number allows 216
different numbers, or 32000 different numbers, ie 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
Data Bus: carries ‘data’, in binary form, between µP and other external units, such as memory.
Typical size is 8 or 16 bits. Size determined by size of boxes in memory andµP size helps
determine performance of µP. The Data Bus typically consists of 8wires. Therefore, 28
combinations of binary digits. Data bus used to transmit "data" ie information, results of
arithmetic, etc, between memory and the microprocessor.
Control Bus
Control Bus are various lines which have specific functions for coordinating and controlling uP
operations. Eg: Read/Not Write line, single binary digit. Control whether memory is being
‘written to’ (data stored in mem) or ‘read from’ (data taken out of mem) 1 = Read, 0 = Write.
May also include clock line(s) for timing/synchronizing, ‘interrupts’, ‘reset’ etc. Typically µP has
10 control lines.
Aim:- To Study The Addressing modes and Instruction Set for Microprocessor 8085.
Theory:-
1. Immediate addressing.
2. Register addressing.
3. Direct addressing.
4. Indirect addressing.
Immediate addressing :-
Data is present in the instruction. Load the immediate data to the destination provided.
Example: MVI R,data
Register addressing:-
Data is provided through the registers.
Example: MOV Rd, Rs
Direct addressing:-
Used to accept data from outside devices to store in the accumulator or send the data stored
in the accumulator to the outside device. Accept the data from the port 00H and store them
into the accumulator or Send the data from the accumulator to the port 01H.
Example: IN 00H or OUT 01H
Indirect Addressing:-
This means that the Effective Address is calculated by the processor. And the contents of the
address (and the one following) is used to form a second address. The second address is
where the data is stored. Note that this requires several memory accesses; two accesses to
retrieve the 16-bit address and a further access (or accesses) to retrieve the data which is to
be loaded into the register.
Arithmetic Operations:-
These instructions perform arithmetic operations such as addition, subtraction, increment,
and decrement.
Addition – Any 8-bit number, or the contents of a register or the contents of a memory
location can be added to the contents of the accumulator and the sum is stored in the
accumulator. No two other 8-bit registers can be added directly (e.g., the contents of register
B cannot be added directly to the contents of the register C). The instruction DAD is an
exception; it adds 16-bit data directly in register pairs.
Subtraction - Any 8-bit number, or the contents of a register, or the contents of a memory
location can be subtracted from the contents of the accumulator and the results stored in the
accumulator. The subtraction is performed in 2's compliment, and the results if negative, are
expressed in 2's complement. No two other registers can be subtracted directly.
Logical Operations:-
These instructions perform various logical operations with the contents of the accumulator.
Rotate- Each bit in the accumulator can be shifted either left or right to the next position.
Compare- Any 8-bit number, or the contents of a register, or a memory location can be
compared for equality, greater than, or less than, with the contents of the accumulator.
Complement - The contents of the accumulator can be complemented. All 0s are replaced by
1s and all 1s are replaced by 0s.
KES SHROFF COLLEGE Page 13
Branching Operations:-
This group of instructions alters the sequence of program execution either
conditionally or unconditionally.
Jump - Conditional jumps are an important aspect of the decision-making process in the
programming. These instructions test for a certain conditions (e.g., Zero or Carry flag) and
alter the program sequence when the condition is met. In addition, the instruction set
includes an instruction called unconditional jump.
Call, Return, and Restart - These instructions change the sequence of a program either by
calling a subroutine or returning from a subroutine. The conditional Call and Return
instructions also can test condition flags.
The data transfer instructions move data between registers or between memory and registers.
MOV Move
An 'X' in the name of a data transfer instruction implies that it deals with a register pair (16-
bits);
Arithmetic Group:
(Carry) Flag
Logical Group:
KES SHROFF COLLEGE Page 15
This group performs logical (Boolean) operations on data in registers and memory and on
condition flags.
The logical AND, OR, and Exclusive OR instructions enable you to set specific bits in the
accumulator ON or OFF.
The Compare instructions compare the content of an 8-bit value with the contents of the
accumulator;
CMP Compare.
The rotate instructions shift the contents of the accumulator one bit position to the left or
right:
Branch Group:
The branching instructions alter normal sequential program flow, either unconditionally or
conditionally. The unconditional branching instructions are as follows:
JMP Jump.
CALL Call.
RET Return.
Conditional branching instructions examine the status of one of four condition flags to
determine whether the specified branch is to be executed. The conditions that may be
specified are as follows:
NZ Not Zero (Z = 0)
Z Zero (Z = 1)
NC No Carry (C = 0)
C Carry (C = 1)
PO Parity Odd (P = 0)
PE Parity Even (P = 1)
P Plus (S = 0)
M Minus (S = 1)
KES SHROFF COLLEGE Page 17
Thus, the conditional branching instructions are specified as follows:
C CC RC (Carry)
JZ CZ RZ (Zero)
JP CP RP (Plus)
JM CM RM (Minus)
Two other instructions can affect a branch by replacing the contents or the program counter:
with Interrupts.
Aim:- To Study The Keyboard And Display Devices used in Microprocessor in 8085 Kit.
Theory:-
DISPLAY SECTION:-
The display device of microprocessor 8085 is 7-segment LED. 7-segment is the output device
on which you can see the message.
“Friend” when you press Reset key on keyboard.
KEYBOARD:-
Keyboard is the input device which is used to feed the data into the microprocessor. In this
section the total no of keys are 16.
1. SET :- When this key is pressed the display section become blank and the
Dot appears in the address field. Now we can set the address of the memory
location which is to be used.
2. RESET:- When the RESET key is pressed all the internal operations are suspended and
the program counter is cleared.
3. DECREMENT:- this key is used to decrement the address of the memory location is
program counter by 1.
4. EXECUTION:- The Exe. Key is used to execute the program, when we push the EXE key
the microprocessor will load the address that we enter just before pressing execution
key.
6. INCREMENT:- This key will increment the memory address in program counter and
sends the code to processor.
7. REGISTERS:- The key allotted to it is 3, this key allows the users to enter the register
name to see the content in that that register.
8. GO key:- The key allotted to it is 8, this key allows the users to enter the memory
location which makes the beginning of the program during execution.
KES SHROFF COLLEGE Page 19
9. A to F key:- A to F key allows the user to enter A to F letters on the LED.
10. 0/SET key:- This key allows user to enter the memory location , to begin entering the
program.
RESET V1
DEC C D E F
V1 V2 V3 V4
EXE 8 9 A B
GO/H L LOAD SAVE
INR 4 5 6 7
SPH SPL PCH PCL
0 1 2 3
SET CODE STEP REG
EXPERIMENT NO. 5
Aim:- To write a program to transfer data 15H in all general purpose register.
Program:-
C001 15
Lecturer’s Sign
EXPERIMENT NO. 6
Aim:- To write a program to add 02H, 0AH and 05H and store the result in memory location
C070H and in register C also.
Program:-
MEMORY HEX. code OPCODE COMMENT
LOCATION
C000 3E MVI A,02H Moves 15H in Accumulator.
C001 02
C008 C0
Lecturer’s Sign
EXPERIMENT NO. 7
Aim:- To write a program to add content of memory location C080H, and C081H and store
the result in memory location C082H .
Program:-
C002 C0
C008 C0
Lecturer’s Sign
EXPERIMENT NO. 8
Aim:- To write a program to find Two’s compliment of a number stored at C070 H and store
the result in C080 H..
Program:-
C002 C0
C008 C0
Lecturer’s Si
EXPERIMENT NO. 9
Aim:- To write a program to subtract the number stored at memory location C040H from
the number stored at C041 Hand store the result at C042 H.
Program:-
MEMORY HEX. code OPCODE COMMENT
LOCATION
C000 21 LXI H , C041 Load 16 bit data in register pair
designated in operand.
C001 41
C002 C0
C008 C0
Lecturer’s Sign
EXPERIMENT NO. 10
Aim:- To write a program to stored data 00H to 07H in memory location C090 H
respectively.
Program:-
MEMORY HEX. code OPCODE COMMENT
LOCATION
C000 21 LXI H , C090H Load 16 bit data in register pair
designated in operand.
C001 90
C002 C0
C004 00
C006 07 label
C012 07 label
C013 C0
Lecturer’s Sign
EXPERIMENT NO. 11
Aim:- To write a program to stored data FFH in alternate memory location starting from
C030H in 5 memory location.
Program:-
C004 C0
C012 C0
Lecturer’s Sign
Aim:- Assume register B holds 93H and the Accumulator holds 15H illustrate the result of
the instruction ORA B, XRA B, CMA, and ANA B. and store the result in different
registers.
Program:-
C001 93
C002 3E MVI A,15 Moves 15H in accumulator.
C003 15
C007 15
C008 A8 XRA B Content are logically EX-ORed
with the accumulator content.
C009 57 MOV D,A Moves the contents in register D .
C011 15
C015 15
Lecturer’s Sign
EXPERIMENT NO. 13
Aim:- To write a program to exchange digit of a number stored at C050H and store the new
number at C051H.
Program:-
MEMORY HEX. code OPCODE COMMENT
LOCATION
C000 21 LXI H,CO50H Loads 16 bit data in register pair
designated in operand.
C001 50
C002 C0
C003 36 MVI M,56 Stores 56 in accumulator.
C004 56
C005 7E MOV A,M Moves the contents From M to
accumulator.
C006 0F RRC Each binary bit of accumulator is
rotated right .
C007 0F RRC Each binary bit of accumulator is
rotated right .
C008 0F RRC Each binary bit of accumulator is
rotated right .
C009 0F RRC Each binary bit of accumulator is
rotated right .
C010 32 STA C051 Contents of accumulator is copied to
memory location specified by operand.
C011 51
C012 C0
EXPERIMENT NO. 14
Aim:- To write a program to mask 3rd and 5th bit of number stored at memory location C070 H
store the result in C080 H.
Program:-
C004 07
Lecturer’s Sign
APPENDIX
A. How to Write and Execute the program through the 8085 kit.
RESET
SET
Location from where u wants to store the data.(Ex. C000)
INR
Write the opcode of program
INR
Next opcode
INR
………
………
………
CF.
RESET
GO
Location at where from the program is stored(Ex. C000)
EXE.