From: SourceForge.net <no...@so...> - 2007-02-05 16:51:30
|
Bugs item #1652561, was opened at 2007-02-05 17:51 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=1652561&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: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jan Rejlek (jare) Assigned to: Nobody/Anonymous (nobody) Summary: Bad code generated for Parity flag Initial Comment: This function always returns even parity: #include <8051.h> bit getParity(char c) { ACC = c; return P; } return !P; or return !(!P); works well. Compiled with SDCC Version 2.6.3 #4543 (Dec 31 2006) invoked by command sdcc -c test.c. The Parity flag is overwritten by clearing accumulator before it is used. ; genReceive mov _ACC,dpl ; test.c:6: return P; ; genRet clr a <--- the P flag is overwritten here mov c,_P rlc a add a,#0xff ; Peephole 500 removed redundant label 00101$ ret Best Regards Jan ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1652561&group_id=599 |