{_______________________________________________________________________ SINTEST.ASM Example calling routine for the sine function _________________________________________________________________________} #include "asm_glob.h"; #include "def21020.h"; #define N 4 #define PIE 3.141592654 .SEGMENT/DM dm_data; { Declare variables in data memory } .VAR input[N]= PIE/2, PIE/4, PIE*3/4, 12.12345678; { test data } .VAR output[N]; { results here } .VAR correct[N]=1.0, .707106781, .707106781, -.0428573949; { correct results } .ENDSEG; .SEGMENT/PM pm_rsti; { The reset vector resides in this space } DMWAIT=0x21; { Set data memory waitstates to zero } PMWAIT=0x21; { Set program memory waitstates to zero } JUMP start; .ENDSEG; .EXTERN sine; .SEGMENT/PM pm_code; start: bit set mode2 0x10; nop; read cache 0; bit clr mode2 0x10; M1=1; B0=input; L0=0; I1=output; L1=0; lcntr=N, do calcit until lce; CALL sine (db); l_reg=0; f0=dm(i0,m1); calcit: dm(i1,m1)=f0; end: IDLE; .ENDSEG;