TK 2633 Microprocessor & Interfacing

Slides:



Advertisements
Similar presentations
Microprocessors and Interfacing
Advertisements

Microprocessors.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
Processor Function Topic 3.
The 8085 Microprocessor Architecture. Contents The 8085 and its Buses. The address and data bus ALU Flag Register Machine cycle Memory Interfacing The.
Processor System Architecture
MICRO PROCESSER The micro processer is a multipurpose programmable, clock driven, register based, electronic integrated device that has computing and decision.
Parul Polytechnic Institute Subject Code : Name Of Subject : Microprocessor and assembly language programming Name of Unit : Introduction to Microprossor.
BLOCK DIAGRAM OF INTEL 8085 GURSHARAN SINGH TATLA
Instruction Set Architecture & Design
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Room: Timbalan Pengarah Pusat Komputer Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 4: Introduction.
TK 2633 Microprocessor & Interfacing
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 5: Arithmetic and Logic Instructions.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Parul Polytechnic Institute Parul Polytechnic Institute Subject Code : Name Of Subject : Microprocessor and assembly language programming Name.
INSTRUCTION SET OF MICROPROCESSOR 8085
created by :Gaurav Shrivastava
Machine Instruction Characteristics
Electrical Engineering Department Engineering College Prince Sattam bin Abdul Aziz University Text Book: - Triebel and Singh, "The 8088 and 8086 Microprocessors",
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
TK2633 : MICROPROCESSOR & INTERFACING Lecture 10: Fixed Point Arithmetic Lecturer: Ass. Prof. Dr. Masri Ayob.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
Computer Architecture and Organization
Lecture 2 Microprocessor Architecture Image from:
Ass. Prof. Dr Masri Ayob Lecture 5: Arithmetic and Logic Instructions TK 2633: Microprocessor & Interfacing.
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
Z80 Overview internal architecture and major elements of the Z80 CPU.
ASSEMBLY LANGUAGE.  Upon completing this topic, you should be able to: Classify the 8085A microprocessor instructions Explain the basic function of common.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 8.
Ass Prof Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 6: Control Instructions.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
Assembly Language Programming of 8085 BY Prof. U. V. THETE Dept. of Computer Science YMA.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 2)
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.
Gandhinagar Institute of Technology
Architecture of 8085 Nitin Mishra. Registers Microprocessor Instruction Cache Arithmetic & Logic Unit Control Unit Bus Interface Unit Data Cache Instruction.
The 8085A is a general-purpose microprocessor with low hardware overhead requirements. Within the 8085A are contained the functions of clock generation,
8085 Microprocessor Architecture
Gursharan Singh Tatla INSTRUCTION SET OF 8085 Gursharan Singh Tatla Gursharan Singh Tatla
Unit 1 Instruction set M.Brindha AP/EIE
BLOCK DIAGRAM OF INTEL 8085.
Control Unit Lecture 6.
Gunjeet Kaur Dronacharya Group of institutions
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Introduction to microprocessor (Continued) Unit 1 Lecture 2
Introduction to 8085 Instructions
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 3 & 4 Part 2
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 3 & 4 Part 1
Dr. Michael Nasief Lecture 2
Microcomputer Programming
Number Representations and Basic Processor Architecture
Chapter 1 Introduction.
INSTRUCTION SET OF 8085.
COMPUTER ORGANIZATION AND ARCHITECTURE
Computer Operation 6/22/2019.
Presentation transcript:

TK 2633 Microprocessor & Interfacing Lecture 2: Introduction to 8085 Assembly Language Programming (2) Prepared By: Associate Prof. Dr Masri Ayob

Objectives Explain the various functions of the registers in the 8085 programming model. Define the term flag and explain how the flags are affected. Explain the terms operation code (Opcode) and the operand, and illustrate these terms by writing instructions. Prepared by: Dr Masri Ayob - TK2123

Objectives Classify the instructions in terms of their word size and specify the number of memory registers required to store the instructions in memory. List the five categories of the 8085 instruction set. Define and explain the term addressing mode. Prepared by: Dr Masri Ayob - TK2123

