Texas Instruments MSP50C614 manual ±3. Data Memory Organization and Addressing

Models: MSP50C614

1 414
Download 414 pages 24.44 Kb
Page 137
Image 137

Bit, Byte, Word and String Addressing

is a string of bytes. The length of the byte string is stored in the string register (STR). To define the length of a string, the STR register should hold the length of the string minus 2. For example, if the length of a byte string is 10, then STR should be 8. A byte string address can be even or odd. Byte string data is fetched from the lower address (starting address) one byte at a time to consec- utive addresses.

NOTE: Data Memory Access

Data memory access (RAM) is always accessed with byte addresses. Pro- gram memory (ROM) is accessed with 17-bit words. Rx registers autoincre- ment (or autodecrement) by 1 for byte addressing, by 2 for word addressing, or by the length of the string in bytes if Rx++ (or Rx± ±) is used.

Word and Word string addresses: One data memory word is composed of two consecutive bytes. A word address is always an even byte address and the least significant bit of the byte address is assumed to be zero. Instructions that operate on words have internal hardware which increments the byte ad- dress appropriately to load the two consecutive bytes in one clock cycle. To use an absolute word address, the address should be multiplied by 2. A word- string is a string of consecutive words. Like a byte-string, word-strings use the STR register to define the string length. Word-strings always start at an even byte address. When string instructions are used, words are fetched from the first word-string memory location to consecutive addresses. The word address is the data memory address in bytes. This is obtained by multiplying the byte address by two.

Figure 4±3. Data Memory Organization and Addressing

Global

flags

Relative

flags

Flag addresses²

0000h

0001h

0002h

0040h

0041h

nnnn

17th Bit

17th Bit

17th Bit

17th Bit

17th Bit

17th Bit

Data memory

 

1 Word

Data memory

address (even)

 

address (odd)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0001h

0000h

 

 

MS Byte

 

 

 

LS Byte

 

 

0002h

 

 

 

 

 

 

 

 

0003h

 

 

MS Byte

 

 

 

LS Byte

 

 

0004h

 

 

 

 

 

 

 

 

0005h

 

 

MS Byte

 

 

 

LS Byte

 

 

 

 

 

 

 

 

 

 

 

nnnn+1

 

 

 

 

 

 

 

 

nnnn

 

 

MS Byte

 

 

 

LS Byte

 

 

 

 

 

 

 

 

 

 

 

 

 

Note: Word address is data memory address (or byte address) divided by 2.

²Flag address always accesses the 17th bit of 17 bit wide data word in data memory.

Assembly Language Instructions

4-45

Page 137
Image 137
Texas Instruments MSP50C614 manual ±3. Data Memory Organization and Addressing