DSPRelated.com
Forums

blackfin basic assembly codes needed

Started by suhas kadu September 26, 2004
Hi friends,
 
I am a new comer working on Blackfin processor first time.
If anyone is having some basic sample assembly codes on blackfin,pls forward it to me.
 
it will be a gr8 help for me.
 
Regards
Suhas kadu
 



 
hey here are some basic programs.

1.program for addition.
2.prg for mat multiplication.
for the programs u must add linker file before running.

.section L1_data_a;

.byte4 a=0xfffff001;
.byte2 d=0xfab0;
.byte2 c=0xfff0; .section program;

p0.h=a; p0.l=a; p1.h=d; p1.l=d; p2.h=c; p2.l=c;

r0= [ p0 ] ;
r1.h=w [ p1 ];
r2s r0;
nop;
//jump.s -1;
//2.

.section L1_data_a;

.byte2 a[9]={1,1,1,1,1,1,1,1,3};
.byte2 c[9]={1,1,1,1,1,1,1,1,1};
.byte2 d[9]; .section program;

i0.h=a;i0.l=a;  l0.h=0;l0.l=6; b0.h=a ; b0.l=a; //m0.h=0; m0.l=6;//1st matrix
i1.h=c;i1.l=c;  l1.h=0;l1.l;b1.h=a ; b1.l=c;// m1.h=0; m1.l=2;//2nd matrix
i2.h=d;i2.l=d;  l2.h=0;l2.l=0; //b2.h=a ; b2.l=d;// m2.h=0; m2.l=2;//3rd matrix start0:
p2=3;
p3=1;
start2:
p0=3; p1=1;//just for decrement

start1:
r0.l= w [ i0++ ] ;
r0.h= w [ i1++ ] ;
a0+=r0.l * r0.h;
p0-=p1;
cc=p0==0;
if cc  jump sam;

jump start1;
sam:

r6;
r6>>=1;
w [ i2++ ]=r6.l;//storing the values in output. a0=0;

p2-=p1;
cc=p2==0;
if cc jump sam1;

jump start2;

sam1:

p5=i0;
p4=6;
cc=p3==0;
if cc jump sam2;

excel:
p5=p5+p4;

b0=p5;

i0=p5;

p3-=p1;
jump start0;

sam2:

p4=p4 << 1;

jump excel; On Sun, 26 Sep 2004 suhas kadu wrote :
>Hi friends,
>
>I am a new comer working on Blackfin processor first time.
>If anyone is having some basic sample assembly codes on blackfin,pls forward it to me.
>
>it will be a gr8 help for me.
>
>Regards
>Suhas kadu >
>---------------------------------
>