; ***************** prog.c ****************************************** ; Dsp program sample demonstrates call of assembler ; function from C code according to calling ; convinience ; ; (c)OJSC R&D "ELVEES" ; ; ******************************************************************* /* Function: func float func (int p1, int p2, float p3, float p4) Parameters: - p1, p2, p3, p4 - parameters Results: - (float)p1*p3 + (float)p2*p4 */ .text .globl _func .align 4 .type _func,@function _func: ; this move instructions are for demonstrating in sample ; it is not necessarily copy r0.l, r2.l, r4.l regs to another regs move r0.l, r11.l ; get param1 move r2.l, r12.l ; get param2 move r4.l, r13.l ; get param3 move (a7.l), r14.l ; get param4 cvif r11.l, r11.l cvif r12.l, r12.l fmpy r11.l, r13.l, r13.l fmpy r12.l, r14.l, r14.l fadd r13.l, r14.l, r10.l ; this move instructions is also for demonstrating in sample ; you may do 'fadd r12.l, r14.l, r0.l' in real application move r10.l, r0.l ; set return parameter rts