沈阳理工大学课程设计
Pulse[i]=-1; break; case 2: Pulse[i]=1; break; case 3: Pulse[i]=3; break; } } //调用汇编函数 qpsk qpsk();
for(i=0;i 2.psk_asm.asm .title\ .global _qpsk ;.global _y ;C.global _Pulse .global _PskSignal .mmregs .text _qpsk: rsbx CPL stm #8-1,AR2 stm #_y, AR4 定义为全局变量,提供给C调用程序变量 ;C程序变量 ;C程序变量 ;循环变量 256/32=8 9 沈阳理工大学课程设计 stm #_Pulse, AR3 stm #_PskSignal, AR5 loop: ld *AR3, A bc phase0, AEQ ;若为0状态信号,则相移0 sub #1, A addm #4, AR4 bc phase1, AEQ ;若为1状态信号,则相移pi/2 sub #1, A addm #8, AR4 bc phase2, AEQ ;若为2状态信号,则相移pi sub #1, A addm #12, AR4 bc phase3, AEQ ;若为3状态信号,则相移3*pi/2 pskend: addm #32, AR3 banz loop, *AR2- ret phase0: rpt #32-1 mvdd *AR4+, *AR5+ b pskend phase1: rpt #32-1 mvdd *AR4+, *AR5+ addm #-36,AR4 b pskend phase2: rpt #32-1 10 沈阳理工大学课程设计 mvdd *AR4+, *AR5+ addm #-40,AR4 b pskend phase3: rpt #32-1 mvdd *AR4+, *AR5+ addm #-44, AR4 b pskend .end 3.Qpsk.cmd -c -l rts.lib -l c54math.lib -stack 0x200 -heap 0x200 MEMORY { PAGE 0: INT_PM_DRAM: origin = 0080h, length = 1000h PAGE 1: INT_DM_1: origin = 1080h, length = 01000h } SECTIONS { .text:{} > INT_PM_DRAM 1 1 PAGE 0 沈阳理工大学课程设计 .cinit:{} > INT_PM_DRAM PAGE 0 .switch:{} > INT_PM_DRAM PAGE 0 .data:{} > INT_DM_1 PAGE 1 .stack:{} > INT_DM_1 PAGE 1 .bss:{} > INT_DM_1 PAGE 1 .sysmem:{} > INT_DM_1 PAGE 1 .const:{} > INT_DM_1 PAGE 1 4 结果 仿真结果图 12