Menu

GCASM errors

Help
Dmitry
2022-12-22
2023-03-20
  • Dmitry

    Dmitry - 2022-12-22

    Hello, people.

    GCstudio 1.0 does not work. Does not start at all.

    Im compiling my project...
    chip 16f676,4

    G+Stool V20200921 www.FrankSteinberg.de >>fst'20<<
    Great Cow BASIC Pre-processing (Copyright 2007..2021)
    C:\port\GCB@Syn\GreatCowBasic\include\Inspecting_Libraries.h
    Great Cow BASIC (0.98.07 2021-07-24 (Windows 32 bit) : Build 1005)
    Assembling program ...
    Errors have been found:
    Error: GCASM: Symbol 7.0 has not been defined at DECF PORTC.0,W
    Error: GCASM: Symbol 39.0 has not been defined at SUBWF ADC.0,W

    What do mean errors? How can I corretc them?
    I do not understand source of a problem.
    Text of symbols is not found in work directory.

     
  • Anobium

    Anobium - 2022-12-22

    I can look for you.

    Please post your program as an attachment.

    Eva

     
  • Anobium

    Anobium - 2022-12-24

    Regarding your GC Studio - please post to https://sourceforge.net/p/gcbasic/discussion/596084/thread/2f0beef127/ We do need all feedback on installations.

    Evan

     
  • Dmitry

    Dmitry - 2023-01-12

    Its interesting how to corect such bugs.

     
    • Anobium

      Anobium - 2023-01-12

      Hi,

      What errors are you seeing?
      And, can you post the top four lines of the .ASM file afer you have compiled.

       
  • Anobium

    Anobium - 2023-01-12

    I get these errors - sorry, but all of these are correctly identified errors than need to be corrected.

    Warning: Configuration setting not valid: INTOSC_OSC_NOCLKOUT
     work0.gcb (178): Error: Illegal operation:  Bit variables cannot be added or subtracted
     work0.gcb (245): Error: Illegal operation:  Bit variables cannot be added or subtracted
     work0.gcb (246): Error: Illegal operation:  Bit variables cannot be added or subtracted
     work0.gcb (253): Error: Illegal operation:  Bit variables cannot be added or subtracted
     work0.gcb (256): Error: Illegal operation:  Bit variables cannot be added or subtracted
     work0.gcb (279): Error: Illegal operation:  Bit variables cannot be added or subtracted
     work0.gcb (291): Warning: Inaccurate microsecond delay due to use of variable at the current clock speed
     work0.gcb (293): Warning: Inaccurate microsecond delay due to use of variable at the current clock speed
     work0.gcb (302): Error: Illegal operation:  Bit variables cannot be added or subtracted
    

    Incorrect config. INTOSC_OSC_NOCLKOUT is not valid. Use PICINFO to see what is valid.
    meas is port.pin and therefore you cannot to maths on it.
    charge is port.pin and therefore you cannot to maths on it.
    Using single letter for variables is not good practice but this is ? for i=1 to adc.0 What is adc.0 ? Bit zero of the word variable acd? that would either 0 tor 1.
    And, wait adc us where adc can be 1 us is not valid. You need to clock the chip at 12Mhz to make 1 us happen. So, use a constant and work some method that uses a repeat-end repeat.

     
  • Dmitry

    Dmitry - 2023-03-17

    Thank You, IDE works. Code is corrected, look from a side is usefull.
    Proect goes hardly... One more trouble.
    It says now end if without if, but all is seem on its place. Editor does not mark left the group.

     
  • Anobium

    Anobium - 2023-03-18

    See attached.

    But, you need to decide to use one line IF-THEN or multiline IF-THEN-END IF. You had a bit of both.

    AND,

    Add #OPTION EXPLICIT to your program to discover all the other errors that need correction. :-)


    I will update the compiler to better handle the ELSE statement / ELSE error handling.

    :-)

     

    Last edit: Anobium 2023-03-18
  • Anobium

    Anobium - 2023-03-18

    The error message are correct. See the diagram.
    Explaination of errors

     

    Last edit: Anobium 2023-03-18
  • Dmitry

    Dmitry - 2023-03-18

    ... By general logic, bit variable can mean integer 0 or 1 for add-substract, zero or unity operator for multiply. In GCB all this is not realized. Sadly, I wil know. One more limit.

    Mmmm. This CRs. Legasy Turbo Pascal was unsensitive for them at all.
    I seem it will be logically better to write
    if condition
    then code
    else code
    endif
    Editor marks it correctly, but compiler says wrong.
    Well, will know too. Thanks, works.

     
    • Anobium

      Anobium - 2023-03-18

      Your code style should be

      if condition then
      code
      else
      code
      endif

       
  • Anobium

    Anobium - 2023-03-20

    News. The new build of the compiler and toolchain now include an improved IF-THEN ELSE construct.

    Get the new build via GCSTUDIO automatic updates.

    The new build now supports ELSE code.

    So, the following is now valid.

    if condition then
        code
        more_ode
    else code
    more_code
    endif
    

    The else code is expanded and processed normally. A good change to the compiler.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.