Menu

Comparison COWBSIC and BASCOM

Help
lsmod
2012-06-06
2013-05-30
  • lsmod

    lsmod - 2012-06-06

    Hello,

    I am interested to compare the results of BASCOM and COWBASIC.
    It is very perfect that Cowbasic creates a readable ASM-Code!
    But i can't compare the length of the produced hex-files.

    What format has the produced hexfile?
    (I could not find anything about it up to now.)

    I tried to convert the hexfile with http://sourceforge.net/projects/hex2bin/
    But the output has bigger files than the input files!
    The conversion of the intel hexfiles from bascom works with this converter.

    I also want to understand how CowBasic is working?
    Where are the libraries that are used and how can i manipulate them?
    I could find some in the folder /include/lowlevel but this could not be all of them?

    Where can i find the difference in the handling of PIC and Atmel controllers?

    At least i would change to Cowbasic from Bascom with pleasure, because it is Free.
    Another big adavantage is that Cowbasic can handle both controller families PIC and Atmel.
    I prefer to use free software and want to encourage this.
    But for a really extensive use it would be helpfull to understand how Cowbasic is working?

    Up to now i miss examples for Cowbasic, because there are really many for Bascom.
    It is unsettling that there are no examples for Atmel.
    This will not change - so someone must start.
    The question is how to "convert" or use examples for Cowbasic.

    Another question is how to use ready lib's for basic things like 1-Wire, I2C etc.
    What is existent and maybe how stuff from Bascom can be used?

     
  • Hugh Considine

    Hugh Considine - 2012-06-06

    I've never actually used BASCOM, but the language looks very similar to GCBASIC. Both are based on QBASIC, so some things will be identical. You might be able to use some libraries from BASCOM with GCBASIC, but you would need to change some things.

    GCBASIC's libraries are all stored as BASIC (or sometimes assembly) code in .h files. There are libraries in the include directory that are optional and can be added if needed, and there are libraries in include\lowlevel that are added to every program by the compiler.

    Most libraries in GCBASIC will work on PIC and AVR. Some libraries, like software I2C, software serial, LCD and matrix keypad routines don't have anything that requires a particular chip, and will work on a PIC or an AVR. Some other libraries, like hardware serial and analog to digital conversion, have two lots of code inside them - one for PIC and one for AVR. I think there are one or two libraries in GCBASIC that are PIC only (hardware I2C is one), but AVR compatible versions can and will be written.

    There should be a help file called gcbasic.chm in your copy of GCBASIC. The page for each command will tell you what chips that command will work with. Most commands will work on any chip (PIC or AVR).

     
  • Nobody/Anonymous

    Thank you for the answer.

    That sounds good.
    I already found the libraries you have described.
    But i have not checked if they will fit to Atmel.
    The big advantage of Bascom is the perfect hardware support and many examples so far.

    I agree that many details will be equal in this two Basic dialects, so it should not be to much work to use already programmed routines from Bascom in Cowbasic.
    Maybe i can write a script for some fundamental translating.

    When i understand all the details of the library use this should also be possible for libs and chip definition.
    Of course only this script can be published when Bascom content will be used.

    But first i must get it work and tested generally.

     

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.