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

Error when i change asm from pic16f877 to pic18f458. Please.

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







Error when i change asm from pic16f877 to pic18f458. Please.
PostPosted: Thu Jan 06, 2005 7:25 am     Reply with quote

Now i will change from pic16f877 to pic 18f458 and some function like
find_parity(); is not work
below is my original in pic16f877
===================pic16f877===================
int8 find_parity(int8 data)
{
#asm
swapf data, W
xorwf data, F
rrf data, W
xorwf data, F
btfsc data, 2
incf data, F
movf data, W
andlw 1
movwf _return_
#endasm
}
===========================================

and i chand in one line because in pic18 is not have it

===================pic18f458=====================
int8 find_parity(int8 data)
{
#asm
swapf data, W <== this line is error.
xorwf data, F
rrcf data, W <==i change only this line.
xorwf data, F
btfsc data, 2
incf data, F
movf data, W
andlw 1
movwf _return_
#endasm
}

Error show me like " Expecting an identifier "

And when i see help .
it tell me "This must be a Microchip mnemonic such as MOVLW or BTFSC."

Sorry for my english. and i don't understand well about asm.
please.
Mark



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

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

PostPosted: Thu Jan 06, 2005 8:10 am     Reply with quote

Not sure the reason, but it doesn't like the variable "data". If you rename it to something else, it will compile.
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