cadrjr2
Joined: 17 Dec 2008 Posts: 1
|
Newbie Assembler problem. |
Posted: Wed Dec 17, 2008 11:18 am |
|
|
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
} |
|
|