SlideShare una empresa de Scribd logo
1 de 36
Relatively Simple CPU and 8085
microprocessor Instruction Set
           Architecture
  Presented by: Chi Yan Hung
 Class: Cs 147 - sec 2 Fall 2001
        Prof: Sin-Min Lee
Topics to cover


• Relatively Simple Instruction Set Architecture


• 8085 Microprocessor Instruction Set Architecture
• Analyzing the 8085 Instruction Set Architecture


• Summary
Relatively Simple microprocessors, or CPU
• Designed as an instructional aid and draws its
features from several real microprocessors

• Too limited to run anything as complex as
      personal computer

• It has about the right level of complexity to
       control a microwave oven or other consumer
       appliance
Instruction Set Architecture (ISA)
    • Memory Model
•   Registers
•   Instruction set
Memory Model
• This microprocessor can access 64K ( = 216 )
bytes of memory

• Each byte has 8 bits, therefore it can access
     64K × 8 bits of memory

• 64K of memory is the maximum limit,
sometimes a system based on this CPU can
have less memory

• Use memory to map I/O
     Same instructions to use for accessing I/O
     devices and memory
Registers
•   Accumulator (AC), is an 8-bit general purpose
    register

•    Register R, is an 8-bit general purpose register.
     It supplies the second operand and also it can be
     use to store data that the AC will soon need to
     access.

•    Flag Z, is an 1-bit zero flag. Z is set to 1 or 0
     whenever an instruction is execute

•     Other registers that cannot be directly accessed
     by programmer
Instruction Set
• Data movement instructions

• Data operation instructions

• Program control instructions
•      Data movement instruction for the
       Relatively Simple CPU
Instruction              Operation

NOP                      No operation
LDAC Γ                   AC = M[Γ]
STAC Γ                   M[Γ] = AC
MVAC                     R = AC
MOVR                     AC = R
AC – accumulator register
R – general purpose register
Γ/M[Γ] – 16-bit memory address
•   NOP -- performs no operation
•   LDAC -- loads data from memory and stores
            it in the AC
•   STAC -- copies data from AC to memory
            location Γ
•   MVAC -- copies data in AC to register R
•   MOVR -- copies data from R to AC
•      Data operation instruction for the
        Relatively Simple CPU
Instruction   Operation

ADD           AC = AC + R, If (AC + R = 0) Then Z = 1 Else Z = 0
SUB           AC = AC - R, If (AC - R = 0) Then Z = 1 Else Z = 0
INAC          AC = AC + 1, If (AC + 1 = 0) Then Z = 1 Else Z = 0
CLAC          AC = 0, Z = 1
AND           AC = AC ∧ R, If (AC ∧ R = 0) Then Z = 1 Else Z = 0
OR            AC = AC ∨ R, If (AC ∨ R = 0) Then Z = 1 Else Z = 0
XOR           AC = AC ⊕ R, If (AC ⊕ R = 0) Then Z = 1 Else Z = 0
NOT           AC = AC′, If (AC′ = 0) Then Z = 1 Else Z = 0
  AC – accumulator register   R – general purpose register
  Z – zero flag
•      Program control instruction for the
       Relatively Simple CPU

Instruction         Operation

JUMP Γ              GOTO Γ
JMPZ Γ              If (Z = 1) Then GOTO Γ
JPNZ Γ              If (Z = 0) Then GOTO Γ

Z – zero flag
Γ -- 16-bit memory address
Note:
•   Each instruction is having an 8-bit instruction
    code.
•   LDAC, STAC, JUMP, JUMPZ, and JPNZ
    instructions all require a 16-bit memory
    address, represented by Γ/M[Γ]. These
    instructions each require 3 bytes in
    memory.
Instruction formats for the Relatively
             Simple CPU
        byte 1      Instruction code
        byte 2    Low-order 8 bits of Γ
        byte 3 High-order 8 bits of Γ
Example:
       25:       JUMP 1234 H
instruction stored in memory:
 25th byte      25:    0000 0101     (JUMP)
 26th byte      26:    0011 0100     (34H)
 27th byte      27:    0001 0010     (12H)

 H -- in hexadecimal format
