ECE 447 Fall 2009 Lecture 4: TI MSP430 Architecture and Instruction Set.

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

UBI >> Contents Chapter 15 Advanced Laboratories MSP430 assembly language tutorial: MSP430X CPU MSP430 Teaching Materials Texas Instruments Incorporated.
MSP430 Assembly Paul Roper
ECE 447 Fall 2009 Lecture 2: TI MSP430 Software Development C and MSP430 Assembly.
UBI >> Contents Chapter 15 Advanced Laboratories MSP430 assembly language tutorial: Instructions MSP430 Teaching Materials Texas Instruments Incorporated.
INSTRUCTION SET ARCHITECTURES
Instruction Set Architecture
Processor Function Topic 3.
Instruction Set Architecture & Design
TK 2633 Microprocessor & Interfacing
COMP3221: Microprocessors and Embedded Systems--Lecture 8 1 COMP3221: Microprocessors and Embedded Systems Lecture 8: Program Control Instructions
Execution of an instruction
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Memory - Registers Instruction Sets
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Pentium Addressing Modes
EET 2261 Unit 2 HCS12 Architecture
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Architecture of the MSP430 Processor. Central Processing Unit Program Counter (PC) - Contains the address of the next instruction to be executed. The.
Rabel Talpur:12BME#025.  40-pin chip  Developed by Motorola in 1975  16 address lines and 8 data lines  Used only +5V.
MICROCONTROLLER INSTRUCTION SET
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA.
ECE 447 Fall 2009 Lecture 5: TI MSP430 Software Development in C and Assembly pt. 2.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
VAX-11/780 – A Virtual Address Extension to the DEC PDP-11 Family ( Author : W.D.Strecker ) By Padmaja chowti.
Machine Instruction Characteristics
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR1 Addressing Mode.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
Execution of an instruction
Computer Architecture Lecture 03 Fasih ur Rehman.
Topics covered: Instruction Set Architecture CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
October 1, 2003Serguei A. Mokhov, 1 SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003.
Assembly Language Programming of 8085 BY Prof. U. V. THETE Dept. of Computer Science YMA.
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 2)
Computer Organization Instructions Language of The Computer (MIPS) 2.
CPE 323 Introduction to Embedded Computer Systems: The MSP430X Architecture Instructor: Dr Aleksandar Milenkovic.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
F453 Module 8: Low Level Languages 8.2: Features of Low-Level Languages.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Assembly language programming
Unit 1 Instruction set M.Brindha AP/EIE
ECE 3430 – Intro to Microcomputer Systems
Control Unit Lecture 6.
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
ARM Registers Register – internal CPU hardware device that stores binary data; can be accessed much more rapidly than a location in RAM ARM has.
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Machine control instruction
8051 Addressing Modes The way, using which the data source or destination addresses are specified in the instruction mnemonic for moving the data, is.
Microcomputer Programming
BIC 10503: COMPUTER ARCHITECTURE
STACK and Stack Pointer
ECE 3430 – Intro to Microcomputer Systems
Chapter 8 Central Processing Unit
Addressing Modes Register Direct, with 1 and 2 registers I/O Direct
Introduction to Micro Controllers & Embedded System Design
Introduction to Microprocessor Programming
8051 ASSEMBLY LANGUAGE PROGRAMMING
COMPUTER ORGANIZATION AND ARCHITECTURE
Presentation transcript:

ECE 447 Fall 2009 Lecture 4: TI MSP430 Architecture and Instruction Set

ECE447: MSP430 Assembly language Specific to the platform (ie: The MSP430). No data types, structures, or explicit execution control (for, while, if, switch) Define locations for and variables and program code. No complex instructions, such as long integer math, floating point. Close coupling to the hardware (registers, peripherals and input/output ports) Teaches a more in depth appreciation for the device architecture.

ECE 447: Levels of Software High-level language (C, C++, Pascal) Assembly language (MSP430, 8051, Z80) Machine language assembler compiler linker Object code

ECE 447: Levels of Software C Pascal Pseudocode MSP Z80 Object code compiler assembler Machine language Object code Machine language Object code Machine language linker

