Part 4: Instruction and Data Formats of 8085 microprocessor

Microprocessor & Microcontroller | 0 comments

8085 microprocessor Instruction and Data Formats.

There are numerous techniques to require data for instructions are:

  1. In the instruction itself 8-bit or 16-bit data may be directly given.
  2. In the instruction itself, the address of the memory location, I/O port or I/O device, where data resides, may be given.
  3. In some instructions, only one register is specified. The content of the specified register is one of the operands.
  4. Some instructions specify two registers and contents of the registers are the required data.
  5. In some instructions, data is implied and in the most instructions of this type operate on the content of the accumulator.

To specify various kind of data for instructions, the machine codes of all instructions are not of the same length. It may vary as 1-byte, 2-byte or 3-byte instruction.

8085 microprocessor Addressing Modes

Each instruction requires some data on that it has to operate. There are different techniques which are called addressing modes. Intel 8085 uses the following addressing modes:

  • Direct Addressing

In this addressing mode, the address of the operand or data is given in the instruction itself.

Example

STA 2400H: This stores the content of the accumulator in the memory location 2400H.

32, 00, 24: The above instruction in the code form.

In the above instruction, 2400H is the memory address for data stored given in the instruction itself. The 2nd and 3rd bytes of the instruction specify the address of the memory location. It is clear, that the source of the data is accumulator.

  • Register Addressing

In register addressing mode, the operand is in one of the general-purpose registers. The opcode specifies the address of the register(s) in addition to the operation to be performed.

Example:

MOV A, B: Move the content of B register to register A.

78: The instruction in the code form.

In the above MOV A, B is 78H. In addition the operation to be performed the opcode also specifies source and destination registers.

The opcode 78H can be printed in binary form as 01111000. The first two bits, i.e. 0 1 are for MOV operation, the next three bits 1 1 1 are the binary code for register A, and the last three bits 000 are the binary code for register B.

  • Register Indirect Addressing

The Register Indirect mode of addressing operand is specified by a register pair.

Example

  • LXI H, 2500 H – Load H-L pair with 2500H.
  • MOV A, M – Move the content of the memory location, whose address is in H-L pair (i.e. 2500 H) to the accumulator.
  • HLT – Halt.

In the above program MOV A, M is register indirect addressing. This instruction, the operand is in the memory. The address of the memory is not directly given in the instruction. The address of the memory resides in H-L pair and this has already been specified by an earlier instruction in the program, i.e. LXI H, 2500 H.

  • Immediate Addressing

In this addressing mode the operand is specified within the instruction itself.

Example

immediate addressing. 2500 is 16-bit data which is given in the instruction itself. It is to be loaded into H-L pair.

  • Implicit Addressing

There are certain instructions which operate on the content of the accumulator. Such instructions do not require the address of the operand.

Example

CMA, RAL, RAR, etc.

Status Flags

There is a set of five flip-flops which indicate status (condition) arising after the execution of arithmetic and logic instructions. These are:

  • Carry Flag (CS)
  • Parity Flag (P)
  • Auxiliary Carry Flags (AC)
  • Zero Flags (Z)
  • Sign Flags (S)

Symbols and Abbreviations:

The symbol and abbreviations which have been used while explaining Intel 8085 instructions are as follows:

Symbol with details
Addr 16-bit address of the memory location.
Data 8-bit data
data 16 16-bit data
r, r1, r2 One of the registers A, B, C, D, E, H or L
A, B, C, D, H, L 8-bit register
A Accumulator
H-L Register pair H-L
B-C Register pair B-C
D-E Register pair D-E
PSW Program Status Word
M Memory whose address is in H-L pair
H Appearing at the end of the group of digits specifies hexadecimal, e.g. 2500H
Rp One of the register pairs.
Rh The high order register of a register pair
Rl The low order register of a register pair
PC 16-bit program counter, PCH is high order 8 bits and PCL low order 8 bits of register PC.
CS Carry Status
[] The contents of the register identified within bracket
[ [] ] The content of the memory location whose address is in the register pair identified within brackets
^ AND operation
OR operation
⊕ or ∀ Exclusive OR
Move data in the direction of arrow
Exchange contents

 

Intel 8085 Instructions:

An instruction of a computer is a command given to the computer to perform a specified operation on given data. In microprocessor, the instruction set is the collection of the instructions that the microprocessor is designed to execute.

The programmer writes a program in assembly language using these instructions. These instructions have been classified into the following groups:

Data Transfer Group:

Instructions which are used to transfer the data from a register to another register from memory to register or register to memory come under this group

Instruction

Example