•        Example program using Relatively Simple CPU coding


    The Algorithm of the program
    1:       total = 0, i = 0
    2:       i=i+1
    3:       total = total + i
    4:       IF i ≠ n THEN GOTO 2


    What exactly this algorithm doing is: 1+ 2 + … + (n – 1) + n
The Relatively Simple CPU coding of the program
      CLAC
      STAC total    total = 0, i = 0
      STAC i
Loop: LDAC i
      INAC          i = i +1
      STAC i
      MVAC
      LDAC total
                    total = total +1
      ADD
      STAC total
      LDAC n
      SUB           IF i ≠ n THEN GOTO Loop
      JPNZ Loop
Relatively Simple microprocessors, or CPU
• Designed as an instructional aid and draws its
features from several real microprocessors

• Too limited to run anything as complex as
      personal computer

• It has about the right level of complexity to
       control a microwave oven or other consumer
       appliance
Instruction Set Architecture (ISA)
    • Memory Model
•   Registers Set
•   Instruction Set
Memory Model
• This microprocessor is a complete 8-bit
parallel Central Processing Unit (CPU).

• Each byte has 8 bits

• Isolated I/O, input and output devices are
treated as being separate from memory.
       Different instructions access memory and I/O
       devices
Register Set
•   Accumulator A, is an 8-bit register.
•   Register B, C, D, E, H, and L, are six 8-bit
    general purpose register. These registers can be
    accessed individually, or can be accessed in
    pairs.
•   Pairs are not arbitrary; BC are a pair (16- bit),
    as are DE, and HL
•   Register HL is used to point to a memory
    location.
•   Stack pointer, SP, is an 16-bit register, which
    contains the address of the top of the stack.
•   The sign flag, S, indicates the sign of a value
    calculated by an arithmetic or logical
    instruction.
•   The zero flag, Z, is set to 1 if an arithmetic or
    logical operation produces a result of 0;
    otherwise set to 0.
•   The parity flag, P, is set to 1 if the result of an
    arithmetic or logical operation has an even
    number of 1’s; otherwise it is set to 0.
•   The carry flag, CY, is set when an arithmetic
    operation generates a carry out.
•   The auxiliary carry flag, AC, very similar to
    CY, but it denotes a carry from the lower half of
    the result to the upper half.
•   The interrupt mask, IM, used to enable and
    disable interrupts, and to check for pending
    interrupts
Instruction Set
• Data movement instructions

• Data operation instructions

• Program control instructions
Data movement instruction for the 8085 microprocessor
Instruction         Operation
MOV r1, r2          r1 = r2
LDA Γ               A = M[Γ]
STA Γ               M[Γ] = A
PUSH rp             Stack = rp (rp ≠ SP)
PUSH PSW            Stack = A, flag register
POP rp              rp = Stack (rp ≠ SP)
POP PSW             A, flag register = Stack
IN n                A = input port n
OUT n               Output port n =A
 r, r1, r2 – any 8-bits register             Γ / M[Γ] – memory location
 rp – register pair BC, DE, HL, SP(Stack pointer)
 n – 8-bit address or data value
Data operation instruction for the 8085 microprocessor
    Instruction       Operation           Flags
    ADD r             A=A+r               All
    ADD M             A = A + M[HL]       All
    INR r             r=r+1               Not CY
    IN M              M[HL] = M[HL] + 1   Not CY
    DCR n             r=r-1               Not CY
    DCR M             M[HL] = M[HL] - 1   Not CY
    XRA M             A = A ⊕ M[HL]       All
    CMP r             Compare A and r     All
    CMA               A = A′              None

    CY – carry flag
Program control instruction for the
                8085 microprocessor

Instruction Operation
JUMP Γ        GOTO Γ
Jcond Γ       If condition is true then GOTO Γ
CALL Γ        Call subroutine at Γ
Ccond Γ       If condition is true then call subroutine at Γ
RET           Return from subroutine
Rcond         If condition is true then return from subroutine
cond – conditional instructions
       NZ (Z = 0)      Z (Z = 1)       P (S = 0)      N (S = 1)
       PO (P = 0)      PE (P = 1)      NC (CY = 0) C (CY = 1)