ECE447: Assembly vs. Machine code for the MSP – 1211 – – 0 OpcodeS-regAdB/WAsD-reg Opcode (4 bits): Operation Code S-reg and Dreg (4 bits each): Specifies CPU registers associated with the src and dst Ad (1 bit): Gives mode of addressing for dst B/W (1 bit): chooses whether the operand is a byte (1) or a word (0) As (2 bits): gives the mode of addressing for the src mov.wR5, R6; 4506 – Machine code translation

ECE 447: Features of Assembly Language 1. Very hardware dependent 2. Not very portable (if at all) 3. Very detailed (responsible for all register contents) 4. No inherent data types 5. Requires programming discipline 6. Difficult to document 7. Access to all hardware intricacies of the chip 8. Fastest execution 9. Small memory usage

ECE447: MSP430 Register Structure PC: Program Counter Contains the address of the next instruction to be executed. SP: Stack Pointer Contain the address of the stack frame. The stack is primarily responsible for storing the return address of subroutine calls. SR: Status Register Contains a set of flags CG1/CG2: Constant Generator Provides the six most frequently used values so that they do not need to be fetched from memory.

ECE 447: MSP430 Status Register (SR) V - Overflow, set when a result of a signed operation has overflowed. N - Negative, set to the msb of the result which indicates a negative number if the values are signed. Z - Zero, set when the result is 0. C - Carry, set to indicate an arithmetic operation is too larger to fit in the destination space. GIE - General Interrupt Enable - Set to enable the maskable interrupts. OSCOFF, CPUOFF, SCG0, SCG1 - bits to control the mode of operation of the MCU. Will be covered in detail in discussion of Low Power Modes.

ECE447: Groups of Instructions (1) –Movement - general (mov) –Movement - stack (push, pop) –Arithmetic i.One Operand (clr, dec, inc, test) ii.Two Operands (add, sub, cmp) iii.Decimal Arithmetic (dadd, dadc) –Logic Instructions i.One Operand (inv(ert)) ii.Two Operands (and, xor, bis, bic)

ECE447: Groups of Instructions (2) –Status Register Instructions clr(c/z/n): clear specified bits set(c/z/n): set specified bits dint/eint: disable/enable interrupts –Shift and Rotates rla, rra: arithmetic shift left/right rlc, rrc: rotate through carry left/right –Byte Manipulation swpb: swap bytes (word only) sxt: sign extend (word only)

ECE447: Groups of Instructions (3) –Flow Control Operations br: branch (go to) call: call a subroutine ret: return from subroutine reti: return from interrupt nop: no operation (consumes one cycle) –Jumps jmp: unconditional jump conditional jmp’s: various conditional jumps

ECE447: MSP430 Operand width notation Most MSP430 instructions can operate on either 8 or 16 bit data. In MSP430X device the 20 bit address bus is also supported for operands. The move instruction: –mov.b - Operands will be byte wide –mov.w - Operands will be word (16-bit) wide –mov.a - Operands will be address word (20- bit) wide

ECE447: Move Instruction (mov) Only one mov instruction to move data Can address all of memory as either source or destination, including all registers. Note: The MSP430 mov instruction does not affect the SR register bits.

Addressing Modes The ways in which operands can be specified

Register Mode

Indexed Mode

Indexed Mode (cont.)

Symbolic Mode

Symbolic Mode (cont.)

Absolute Mode

Absolute Mode (cont.)

Indirect Register Mode

Indirect Register Mode (cont.)

Indirect Autoincrement Mode

Indirect Autoincrement Mode (cont.)

Immediate Mode

Immediate Mode (cont.)

Addressing Mode Summary

Addressing Mode Examples Register Indexed Absolute Indirect Immediate

ECE447: MSP430 Constant Generator and Emulated Instruction Two registers in the MSP430 allow up to 7 common constant values. R3/CG2 and R2/SR/CG1 when accessed in various addressing modes provide “0” base for absolute addressing and six immediate values 0,1,2,4,8, and 0xFFFF. The instruction that use these values are “emulated,” that is no actual machine instruction exists for the mnemonic

ECE447: MSP430 Constant Generator and Emulated Instruction InstructionExplanationEmulation nopNo operation commencedmov R3, R3

Summary Assembly Rocks! MSP430 Registers Instruction Types The mov command Addressing Modes