This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请问一下这句话是什么意思?DSP里边的语句——————asm("TRAP #31")

补充一下,DSP里边的非外设中断用什么来触发?比如USER11和USER12

  • 不知道主题里的语句是哪里看到的?或者是谁写的?

    对于你提到的USER11/12类似的中断,请参考System Control User Guide说明:

    When the PIE is enabled, a TRAP #1 through TRAP #12 or an INTR INT1 to INTR INT12 instruction

    transfers program control to the interrupt service routine corresponding to the first vector within the PIE

    group. For example: TRAP #1 fetches the vector from INT1.1, TRAP #2 fetches the vector from INT2.1

    and so forth. Similarly an OR IFR, #16-bit operation causes the vector to be fetched from INTR1.1 to

    INTR12.1 locations, if the respective interrupt flag is set. All other TRAP, INTR, OR IFR,#16-bit operations

    fetch the vector from the respective table location. The vector table is EALLOW protected.

  • 我再补充一下啊,#define OS_TASK_SW() asm(" TRAP #31")

    也就是说这个语句是用来做DSP操作系统的任务切换的,我怀怀疑asm(" TRAP #31")这个语句是用来触发用户中断,PieVectTable.USER12 = &OSCtxSw; //User-Defined Trap, Non-Peripheral Interrupts我在初始化时程序里边是开的这个中断

  • 除了10#说的,您还可以看一下 CPU and Instruction Set Reference Guide。里面有说TRAP的作用,TRAP #31可以触发USER12中断。