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 direct [<label>] in <dma>,<pa> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SYNTAX      DIRECT   [<LABEL>] IN <dma>,<PA>
            INDIRECT [<LABEL>] IN {ind},<PA>[,<next ARP>]

OPERANDS    0 . dma . 127; 0 . next ARP . 7; 0 . port address PA . 15.

EXECUTION   (PC) + 1 . PC
            Port address . address bus A3-A0
            0 . address bus A15-A4
            Data bus D15-D0 . dma

DESCRIPTION The IN instruction reads a 16-bit value from one of the
            external I/O ports into the specified data memory location.
                __                                                  ____
            The IS line goes low to indicate an I/O access, and the STRB,
              _
            R/W, and READY timings are the same as for an external memory
            read.

WORDS       1

ENCODING    15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
            +-----------------------------------------------+
            |1  0  0  0|port address|0| data memory address | DIRECT
            +-----------------------------------------------+

            15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
            +-----------------------------------------------+
            |1  0  0  0|port address|1| see indirect fields | INDIRECT
            +-----------------------------------------------+

CYCLES

            +---------------------------------------------------+
            |       Cycle Timings for a Single Instruction      |
            |---------------------------------------------------|
            | PI/DI |  PI/DE | PE/DI | PE/DE    | PR/DI | PR/DE |
            |-------+--------+-------+----------+-------+-------|
      '20   |  1+i  |  2+d+i | 2+p+i | 3+d+p+i  |   -   |   -   |
            |-------+--------+-------+----------+-------+-------|
     'C25   |  2+i  |  2+d+i | 2+p+i | 3+d+p+i  |  2+i  | 2+d+i |
            |---------------------------------------------------|
            |       Cycle Timings for a Repeat Instruction      |
            |---------------------------------------------------|
      '20   |  n+ni |2n+nd+ni|2n+p+ni|3n+nd+p+ni|   -   |   -   |
            |-------+--------+-------+----------+-------+-------|
            |1+n+ni |2n+nd+ni|1+n+p+ | 1+2n+nd  |1+n+ni | 2n+nd |
     'C25   |       |        |  +ni  |   +p+ni  |       |   +ni |
            +---------------------------------------------------+



EXAMPLE     IN    STAT,PA5    Read in word from peripheral on port address
                              5. Store in data memory location STAT.
            or

            LRLK  1,520       Load AR1 with decimal 520
            LARP  1           Load ARP with decimal 520
            IN    *-,PA1,0    Read in word from peripheral on port address
                              1. Store in data memory location 520.
                              Decrement AR1 to 519. Load the ARP with 0.

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