Objectives Write logical steps to solve a simple programming problem. Draw a flowchart from the logical steps of a given programming problem. Translate the flowchart into mnemonics and convert the mnemonics into Hex code for a given programming problem. Prepared by: Dr Masri Ayob - TK2123

The 8085 Hardware/Programming Model A model is a conceptual representation of a real object. The microprocessor can be represented in terms of its hardware (physical electronic components) and a programming model (information needed to write programs). Prepared by: Dr Masri Ayob - TK2123

8085 Hardware Model Prepared by: Dr Masri Ayob - TK2123

8085 Programming Model Prepared by: Dr Masri Ayob - TK2123

8085 Flag Register Prepared by: Dr Masri Ayob - TK2123

8085 Hardware Model Two major segments: One segment includes the arithmetic/logic unit (ALU) and an 8-bit register called an accumulator, instruction decoder, and flags. The second segment shows 8-bit and 16-bit registers. Both segments are connected with various internal connections called an internal bus. The arithmetic and logical operations are performed in the ALU. Results are stored in the accumulator, and flip-flops, called flags, are set or reset to reflect the results Prepared by: Dr Masri Ayob - TK2123

8085 Hardware Model There are three buses: a 16-bit unidirectional address bus to send out memory addresses; an 8-bit bidirectional data bus, and a control bus to transfer data, and. the control bus for timing signals. Prepared by: Dr Masri Ayob - TK2123

8085 Programming Model The model includes six 8-bit registers (B, C, D, E, H & L), one accumulator, and one flag register. It also has two 16-bit registers: the stack pointer (SP); the program counter (PC). Prepared by: Dr Masri Ayob - TK2123

General-purpose Registers The 8085 has six general-purpose registers to store 8-hit data; B, C, D, E, H, and L. They can be combined as register pairs - BC, DE, and HL - to perform some 16-bit operations. The programmer can use these registers to store or copy data into the registers by using data copy instructions. Prepared by: Dr Masri Ayob - TK2123

Accumulator The accumulator is an 8-bit register that is part of the arithmetic/logic unit (ALU). This register is used to store 8-bit data and to perform arithmetic and logical operations. The result of an operation is stored in the accumulator. The accumulator is also identified as register A. Prepared by: Dr Masri Ayob - TK2123

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; Prepared by: Dr Masri Ayob - TK2123

Flags The most commonly used flags are Zero, Carry, and Sign. The microprocessor uses these flags to test data conditions. These flags have critical importance in the decision-making process of the microcessor. E.g., the instruction JC (Jump On Carry) is implemented to change the sequence of a program when the CY flag is set. Prepared by: Dr Masri Ayob - TK2123

Flags The following flags are set or reset after the execution of an arithmetic or logic operation; data copy instructions do not affect any flags. See the instruction set (Appendix F) to find how flags are affected by an instruction. Z-Zero: The Zero flag is set to 1 when the result is zero; otherwise it is reset. CY - Carry: If an arithmetic operation results in a carry, the CY flag is set; otherwise it is reset. Prepared by: Dr Masri Ayob - TK2123

Flags S - Sign: The Sign flag is set if bit D7 of the result = 1; otherwise it is reset. P - Parity: If the result has an even number of 1s, the flag is set; for an odd number of 1s, the flag is reset. AC - Auxiliary Carry: In an 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 (binary-coded decimal) operations; there is no Jump instruction associated with this flag. Prepared by: Dr Masri Ayob - TK2123

Example ADD B Instruction: Register contents before instruction 9A h Flag Register contents after instruction: 23 h 89 h A B 10 h Flag 1 0 0 1 1 0 1 0 1 0 0 0 1 0 0 1 Note: All flags are modified to reflect the result of the addition. 0 0 1 0 0 0 1 1 Flag: S=0, Z=0, AC=1 , P=0 and C=1, Prepared by: Dr Masri Ayob - TK2123

