![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
In Nigel's "PIC Tutorial One - LED's" he uses;
Code:
cblock 0x20
count1
counta
countb
endc
For instance, if I define 'bucket' how many bits do I have that could be set/unset? Can the bits be manipulated like other registers? Example using 8 bits Code:
cblock 0x20
bucket
endc
movlw b'00000001'
movwf bucket
rlf bucket
bsf bucket, 6
__________________
Dave Life may not be the party we hoped for, but while we are here we might as well dance. |
|
|
|
|
|
|
(permalink) |
|
All PIC registers are 8 bit, so the section of my code you quoted allocates three 8 bit variables at GPR addresses 0x20, 0x21, 0x22. The cblock/endc is an assembler directive for allocating meomory, and is described in the MPASM helpfile.
Basically it's a simpler way to allocate GPR's, than allocating each one a seperate address. |
|
|
|
|
|
|
(permalink) |
|
Thanks for the reply Nigel.
The more I learn the more dangerous I get... watch out PIC's here I come. :lol:
__________________
Dave Life may not be the party we hoped for, but while we are here we might as well dance. |
|
|
|
|