Professional Documents
Culture Documents
MODULE‐1
Syllabus
1.1 8085
5 Microp
processo
or
Feature
es of 8085:
8 bit microp
It is an 8 processor.
It is mannufactured wwith N‐MOSS technology
y.
It has 16 6‐bit addresss bus and hhence can ad ddress up to = 65536 bytes (64KKB)
memory y locations tthrough A0‐AA15.
It has 8‐‐bit data buss.
It suppo orts externaal interrupt rrequest.
It requirres a signal +5V power supply and operates att 3.2 MHZ sin ngle phase cclock.
It is encclosed with 4 40 pins, DIP
P (Dual in lin
ne package).
Archite
ecture of 8
8085
ALU:
Functions of ALU:
Register Array:
Sign Flag‐ If D7 of the result is 1 then sign flag is set otherwise reset. As we know that a
number on the D7 always decides the sign of the number.
Zero Flag (Z)‐If the result stored in an accumulator is zero then this flag is set otherwise
it is reset.
Auxiliary carry Flag (AC)‐If any carry goes from D3 to D4 in the result, then it is set
otherwise it is reset.
Parity Flag (P)‐If the no of 1's in the result stored in the accumulator is even, then it is
set otherwise it is reset for the odd.
Carry Flag (C)‐If the result stored in an accumulator generates a carry in its final output
then it is set otherwise it is reset.
1.2 Instructions
An instruction is a command to the microprocessor to perform a given task on a
specified data. Each instruction has two parts: one is task to be performed, called the
operation code (op‐code), and the second is the data to be operated on, called the
operand.
Instruction Set Classification:
The entire group of instructions is called the instruction set.
These instructions can be classified into the following five functional categories: data
transfer (copy) operations, arithmetic operations, logical operations, branching
operations, and machine‐control operations.
1. Data Transfer (Copy) Instructions:
This group of instructions copy data from a location called a source to another location
called a destination, without modifying the contents of the source.
The various types of data transfer (copy) are listed below together with examples of
each type:
2. Arithmetic Instructions
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).
Eg:‐ ADD B,ADI 09
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.
Eg:‐ SUB C, SBI 08
Increment/Decrement:‐
The 8‐bit contents of a register or a memory location can be incremented or decrement
by 1. Similarly, the 16‐bit contents of a register pair (such as BC) can be incremented or
decrement by 1.
Eg:‐ INR D, DCR D
3. Logical Instructions
These instructions perform various logical operations with the contents of the accumulator.
AND, OR Exclusive‐OR: ‐
Any 8‐bit number, or the contents of a register, or of a memory location can be logically
ANDed, ORed, or Exclusive‐ORed with the contents of the accumulator.
The results are stored in the accumulator.
Eg:‐ ANA D, ORA C
Rotate:‐
Each bit in the accumulator can be shifted either left or right to the next position.
Eg:‐ RLC,RAL,RRC,RAR
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.
Eg:‐ CMP B, CPI 08
Complement:‐
The contents of the accumulator can be complemented. All 0s are replaced by 1s and all
1s are replaced by 0s.
Eg:‐ CMA
4. Branching Instructions
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.
Eg:‐ JC address ,JNC address, JZ address
In addition, the instruction set includes an instruction called unconditional jump.
Eg:‐ JMP address
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.
Eg:‐ CALL address, RET
5. Machine Control Instructions
These instructions control machine functions such as Halt, Interrupt, or do nothing.
Eg:- i) SIM ii) RIM iii) HLT
Eg. MVI B, 3EH - Move the data 3EH given in the instruction to B register.
Direct Addressing
In direct addressing mode, the address of the data is specified in the instruction. The data will
be in memory.
This type of addressing can be identified by 16-bit address present in the instruction.
Eg. LDA 1050H - Load the data available in memory location 1050H in accumulator.
Register Addressing
In register addressing mode, the instruction specifies the name of the register in which the data is
available.
This type of addressing can be identified by register names (such as ‘A’, ‘B’, … ) in the
instruction.
Eg. MOV A, B -Move the content of B register to A register.
In register indirect addressing mode, the instruction specifies the name of the register in
which the address of the data is available.
Here the data will be in memory and the address will be in the register pair.
This type of addressing can be identified by letter ‘M’ present in the instruction.
Implied Addressing
In implied addressing mode, the instruction itself specifies the type of operation and location
of data to be operated.
This type of instruction does not have any address, register name, immediate data specified
along with it.
Eg. CMA - Complement the content of accumulator.