ECE 382 Lesson 2 Readings Lesson Outline Admin Assembler Linker

Slides:



Advertisements
Similar presentations
Assembly Language.
Advertisements

Instruction Set Design
Code Composer Department of Electrical and Computer Engineering
S04: MSP430 Microarchitecture
Chapter 2 Data Manipulation Dr. Farzana Rahman Assistant Professor Department of Computer Science James Madison University 1 Some sldes are adapted from.
The 8051 Microcontroller and Embedded Systems
Outline MSP430 LaunchPad MSP430 Microcontroller
ECE 382 Lesson 6 Lesson Outline Example Assembly Code In class programming Debugging Assembly Code Lesson 6, 7, and 8 notes Admin CompEx1CompEx1  due.
Chung-Ta King National Tsing Hua University
CSE 340 Computer Architecture Spring 2014 MIPS ISA Review
Microprocessors General Features To be Examined For Each Chip Jan 24 th, 2002.
Processor System Architecture
Chapter 1 Background System Software Chih-Shun Hsu
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
Introduction to ARM Architecture, Programmer’s Model and Assembler Embedded Systems Programming.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
ARM programmer’s model and assembler Embedded Systems Programming.
Railway Foundation Electronic, Electrical and Processor Engineering.
Henry Hexmoor1 Chapter 10- Control units We introduced the basic structure of a control unit, and translated assembly instructions into a binary representation.
Micro-controller or embedded controller
8051 ASSEMBLY LANGUAGE PROGRAMMING
ARM C Language & Assembler. Using C instead of Java (or Python, or your other favorite language)? C is the de facto standard for embedded systems because.
Embedded Systems Programming
Railway Foundation Electronic, Electrical and Processor Engineering.
Software Development and Software Loading in Embedded Systems.
ARM Core Architecture. Common ARM Cortex Core In the case of ARM-based microcontrollers a company named ARM Holdings designs the core and licenses it.
The MSP430xxxx Department of Electrical and Computer Engineering
Development. Development Environment Editor Assembler or compiler Embedded emulator/debugger IAR Embedded Workbench Kickstart Code Composer Essentials.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Lab 4: MSP430 Microarchitecture
PHY 201 (Blum)1 Microcode Source: Digital Computer Electronics (Malvino and Brown)
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
MICROOCESSORS AND MICROCONTROLLER:
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
ARM Assembly Language Programming and Architecture by Mazidi et al
Lecture 5 A Closer Look at Instruction Set Architectures Lecture Duration: 2 Hours.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
ECE 447 Fall 2009 Lecture 4: TI MSP430 Architecture and Instruction Set.
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
8051 Micro Controller. Microcontroller versus general-purpose microprocessor.
Intel Xscale® Assembly Language and C. The Intel Xscale® Programmer’s Model (1) (We will not be using the Thumb instruction set.) Memory Formats –We will.
INTRODUCTION TO AVRASSEMBLY PROGRAMMING
The 8051 Microcontroller architecture
CS4101 嵌入式系統概論 General Purpose IO
Lecture 8: TI MSP430 Interrupts, ISRs
ECE 3430 – Intro to Microcomputer Systems
ECE 382 Lesson 3 ECE 382Website:
CS4101 Introduction to Embedded Systems Lab 1: MSP430 LaunchPad IDE
ECE 382 Lesson 6 Lesson Outline Status Register Flow of Control
S04: MSP430 Microarchitecture
CS4101 嵌入式系統概論 General Purpose IO
ECE 382 Lesson 4 Lesson Outline Readings
A Closer Look at Instruction Set Architectures
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
ECE 3430 – Intro to Microcomputer Systems
Unit – Microcontroller Tutorial Class - 2 ANITS College
ECEG-3202 Computer Architecture and Organization
Lecture 06 Programming language.
ECEG-3202 Computer Architecture and Organization
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
COMS 361 Computer Organization
8051 ASSEMBLY LANGUAGE PROGRAMMING
Review: The whole processor
8051 Development System Details
Program Assembly.
Computer Architecture and System Programming Laboratory
Presentation transcript:

ECE 382 Lesson 2 Readings Lesson Outline Admin Assembler Linker Intro to the MSP430 MSP430 Architecture Assembly and Machine Languages Admin Skills Review due next time!

