Texas Instruments MSP50C614 Stereo System User Manual


 
Instruction Syntax and Addressing Modes
4-20
4.3.8 Tag/Flag Bits
The words TAG and flag may be used interchangeably in this manual. The
TAG bit is the 17
th
bit of a word of data memory. There are 640 words of RAM,
each 17 bits wide, on the C614. Therefore, there are 640 TAG bits on the C614.
When an instruction of the format,
MOV accumulator, RAM
is performed, the STAT register is affected by various properties of this trans-
fer. The TAG bit of the RAM location is copied into the TAG bit of the STAT reg-
ister during such transfers.
The TAG bit can be modified using several instructions: STAG, RTAG, SFLAG,
RFLAG. There are subtle differences between these instructions that the user
must understand before using them. The first difference between the xTAG
and xFLAG instructions is the addressing.
STAG *0x0000 ;sets the TAG bit of RAM word zero
RTAG *0x0002 ;clears the TAG bit of RAM word one
STAG *0x0002 * 2 ;sets the TAG bit of RAM word two
STAG and RTAG use RAM byte addresses to specify which TAG to set or clear.
This immediately causes confusion since there are 1280 bytes and only 640
TAGs. What happens when an odd byte is used to set a tag with STAG?
STAG *0x0001 ;sets the TAG bit of RAM word zero
STAG *0x0003 ;sets the TAG bit of RAM word one
STAG *0x0005 * 2 ;sets the TAG bit of RAM word five
All word boundaries in RAM start at even numbers, RAM
even
. If an odd byte,
RAM
even
+ 1 is used to set a TAG, then the TAG for RAM
even
is set. Thus,
STAG *0x0000
STAG *0x0001
are functionally equivalent.
As a sharp contrast, the SFLAG and RFLAG instructions use RAM word ad-
dresses to specify which TAG to set or clear.
SFLAG *0x0000 ;sets the TAG bit of RAM word zero
SFLAG *0x0001 ;sets the TAG bit of RAM word one
Another difference between the xTAG and xFLAG instructions is the addres-
sing modes. STAG and RTAG can use {adrs} addressing modes. This in-
cludes, direct, short relative, relative to R5, long relative, and indirect addres-
sing modes. This affects the number of clock cycles it takes to execute xTAG
instructions.