Author Topic: dsPIC - Calling asm code from C  (Read 5499 times)

0 Members and 1 Guest are viewing this topic.

Offline drZoidbergTopic starter

  • Contributor
  • Posts: 21
dsPIC - Calling asm code from C
« on: June 05, 2010, 09:40:42 pm »
Hi! I'm a student trying to learn digital filters, and i have a problem with c being too slow.

I use a dsPIC30F4011, and i want to use the hardware multiplier. But I dont know how to call assembler code from c.

Can someone please show me how to call asm from c?

Thanks!  :)
 

Offline migsantiago

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: 00
    • MigSantiago's Web Site
Re: dsPIC - Calling asm code from C
« Reply #1 on: June 05, 2010, 11:51:03 pm »
Hi

Just add the asm() tags and you're ready to go!

Code: [Select]
asm("TBLRDL [W0], W4");
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: dsPIC - Calling asm code from C
« Reply #2 on: June 06, 2010, 04:12:55 am »
Assuming you are using the MicroChip C compiler, then read chapter 9 of the manual.

http://ww1.microchip.com/downloads/en/DeviceDoc/51284J.pdf
Mark Higgins
 

Offline drZoidbergTopic starter

  • Contributor
  • Posts: 21
Re: dsPIC - Calling asm code from C
« Reply #3 on: June 06, 2010, 09:57:48 am »
Awesome! Ch 9 was just what i was looking for! Thanks!   ;D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf