Jump to content

Dark.Rider

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Dark.Rider

  • Rank
    Newbrie
  1. Hello! I just ried to modify a value of a symbol in the debugger ant got "Debugging... Can not modify value of the symbol". Just a simple program char a,b; main() { a=1; b=0; for(;; } I run the debugger, put a and b in the watch window and tried to edit their values. It seems not to work. Any suggestions? Thanks Thomas Kusch
  2. Hello! signed char opposite(signed char a, signed char B ) { if((a^ B ) <0 && a && B ) return TRUE; return FALSE; } I commented it out, no change. I just tested a simple program: #include <system.h> signed char a,b,c; main() { a=-90; b=0; c=0; if( a>b ) c=1; for(;; } c becomes '1'!!! The comparison seems be done unsigned. Here the casm: main() { a=-90; 0003 30A6 MOVLW 0xA6 0004 1283 BCF STATUS, RP0 0005 1303 BCF STATUS, RP1 0006 00A0 MOVWF gbl_a b=0; 0007 01A1 CLRF gbl_b c=0; 0008 01A2 CLRF gbl_c if(a> c=1; 0009 0820 MOVF gbl_a, W 000A 1003 BCF STATUS,C 000B 1BA0 BTFSC gbl_a,7 000C 0221 SUBWF gbl_b, W 000D 1FA1 BTFSS gbl_b,7 000E 0221 SUBWF gbl_b, W 000F 1803 BTFSC STATUS,C 0010 2813 GOTO label268436063 0011 3001 MOVLW 0x01 0012 00A2 MOVWF gbl_c 0013 label268436063 for(;; 0013 2813 GOTO label268436063 } regards Thomas Kusch
  3. Hello! Here is my problem, probably a bug: Bug description: a comparison between two signed chars seems not to work correclty Steps to reproduce: here my code sniplet: signed char DefaultAction(signed char cIst, signed char cSoll) { signed char cAccel; if(cIst == cSoll) return(0); cAccel=1; if(opposite(cIst,cSoll)) cAccel=4; if(cSoll==0) cAccel=2; //HERE IS THE PROBLEM if(cIst>cSoll) cAccel=-cAccel; //Example: cIst=-90 cSoll=0 and the statement gets TRUE //(cAccel old value=2 new value=-2) 100% tested with the debugger //Assembler code for this statement //006E 0832 MOVF DefaultAct_00005_arg_cIst, W //006F 1003 BCF STATUS,C //0070 1BB2 BTFSC DefaultAct_00005_arg_cIst,7 //0071 0233 SUBWF DefaultAct_00005_arg_cSoll, W //0072 1FB3 BTFSS DefaultAct_00005_arg_cSoll,7 //0073 0233 SUBWF DefaultAct_00005_arg_cSoll, W //0074 1803 BTFSC STATUS,C //0075 2879 GOTO label268436421 //0076 0934 COMF DefaultAct_00005_1_cAccel, W //0077 00B4 MOVWF DefaultAct_00005_1_cAccel //0078 0AB4 INCF DefaultAct_00005_1_cAccel, F //0079 label268436421 if(bSpinTurn) cAccel+=cAccel; return(cAccel); } Expected behaviour: It should do the opposithe thing Is the problem 100% reproduceable: It happens EVERY time at this statement IDE version: SourceBoost IDE version 6.01 Compiler: BoostC Target device: PIC16F873 OS: Win2k Comments: Please help! I would like to change from cc5x because of limitations and price. But the compiler should work correctly
×
×
  • Create New...