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>] lalk <constant>[,shift] http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SYNTAX      [<LABEL>] LALK <constant>[,shift]

OPERANDS    16-bit constant; 0 . shift . 15.

EXECUTION   (PC) + 2 . PC
            Constant * 2 ^shift . ACC
            If SXM = 1, then -32768 . constant . 32767.
            If SXM = 0, then 0 . constant . 65535.
            Affected by SXM.

DESCRIPTION The left-shifted 16-bit immediate value is loaded into the
            accumulator. The shifted 16-bit constant is sign extended if
            SXM = 1; otherwise, the high-order bits of the accumulator
            (past the shift) are set to zero. Note that the MSB of the
            accumulator can only be set if SXM = 1 and a negative number
            is loaded. The shift count is optional and defaults to zero.

WORDS       2

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

CYCLES

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



EXAMPLE     LALK  >F794,8     (SXM = 1)

                     BEFORE             AFTER

            ACC X >12345678   ACC X >FFF79400
                C                 C


EXAMPLE     LALK  >F794,8     (SXM = 0)

                     BEFORE             AFTER

            ACC X >12345678   ACC X   >F79400
                C                 C

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