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 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Writing it this way, generates smaller and faster code: | Writing it this way, generates smaller and faster code: | ||
− | + | bit LED1_TRIS @ TRISB.5; | |
− | + | ||
− | + | bit LED2_TRIS @ TRISB.6; | |
− | + | ||
− | + | bit LED3_TRIS @ TRISB.4; | |
− | + | ||
− | + | ||
− | + | // 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). | ||
− | |||
[[Category:BoostC]][[Category:PIC]] | [[Category:BoostC]][[Category:PIC]] |