Searching \ for '[PIC]: labeling an indivdual bit in MPASM' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=asm
Search entire site for: 'labeling an indivdual bit in MPASM'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: labeling an indivdual bit in MPASM'
2001\06\02@014625 by fischers

flavicon
face
Is there a directive in MPASM, equivelent to CBLOCK but that labels
indivdual bits insteed of whole bites?

I need 3 or 4 bits to use as flags.

--
Seth Fischer
Auckland, New Zealand
spam_OUTfischersTakeThisOuTspamxtra.co.nz

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\06\02@023822 by Andrew Warren

face
flavicon
face
Seth Fischer <.....fischersKILLspamspam@spam@xtra.co.nz> wrote:

> Is there a directive in MPASM, equivelent to CBLOCK but that labels
> indivdual bits insteed of whole bites?

Seth:

   #define FLAG1   REG,0   ;Bit 0 of register REG is
                           ;called "FLAG1".

   ....

           BSF     FLAG1   ;Set FLAG1.

-Andy

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\06\02@101339 by Olin Lathrop

face picon face
> Is there a directive in MPASM, equivelent to CBLOCK but that labels
> indivdual bits insteed of whole bites?

You can "label" a flag with:

#define flag_afu gfl0,0

And then use it like

    BSF   flag_afu

However, this doesn't help with allocating the flag bits and making sure that
another flag doesn't use the same bit, etc.  I run all my MPASM source code
thru a preprocessor that, among other things, implements a /FLAG directive.
This allocates individual flag bits in variables GFL0, GFL1, ... GFLn.  An
assembly variable is set to the number of GFLn variables required so that
these can be allocated later.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinspamKILLspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...