#include #include "adds_21161_ezkit.h" #include .extern _vector_X; .extern _vector_Y; .extern _matrix_A_PM; //--------- .extern _liczba1; .extern _wykladnik,_podstawa; .segment /pm seg_pmco; //########################################################################### //# pusta procedura - w celu obliczenia czasu wejscia i wyjscia z procedury # //########################################################################### //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ _matrix_x_vector_0: .global _matrix_x_vector_0; leaf_entry; I8=_matrix_A_PM; M8=1; B8=I8; L8=9; I1=_vector_X; M1=1; B1=I1; L1=3; I2= _vector_Y; B2=I2; L2=3; M2=1; //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // wyjscie z procedury (przywrócenie wartości zerowych w rejestrach) i0=0; i1=0; b0=i0; b1=i0; l0=0; l1=0; m0=0; m1=0; I2=0; B2=0; M2=0; L2=0; leaf_exit; _matrix_x_vector_0.end: //############################################################# _potegowanie: .global _potegowanie; leaf_entry; r0=DM(_podstawa); r1=DM(_wykladnik); r2=r0; r1=r1-1; LCNTR=r1, do kontynuuj until LCE; kontynuuj: r2=r2*r0(ssi); DM(_liczba1)=r2; leaf_entry; _potegowanie.end: //^^^^^^^^^^^^^ //@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //################################################################ //# procedura _count_start - do pomiaru czasu trwania procedury # //################################################################ _count_start: //* call this to start cycle count .global _count_start; r1=mode1; bit clr mode1 IRPTEN; r0=emuclk; mode1=r1; exit; _count_start.end: //############################################################### //# procedura _count_end - do pomiaru czasu trwania procedury # //############################################################### _count_end: //* call this to end cycle count .global _count_end; r2=mode1; bit clr mode1 IRPTEN; r0=emuclk; r0=r0-r4; r1=14; //* fudge factor to compensate for overhead r0=r0-r1; mode1=r2; exit; _count_end.end: .endseg;