Z – zero flag, S – sign flag, P – parity flag, C – carry flag
Note:
•   Each instruction is having an 8-bit instruction
    code.
•   Some instructions have fields to specify
    registers, while others are fixed.
Instruction formats for the Relatively
               Simple CPU

             byte 1    Instruction code
Two-byte
             byte 2          value

  Example:
           25:   MVI    r, n
                                          Specifies r
  instruction stored in memory:
   25th byte      25:    00xxx110     (MVI r)
   26th byte      26:    xxxx xxxx    (low-order memory)
byte 1     Instruction code
Three-byte byte 2      Low-order 8 bits
            byte 3     High-order 8 bits

    Example:
   Example:
           25:
          25:    LXI rp, Γr2
                  MOV r1,
                                       Specifies rp
    instruction stored in memory:
   instruction stored in memory:
      25th byte 25:
    25th byte       25: 00rp 0001
                           0000 0001     (MOV)
                                       (LXI rp)
      26th byte 26:
    26th byte       26: xxxx xxxx
                           xxxx xxxx     (specifies r1)
                                       (low-order memory)
      27th byte 27:
    27th byte       27: yyyy yyyy
                           yyyy yyyy   (high-order r2)
                                         (specifies
   memory)
•    Example program using 8085 microprocessor coding
    The Algorithm of the program
    1:    total = 0, i = 0
    2:    i=i+1                     n + (n - 1) + … + 1
    3:    total = total + i
    4:    IF i ≠ n THEN GOTO 2
     The 8085 coding of the program
               LDA n
                                i=n
               MOV B, A
              XRA A            sum = A ⊕ A = 0
       Loop: ADD B             sum = sum + i
              DCR B            i=i-1
              JNZ Loop         IF i ≠ 0 THEN GOTO Loop
              STA total        total = sum
Analyzing the 8085 ISA
• The 8085 CPU’s instruction set is more
complete than that of the Relatively
Simple CPU. More suitable for consumer
appliance.

• Too limited to run anything as complex   as
personal computer
Advantages of the 8085’s ISA vs.
      Relative Simple CPU
• It has the ability to use subroutines

• It can incorporate interrupts, and it has
      everything the programmer needs in
      order to process interrupts.

• The register set for the 8085 is mostly
    sufficient, thus less coding apply which
    will improve task completion.
• The instruction set is fairly orthogonal.
    E.g. no clear accumulator instruction


  Disadvantages of the 8085’s ISA
• Like the Relatively Simple CPU, it
cannot easily process floating point data.
Summary of ISA
1. The ISA specifies
      a.     an instruction set that the CPU can process
      b.     its user accessible registers
      c.     how it interacts with memory

2.     The ISA does not specify how the CPU is designed, but
       it specifies what it must be able to do.

3.     The ISA is concerned only with the machine language
       of a microprocessor because CPU only executes
       machine language program, not any kind of high-level
       program.
4. When designing an ISA, an important goal is
completeness:
      a.      instruction set should include the instructions
              needed to program all desired tasks.
      b.      instruction should be orthogonal, minimizing
              overlap, reducing the digital logic without
              reducing its capabilities within the CPU.
      c.      CPU should includes enough registers to
              minimize memory accesses, and improve
              performance.

5.     An ISA should specifies the types of data the
       instruction set to process.
6.   An ISA should specifies the addressing modes each
     instruction can use

7.   An ISA should specifies the format for each instruction
THE END

Más contenido relacionado

La actualidad más candente

Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Hsien-Hsin Sean Lee, Ph.D.
 
Lec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILP
Lec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILPLec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILP
Lec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILPHsien-Hsin Sean Lee, Ph.D.
 
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIWLec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIWHsien-Hsin Sean Lee, Ph.D.
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1v1i7n9i2
 
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsPragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsMarina Kolpakova
 
