0% found this document useful (0 votes)
12 views11 pages

Class 3

The document discusses the data format and instruction set of the 8085 microprocessor. It describes the different types of operands like addresses, numbers, and characters that can be used. It also explains the various instructions like data transfer, arithmetic, logical, and I/O instructions along with examples.

Uploaded by

Aalu Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views11 pages

Class 3

The document discusses the data format and instruction set of the 8085 microprocessor. It describes the different types of operands like addresses, numbers, and characters that can be used. It also explains the various instructions like data transfer, arithmetic, logical, and I/O instructions along with examples.

Uploaded by

Aalu Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Data Format of 8085 Microprocessor:

The operand is an another name for data. It may appear in different forms :
• Addresses
• Numbers/Logical data and
• Characters
Addresses : The address is a 16-bit unsigned integer ,number used to refer a memory location.
Numbers/Data : The 8085 supports following numeric data types.
•Signed Integer : A signed integer number is either a positive number or a negative number. In 8085, 8-
bits are assigned for signed integer, in which most significant bit is used for sign and remaining seven
bits are used for magnitude. Sign bit 0 indicates positive number whereas sign bit 1 indicates negative
number.
•Unsigned Integer : The 8085 microprocessor supports 8-bit unsigned integer.
•BCD : The term BCD number stands for binary coded decimal number. It uses ten digits from 0 through
9. The 8-bit register of 8085 can store two digit BCD
Characters : The 8085 uses ASCII code to represent characters. It is a 7-bit alphanumeric code that represents
decimal numbers, English alphabets, and other special characters.
FLAG REGISTER OF 8085

In 8085 microprocessor, the flags register can have a total of eight flags. But only five flags are

implemented . A flag is represented by 1 bit of information.

The Flags are :

•Carry flag (Cy)

•Auxiliary carry flag (AC),

•Sign flag (S),

•Parity flag (P), and.

•Zero flag (Z).

The individual flags are either set to 1, or reset to 0 depending on the result of execution of the last
executed arithmetic or logical instruction.
Carry flag (Cy): after performing the addition of any two 8-bit numbers, the carry generated can be either 0 or 1.

Sign flag (S): The S flag is set to 1, when the result thus produced against any logical or arithmetic operations is
negative, indicated by MS bit of 8-bit result being 1. It is reset to 0 otherwise if the result is positive, indicated by
MS bit of 8-bit result being 0.

Parity flag (P): The P flag is set to 1, if the 8-bit result thus produced against any logical and arithmetic
operation has an even number of 1's in it. If there are odd number of 1's in the 8-bit result, the P flag is reset
to 0.

Auxiliary carry flag (Ac): Now let us consider the addition of any two 8-bit (2-hex digit) numbers, a carry
may be generated when we add the LS hex digits of the two numbers. Such a carry is called intermediate
carry also known as half carry, or auxiliary carry (AC).

Zero flag (Z): The Z flag is set to 1, if after arithmetic and logical operations, the 8-bit result thus produced, is
00H. If the 8-bit result is not equal to 00H, the Z flag is reset to 0. Thus the Z flag is hoisted to indicate that
the result is 0.
Example 1: In the addition of 45H and F3H, the result thus produced will be 38H and with Cy flag = 1, as shown
below

CY is 1
Sign is reset to 0 (MSB bit – positive)
Parity is reset to 0 ( odd ones)
AC is reset to 0
Z flag is reset to 0

Example 2: In the addition of 85H and 1EH, the result thus produced will be A3H with Cy = 0, as shown below.

CY is 0
Sign is set to 1 (negative)
Parity is set to 1 ( even ones)
AC is reset to 1
Z flag is reset to 0
Instruction set of 8085

INTEL 8085 has a very enriched Instruction Set. All these instructions can be broadly classified as
follows: -