Program COUNTER (PC) AND STACK POINTER (SP) These are two 16-bit registers used to hold memory addresses. PC: The function of the PC is to point to the memory address from which the next byte is to be fetched. When a byte (machine code) is being fetched, the program counter is incremented by one to point to the next memory location. Prepared by: Dr Masri Ayob - TK2123

Program COUNTER (PC) AND STACK POINTER (SP) It points to a memory location in R/W memory, called the stack. The beginning of the stack is defined by loading a 16-bit address in the stack pointer. The PC will automatically update when calling to /returning from Subroutines. Prepared by: Dr Masri Ayob - TK2123

Stack The stack is one of the most important things you must know when programming. Think of the stack as a deck of cards. When you put a card on the deck, it will be the top card. Then you put another card, then another. When you remove the cards, you remove them backwards, the last card first and so on. The stack works the same way, you put (push) words (addresses or register pairs) on the stack and then remove (pop) them backwards. That's called LIFO, Last In First Out. Prepared by: Dr Masri Ayob - TK2123

Stack There are instructions that allow you to modify SP contents but you should NOT change the contents of that register if you don't know what you're doing! PUSH POP Prepared by: Dr Masri Ayob - TK2123

8085 Instruction Set An instruction is a binary pattern designed inside a microprocessor to perform a specific function. The entire group of instructions, called the instruction set, determines what functions the microprocessor can perform. Prepared by: Dr Masri Ayob - TK2123

8085 Instruction Set Can be classified into the following five functional categories: data transfer (copy) operations, arithmetic operations, logical operations, branching operations, and machine-control operations. Prepared by: Dr Masri Ayob - TK2123

Data Transfer (copy) Instructions Copies data from a location called a source to another location, called a destination, without modifying the contents of the source. In technical manuals, the term data transfer is used for this copying function. The term transfer is misleading; it creates the impression that the contents of a source are destroyed when, in fact, the contents are retained without any modification. Prepared by: Dr Masri Ayob - TK2123

Data Transfer (copy) Instructions Prepared by: Dr Masri Ayob - TK2123

Arithmetic Operations 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 register C). The instruction DAD is an exception; it adds 16-bit data directly in register pairs. Prepared by: Dr Masri Ayob - TK2123

Arithmetic Operations 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 complement, and the results, if negative, are expressed in 2’s complement. No two other registers can be subtracted directly. Prepared by: Dr Masri Ayob - TK2123

Arithmetic Operations Lncrement/Decrement - The 8-bit contents of a register or a memory location can be incremented or decremented by 1. Similarly, the 16-bit contents of a register pair (such as BC) can be incremented or decremented by I. These increment and decrement operations differ from addition and subtraction in an important way; i.e., they can be performed in any one of the registers or in a memory location. Prepared by: Dr Masri Ayob - TK2123

Logical Operations 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 EXORed with the contents of the accumulator. The results are stored in the accumulator. Rotate - Each bit in the accumulator can be shifted either left or right to the next position. Prepared by: Dr Masri Ayob - TK2123

Logical Operations 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. Complement - The contents of the accumulator can be complemented; all 0s are replaced by 1s and all 1s are replaced by 0s. Prepared by: Dr Masri Ayob - TK2123

Branching Operations 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 programming. These instructions test for a certain condition (e.g., Zero or Carry flag) and alter the program sequence when the condition is met. This set includes an instruction called unconditional jump. Prepared by: Dr Masri Ayob - TK2123

Branching Operations 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. Prepared by: Dr Masri Ayob - TK2123

Machine Control Operations These instructions control machine functions such as Halt, Interrupt, or do nothing. Prepared by: Dr Masri Ayob - TK2123

Review of the 8085 Operations In data transfer, the contents of the source are not destroyed; only the contents of the destination are changed. The data copy instructions do not affect the flags. Arithmetic and logical operations are performed with the contents of the accumulator, and the results are stored in the accumulator (with some exceptions). The flags are affected according to the results. Prepared by: Dr Masri Ayob - TK2123

Review of the 8085 Operations Any register including memory can be used for increment and decrement. A program sequence can be changed either conditionally or by testing for a given data condition. Prepared by: Dr Masri Ayob - TK2123

Thank you Q & A