8051 experiments1
8051 experiments18051 experiments1
8051 experiments1tt_aljobory
 
8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil KawareProf. Swapnil V. Kaware
 
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...Hsien-Hsin Sean Lee, Ph.D.
 
Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...
Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...
Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...Hsien-Hsin Sean Lee, Ph.D.
 
Lec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Pipelining
Lec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- PipeliningLec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Pipelining
Lec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- PipeliningHsien-Hsin Sean Lee, Ph.D.
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 softbaluusa8
 
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...Hsien-Hsin Sean Lee, Ph.D.
 
4th sem,(cs is),computer org unit-7
4th sem,(cs is),computer org unit-74th sem,(cs is),computer org unit-7
4th sem,(cs is),computer org unit-7Sujay pai
 

La actualidad más candente (20)

Limen Alpha Processor
Limen Alpha ProcessorLimen Alpha Processor
Limen Alpha Processor
 
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
 
Lec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILP
Lec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILPLec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILP
Lec2 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ILP
 
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIWLec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
 
Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1Ec2308 microprocessor and_microcontroller__lab1
Ec2308 microprocessor and_microcontroller__lab1
 
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsPragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
 
8051 experiments1
8051 experiments18051 experiments1
8051 experiments1
 
8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware
 
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
 
Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...
Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...
Lec20 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Da...
 
Mpmc lab
Mpmc labMpmc lab
Mpmc lab
 
Instruction types
Instruction typesInstruction types
Instruction types
 
Lec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Pipelining
Lec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- PipeliningLec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Pipelining
Lec1 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Pipelining
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8086 Instruction set
8086 Instruction set8086 Instruction set
8086 Instruction set
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 soft
 
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
 
4th sem,(cs is),computer org unit-7
4th sem,(cs is),computer org unit-74th sem,(cs is),computer org unit-7
4th sem,(cs is),computer org unit-7
 

Destacado

MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085Sumadeep Juvvalapalem
 
T-states in microprocessor 8085
T-states in microprocessor 8085T-states in microprocessor 8085
T-states in microprocessor 8085yedles
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operationNikhil Pandit
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly languageAhmed M. Abed
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1Motaz Saad
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 

Destacado (12)

MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085MICROPROCESSOR INSTRUCTION SET OF 8085
MICROPROCESSOR INSTRUCTION SET OF 8085
 
Instruction set
Instruction setInstruction set
Instruction set
 
T-states in microprocessor 8085
T-states in microprocessor 8085T-states in microprocessor 8085
T-states in microprocessor 8085
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
ARM Processor
ARM ProcessorARM Processor
ARM Processor
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 

Similar a Chapter3 presentation2

5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085Mani Afranzio
 
(a)Suppose the main memory of the Pep8 were completely filled with .docx
(a)Suppose the main memory of the Pep8 were completely filled with .docx(a)Suppose the main memory of the Pep8 were completely filled with .docx
(a)Suppose the main memory of the Pep8 were completely filled with .docxajoy21
 
MICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERSMICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERSselvakumar948
 
UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER ravis205084
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructionsRavi Anand
 
20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptx20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptxMohanumar S
 
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS Mohanumar S
 
8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptx8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptxkarthik R
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.pptsteffydean
 
ARM Architecture Instruction Set
ARM Architecture Instruction SetARM Architecture Instruction Set
ARM Architecture Instruction SetDwight Sabio
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Kshitij Singh
 
unit2-8085-programminG.pptx
unit2-8085-programminG.pptxunit2-8085-programminG.pptx
unit2-8085-programminG.pptxRajaSekhar533255
 

Similar a Chapter3 presentation2 (20)

5th unit Microprocessor 8085
5th unit Microprocessor 80855th unit Microprocessor 8085
5th unit Microprocessor 8085
 
Emb day2 8051
Emb day2 8051Emb day2 8051
Emb day2 8051
 
(a)Suppose the main memory of the Pep8 were completely filled with .docx
(a)Suppose the main memory of the Pep8 were completely filled with .docx(a)Suppose the main memory of the Pep8 were completely filled with .docx
(a)Suppose the main memory of the Pep8 were completely filled with .docx
 
MICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERSMICROPROCESSORS AND MICROCONTROLLERS
MICROPROCESSORS AND MICROCONTROLLERS
 
UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER UNIT II MICROPROCESSOR AND MICROCONTROLLER
UNIT II MICROPROCESSOR AND MICROCONTROLLER
 
Lec03
Lec03Lec03
Lec03
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
 
20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptx20ME702– MECHATRONICS -UNIT-2.pptx
20ME702– MECHATRONICS -UNIT-2.pptx
 
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
 
8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptx8085 MICROPROCESSOR.pptx
8085 MICROPROCESSOR.pptx
 
set de instrucciones primera parte de atmel
set de instrucciones primera parte de atmelset de instrucciones primera parte de atmel
set de instrucciones primera parte de atmel
 
8085 MICROPROCESSOR
8085 MICROPROCESSOR 8085 MICROPROCESSOR
8085 MICROPROCESSOR
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
ARM Architecture Instruction Set
ARM Architecture Instruction SetARM Architecture Instruction Set
ARM Architecture Instruction Set
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1
 
8085-paper-presentation.ppt
8085-paper-presentation.ppt8085-paper-presentation.ppt
8085-paper-presentation.ppt
 
unit2-8085-programminG.pptx
unit2-8085-programminG.pptxunit2-8085-programminG.pptx
unit2-8085-programminG.pptx
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Chapter3 presentation2

  • 1. Relatively Simple CPU and 8085 microprocessor Instruction Set Architecture Presented by: Chi Yan Hung Class: Cs 147 - sec 2 Fall 2001 Prof: Sin-Min Lee
  • 2. Topics to cover • Relatively Simple Instruction Set Architecture • 8085 Microprocessor Instruction Set Architecture • Analyzing the 8085 Instruction Set Architecture • Summary
  • 3. Relatively Simple microprocessors, or CPU • Designed as an instructional aid and draws its features from several real microprocessors • Too limited to run anything as complex as personal computer • It has about the right level of complexity to control a microwave oven or other consumer appliance
  • 4. Instruction Set Architecture (ISA) • Memory Model • Registers • Instruction set
  • 5. Memory Model • This microprocessor can access 64K ( = 216 ) bytes of memory • Each byte has 8 bits, therefore it can access 64K × 8 bits of memory • 64K of memory is the maximum limit, sometimes a system based on this CPU can have less memory • Use memory to map I/O Same instructions to use for accessing I/O devices and memory
  • 6. Registers • Accumulator (AC), is an 8-bit general purpose register • Register R, is an 8-bit general purpose register. It supplies the second operand and also it can be use to store data that the AC will soon need to access. • Flag Z, is an 1-bit zero flag. Z is set to 1 or 0 whenever an instruction is execute • Other registers that cannot be directly accessed by programmer
  • 7. Instruction Set • Data movement instructions • Data operation instructions • Program control instructions
  • 8. Data movement instruction for the Relatively Simple CPU Instruction Operation NOP No operation LDAC Γ AC = M[Γ] STAC Γ M[Γ] = AC MVAC R = AC MOVR AC = R AC – accumulator register R – general purpose register Γ/M[Γ] – 16-bit memory address
  • 9. NOP -- performs no operation • LDAC -- loads data from memory and stores it in the AC • STAC -- copies data from AC to memory location Γ • MVAC -- copies data in AC to register R • MOVR -- copies data from R to AC
  • 10. Data operation instruction for the Relatively Simple CPU Instruction Operation ADD AC = AC + R, If (AC + R = 0) Then Z = 1 Else Z = 0 SUB AC = AC - R, If (AC - R = 0) Then Z = 1 Else Z = 0 INAC AC = AC + 1, If (AC + 1 = 0) Then Z = 1 Else Z = 0 CLAC AC = 0, Z = 1 AND AC = AC ∧ R, If (AC ∧ R = 0) Then Z = 1 Else Z = 0 OR AC = AC ∨ R, If (AC ∨ R = 0) Then Z = 1 Else Z = 0 XOR AC = AC ⊕ R, If (AC ⊕ R = 0) Then Z = 1 Else Z = 0 NOT AC = AC′, If (AC′ = 0) Then Z = 1 Else Z = 0 AC – accumulator register R – general purpose register Z – zero flag
  • 11. Program control instruction for the Relatively Simple CPU Instruction Operation JUMP Γ GOTO Γ JMPZ Γ If (Z = 1) Then GOTO Γ JPNZ Γ If (Z = 0) Then GOTO Γ Z – zero flag Γ -- 16-bit memory address
  • 12. Note: • Each instruction is having an 8-bit instruction code. • LDAC, STAC, JUMP, JUMPZ, and JPNZ instructions all require a 16-bit memory address, represented by Γ/M[Γ]. These instructions each require 3 bytes in memory.
  • 13. Instruction formats for the Relatively Simple CPU byte 1 Instruction code byte 2 Low-order 8 bits of Γ byte 3 High-order 8 bits of Γ Example: 25: JUMP 1234 H instruction stored in memory: 25th byte 25: 0000 0101 (JUMP) 26th byte 26: 0011 0100 (34H) 27th byte 27: 0001 0010 (12H) H -- in hexadecimal format
  • 14. Example program using Relatively Simple CPU coding The Algorithm of the program 1: total = 0, i = 0 2: i=i+1 3: total = total + i 4: IF i ≠ n THEN GOTO 2 What exactly this algorithm doing is: 1+ 2 + … + (n – 1) + n
  • 15. The Relatively Simple CPU coding of the program CLAC STAC total total = 0, i = 0 STAC i Loop: LDAC i INAC i = i +1 STAC i MVAC LDAC total total = total +1 ADD STAC total LDAC n SUB IF i ≠ n THEN GOTO Loop JPNZ Loop
  • 16. Relatively Simple microprocessors, or CPU • Designed as an instructional aid and draws its features from several real microprocessors • Too limited to run anything as complex as personal computer • It has about the right level of complexity to control a microwave oven or other consumer appliance
  • 17. Instruction Set Architecture (ISA) • Memory Model • Registers Set • Instruction Set
  • 18. Memory Model • This microprocessor is a complete 8-bit parallel Central Processing Unit (CPU). • Each byte has 8 bits • Isolated I/O, input and output devices are treated as being separate from memory. Different instructions access memory and I/O devices
  • 19. Register Set • Accumulator A, is an 8-bit register. • Register B, C, D, E, H, and L, are six 8-bit general purpose register. These registers can be accessed individually, or can be accessed in pairs. • Pairs are not arbitrary; BC are a pair (16- bit), as are DE, and HL • Register HL is used to point to a memory location. • Stack pointer, SP, is an 16-bit register, which contains the address of the top of the stack.
  • 20. The sign flag, S, indicates the sign of a value calculated by an arithmetic or logical instruction. • The zero flag, Z, is set to 1 if an arithmetic or logical operation produces a result of 0; otherwise set to 0. • The parity flag, P, is set to 1 if the result of an arithmetic or logical operation has an even number of 1’s; otherwise it is set to 0. • The carry flag, CY, is set when an arithmetic operation generates a carry out. • The auxiliary carry flag, AC, very similar to CY, but it denotes a carry from the lower half of the result to the upper half.
  • 21. The interrupt mask, IM, used to enable and disable interrupts, and to check for pending interrupts
  • 22. Instruction Set • Data movement instructions • Data operation instructions • Program control instructions
  • 23. Data movement instruction for the 8085 microprocessor Instruction Operation MOV r1, r2 r1 = r2 LDA Γ A = M[Γ] STA Γ M[Γ] = A PUSH rp Stack = rp (rp ≠ SP) PUSH PSW Stack = A, flag register POP rp rp = Stack (rp ≠ SP) POP PSW A, flag register = Stack IN n A = input port n OUT n Output port n =A r, r1, r2 – any 8-bits register Γ / M[Γ] – memory location rp – register pair BC, DE, HL, SP(Stack pointer) n – 8-bit address or data value
  • 24. Data operation instruction for the 8085 microprocessor Instruction Operation Flags ADD r A=A+r All ADD M A = A + M[HL] All INR r r=r+1 Not CY IN M M[HL] = M[HL] + 1 Not CY DCR n r=r-1 Not CY DCR M M[HL] = M[HL] - 1 Not CY XRA M A = A ⊕ M[HL] All CMP r Compare A and r All CMA A = A′ None CY – carry flag
  • 25. Program control instruction for the 8085 microprocessor Instruction Operation JUMP Γ GOTO Γ Jcond Γ If condition is true then GOTO Γ CALL Γ Call subroutine at Γ Ccond Γ If condition is true then call subroutine at Γ RET Return from subroutine Rcond If condition is true then return from subroutine cond – conditional instructions NZ (Z = 0) Z (Z = 1) P (S = 0) N (S = 1) PO (P = 0) PE (P = 1) NC (CY = 0) C (CY = 1) Z – zero flag, S – sign flag, P – parity flag, C – carry flag
  • 26. Note: • Each instruction is having an 8-bit instruction code. • Some instructions have fields to specify registers, while others are fixed.
  • 27. Instruction formats for the Relatively Simple CPU byte 1 Instruction code Two-byte byte 2 value Example: 25: MVI r, n Specifies r instruction stored in memory: 25th byte 25: 00xxx110 (MVI r) 26th byte 26: xxxx xxxx (low-order memory)
  • 28. byte 1 Instruction code Three-byte byte 2 Low-order 8 bits byte 3 High-order 8 bits Example: Example: 25: 25: LXI rp, Γr2 MOV r1, Specifies rp instruction stored in memory: instruction stored in memory: 25th byte 25: 25th byte 25: 00rp 0001 0000 0001 (MOV) (LXI rp) 26th byte 26: 26th byte 26: xxxx xxxx xxxx xxxx (specifies r1) (low-order memory) 27th byte 27: 27th byte 27: yyyy yyyy yyyy yyyy (high-order r2) (specifies memory)
  • 29. Example program using 8085 microprocessor coding The Algorithm of the program 1: total = 0, i = 0 2: i=i+1 n + (n - 1) + … + 1 3: total = total + i 4: IF i ≠ n THEN GOTO 2 The 8085 coding of the program LDA n i=n MOV B, A XRA A sum = A ⊕ A = 0 Loop: ADD B sum = sum + i DCR B i=i-1 JNZ Loop IF i ≠ 0 THEN GOTO Loop STA total total = sum
  • 30. Analyzing the 8085 ISA • The 8085 CPU’s instruction set is more complete than that of the Relatively Simple CPU. More suitable for consumer appliance. • Too limited to run anything as complex as personal computer
  • 31. Advantages of the 8085’s ISA vs. Relative Simple CPU • It has the ability to use subroutines • It can incorporate interrupts, and it has everything the programmer needs in order to process interrupts. • The register set for the 8085 is mostly sufficient, thus less coding apply which will improve task completion.
  • 32. • The instruction set is fairly orthogonal. E.g. no clear accumulator instruction Disadvantages of the 8085’s ISA • Like the Relatively Simple CPU, it cannot easily process floating point data.
  • 33. Summary of ISA 1. The ISA specifies a. an instruction set that the CPU can process b. its user accessible registers c. how it interacts with memory 2. The ISA does not specify how the CPU is designed, but it specifies what it must be able to do. 3. The ISA is concerned only with the machine language of a microprocessor because CPU only executes machine language program, not any kind of high-level program.
  • 34. 4. When designing an ISA, an important goal is completeness: a. instruction set should include the instructions needed to program all desired tasks. b. instruction should be orthogonal, minimizing overlap, reducing the digital logic without reducing its capabilities within the CPU. c. CPU should includes enough registers to minimize memory accesses, and improve performance. 5. An ISA should specifies the types of data the instruction set to process.
  • 35. 6. An ISA should specifies the addressing modes each instruction can use 7. An ISA should specifies the format for each instruction