314x Filetype PDF File size 0.83 MB Source: ece.uprm.edu
7/9/2014
MSP430 Assembly Programming
Programming Levels
• Machine language
– Description of instructions in terms of 0’s and 1’s. This
is the model for the actual contents in program
memory
– Normally presented in Hex Notation.
• Assembly language
– Machine language in human-readable form. Allows
better control of program
• High level language
– Preferred by most programmers because of its English
like syntaxis and notation.
1
7/9/2014
Example: Blinking LED Program
Objective: blink led by
toggling of voltage levels
Programming Machine Language
1 5 1:
2:
2 3:
4:
3 6 5:
8 6:
7:
7 8:
4
2
7/9/2014
Programming Assembly Language
There is a one-to-one correspondence between machine language
and assembly language instructions
MSP430 Machine language
structure (1/3)
• Length of One, two or three words:
– Instruction word
– Instruction word - Source Info – Destination Info
– Instruction word – (Source or Dest) Info
• 2 operand instructions with source and destination
• 1 operand instructions with dest or source
• 0 operand instruction: Only one: RETI return from
interrupt
• JUmps
3
7/9/2014
MSP430 Machine language
structure (2/3)
Two operand instructions (most significant nibble 4 to F)
Single operand instruction (most sign. Nibble 1; reti = 1300)
MSP430 Machine language
structure (3/3)
Jumps: Most significant nibble is 2 o3 ; eight jumps
OPCODE = 001
Eight conditions for C: 000 ….. 111
Largest jump: +- 2^10 bytes.
4
no reviews yet
Please Login to review.