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

Newbie Assembler problem.

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



Joined: 17 Dec 2008
Posts: 1

View user's profile Send private message

Newbie Assembler problem.
PostPosted: Wed Dec 17, 2008 11:18 am     Reply with quote

I'm trying to get a piece of PICC assembley code to return an int.
(The find_parity example below, from Help, seems to be syntactily incorrect and no help to me.)

I have something like:
Code:
int find_parity(int data){

    int count;

    #asm

   .....
   .....

    MOVWF _RETURN_
    #endasm
 }


I get the error message
"Function not void and does not return a value find_parity."
Can someone please tell me where I'm going wrong ?
CADRJR


Code:
int find_parity(int data){

    int count;

    #asm
    MOV #0x08, W0
    MOV W0, count
    CLR W0

    loop:
    XOR.B data,W0
    RRC data,W0
    DEC count,F
    BRA NZ, loop
    MOV #0x01,W0
    ADD count,F
    MOV count, W0
    MOV W0, _RETURN_
    #endasm

 }
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 17, 2008 11:48 am     Reply with quote

This thread tells how to disable that warning message:
http://www.ccsinfo.com/forum/viewtopic.php?p=84796
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