Instruction : A command to the microprocessor to perform a given task on specified data. Each instruction has two parts

Similar documents
Assembly Language Programming of 8085

Assembly Language Programming of 8085


(2) Explain the addressing mode of OR What do you mean by addressing mode? Explain diff. addressing mode for 8085 with examples.

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

PERIPHERAL INTERFACING Rev. 1.0

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

INSTRUCTION SET OF 8085

Computer Organization

MSMF GATE CENTRE. Sub: MICROPROCESSORS. Time: 50min Date: Marks:33

8085 INSTRUCTION SET INSTRUCTION DETAILS

Programming of 8085 microprocessor and 8051 micro controller Study material

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 153) Pass Marks: 24

Lecture-19 MICROPROCESSOR INSTRUCTIONN SET: Each subsystem in a microprocessor based system the memory, the microprocessor and the input and output

Lecture 5. EEE3410 Microcontroller Applications Department of Electrical Engineering Assembly Language Programming (1)

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

MICROPROCESSOR BASICS AND RELATED TERMS

Counters & Time Delays. Microprocessors & Interfacing 1

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

Q. P. Code : b. Draw and explain the block dig of a computer with microprocessor as CPU.

Instruction set of 8085

2010 Summer Answers [OS I]

1. Internal Architecture of 8085 Microprocessor

4 Categories Of 8085 Instructions That Manipulate Data

Chapter 2 Instruction Set Architecture

8051 Microcontroller

Assembly Language Programming

1. Internal Architecture of 8085 Microprocessor

The due date for submitting this assignment has passed. 1) How many times will the following loop be executed? Depends on the initial value of A

The due date for submitting this assignment has passed. 1) Which of the following statements regarding a microcomputer, a

LIST OF PROGRAMS. Prg. Name of the Program. 1 Study of Pin Diagram of Study of Architecture of Study of 8085 Kit.

Computer Architecture 1 ح 303

Its Assembly language programming

(2½ Hours) [Total Marks: 75]

ELECTRICAL ENGINEERING

COMPUTER ORGANIZATION & ARCHITECTURE

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

Introduction to Assembly Language Programming (Instruction Set) 1/18/2011 1

Subject Code: Model Answer Page No: /25

Assembly Language programming (1)

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

B.C.A 2017 MICROPROCESSOR AND ASSEMBLY LANGUAGE MODULE SPECIFICATION SHEET. Course Outline

SAMPLE STUDY MATERIAL

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE

(1) Define following terms: Instruction, Machine Cycle, Opcode, Oprand & Instruction Cycle. Instruction:

address ALU the operation opcode ACC Acc memory address

GATE Exercises on Microprocessors

Assembly language Programming

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

EE 3170 Microcontroller Applications

Practical Course File For

ENE 334 Microprocessors

ELEG3924 Microprocessor

Lecture-15 W-Z: Increment-Decrement Address Latch:

In this lecture, we will look at how storage (or memory) works with processor in a computer system. This is in preparation for the next lecture, in

ELEG3923 Microprocessor Ch.2 Assembly Language Programming

Assembly Language programming (2)

2.2 THE MARIE Instruction Set Architecture

4- MACHINE LANGUAGE CODING 4-1THE INSTRUCTION SET:

1. Introduction to Assembly Language

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

LABORATORY 1 INTRODUCTION TO 8085 MICROPROCESSOR DEVELOPMENT SYSTEM BOARD

8051 Instruction Opcodes In Hexadecimal Order

EKT222 Miroprocessor Systems Lab 5

ROEVER ENGINEERING COLLEGE

STRUCTURE OF DESKTOP COMPUTERS

SYSTEM FUNCTIONAL TEST TEST PROGRAM 1 ADDRESS INSTRUCTION ADDRESS INSTRUCTION BINARY DESCRIPTION DB INPUT

ORG ; TWO. Assembly Language Programming

COPYRIGHT IS NOT RESERVED BY AUTHORS. AUTHORS ARE NOT RESPONSIBLE FOR ANY LEGAL ISSUES ARISING OUT OF ANY COPYRIGHT DEMANDS

Four Categories Of 8085 Instructions That >>>CLICK HERE<<<

ENE 334 Microprocessors

CISC Processor Design


Microprocessors and Microcontrollers Prof. Santanu Chattopadhyay Department of E & EC Engineering Indian Institute of Technology, Kharagpur

UNIT I. Differences between: Microcomputer, Microprocessor and Microcontroller

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

S.R.M. INSTITUTE OF SCIENCE & TECHNOLOGY SCHOOL OF ELECTRONICS & COMMUNICATION ENGINEERING

Assembly Language. Instructor: Dmitri A. Gusev. Spring Lecture 10, February 27, CSC : Introduction to Computer Science

