Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TMS320C2x DSP - syntax [<label>] rptk <constant> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SYNTAX      [<LABEL>] RPTK <constant>

OPERANDS    0 . constant . 255

EXECUTION   (PC) + 1 . PC
            Constant . RPTC

DESCRIPTION The 8-bit immediate value is loaded into the RPTC (repeat
            counter). This causes the following instruction to be executed
            one time more than the number loaded into the RPTC (provided
            that it is a repeatable instruction). Interrupts are masked
            out until the next instruction has been executed the specified
            number of times. Interrupts cannot be allowed during the
            RPT/next instruction sequence because the RPTC cannot be saved
            during a contextswitch. The RPTC counter is cleared on a RS.

            RPT and RPTK are especially useful for operating instructions
            such as BLKP, BLKD, IN, MAC, MACD, NORM, OUT, TBLR, TBLW and
            others.

WORDS       1

ENCODING    15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
            +-----------------------------------------------+
            |1  1  0  0  1  0  1  1|     8-bit constant     |
            +-----------------------------------------------+


CYCLES

            +------------------------------------------------+
            |    Cycle Timings for a Single Instruction      |
            |------------------------------------------------|
            | PI/DI | PI/DE | PE/DI | PE/DE  | PR/DI | PR/DE |
            |-------+-------+-------+--------+-------+-------|
      '20   |   1   |   1   |  1+p  |  1+p   |   -   |   -   |
            |-------+-------+-------+--------+-------+-------|
     'C25   |   1   |   1   |  1+p  |  1+p   |   1   |   1   |
            |------------------------------------------------|
            |    Cycle Timings for a Repeat Instruction      |
            |------------------------------------------------|
      '20   |         not repeatable         |   -   |   -   |
            |------------------------------------------------|
     'C25   |                not repeatable                  |
            +------------------------------------------------+



EXAMPLE     LRLK  AR2,>200    Load AR2 with the address of X.
            LARP  2
            ZAC               Clear the accumulator.
            MPYK  0           Clear the P register.
            RPTK  2           Repeat the next instruction 3 times.
            SQRA  *+          Compute X(0)*X(0) + X(1)*X(1) + X(2)*X(2)
            APAC


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson