Jump to content

BulentSelek

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About BulentSelek

  • Rank
    Newbrie
  1. 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
×
×
  • Create New...