Код
/********************************************************************************
***********
Description : This function performs FIR filter operation on given input.
Input: R0-current address of input circular buffer, R1-address of coeff. vector,
R2-number of taps*2.
Output: R0-next address of input circular buffer.
Prototype: fract16* FIR_fract(fract16*, fract16*, u32).
*/
#include "Tru_def.h"
#include <defBF534.h>
.extern _Host_MC_Out; //output array
.section program;
.global _FIR_fract;
.align 8;
//-----------------------------------------------------------------------------------
_FIR_fract:
L0=INPUT_LEN*2(Z); // L0 = length of input buffer in bytes
L1=R2; // L1 = length of coeff buffer in bytes
I0=R0; // set up input pointer
................................
БЛА-БЛА-БЛА
................................
L0=0; // Clear modulo registers
L1=0;
RTS;
_FIR_fract.end:
Вызывается как обычная сишная функция с тремя входными параметрами и одним выходным, передавая их наиболее простым и быстрым способом - через регистры, не используя стек.***********
Description : This function performs FIR filter operation on given input.
Input: R0-current address of input circular buffer, R1-address of coeff. vector,
R2-number of taps*2.
Output: R0-next address of input circular buffer.
Prototype: fract16* FIR_fract(fract16*, fract16*, u32).
*/
#include "Tru_def.h"
#include <defBF534.h>
.extern _Host_MC_Out; //output array
.section program;
.global _FIR_fract;
.align 8;
//-----------------------------------------------------------------------------------
_FIR_fract:
L0=INPUT_LEN*2(Z); // L0 = length of input buffer in bytes
L1=R2; // L1 = length of coeff buffer in bytes
I0=R0; // set up input pointer
................................
БЛА-БЛА-БЛА
................................
L0=0; // Clear modulo registers
L1=0;
RTS;
_FIR_fract.end:
Обработчики прерываний писать на асме ещё проще.
Здравствуйте. Подскажите пожалуйста, как связать прерывание написанное на .asm с основным кодом на с. Не пойму, какие параметры у функции должны быть? Прототип FIR_fract(fract16*, fract16*, u32), а как и куда они передаются в _FIR_fract: ?