Beruflich Dokumente
Kultur Dokumente
Bharat Sankhlecha
This model does not reflect
the physical structure of
the 8085 but includes the
information that is critical
in writing assembly
language programs.
This model includes six
registers, one accumulator,
and one flag register as
shown in figure.
In addition, it has two 16-
bit registers : stack pointer1
and the program counter.
CONT…
Registers : The 8085 has six general purpose registers to store 8-bit
data; these are identified as B, C, D, E, H, and L. They can be
Bharat Sankhlecha
combined as register pairs – BC, DE and HL to perform 16-bit
operations.
The programmer can use these registers to store or copy data into
registers by using data copy operations.
Accumulator : The accumulator is an 8-bit register that is part of
ALU. The result of an operation is stored in the accumulator.
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.
The microprocessor used these flags to test data conditions.
These flags have critical importance in the decision making process
of the microprocessor. The conditions (set or reset) of the flags are 2
tested through software instructions.
FLAGS DESCRIPTION
Z- Zero: The zero flag is set to 1 when the result
is zero, otherwise it is reset.
Bharat Sankhlecha
CY-Carry: If an arithmetic operation result in a
carry, the carry flag is set otherwise it is reset.
S-Sign: The sign flag is set if the bit D7 of the
result =1; otherwise it is reset.
AC-Auxiliary Carry: In a arithmetic operation,
when a carry is generated by digit D3 and passed
to digit D4, the AC flag is set. This Flag is used
internally for BCD operation.
3
PROGRAM COUNTER (PC) AND STACK
POINTER (SP)
These are two 16-bit registers used to hold memory
addresses. The size of these two register is 16 bits
because the memory addresses are 16 bits.
Bharat Sankhlecha
The microprocessor uses the PC register to
sequence the execution of the instructions. The
function of the program counter is to point to the
memory address from which the next byte is to be
fetched. When a byte is being fetched, the
program counter is incremented by one point to
the next memory location.
The stack pointer is also a 16-bit register used as a
memory pointer. It point to a memory to a
memory location in R/W memory, called the 4
stack.
INSTRUCTION CLASSIFICATION
An instruction is a binary pattern designed inside
a microprocessor to perform a specific function.
Bharat Sankhlecha
The entire group of instructions, called the
instruction set, determines what functions the
microprocessor can perform.
5
THE 8085 INSTRUCTION SET
The 8085 instructions can be classified into five
categories: data transfer (copy) operations,
arithmetic operations, logical operations.
Bharat Sankhlecha
Branching operations, and machine control
operations.
6
DATA TRANSFER OPERATIONS
This group of instructions copies data from a location
called a source to another location, called a
destination, without modifying the contents of the
source.
Bharat Sankhlecha
The various types of data transfer are
Types Examples
Bharat Sankhlecha
And, OR, Exclusive-OR
Rotate
Compare
Complement
8
BRANCHING OPERATIONS
This group of instructions alters the sequence of
program execution either conditionally or
unconditionally.
Bharat Sankhlecha
Jump
9
MACHINE CONTROL OPERATIONS
These instructions control machine functions
such as Halt, Interrupt, or do nothing.
Bharat Sankhlecha
10
INSTRUCTION, DATA FORMAT, AND
STORAGE
In instruction is a command to the
microprocessor to perform a given task on
specified data.
Bharat Sankhlecha
Each instruction has two parts: one is the task to
be performed, called the operation code(op-code),
and the second is the data to be operated on,
called the operand.
The operand and data can be specified in various
ways. It may include 8-bit (or 16-bit) data, an
internal register, a memory location, or an
memory location, or an 8-bit(16-bit) address.
11
INSTRUCTIONS WORD SIZE
The 8085 instruction set is classified into the
following three groups according to word size or
byte size.
Bharat Sankhlecha
1-byte instructions
2-byte instructions
3-byte instructions
12
ONE BYTE INSTRUCTIONS
A 1-byte instruction includes the opcode and the operand in the same byte. E.g
Bharat Sankhlecha
e d Code
Copy the contents of the MOV C,A 0100 1111 4FH
accumulator in register
C
Add the contents of ADD B 1000 0000 80H
register B to the
contents of the
accumulator
Invert (complement) CMA 0010 1111 2FH
each bit in the
accumulator
13
TWO BYTE INSTRUCTIONS
Task Opcod Operan Binary Hex
e d Code Code
Load an 8-bit data MVI A,32H 0011 1110 3E First Byte
byte in the 0011 0011 32 Second
accumulator Byte
Load an 8-bit data MVI B,F2H 0000 0110 06 First Byte
byte in register B 1111 0010 F2 Second
Bharat Sankhlecha
Byte
Bharat Sankhlecha
Immediate Addressing MVI R, Data
Indirect Addressing
15