Jump to content

onyx

EstablishedMember
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About onyx

  • Rank
    Newbrie
  1. Bug description: hex file contains extended linear address record now Steps to reproduce: compile the following example #include <system.h> char a; void main() { while(1) { a = 23; } } generated hexfile for 16F876 target: :020000040000FA <-- extended linear address record :020000000828CE :0A000600173083120313A000032833 :020010000328C3 :00000001FF Expected behaviour: BoostC Compiler/Linker should generate extended linear address records ONLY WHEN IT IS NECESSARY, because otherwise it makes the downloader fail. I use Shane Tolmies BootLoader and Downloader 1.09 It is very annoying to delete this line every time before downloading. Is the problem 100% reproduceable: yes IDE version: SourceBoost IDE 5.70 Compiler: BoostC Compiler version: Alpha 1.8 OS: Windows 2000 SP4 Comments: C2C compiler does not insert extended linear address records into hexfiles.
  2. Bug description: code for strings in rom not generated Steps to reproduce: compile the following example #include <system.h> rom char* strVersion = "Version 1.00"; rom char* strHello = "Hello World"; void myputch(char ch) { portb = ch; } void sendString(const char* s) { while(*s) { myputch(*s); s++; } } void main() { sendString(strVersion); sendString(strHello); } Expected behaviour: BoostC compiler should generate code that represent theese strings in rom, I would expect to see a romget routine for accessing the strings. Is the problem 100% reproduceable: yes IDE version: SourceBoost IDE 5.70 Compiler: BoostC Compiler version: Alpha 1.8 OS: Windows 2000 SP4 Comments:
  3. Bug description: pointer arithmetic expression evaluation is not consistent, very often results in error: failed to generate expression Steps to reproduce: compile the following with BoostC #include <system.h> const char* d; const char* s; const char* res; int length; void main() { d += 1024; s++; res = d - s; // what's wrong with this expression ? res = d; // splitting up the expression works res -= s; // length = (int) res; // length is 1023 } Expected behaviour: the compiler should evaluate all pointer arithmetic expressions correctly and there should be no difference if you write p = p - a; or p -= a; Is the problem 100% reproduceable: yes IDE version: SourceBoost IDE 5.6.1 Compiler: BoostC Compiler version: Alpha 1.4 OS: Win2000 Comments:
  4. Bug description: compiler struggles with keyword register it complains error: missing semicolon, but i don't know where. if you remove the keyword register, it compiles fine Steps to reproduce: compile the following with BoostC #include <system.h> char strlen(const char* s) { register char len = 0; while(s[len]) len++; return len; } char length; void main() { length = strlen("how long is it"); // 14 } Expected behaviour: the compiler should ignore the keyword register Is the problem 100% reproduceable: yes IDE version: SourceBoost IDE 5.6.1 Compiler: BoostC Compiler version: Alpha 1.4 OS: Win2000 Comments:
  5. Bug description: multiply by 256 generates wrong results Steps to reproduce: compile the following with BoostC #include <system.h> char h, l; unsigned int gamma; void main() { l = 0xE8; // low byte of gamma h = 0x03; // hi byte of gamma gamma = h*256 + l; // *** wrong, due to shift optimization ?;-) gamma = ((int) h) << 8 | l; // *** correct gamma = 1000 } produces the following code ... gamma = h*256 + l; // *** wrong, due to shift optimization ?;-) 1FE5 ; { 1FE5 A501 CLRF CompTempVar7 1FE6 A401 CLRF CompTempVar6 1FE7 2108 MOVF gbl_l, W 1FE8 2407 ADDWF CompTempVar6, W 1FE9 A600 MOVWF CompTempVar8 1FEA 2508 MOVF CompTempVar7, W 1FEB A700 MOVWF CompTempVar9 1FEC 0318 BTFSC STATUS,C 1FED 1FED A70A INCF CompTempVar9 1FEE 1FEE 1FEE 2608 MOVF CompTempVar8, W 1FEF A200 MOVWF gbl_gamma 1FF0 2708 MOVF CompTempVar9, W 1FF1 A300 MOVWF gbl_gamma+D'1' 1FF2 ; } gamma = ((int) h) << 8 | l; 1FF2 ; { 1FF2 A401 CLRF CompTempVar10 1FF3 2008 MOVF gbl_h, W 1FF4 A500 MOVWF CompTempVar11 1FF5 2108 MOVF gbl_l, W 1FF6 2404 IORWF CompTempVar10, W 1FF7 A600 MOVWF CompTempVar12 1FF8 2508 MOVF CompTempVar11, W 1FF9 A700 MOVWF CompTempVar13 1FFA 2608 MOVF CompTempVar12, W 1FFB A200 MOVWF gbl_gamma 1FFC 2708 MOVF CompTempVar13, W 1FFD A300 MOVWF gbl_gamma+D'1' 1FFE ; } Expected behaviour: the compiler should generate correct code so that gamma evaluates to 1000 Is the problem 100% reproduceable: yes IDE version: SourceBoost IDE 5.6.1 Compiler: BoostC Compiler version: Alpha 1.3 OS: Win2000 Comments:
  6. Bug description: BoostC generates no BCF instructions in clear_bit(var,bit) Steps to reproduce: compile the following example with boostc #include <system.h> char beta; void main() { beta = 0x0f; set_bit(beta, 5); clear_bit(beta, 3); } compiles with boostC to the following void main() 1FF9 main; function begin { beta = 0x0f; 1FF9 ; { 1FF9 ; { 1FF9 0F30 MOVLW 0x0F 1FFA 1FFA A000 MOVWF gbl_beta 1FFB ; } set_bit(beta, 5); 1FFB ; { 1FFB A016 BSF gbl_beta,5 1FFC ; } clear_bit(beta, 3); 1FFC ; { 1FFC F730 MOVLW 0xF7 1FFD A005 ANDWF gbl_beta 1FFE ; } } 1FFE 1FFE 0800 RETURN 1FFF ; } 1FFF ; main function end - Exit PCLATH/Uncertainty: 0x3:0x0 Expected behaviour: Compiler should generate BCF gbl_beta,3 for the expression clear_bit(beta, 3) this code generation is not wrong, but it would be much nicer using BCF, than loading a literal constant and anding it with the variable Reproduceable: always SourceBoost DE version: 5.6.1 Compiler: BoostC 1.3 Alpha Remark: C2C 5.6.1e generates the expected code OS: Win2000
  7. BoostC Alpha 1.1 Hi, Im missing the compiler option that inserts C-source into assembly code, it makes checking of compiled code much easier. if you could please make it available again in BoostC, thank you!
  8. Bug description: generates wrong code for shift operations Steps to reproduce: compile following example with boostc #include <system.h> unsigned int counter, result; void main() { counter = 2457; counter = counter >> 3; // division by 8 result = counter; counter = counter << 3; // multiply by 8 result = counter; } Expected behaviour: Compiler should generate a shift operation and not a rotate operation. for every right shift cycle the carry flag should be cleared. ORG 0x00000000 0000 0000 158A BSF PCLATH,3 0001 160A BSF PCLATH,4 0002 D42F GOTO _startup ORG 0x00001FD4 1FD4 _startup 1FD4 ; { 1FD4 ; } 1FD4 1FD4 D52F GOTO main ORG 0x00001FD5 1FD5 main; function begin 1FD5 ; { 1FD5 ; { 1FD5 9930 MOVLW 0x99 1FD6 1FD6 A000 MOVWF gbl_counter 1FD7 0930 MOVLW 0x09 1FD8 A100 MOVWF gbl_counter+D'1' 1FD9 ; } 1FD9 ; { 1FD9 2008 MOVF gbl_counter, W 1FDA A400 MOVWF CompTempVar6 1FDB 2108 MOVF gbl_counter+D'1', W 1FDC A500 MOVWF CompTempVar7 1FDD 0310 BCF STATUS,C 1FDE A50C RRF CompTempVar7 1FDF A40C RRF CompTempVar6 1FE0 A50C RRF CompTempVar7 1FE1 A40C RRF CompTempVar6 1FE2 A50C RRF CompTempVar7 1FE3 240C RRF CompTempVar6, W Pseudo instruction:INSTR_RSHIFT_VAL_TO_W not available on target! 1FE4 A000 MOVWF gbl_counter 1FE5 2508 MOVF CompTempVar7, W 1FE6 A100 MOVWF gbl_counter+D'1' 1FE7 ; } 1FE7 ; { 1FE7 2008 MOVF gbl_counter, W 1FE8 A200 MOVWF gbl_result 1FE9 2108 MOVF gbl_counter+D'1', W 1FEA A300 MOVWF gbl_result+D'1' 1FEB ; } 1FEB ; { 1FEB 2008 MOVF gbl_counter, W 1FEC A400 MOVWF CompTempVar8 1FED 2108 MOVF gbl_counter+D'1', W 1FEE A500 MOVWF CompTempVar9 1FEF 0310 BCF STATUS,C 1FF0 A40D RLF CompTempVar8 1FF1 A50D RLF CompTempVar9 1FF2 A40D RLF CompTempVar8 1FF3 A50D RLF CompTempVar9 1FF4 A40D RLF CompTempVar8 1FF5 A50D RLF CompTempVar9 1FF6 2408 MOVF CompTempVar8, W 1FF7 A000 MOVWF gbl_counter 1FF8 2508 MOVF CompTempVar9, W 1FF9 A100 MOVWF gbl_counter+D'1' 1FFA ; } 1FFA ; { 1FFA 2008 MOVF gbl_counter, W 1FFB A200 MOVWF gbl_result 1FFC 2108 MOVF gbl_counter+D'1', W 1FFD A300 MOVWF gbl_result+D'1' 1FFE ; } 1FFE 1FFE 0800 RETURN 1FFF ; } 1FFF ; main function end - Exit PCLATH/Uncertainty: 0x3:0x0 Reproduceable: always SourceBoost DE version: 5.6.1 Compiler: BoostC 1.1 Alpha Remark: C2C generates correct code for this example
×
×
  • Create New...