Intro to the MSP430 What is an ISA? The MSP430 is an industry leader in low-cost, low-power consumption embedded applications RISC architecture with just 27 instructions. Products in the Wild Using MSP430 Only $5 Our version: Msp430g2553 What is an ISA?

Instruction Set Architecture Consists of set of operations (instructions) registers data units (byte/word/etc) addressing modes memory organization / memory map

MSP430’s ISA RISC architecture fewer instructions (27) emulates higher-level instructions (about 27) for instance, NOP  ___________ 16-bit datapath What is a datapath?

MSP430’s ISA What is a register? 16-bit datapath word size is 16 bits word is the natural unit of info for the processor 16 bit addresses 16 bit registers all instructions are 16 bits long this consistency isn't necessarily true of all processors, but it's convenient - allows us to load addresses into registers, perform ops on them, etc. What is a register?

MSP430’s ISA Registers - 16 bits wide 12 general purpose registers Fast memory that holds values in-use by the CPU Four special purpose registers r0 - Program Counter - holds address of instruction currently being executed r1 - Stack Pointer - address of top of stack r2 - Status Register - holds flags related to various conditions r3 - Constant Generator - 0, but can assume other values for different addressing modes (L4) 12 general purpose registers r4 to r15: can be used to hold anything you want

MSP430’s ISA Set of Operations 27 Instructions in 3 families - we'll talk about these next time Single-operand for instance, SWPB r12 Conditional jump for instance, JMP jump_label Two-operand for instance, MOV r12, r10

MSP430’s ISA Data Units byte-addressable memory instructions for byte and word actions MOV.B r12, r10 MOV.W r12, r10 remember, word size is 16 bits words must lie on even addresses

MSP430’s ISA How many addr bits? Msp430g2553 Memory Map 512b of RAM - 0x200-0x400 16kb of ROM - 0xc000-0xffdf 0x1100-0xc000 is empty! - There is no memory backing it up! - If you attempt to write to this area of memory, you'll trigger what's essentially a segmentation fault because that memory doesn't exist. It will cause the chip to do a Power-up Clear (PUC), resetting the state of your processor. This is a tough error to debug.

MSP430’s ISA Endianness concerned with the ordering of bytes on a computer. Little Endian means the least significant byte of a chunk of data is stored at the lowest memory address. MSP430 and your x86_64 are little endian Big Endian means the most significant byte of a chunk of data is stored at the lowest memory address. The 68S12 we used last semester used this If we executed MOV.W #0xdfec, &0x0200, how would that word be stored in memory? addr value 200   201 202 203 Debugger: 200

Assembly and Machine Languages Instructions: words in a computers language Instruction Set: the dictionary of the language Assembly Language: human-readable format of computer instructions Machine Language: computer-readable instructions - binary (1's and 0's) Assembly Language Program Assembler Relocatable Object Code Linker Executable Code

Let's write our first MSP430 program ; This program sets all pins on Port 1 to output and high. Since LEDs 1 and 2 are connected to P1.0 and P1.6 respectively, they will light up. .include 'header.S' .text main: mov.w #WDTPW, r15 ; turn off watchdog timer xor.w #WDTHOLD, r15 mov.w r15, &WDTCTL bis.b #0xFF, &P1DIR ; set port1 direction to output bis.b #0xFF, &P1OUT ; turn on leds at port1 loop: jmp loop ; loop forever

Example Relocatable Code Notice the addresses - the code starts at 0x0. Hex dump of section '.text': 0x00000000 3f40005a 3fe08000 824f2001 f2d32200 0x00000010 f2d32100 b0120000 ff3f After Linking Notice the addresses - the code starts at 0xC000. Hex dump of section '.text': 0x0000c000 3f40005a 3fe08000 824f2001 f2d32200 0x0000c010 f2d32100 b0121ac0 ff3fc243 21003041

Example Dissassembled Code Disassembly of section .text: 0000c000 <__ctors_end>: c000: 3f 40 00 5a mov #23040, r15 ;#0x5a00 c004: 3f e0 80 00 xor #128, r15 ;#0x0080 c008: 82 4f 20 01 mov r15, &0x0120 c00c: f2 d3 22 00 bis.b #-1, &0x0022 ;r3 As==11 c010: f2 d3 21 00 bis.b #-1, &0x0021 ;r3 As==11 0000c014 <loop>: c014: ff 3f jmp $+0 ;abs 0xc014

Code Composer Studio demo…