From: SourceForge.net <no...@so...> - 2005-02-04 02:32:03
|
Bugs item #1080519, was opened at 2004-12-07 18:23 Message generated for change (Comment added) made by slade_rich You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1080519&group_id=599 Category: None Group: None Status: Open >Resolution: Fixed Priority: 5 Submitted By: Tommaso Massimi (tom2004) Assigned to: Nobody/Anonymous (nobody) Summary: [PIC14] bug on operator << Initial Comment: this is the source file - - - - - - - - - - - - - - - - - - - - - - - - - - #include "pic16F627.h" void sample(unsigned char nPin) { unsigned char mask = 0x01 << nPin; PORTA = mask; } - - - - - - - - - - - - - - - - - - - - - - - - - - this is (part of) the compiler output: - - - - - - - - - - - - - - - - - - - - - - - - - - ;-------------------------------------------------------- ; File Created by SDCC : FreeWare ANSI-C Compiler ; Version 2.4.7 #896 (Dec 2 2004) ; This file generated Fri Dec 03 14:10:16 2004 ;-------------------------------------------------------- ; PIC port for the 14-bit core ;-------------------------------------------------------- ; void sample(unsigned char nPin) BANKSEL r0x20 MOVWF r0x20 ;#CSRC C:/tom/pic/sdcc/test/pippo.c 5 ; unsigned char mask = 0x01 << nPin; MOVF 0x01,W BCF STATUS,5 BCF STATUS,6 MOVWF _PORTA BANKSEL r0x20 COMF r0x20,W BCF STATUS,5 BCF STATUS,6 RRF _PORTA,F _00107_DS_ RLF _PORTA,F ADDLW 0x01 BTFSS STATUS,0 GOTO _00107_DS_ ;#CSRC C:/tom/pic/sdcc/test/pippo.c 7 ; PORTA = mask; RETURN - - - - - - - - - - - - - - - - - - - - - - - - - - in my opinion the line ; unsigned char mask = 0x01 << nPin; MOVF 0x01,W (move a value from location 0x01 to W) should be like ; unsigned char mask = 0x01 << nPin; MOVLW 0x01 (move the literal value 0x01 to W) I'm using sdcc.exe built on december, 2 Best regards Tommaso Massimi to...@us... ---------------------------------------------------------------------- >Comment By: Slade Rich (slade_rich) Date: 2005-02-04 10:32 Message: Logged In: YES user_id=849691 Fixed in version 2.4.8 #954 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1080519&group_id=599 |