Professional Documents
Culture Documents
Launchpad introduction
Addressing modes
Machine instruction execution over buses
MSP430 Instruction format
Week 2: Addressing Modes 1
MSP-EXP430FR5969 Launchpad
LCD Launchpad
Week 2: Addressing Modes 8
Where do we start?
• Download the following pdf file and read
carefully.
http://www.ti.com/lit/ug/slau535b/slau535b.pdf
mov.w src,dest
48
op code for MOV
46
48
op code for MOV
66
operands
The @ sign distinguishes between them
Week 2: Addressing Modes 44
Are Instruction Codes random?
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Op-Code S-reg Ad b/w As D-reg
MOV.W R8, R6
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 0 0 1 0 0 0 0 1 0 0 0 1 1 0
.W
MOV (4) R8 R6
Register Addr. mode
MOV.W @R8, R6
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 0 0 1 0 0 0 0 1 1 0 0 1 1 0
.W
MOV (4) R8 Indirect R6
Register Mode
Register Mode
45
The Instruction Execution Cycle
MSP430 Example
MOVE: copy an 16 bit constant value 0x300 (hexadecimal) into
the register R6 in CPU
MOV.W #0x300,R6
MOVE: copy the content of a memory location pointed by R6
to the register R7 and R6 is incremented by one.
MOV.B @R6+,R7
Libraries
Linker
Object File
Linker uploads data and
Execute file in memory
At addresses specified by Loadable and
Map files, etc
Assembler using specifiers. Executable File
0 1 0 0 0 1 0 1 0 0 0 0 0 1 1 0
Op-Code S-reg Ad b/w As D-reg
0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 0
Op-Code S-reg Ad b/w As D-reg
0 1 0 0 0 1 0 1 0 0 1 1 0 1 1 0
Op-Code S-reg Ad b/w As D-reg
Symbolic (PC
X X MOV SRC, DEST
relative)
Indirect
X - MOV @Rn+, Rm MOV @R10+,R11
Autoincrement
mov.w 1200(R2),r6
Accesses memory address 1200
mov.w &1200,r6
Week 2: Addressing Modes 77
HOW TO WRITE, ASSEMBLE
AND UPLOAD TO
LAUNCHPAD
Week 2: Addressing Modes 78
Software for MSP430FR5969
• In order to use the launchpad you are provided, you
need to access the following web address
http://software-dl.ti.com/ccs/esd/documents/ccs_downloads.html
• You are supposed to install the following software
– CCS: Code Compose Studio. An Integrated Debugger
Environment (IDE) for programming the MSP430FR5969
launchpad
– MSP430 Flasher to install programs into flash of MSP430
microprocessors
Downloading Software
Code Composer Studio
• Code Composer Studio is an integrated development
environment (IDE) that supports TI's Microcontroller and
Embedded Processors portfolio.
• Code Composer Studio comprises a suite of tools used to
develop and debug embedded applications. It includes an
optimizing C/C++ compiler, source code editor, project build
environment, debugger, profiler, and many other features.
• The IDE provides a single user interface taking you through
each step of the application development flow.
• Code Composer Studio combines the advantages of the Eclipse
software framework with advanced embedded debug
capabilities for embedded developers.
Do NOT change!!!!
Do NOT change!!!!
Do NOT change!!!!
breakpoint