Chapter 07 - MSP430 Assembler

Chapter 07 - MSP430 Assembler - Chapter 7 MSP430 Assembler...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 7 – MSP430 Assembler / Linker
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS/ECEn Chapter 7 - MSP430 Assembler 2 Topics to Cover… n High Level vs. Assembly n MSP430 Assembler n Assembly Code n Assembly Process n Assembly Directives n Assembly Sections n Linker n Libraries n Code Composer Essentials/Studio n Device: LED’s n Systematic Decomposition n Assembly Instructions
Background image of page 2
BYU CS/ECEn Chapter 7 - MSP430 Assembler 3 Moving Up Levels of Abstraction Problems Algorithms Language Machine (ISA) Architecture Microarchitecture Circuits Devices Transistors Logic gates, multiplexers, memory, etc. MSP430 Architecture Machine code Assembly code
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS/ECEn Chapter 7 - MSP430 Assembler 4 High Level vs. Assembly n High Level Languages n More programmer friendly n More ISA independent n Each high-level statement translates to several instructions in the ISA of the computer n Assembly Languages n Lower level, closer to ISA n Very ISA-dependent n Each instruction specifies a single ISA instruction n Makes low level programming more user friendly n More efficient code High Level vs. Assembly
Background image of page 4
BYU CS/ECEn Chapter 7 - MSP430 Assembler 5 Why Assembly Code? n Allows us to work at a slightly higher level than machine language. n Allows us to use symbolic names for opcodes n Allows us to use symbolic names for memory locations - n SUM, PRODUCT n Don’t need to know every address of every storage location. n Calculates addresses for us – really a big deal! n Helps to allocate memory locations. n Provides additional error checking High Level vs. Assembly
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS/ECEn Chapter 7 - MSP430 Assembler 6 Assembler An assembler outputs an object file An assembly program is a text file containing assembly instructions, directives, macros, and comments An assembler translates a program into machine code MSP430 Assembler An object file is input to a linker program
Background image of page 6
BYU CS/ECEn Chapter 7 - MSP430 Assembler 7 Assembler Syntax n Each assembly line begins with either a label, a blank (tab), an asterisk, or a semicolon n Each line has four fields: {label[:]} mnemonic {operand list} {;comment} n Some line examples are: .sect ".sysmem" ; data space var1 .word 2 ; variable var1 declaration .text ; program space loop: mov #COUNT,r5 ; get MSP430 Assembler
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
BYU CS/ECEn Chapter 7 - MSP430 Assembler 8 Symbols / Labels n Symbols n Symbols are used as labels, constants, and substitution values n Symbols are stored in a symbol table n A symbol name n is a string of up to 200 alphanumeric characters (A-Z, a-z, 0-9, $, and _) n cannot contain embedded blanks n first character cannot be a number n case sensitive n Symbols used as labels become symbolic addresses that are associated with locations in the program n Label Field n Labels are symbols n Labels must begin in column 1. n
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 75

Chapter 07 - MSP430 Assembler - Chapter 7 MSP430 Assembler...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online