Menu

A short collection of questions

Help
2007-01-03
2013-05-30
  • Russ Hensel

    Russ Hensel - 2007-01-03

    Hi:

    I am just starting with Great Cow Basic and am trying to write a program to control 2 stepper motors ( I will submit it if/when i get it running ).  It is based on a program I have already written in assembler that works, so I have got the basic concepts down.  I want to get familiar with Great Cow because I am working with a bunch of high school kids and think that assembler it too hard for them ( actually I think it is too hard for me, my stepper program took far too much time to write and debug ).

    In just starting the program I have several questions that are not addressed ( as far as I can find ) in the documentation.  If you could answer the questions ( and update the documentation ) I would greatly appreciate it.  Having written documentation myself, I know that one of the best sources for improvements is having first time readers read it.  I hope you find this useful for yourself.

    By the way I think that this project is a great one for the PIC community, keep it up.

    Questions:

            Are the and's and or's “bitwise” or “logical” for just true and false?

           I would like to set several bits in a port at once without disturbing  other bits I assume that the reading the port, combining the new bits ( perhaps with a bitwise or ) and writing the port is the way to go, is this what you would recommend?

        Can “if then”'s be nested, likewise other control structures?

        “For next” works with what size variables ( byte, word )?

        Can “if then”'s be nested, likewise other control structures?

        How caps sensitive is the compiler?

    Notes:

        Table commands do not seem to be in command document

        This might be added to docs.

    It is possible to use binary numbers in GCBASIC, as long as you use "b'" to mark the numbers as binary. For example, this will work:

    A(2) = b'00110011'

    Incidentally, hexadecimal can also be used - add 0x to the start of a number to mark it as hex.

    Thanks much

        Russ

     
    • Hugh Considine

      Hugh Considine - 2007-01-06

      In GCBASIC, true and false are represented by values of 255 and 0 respectively. Hence while the and/or/xor functions are bitwise, they will also work logically.

      Using And and Or to clear/set several bits at once is definitely the best way to go.

      All control structures can be nested.

      For .. Next will work with byte and word variables.

      GCBASIC is not case sensitive.

      I will add these points to the documentation. Thanks for the feedback - it does indeed make development easier.

       

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.