From: SourceForge.net <no...@so...> - 2006-04-24 19:25:17
|
Bugs item #1475742, was opened at 2006-04-24 15:25 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1475742&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pic16 target Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stevie Oh (stevie-o) Assigned to: Nobody/Anonymous (nobody) Summary: Braindead bit-test handling with == 0 Initial Comment: I apologize in advance if this should really be a feature request/enhancement. ==Summary== The translation of a single-bit test to a BTFSS/BTFSC instruction is not all that smart: ; .line 9; btfssdumb.c if (!(PORTB & BIT_5)) { foo(); } BTFSC _PORTB, 5 GOTO _00106_DS_ CALL _foo That works fine. But this perfectly valid alternate syntax fails miserably: ; .line 10; btfssdumb.c if ((PORTB & BIT_5) == 0) { bar(); } MOVLW 0x20 ANDWF _PORTB, W MOVWF r0x00 MOVF r0x00, W BNZ _00114_DS_ GOTO _00115_DS_ ==SDCC Version== SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.5.6 #1249 (Apr 17 2006) (MINGW32) ==Command Line== sdcc -mpic16 -p18f452 btfssdumb.c ==Other Information== Attached is a tar.bz2 of all the files involved. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1475742&group_id=599 |