No. of instruction
Description No. of opcodes Example
types
Data transfer
83 13 MOV, MVI etc.
Instructions
Arithmetic
62 14 ADD, SUB etc.
Instructions
Logical Instructions 43 15 AND, XOR etc.
Stack Instructions 15 9 PUSH, POP etc.
Branch Instructions 36 8 JMP, JZ etc.
I/O Instructions 2 2 IN, OUT etc.
Interrupt Instructions 5 5 RST 0, RST 1 etc.

Total 246 66
Data transfer instructions
This instruction copies the
contents of the source
Rd, Rs Copy from the source
register into the
MOV M, Rs (Rs) to the destination
destination register
Rd, M (Rd)
without any alteration.
Example − MOV H, L

The 8-bit data is stored in


Rd, # 8 data Move immediate 8-bit the destination register or
MVI
M, #8 data data memory.
Example − MVI B, 55H

The contents of a
memory location,
specified by a 16-bit
LDA 16-bit address Load the Accumulator
address in the operand,
are copied to the
Accumulator.
Example − LDA 2034H
The contents of the designated register pair point
to a memory location. This instruction copies the
Load the Accumulator
LDAX B/D Reg. pair contents of that memory location into the
indirect
Accumulator.
Example − LDAX B

The instruction loads 16-bit data in the register pair


Load the register pair
LXI Reg. pair, 16-bit data designated in the register or the memory.
immediate
Example − LXI B, 3225H

The instruction copies the contents of the memory


Load H and L registers location pointed out by the address into register L
LHLD 16-bit address
direct and copies the contents of the next memory
location into register H.
Example − LHLD 3225H
The contents of the Accumulator are copied into the memory location
specified by the operand.
STA 16-bit address 16-bit address This is a 3-Byte instruction, the second Byte specifies the low-order
address and the third Byte specifies the high-order address.
Example − STA AB00H

Store the The contents of the Accumulator are copied into the memory location
STAX 16-bit address Accumulator specified by the contents of the operand.
indirect Example − STAX 4050H

The contents of register L are stored in the memory location specified


by the 16-bit address in the operand and the contents of H register
Store H and L are stored into the next memory location by incrementing the
SHLD 16-bit address
registers direct operand.
This is a 3-Byte instruction, the second Byte specifies the low-order
address and the third Byte specifies the high-order address.
Example − SHLD 3225H
The contents of register H are exchanged with the contents of
Exchange H and L register D, and the contents of register L are exchanged with
XCHG None
with D and E the contents of register E.
Example − XCHG

The instruction loads the contents of the H and L registers into


the stack pointer register.
Copy H and L
The contents of the H register provide the high-order address
SPHL None registers to the
and the contents of the L register provide the low-order
stack pointer
address.
Example − SPHL

The contents of the L register are exchanged with the stack


location pointed out by the contents of the stack pointer
Exchange H and L
XTHL None register.
with top of stack
The contents of the H register are exchanged with the next
stack location (SP+1).
Example − XTHL
The contents of the register pair designated in the operand are copied onto the
stack in the following sequence.
The stack pointer register is decremented and the contents of the high order
Push the register pair
PUSH Reg. pair register (B, D, H, A) are copied into that location.
onto the stack
The stack pointer register is decremented again and the contents of the low-
order register (C, E, L, flags) are copied to that location.
Example − PUSH B

The contents of the memory location pointed out by the stack pointer register
are copied to the low-order register (C, E, L, status flags) of the operand.
Pop off stack to the The stack pointer is incremented by 1 and the contents of that memory location
POP Reg. pair
register pair are copied to the high-order register (B, D, H, A) of the operand.
The stack pointer register is again incremented by 1.
Example − POP B

Output the data from


The contents of the Accumulator are copied into the I/O port specified by the
the Accumulator to a
OUT 8-bit port address operand.
port with 8 bit
Example − OUT 01H
address

Input data to
Accumulator from a The contents of the input port designated in the operand are read and loaded
IN 8-bit port address
port with 8-bit into the Accumulator.
address Example − IN 04H

You might also like