04-CPU

Embed Size (px)

Citation preview

  • 7/29/2019 04-CPU

    1/28

    MSP430G2553

    CPU

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    2/28

    CPU Feature

    Registers

    Addressing Modes

    Instructions

    MSP430

    RealTime TechnoSoft

    MSP430G2553 CPU Agenda

  • 7/29/2019 04-CPU

    3/28

    MSP430G2553

    CPU Features

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    4/28

    CPU Features

    Designed for modern programming techniques

    Calculated branching, Table processing

    RISC Architecture 27 Instruction and 7 addressing modes

    Orthogonal architecture

    Every instruction usable with every addressing mode

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    5/28

    CPU Features

    Access entire memory range No paging required

    Single-cycle register operations Predicted execution time

    Full register access Including program counter, status registers, and stack pointer

    Direct memory-to-memory transfers without intermediate registerholding Better register utilization

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    6/28

    MSP430G2553

    Registers

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    7/28

    CPU Block Diagram:

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    8/28

    MSP430

    RealTime TechnoSoft

    R3 R15

    Dedicated General Purpose

    RO

    R1

    R2

    R4

    R5

    .

    .

    PC

    SR

    SP

    CG

  • 7/29/2019 04-CPU

    9/28

    Program Counter (PC)

    PC R0 Holds address of next instruction to execute

    Holds even number

    Since all instructions size are even number (2, 4, 6 bytes)

    16bits wide Can address 64KB space

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    10/28

    Stack Pointer (SP) SP R1 CPU to store the return addresses

    Subroutine/interrupt call

    Predecrement, postincrement scheme

    PUSH Decrement SP then WRITE POP READ and then Increment SP

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    11/28

    Status Register (SR) R2MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    12/28

    Constant Generator (CG)

    R3

    Stores the constant values used in immediate addressing mode

    Assembler automatically uses it

    Source-only register

    Applications cannot use this register as destinationOnly assembler could use

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    13/28

    General-Purpose Registers

    R4 to R15

    Can be used for

    Data registers

    Address pointers or

    Index values

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    14/28

    MSP430G2553

    Addressing Modes

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    15/28

    Addressing Modes

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    16/28

    Register Addressing Mode

    Example: MOV R10,R11

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    17/28

    Indexed Addressing Modes

    Example: MOV 2 (R5) , 6 (R6)

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    18/28

    Symbolic Mode: Example: MOV EDE,TONI; EDE = (PC + X)

    TONI = (PC + Y)

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    19/28

    Absolute Mode: Example: MOV &EDE,&TONI ; EDE = 0F016h ; TONI = 01114h

    MSP430

    RealTime TechnoSoft

    MSP430

  • 7/29/2019 04-CPU

    20/28

    Indirect Register Mode: Example: MOV.B @R10,0(R11)

    MSP430

    RealTime TechnoSoft

    MSP430

  • 7/29/2019 04-CPU

    21/28

    Indirect Auto-Increment Mode: Example: MOV @R10+,0(R11) ; R10 auto incremented

    MSP430

    RealTime TechnoSoft

    MSP430

  • 7/29/2019 04-CPU

    22/28

    Immediate Mode: Example: MOV #45h,TONI

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    23/28

    MSP430G2553

    Instructions

    RealTime TechnoSoft

    MSP430

  • 7/29/2019 04-CPU

    24/28

    Instruction Set:

    27core instructions and 24 emulated instructions.

    Core ins->unique op-codes

    Emulated-> code easier to write and read

    MSP430

    RealTime TechnoSoft

    MSP430

  • 7/29/2019 04-CPU

    25/28

    Double-Operand:

    Word or Byte instruction (.B,.W)

    Examples:

    MOV (.B)ADD (.B)

    SUB (.B)

    MUL (.W)

    ADDC (.B)

    MSP430

    RealTime TechnoSoft

    MSP430

  • 7/29/2019 04-CPU

    26/28

    Single-Operand:

    Example:

    RRC (B)

    RRA (B)SWP (B)

    PUSH (.B)

    MSP430

    RealTime TechnoSoft

    MSP430

  • 7/29/2019 04-CPU

    27/28

    Jump:

    Example:

    JMP

    JCJNC

    JN

    MSP430

    RealTime TechnoSoft

  • 7/29/2019 04-CPU

    28/28

    Q & A

    RealTime TechnoSoft