Ttelmah
Joined: 11 Mar 2010 Posts: 19225
|
|
Posted: Sun Mar 19, 2017 7:54 am |
|
|
However the use of #byte, didn't need getenv. Getenv, is just a nice way of being able to get register locations by name.
So you could have just done:
Code: |
#byte CCP2CON = 0xFBA
//then
CCP2CON=CCP_CAPTURE_FE;
//will set falling edge
CCP2CON=CCP_CAPTURE_RE;
//will set rising edge
|
Key is that is is honestly very rare indeed now that you need assembler. A few things, mainly where a compiler function has a problem, but putting a value just into an SFR, is one that doesn't...
Can understand though that if you have come 'from' an assembler background it does seem more natural. I used to use bits of assembler in CCS quite a lot. However much less now. |
|