CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Does anyone have inline functions for 32/16,16/8,16*16,16*8?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

Does anyone have inline functions for 32/16,16/8,16*16,16*8?
PostPosted: Sat Jul 24, 2004 9:14 pm     Reply with quote

I am looking for some routines to do these operations, plus any other you have.

I ask because I want speed in my code and dont know much asm.

the code I want to start with is..

(int16)A=208335*(int8)B/(int16)C;

The generated code is big with a lot of file register moves (that is what I want to avoid by using inline code).

Edited: A is 16bit.


Last edited by future on Sat Jul 24, 2004 11:57 pm; edited 1 time in total
Guest








Re: Does anyone have inline functions for 32/16,16/8,16*16,1
PostPosted: Sat Jul 24, 2004 11:14 pm     Reply with quote

future wrote:
I am looking for some routines to do these operations, plus any other you have.

I ask because I want speed in my code and dont know much asm.

the code I want to start with is..

(int8)A=208335*(int8)B/(int16)C;

The generated code is big with a lot of file register moves (that is what I want to avoid by using inline code).


First you cast is wrong.... ! The only value you have is already greater than int16 ! This will have to be int32, unless the end result is guaranteed to be int8 .
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sun Jul 25, 2004 9:00 am     Reply with quote

Microchip has app notes with all the asm functions that you require. Do a search on their site for math routines.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group