Microcontroller Systems

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT I THE 8085 & 8086 MICROPROCESSORS. PART A (2 Marks)

Understand the factors involved in instruction set

Valliammai Engineering College

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Introduction to CPU architecture using the M6800 microprocessor

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

PSIM: Processor SIMulator (version 4.2)

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

SCRAM Introduction. Philipp Koehn. 19 February 2018

Module 3 Instruction Set Architecture (ISA)


Interrupt is a process where an external device can get the attention of the microprocessor. Interrupts can be classified into two types:

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

1 = Enable SOD 0 = Disable SOD. Serial Output Data. Fig.12.9 SIM Instruction Format

Transcription:

Lecture 4

Instruction : A command to the microprocessor to perform a given task on specified data. Each instruction has two parts One part is the task to be performed, called operation code or opcode in short The second part is the data to be operated on, called the operand. The operand (or data) can be specified in various ways. It may include 8 or 16 bit data, or an internal register, or a memory location or an 8 or 16 bit address. In some instructions, operand is implicit. In 8085, byte and word are synonymous because it is an 8-bit microprocessor 2

Say, we want to write an assembly program to add two hexadecimal numbers, 32H and 48H for example. This can be divided into 4 small steps: 1. Load the two numbers 32H and 48H in registers A and B respectively 2. Add the numbers 3. Display the sum at the output PORT 1 4. End To write an assembly language program, we need to translate the blocks (shown in the above 3 steps) into 8085 operations and then subsequently into mnemonics. Amongst the above 4 steps, steps 1 and 3 are copy i.e. data movement operations, step 2 is an arithmetic i.e. data manipulation operation and step 4 is a machine control i.e. program manipulation operation 3

The conversion of each step to mnemonics is shown below Step 1a: MVI A, 32H //Load register A with 32H MVI B, 48H //Load register B with 48H Step 2: ADD B //Add two bytes and save the sum in A Step 3: OUT 01H // Display accumulator contents at port 01H Step 4: HLT //End 4

To convert mnemonics to Hex codes, look up for the code in the 8085 instruction set Mnemonics Hex code MVI A, 32H 3E //2-byte instruction 32 MVI B, 48H 06 //2-byte instruction 48 ADD B 80 //1-byte instruction OUT PORT1 D3 //2-byte instruction 01 HLT 76 //1-byte instruction 5

To store the program in memory, need to know the memory and output port address. Let s assume that memory ranges from 2000H to 20FFH and the system has LED output port with the address 01H. Reset the system by pushing the RESET key. Enter the first memory address i.e. 2000H using Hex keys Enter each machine code by pushing HEX keys e.g. to enter first machine code 3E, push the 3, E and STORE keys Repeat the previous step until the last machine code, 76H Reset the system Steps of instruction 8085 Mnemonics Manual Lookup Hex Code Monitor Program Binary Code To memory For Storage 6

To execute the program, we need to tell the microprocessor where the program begins by entering the memory address (2000H in this case) Then the EXECUTE key should be pushed As soon as EXECUTE key is pushed, the microprocessor loads 2000H in the program counter and the program control is transferred from the Monitor program to the specific program under execution The microprocessor reads one machine code at a time. Once the complete instruction is fetched, it executes that instruction. For example, it will fetch machine codes in the memory locations 2000H and 2001H and execute the instruction MVI A, 32H. It continues to execute instructions until it fetches the HLT instruction. 7

Following clues can be used to recognize the number of bytes of an instruction One-byte instruction A mnemonic followed by a letter (or two letters) representing registers. E.g. MOV A,B; RRC; DCX SP, etc. Two-byte instruction A mnemonic followed by 8-bit i.e. a byte. E.g. MVI A, <<8-bit data>>; ADI <<8-bit data>> Three-byte instruction A mnemonic followed by 16 bits or 2 bytes, mostly address. E.g. LXI B, 16 bit (double); JMP <<16-bit address>>; CALL <<16-bit address>> In writing assembly language programs, memory addresses can be assigned once the number of bytes in a given instruction is known. For example, a three-byte instruction has 3 Hex codes and requires 3 memory locations in a sequence. 8

The microprocessor interprets the first byte it fetches as an opcode. When the 8085 is reset, the program counter is cleared to 0000H and it fetches the first code from location 0000H. In the previous example though, the program counter begins from the location 2000H. The first code it fetches is 3EH. When the code 3E is decoded, it knows that it is a 2-byte instruction. Therefore it assumes that the next byte, 32H, is a data. In case 32H is missed out, and directly the next code 06H is entered, the 8085 will load 06H to accumulator as an operand of opcode 3EH. So, the next code 48H will be treated as an opcode by 8085, and this sequence will continue. As a result, the outcome of the program will be completely erroneous. 9

10