|
|
View previous topic :: View next topic |
Author |
Message |
a Guest
|
Error when i change asm from pic16f877 to pic18f458. Please. |
Posted: Thu Jan 06, 2005 7:25 am |
|
|
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
|
|
Posted: Thu Jan 06, 2005 8:10 am |
|
|
Not sure the reason, but it doesn't like the variable "data". If you rename it to something else, it will compile. |
|
|
|
|
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
|