<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="Module.2004-02-25.4612">
  <name>CPU Registers in the MSP430</name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2004/02/25 14:46:12 US/Central</md:created>
  <md:revised>2004/02/26 13:48:08 US/Central</md:revised>
  <md:authorlist>
      <md:author id="seejaie">
      <md:firstname>CJ</md:firstname>
      
      <md:surname>Ganier</md:surname>
      <md:email>seejaie@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="deaniafe">
      <md:firstname>Deania</md:firstname>
      <md:othername>M.</md:othername>
      <md:surname>Fernandez</md:surname>
      <md:email>deaniafe@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="seejaie">
      <md:firstname>CJ</md:firstname>
      
      <md:surname>Ganier</md:surname>
      <md:email>seejaie@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="adrianv">
      <md:firstname>Adrian</md:firstname>
      
      <md:surname>Valenzuela</md:surname>
      <md:email>adrianv@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="jpfrantz">
      <md:firstname>Patrick</md:firstname>
      
      <md:surname>Frantz</md:surname>
      <md:email>jpfrantz@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>msp430</md:keyword>
    <md:keyword>registers</md:keyword>
  </md:keywordlist>

  <md:abstract>Describes the CPU registers in the MSP430.</md:abstract>
</metadata>

  <content>
 <para id="cpu1">
The MSP430 has 16 CPU registers. Of these 16, the upper 12 are general purpose 16 bit registers (R4-R15).  The lower four are:
<list id="registers" type="bulleted">
<item>R0  Program Counter(PC) – This register controls the next instruction to be executed by the MSP core. In general, this register is incremented automatically during execution. It can be used as a source in operations normally. </item>
<item>R1 Stack pointer (SP) – The stack pointer is used to keep track of previous execution modes and to return from interrupts. Can be read as a normal register. </item>
<item>R2 Status Register (SR) – The status register can be written to change the operating mode of the MSP as specified in the User’s Guide. When read it can act as a constant generator. Depending on the instruction code options this register will be read as: a normal register, 0x0000, 0x0004, or 0x0008 depending on the As bits.  </item>
<item>R3 Constant Generator II – This register cannot be written to, and when read produces:
0x0000, 0x0001, 0x0002, or 0xffff depending on the As bits.</item>
</list>
The rest of the registers on the MSP430 behave as if they were memory.  In most cases, these special purpose registers can be read and written to normally; but they affect the behavior of their respective systems.  
</para>
  </content>
  
</document>