Description States Flags Addressing Machine Cycles
MOV A, B Move the content of the one register to another 4 none Register 1
MOV B, M Move the content of memory to register 7 none Register Indirect 2
MOV M, C Move the content of register to memory 7 none Register Indirect 2
MVI r, data
[r] ←dataExample:MVI M, 08
Move immediate data to register 7 None Immediate Register 3
LXI H, 2500H Load Register pair immediate 10 None Immediate 3
LDA 2400 H Load Accumulator direct 13 None Direct 4
STA 2000H Store accumulator direct 13 None Direct 4
LHLD 2500H Load H-L pair direct 16 None Direct 5
SHLD 2500 H Store H-L pair direct 16 None Direct 5
LDAX B Load accumulator indirect 7 None Register Indirect 2
STAX D Store accumulator indirect 7 None Register Indirect 2
XCHG
[H-L] ↔[D-E]
Change the contents of H-L with D-E pair 4 None Register 1

Arithmetic Group:

The instructions of this group perform arithmetic operations such as addition, subtraction, increment or decrement of the content of a register or a memory.

Instruction Example Explanation States Flags Addre-ssing Machine Cycles
ADD r
[A] ←[A]+[r]Example: ADD K
Add register to accumulator 4 All Register 1
ADD M
[A] ← [A] + [[H-L]]Example: ADD K
Add memory to accumulator 7 All Register indirect 2
ACC r
[A] ← [A] + [r] + [CS]Ex:ACC K
Add register with carry to accumulator 4 All Register 1
ADC K Add memory with carry to accumulator 7 All Register indirect 2
ADI 55K Add immediate data to accumulator 7 All Immediate 2
ACI 55K Add with carry immediate data to accumulator 7 All Immediate 2
DAD K Add register paid to H-L pair 10 CS Register 3
SUB K Subtract register from accumulator 4 All Register 1
SUB M
[A] ← [A] – [[H-L]]Example: SUB K
Subtract memory from accumulator 7 ALL Register indirect 2
SBB K Subtract memory from accumulator with borrow 7 All Register indirect 2
SUI 55K Subtract immediate data from accumulator 7 All Immediate 2
XCHG Subtract immediate data from accumulator with borrow 7 All Immediate 2
INR K Increment register content 4 All except carry flag Register 1
INR K Increment memory content 10 All except carry flag Register indirect 3
DCR K Decrement register content 4 All except carry flag Register 1
DCR K Decrement memory content 10 All except carry flag Register indirect 3
INX K Increment memory content 6 None Register 1
DCX K Decrement register pair 6 None Register 1
DAA Decimal adjust accumulator 4 1

Logical Group

The instructions in this group perform logical operation such as AND, OR, compare, rotate, etc.

Instruction Set Explanation States Flags Addressing Machine Cycles
ANA r
[A] ←[A]∧[r]
AND register with accumulator 4 All Register 1
ANA M
[A] ←[A]∧[[H-]]
AND memory with accumulator 4 All Register indirect 2
ANI data
[A] ← [A] ∧ [data]
AND immediate data with accumulator 7 All Immediate 2
ORA r
[A] ←[A]∨[r]
OR-register with accumulator 4 All Register 1
ORA M
[A] ←[A]∨[[H-L]]
OR-memory with accumulator 7 All Register indirect 2
ORI data
[A] ← [A] ∨ [data]
OR -immediate data with accumulator 7 All Immediate 2
CMP r
[A]-[r]
Compare register with accumulator 4 All Register 1
CMP M
[A] – [[H-L]]
Compare memory with accumulator 7 All Register indirect 2
CPI data
[A] – data
Compare immediate data with accumulator 7 All Immediate 2
RLC
[An+1] ←[An], [A0] ←[A7], [CS] ←[A7]
Rotate accumulator left 4 Cs Implicit 1
RRC
[A7] ←[A0], [CS] ←[A0], [An] ←[An+1]
Rotate accumulator right CS Implicit 1
RAL
[An+1] ←[An], [CS] ←[A7], [A0] ←[CS]
Rotate accumulator left through carry CS Implicit 1
RAR
[An] ←[An+1], [CS] ←[A0], [A7] ←[CS]
Rotate accumulator right through carry CS Implicit 1

Branch Control Group: This group contains the instructions for conditional and unconditional jump, subroutine call and return, and restart.
Others are Unconditional Jump, Conditional Jump, Unconditional CALL, Conditional CALL, Unconditional Return, Conditional Return, Restart, Stack, I/O and Machine Control Group.

Chapter 4 Relational Algebra

Relational Algebra The part of mathematics in which letters and other general symbols are used to represent numbers and quantities in formula and equations. Ex: (x + y) · z = (x · z) + (y · z). The main application of relational algebra is providing a theoretical...

Chapter 3 Components of the Database System Environment

Components of the Database System Environment There are five major components in the database system environment and their interrelationships are. Hardware Software Data Users Procedures Hardware:  The hardware is the actual computer system used for keeping and...

Chapter 2: Database Languages and their information

Database Languages A DBMS must provide appropriate languages and interfaces for each category of users to express database queries and updates. Database Languages are used to create and maintain database on computer. There are large numbers of database languages like...

Database basic overview

What is DBMS? A Database Management System (DBMS) is a collection of interrelated data and a set of programs to access those data. Database management systems (DBMS) are computer software applications that interact with the user, other applications, and the database...

Laravel – Scopes (3 Easy Steps)

Scoping is one of the superpowers that eloquent grants to developers when querying a model. Scopes allow developers to add constraints to queries for a given model. In simple terms laravel scope is just a query, a query to make the code shorter and faster. We can...

CAMBRIDGE IELTS 17 TEST 3

READING PASSAGE 1: The thylacine Q1. carnivorous keywords: Looked like a dog had series of stripes ate, diet ate an entirely 1 .......................................... diet (2nd paragraph 3rd and 4th line) 1st and 2nd paragraph, 1st  paragraph,resemblance to a...

You may find interest following article

Chapter 4 Relational Algebra

Relational Algebra The part of mathematics in which letters and other general symbols are used to represent numbers and quantities in formula and equations. Ex: (x + y) · z = (x · z) + (y · z). The main application of relational algebra is providing a theoretical foundation for relational databases, particularly query languages for such databases. Relational algebra...

Chapter 3 Components of the Database System Environment

Components of the Database System Environment There are five major components in the database system environment and their interrelationships are. Hardware Software Data Users Procedures Hardware:  The hardware is the actual computer system used for keeping and accessing the database. Conventional DBMS hardware consists of secondary storage devices, usually...

Chapter 2: Database Languages and their information

Database Languages A DBMS must provide appropriate languages and interfaces for each category of users to express database queries and updates. Database Languages are used to create and maintain database on computer. There are large numbers of database languages like Oracle, MySQL, MS Access, dBase, FoxPro etc. Database Languages: Refers to the languages used to...

Database basic overview

What is DBMS? A Database Management System (DBMS) is a collection of interrelated data and a set of programs to access those data. Database management systems (DBMS) are computer software applications that interact with the user, other applications, and the database itself to capture and analyze data. Purpose of Database Systems The collection of data, usually...

Laravel – Scopes (3 Easy Steps)

Scoping is one of the superpowers that eloquent grants to developers when querying a model. Scopes allow developers to add constraints to queries for a given model. In simple terms laravel scope is just a query, a query to make the code shorter and faster. We can create custom query with relation or anything with scopes. In any admin project we need to get data...

CAMBRIDGE IELTS 17 TEST 3

READING PASSAGE 1: The thylacine Q1. carnivorous keywords: Looked like a dog had series of stripes ate, diet ate an entirely 1 .......................................... diet (2nd paragraph 3rd and 4th line) 1st and 2nd paragraph, 1st  paragraph,resemblance to a dog. … dark brown stripes over its back, beginning at the rear of the body and extending onto the...

CAMBRIDGE IELTS 17 TEST 4

PASSAGE 1 Q1 (False) (Many Madagascan forests are being destroyed by attacks from insects.) Madagascar's forests are being converted to agricultural land at a rate of one percent every year. Much of this destruction is fuelled by the cultivation of the country's main staple crop: rice. And a key reason for this destruction is that insect pests are destroying vast...

Cambridge IELTS 16 Test 4

Here we will discuss pros and cons of all the questions of the passage with step by step Solution included Tips and Strategies. Reading Passage 1 –Roman Tunnels IELTS Cambridge 16, Test 4, Academic Reading Module, Reading Passage 1 Questions 1-6. Label the diagrams below. The Persian Qanat Method 1. ………………………. to direct the tunnelingAnswer: posts – First...

Cambridge IELTS 16 Test 3

Reading Passage 1: Roman Shipbuilding and Navigation, Solution with Answer Key , Reading Passage 1: Roman Shipbuilding and Navigation IELTS Cambridge 16, Test 3, Academic Reading Module Cambridge IELTS 16, Test 3: Reading Passage 1 – Roman Shipbuilding and Navigation with Answer Key. Here we will discuss pros and cons of all the questions of the...

Cambridge IELTS 16 Test 2

Reading Passage 1: The White Horse of Uffington, Solution with Answer Key The White Horse of Uffington IELTS Cambridge 16, Test 2, Academic Reading Module, Reading Passage 1 Cambridge IELTS 16, Test 2: Reading Passage 1 – The White Horse of Uffington  with Answer Key. Here we will discuss pros and cons of all the questions of the passage with...

Cambridge IELTS 16 Test 1

