piclist 2001\01\14\152443a >
Thread: MPASM conditional assembly
face picon face BY : Olin Lathrop email (remove spam text)

>   if Case1              ;Force an error in case someone sets more than one
> X       equ     0       ;to true.
>   else                  ;
>   if Case2              ;
> X       equ     1       ;
>   else                  ;
>   if Case3              ;
> X       equ     2       ;
>   endif                 ;

This won't do what the comment says.  I've done something like this before
by counting the number of CASEx symbols that were true.  If the answer isn't
1, then it's an error.  You can see an example of this.  Go to
http://www.embedinc.com/pic and look near the bottom of STD_DEF.INS.ASPIC
where it ensures that exactly one processor family was selected.

Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spamBeGoneolinspam_OUTspamKILLspamembedinc.com, http://www.embedinc.com

http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

<001301c07e67$d3c83ae0$260bf6cd@pc> 7bit

See also: www.piclist.com/techref/microchip/languages.htm?key=asm
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) MPASM conditional assembly

month overview.

new search...