Jump to content
Sign in to follow this  
BulentSelek

Compiler Does Not Generate Function Return Code

Recommended Posts

Description

Compiler does not generate function return code;

 

Compiler version: Version 6.35

Target device: PIC16FXXX

 

Here is the small code,

 

---------------------------------------------

void spi_write( char b )

{

unsigned char LOOPC;

asm

{

MOVLW 0x08;

MOVWF _LOOPC;

L0:

BCF _status, C;

RLF _b, 1;

BTFSC _status, C;

goto L1;

BCF _portb,0;

goto L2;

L1:

BSF _portb,0;

L2:

BSF _portb,1;

BCF _portb,1;

DECFSZ _LOOPC, 1;

goto L0;

}

};

 

void main()

{

spi_write( 0xff );

 

}

---------------------------------------------------------------------

 

Compiler generates

 

void spi_write( char b )

 

{

unsigned char LOOPC;

asm

{

0003 3008 MOVLW 0x08

0004 008D MOVWF spi_write_00000_1_LOOPC

0005 label268436453

0005 1003 BCF gbl_status,0

0006 0D8C RLF spi_write_00000_arg_b, F

0007 1803 BTFSC gbl_status,0

0008 280B GOTO label268436454

0009 1006 BCF gbl_portb,0

000A 280C GOTO label268436455

000B label268436454

000B 1406 BSF gbl_portb,0

000C label268436455

000C 1486 BSF gbl_portb,1

000D 1086 BCF gbl_portb,1

000E 0B8D DECFSZ spi_write_00000_1_LOOPC, F

000F 2805 GOTO label268436453

}

!!!!!!!! NO RETURN OP HERE !!!!!!!

};

 

void main()

 

{

0010 30FF MOVLW 0xFF

0011 1283 BCF STATUS, RP0

0012 008C MOVWF spi_write_00000_arg_b

0013 2003 CALL spi_write_00000

}

0014 0008 RETURN

 

 

Best regards

Bulent

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...