Editing BoostC tiny Wiki

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 129: Line 129:
 
Keep in mind that the following two sections are not equal. While the first looks neater at the source code level, it generates many times(!) more (redundant) machine instructions than the second form.
 
Keep in mind that the following two sections are not equal. While the first looks neater at the source code level, it generates many times(!) more (redundant) machine instructions than the second form.
  
 +
bit LED1_TRIS        @ TRISB.5;
 +
 +
bit LED2_TRIS        @ TRISB.6;
 +
 +
bit LED3_TRIS        @ TRISB.4;
 +
 +
 +
LED1_TRIS = LED2_TRIS = LED3_TRIS = 0; // make output
  
    bit LED1_TRIS        @ TRISB.5;
 
    bit LED2_TRIS        @ TRISB.6;
 
    bit LED3_TRIS        @ TRISB.4;
 
   
 
    LED1_TRIS = LED2_TRIS = LED3_TRIS = 0; // make output
 
 
  
 
Writing it this way, generates smaller and faster code:
 
Writing it this way, generates smaller and faster code:
  
    bit LED1_TRIS        @ TRISB.5;
+
bit LED1_TRIS        @ TRISB.5;
    bit LED2_TRIS        @ TRISB.6;
+
 
    bit LED3_TRIS        @ TRISB.4;
+
bit LED2_TRIS        @ TRISB.6;
   
+
 
    // make output
+
bit LED3_TRIS        @ TRISB.4;
    LED1_TRIS = 0;
+
 
    LED2_TRIS = 0;
+
 
    LED3_TRIS = 0;
+
// make output
 +
LED1_TRIS = 0;
 +
 
 +
LED2_TRIS = 0;
 +
 
 +
LED3_TRIS = 0;
  
 
==== Read This ====
 
==== Read This ====
Line 223: Line 230:
 
* [http://en.wikibooks.org/wiki/C_programming Wikibooks: C programming] is about C programming in general (alas, focuses on programs running on desktop computers, rather than small microcontrollers).
 
* [http://en.wikibooks.org/wiki/C_programming Wikibooks: C programming] is about C programming in general (alas, focuses on programs running on desktop computers, rather than small microcontrollers).
  
* Gooligum C Tutorials [http://www.gooligum.com.au/tut_midrange_C.html ] C language Tutorials for mid range PICs with extensive examples and detailed explanations.  Written for HITEC and PICC but easily convertable to SourceBoost C.
 
 
[[Category:BoostC]][[Category:PIC]]
 
[[Category:BoostC]][[Category:PIC]]

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)