Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP

Ads

Discussion Groups

Discussion Groups | Analog Devices DSPs | how to call asm from C [BF561]

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

how to call asm from C [BF561] - jman...@pricol.co.in - May 4 5:33:17 2007



Hi,
Greetings to the groups members.

I am using BF561 to detect the lines in the image.
I implemented C code for Sobel edge detection .
But  the code is slow when compared to assembly which is given in the 
example code.
I would like to  call that assembly routine from my program.

I am new to Processor.
Can anybody give guideline to do the same........?
Regards,
Mani mekalai



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: how to call asm from C [BF561] - Ankush Jain - May 4 8:50:45 2007

Hi Mani,
 
 I hope following example code might help you.

Best Regards,
Ankush
 
 ---------------------------C Code --------------------------------------
#include "stdio.h"
 
 extern int sum(int, int);
 
 void main()
 {
     int y;
     y = sum(10,20);
     printf("\nsum = %d",y);
 }
 
 ---------------------------ASM Code --------------------------------------
 .global _sum;
 
 .section L1_code;
 _sum:
 
     // R0 = first argument i.e. 10
     // R1 = second argument i.e. 20
     R0 = R0 + R1; // R0 always contain the return value 
 
     RTS;
     
 _sum.END:
 
 ------------------------------------------------------------------------

j...@pricol.co.in wrote:                                   
Hi, 
Greetings to the groups members. 
 
I am using BF561 to detect the lines in the image. 
I implemented C code for Sobel edge detection . 
But  the code is slow when compared to assembly which is given in the example code. 
I would like to  call that assembly routine from my program. 
 
I am new to Processor. 
Can anybody give guideline to do the same........?

 Regards,
 Mani mekalai

 Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now!
http://messenger.yahoo.com/download.php


(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: how to call asm from C [BF561] - Chamira Perera - May 4 10:03:02 2007

Hey:

I have called the ADI assembly sample sobel edge detector from a C program before for a BF 561.
If you are using VisualDSP++ then check the "C/C++ assembly interface" section in the
VisualDSP++ C/C++ Compiler and library manual. 

HTH,

Chamira.

j...@pricol.co.in wrote:                                   
Hi, 
Greetings to the groups members. 
 
I am using BF561 to detect the lines in the image. 
I implemented C code for Sobel edge detection . 
But  the code is slow when compared to assembly which is given in the example code. 
I would like to  call that assembly routine from my program. 
 
I am new to Processor. 
Can anybody give guideline to do the same........?

 Regards,
 Mani mekalai

---------------------------------
Looking for earth-friendly autos? 
 Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.  


(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: how to call asm from C [BF561] - Diego Andres Botero Galeano - May 4 15:28:41 2007

asm("nop;;nop;;nop;;");

  maybe you can put your function in line.
   
  your c Code
  asm(" your asm code");
  more c Code

j...@pricol.co.in wrote:
          
Hi, 
Greetings to the groups members. 

I am using BF561 to detect the lines in the image. 
I implemented C code for Sobel edge detection . 
But  the code is slow when compared to assembly which is given in the example code. 
I would like to  call that assembly routine from my program. 

I am new to Processor. 
Can anybody give guideline to do the same........? 
Regards,
Mani mekalai

---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.


(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )