String Instructions

4.8 String Instructions

Class 1, 2, 3, and 6 instructions can have string modes. During the execution of string instruction, STR register value plus 2 is assumed as string length. An accumulator string is a group of consecutive accumulators spanning from An to the next N consecutive accumulators (N is the length of the string). The STR register should be loaded with N±2 to define a string length, N. A value of zero in the STR register defines a string length of 2 (string length 1 means the instruction is not in string mode). Arithmetic string instructions treat the string as an N word arithmetic value. The result is also an arithmetic value of the same length. Conditionals are set as they would be set without string mode. Comparing two strings is equivalent to comparing each bit of the string. The accumulator status is modified representing the outcome of the entire operation. Examine the following examples.

Table 4±43. Initial Processor State for String Instructions

Registers (register# = value)

AP0 = 2

AP1 = 21 (0x15)

AP2 = 11 (0x0B)

AP3 = 29 (0x1D)

 

 

 

 

 

 

AC0 =

AC1 =

 

AC2 =

AC3 =

 

 

 

 

 

 

 

AC4 =

AC5 =

 

AC6 =

AC7 =

 

 

 

 

 

 

AC8 =

AC9 =

 

AC10 =

AC11 = 0xAAAA

 

 

 

 

AC12 = 0xAAAA

AC13 = 0xAAAA

AC14 = 0xAAAA

AC15 = 0xAAAA

 

 

 

 

 

 

AC16 =

AC17 =

 

AC18 =

AC19 =

 

 

 

 

 

AC20 =

AC21 = 0x1223

AC22 = 0xFBCA

AC23 = 0x233E

 

 

 

 

 

data memory (*address = data)

 

 

 

 

 

 

 

 

 

 

*0x0200 = 0x12AC

*0x0201

= 0xEE34

*0x0202 = 0x9086

*0x0203

= 0xCDE5

 

 

 

 

program memory (*address = data)

 

 

 

 

 

 

 

 

 

*0x1400 = 0x0123

*0x1401

= 0x4567

*0x1402 = 0x89AB

*0x1403

= 0xCDEF

 

 

 

 

 

 

*0x1404 = 0xFEDC

*0x1405

= 0xBA98

*0x1404 = 0x7654

*0x1405

= 0x3210

 

 

 

 

 

Example 4.8.1

MOV STR, 4±2;

string length = 2

MOVS A0, 0x1400

Refer to initial the processor state in Table 4±43. A0 points to AC2. Consider a program memory location string of length 4 at 0x1400 = 0xCDEF89AB45670123. STR equal to 4±2=2, defines a string length of 4. Final result, AC2=0x0123, AC3=0x4567, AC4=0x89AB, and AC5=0xCDEF,

Example 4.8.2

MOV STR, 3±2;

string

length = 3

 

ADDS A1~, A1,

*0x0200

 

Refer to the initial processor state in Table 4±43. A1 is AC21, A1~ is AC5, the

Assembly Language Instructions

4-55

Page 147
Image 147
Texas Instruments MSP50C614 manual ±43. Initial Processor State for String Instructions, Registers register# = value

MSP50C614 specifications

The Texas Instruments MSP50C614 is a microcontroller that belongs to the MSP430 family, renowned for its low power consumption and versatile functionality. Primarily designed for embedded applications, this microcontroller is favored in various industries, including consumer electronics, industrial automation, and healthcare devices.

One of the standout features of the MSP50C614 is its ultra-low power technology, which enables it to operate in various power modes. This makes it ideal for battery-powered applications, where energy efficiency is crucial. The MSP430 architecture allows for a flexible power management system, ensuring that energy is conserved while providing robust performance.

The MSP50C614 is equipped with a 16-bit RISC CPU that delivers high performance while maintaining low power usage. With a maximum clock frequency of 16 MHz, it can execute most instructions in a single cycle, resulting in swift operation and responsive performance. This microcontroller also comes with a generous flash memory capacity, allowing developers to store large amounts of code and data conveniently.

In terms of peripherals, the MSP50C614 is highly versatile. It features a range of digital and analog input/output options, including multiple timers, GPIO ports, and various communication interfaces like UART, SPI, and I2C. This extensive set of peripherals allows for seamless integration with other components and simplifies the design of complex systems.

The integrated 12-bit Analog-to-Digital Converter (ADC) stands out as a valuable characteristic of the MSP50C614. This feature enables the microcontroller to convert physical analog signals into digital data, making it particularly useful for sensing applications and real-time monitoring.

Another noteworthy technology employed in the MSP50C614 is its support for low-voltage operations. With a broad supply voltage range, this microcontroller can function efficiently in diverse environments and is suitable for low-power applications, enhancing its practicality.

Moreover, Texas Instruments provides software support in the form of Code Composer Studio and various libraries that make it easier for developers to program and utilize the MSP50C614 effectively.

In summary, the Texas Instruments MSP50C614 microcontroller is a powerful, low-power solution equipped with the features and technologies necessary for efficient operation in a wide array of applications. Its blend of performance, flexibility, and energy efficiency makes it a popular choice among engineers and designers looking to create innovative, sustainable designs in the rapidly evolving tech landscape.