Cambridge IELTS 16, Test 1, Reading Passage 1: Why We Need to Protect Bolar Bears, Solution with Answer Key Cambridge IELTS 16, Test 1: Reading Passage 1 – Why We Need to Protect Bolar Bears with Answer Key. Here we will discuss pros and cons of all the questions of the passage with step by step...

Cambridge IELTS 15 Reading Test 4 Answers

PASSAGE 1: THE RETURN OF THE HUARANGO QUESTIONS 1-5: COMPLETE THE NOTES BELOW. 1. Answer: water Key words:  access, deep, surface Paragraph 2 provides information on the role of the huarango tree: “it could reach deep water sources”. So the answer is ‘water’. access = reach Answer: water. 2. Answer: diet Key words: crucial,...

Cambridge IELTS 15 Reading Test 3 Answers

PASSAGE 1: HENRY MOORE (1898 – 1986 ) QUESTIONS 1-7: DO THE FOLLOWING STATEMENTS AGREE WITH THE INFORMATION GIVEN IN READING PASSAGE 1? 1. Answer: TRUE Key words: leaving school, Moore, did, father, wanted It is mentioned in the first paragraph that “After leaving school, Moore hoped to become a sculptor, but instead he complied with his father’s...

Cambridge IELTS 15 Reading Test 2 Answers 

PASSAGE 1: COULD URBAN ENGINEERS LEARN FROM DANCE ?  QUESTIONS 1- 6: READING PASSAGE 1 HAS SEVEN PARAGRAPHS, A-G. 1. Answer: B Key words: way of using dance, not proposing By using the skimming and scanning technique, we would find that before going into details about how engineers can learn from dance, the author first briefly mentions ways of...

Cambridge IELTS 15 Reading Test 1 Answers

PASSAGE 1: NUTMEG – A VALUABLE SPICE QUESTIONS 1- 4: COMPLETE THE NOTES BELOW.CHOOSE ONE WORD ONLY FROM THE PASSAGE FOR EACH ANSWER.WRITE YOUR ANSWER IN BOXES 1-8 ON YOUR ANSWER SHEET. 1. Answer: oval Key words: leaves, shape Using the scanning skill, we can see that the first paragraph describes the characteristics of the tree in detail, including...

CAMBRIDGE IELTS 14 READING TEST 4 ANSWERS 

PASSAGE 1: THE SECRET OF STAYING YOUNG QUESTIONS 1-8: COMPLETE THE NOTES BELOW. 1. ANSWER: FOUR / 4 Explain– Key words: focused age groups, ants– In paragraph 3, it is stated that “Giraldo focused on ants at four age ranges”,so the answer must be “four/4”. 2. ANSWER: YOUNG Explain– Key words: how well, ants, looked after– The first sentence of...

CAMBRIDGE IELTS 14 READING TEST 3 ANSWERS

PASSAGE 1: THE CONCEPT OF INTELLIGENCE QUESTIONS 1-3: READING PASSAGE 1 HAS SIX PARAGRAPHS, A-F. 1. ANSWER: B Explain ·     Key words: non-scientists, assumptions, intelligence, influence, behavior ·    People‟s behavior towards others‟ intelligence is mentioned in the first sentence of paragraph B: “implicit theories of...

CAMBRIDGE IELTS 14 READING TEST 2 ANSWERS

Cambridge IELTS 14 is the latest IELTS exam preparation.https://draftsbook.com/ will help you to answer all questions in cambridge ielts 14 reading test 2 with detail explanations. PASSAGE 1: ALEXANDER HENDERSON (1831-1913) QUESTIONS 1-8: DO THE FOLLOWING STATEMENTS AGREE WITH THE INFORMATION GIVEN IN READING PASSAGE 1? 1. ANSWER: FALSE Explain Henderson rarely...

Cambridge IELTS 14 Reading Test 1 Answers

Cambridge IELTS 14 is the latest IELTS exam preparation.https://draftsbook.com/ will help you to answer all questions in cambridge ielts 14 reading test 1 with detail explanations. PASSAGE 1: THE IMPORTANCE OF CHILDREN’S PLAY QUESTIONS 1-8: COMPLETE THE NOTES BELOW. 1. ANSWER: CREATIVITY Explain building a “magical kingdom” may help develop … – Key words: magical...

Cambridge IELTS 13 Reading Test 4 Answers 

PASSAGE 1: CUTTY SARK: THE FASTEST SAILING SHIP OF ALL TIME QUESTIONS 1-8: DO THE FOLLOWING STATEMENTS AGREE WITH THE INFORMATION GIVEN IN READING PASSAGE 1? 1. CLIPPERS WERE ORIGINALLY INTENDED TO BE USED AS PASSENGER SHIPS Key words: clippers, originally, passengerAt the beginning of paragraph 2, we find the statement: “The fastest commercial sailing...