iv Copyright 2013 Cirrus Logic, Inc. DS795UM11
32-bit DSP Assembly Programmer’s Guide
2.2.1 Data Representation.......................................................................................................2-4
2.2.2 Accumulator Data Transfers...........................................................................................2-6
2.2.2.1 Move to Accumulator.....................................................................................2-7
2.2.2.2 Moving from Accumulator..............................................................................2-8
2.2.2.3 Saturation Examples......................................................................................2-9
2.2.2.4 Rounding Examples.......................................................................................2-9
2.2.2.5 Shifting Examples........................................................................................2-10
2.3 Parallel Address Generation Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-10
2.3.1 Addressing Modes........................................................................................................2-12
2.3.1.1 Modulo Addressing......................................................................................2-12
2.3.1.2 Reverse Binary Addressing .........................................................................2-13
2.3.1.3 Immediate Addressing.................................................................................2-14
2.3.1.4 Indexed Addressing.....................................................................................2-14
2.4 Program Control Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
2.4.1 Program Counter..........................................................................................................2-17
2.4.2 Subroutine Stack ..........................................................................................................2-17
2.4.3 Loop Stack....................................................................................................................2-17
2.4.4 Subroutine Stack and Loop Stack Common Implementations.....................................2-18
2.4.5 jsr_mode Register .......................................................................................................2-19
2.4.6 lst_mode Register.........................................................................................................2-20
2.4.7 stq_base Register ........................................................................................................2-21
2.4.8 mr_jsr_ptr Register.......................................................................................................2-21
2.4.9 jsr_data Register ..........................................................................................................2-21
2.4.10 mr_lst_ptr Register.....................................................................................................2-21
2.4.11 lp_data1 Register .......................................................................................................2-22
2.4.12 lp_data2 Register .......................................................................................................2-22
2.4.13 lst_data1 Register.......................................................................................................2-23
2.4.14 lst_data2 Register.......................................................................................................2-23
2.4.15 jsr_ovf Register...........................................................................................................2-23
2.4.16 jsr_unf Register ..........................................................................................................2-24
2.4.17 lst_ovf Register...........................................................................................................2-24
2.4.18 lst_unf Register...........................................................................................................2-24
2.4.19 Mode Register............................................................................................................2-24
2.4.20 Condition Code Register ............................................................................................2-25
2.4.21 Loop Stack Example...................................................................................................2-26
2.5 Master State Registers (MSREGS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-33
2.5.1 Search Registers..........................................................................................................2-34
2.5.2 Random Number Generator.........................................................................................2-34
2.6 Interrupt Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-35
2.6.1 Fast Interrupts ..............................................................................................................2-35
2.6.2 Long Interrupts .............................................................................................................2-35
2.6.3 Masking........................................................................................................................2-35
2.6.3.1 IMask...........................................................................................................2-36
2.6.3.2 IRMask.........................................................................................................2-36
2.7 Instruction Restrictions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-36
2.7.1 Code Example, Broken Code.......................................................................................2-37
2.7.2 Code Example, Fixed Code..........................................................................................2-37
2.8 LogExp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-37
Chapter 3. Full Word Instructions........................................................................3-1
3.1 Assembly Language Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
3.2 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-2