Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Hobknob

  1. char porta@0x81; The @ operator allows you to specify that the variable is located at the specified address. This allows the syntax of porta = 0xFF; // set all port a bits on porta |= 0x01; // turn bit 0 on porta &= 0xFE; // turn bit 0 off Individal bit addressing is NOT currently supported in the form porta_bit0 = 1; Checkout the help that is part of the installation or //www.picant.com/c2c/doc/c2c.html and search for built in variables. ??? ???
  2. something got lost last paragraph: don't use - this uses the default header file path were ever that may be? #include erfilename.h>
  3. Try: #include "headerfilename.h" The header file must reside in the same folder as the source file which is including it. #include "..\includes\headerfilename.h" The header location is specified relative to the file which is including it. #include "c:\somewhere\headerfilename.h" The header file can reside anywhere if an absolute path is specified. don't use - this uses the default header file path were ever that may be? include erfilename.h>
  4. I seem to remember a previous positing about a problem with the unary minus. I believe that xinc1 = 0-xinc1; should work.
  5. Hi pchiou, your for loop equivalent is not the same as a do while loop, but it is the same as a while loop!. Consider when the condition is tested, in the do while loop the code in the loop is always executed at least once, in the while loop senario the loop code may never be excuted. I'm really surprise that you don't use do while, it makes some some loops look very tidy and therefore highly readable! Hi JoeB, Equivalent code, but it does not look clean.
  6. I'm really not sure about this direct register code. I think it makes neat code but is actually departing from the standard 'C' language, and turning to a 'C' like language instead. This is starting to look like C++ operator overloading with function inlining. Its neat but is it the right thing to do?
  7. Admin, I found that this did not work TRISB = 0; it generates: clrf TRISB ie no bank switching - Are you sure about this!
  8. The live update on the old forum made it feel alive. What is the max time delay between posting a message and it appearing?
  9. Is the do while loop construct support in the c2c compiler? I though this loop was one of the fundamentals
  10. I had the same problem on a 16F84A. The compiler doesn't do the bank switching for you, but I believe it should!? - Admin. Try this: set_bit( STATUS, RP0 ); TRISB = 0; clear_bit( STATUS, RP0 );
  • Create New...