Fellow subcribers, I came up with a useful little define macro (MPASM) for producing bit masks from bit positions. I'm sure there are those of you who have done this sort of thing before, but it might prove useful to others. Mike The example is as follows: ; ; bmsk - This define produces a bit mask from a bit position value. ; (i.e. "(bmsk 4)" produces the value 0x10. ; variable BIT_M=0x01 #define bmsk BIT_M << ; ; ; Bit position equates ; APPLE equ 0 ORANGE equ 1 GRAPE equ 2 CHERRY equ 3 BANANA equ 4 PLUM equ 5 PEACH equ 6 MANGO equ 7 ; ; BSF operations on the file register "FRUIT" ; clrf FRUIT bsf FRUIT,APPLE bsf FRUIT,CHERRY bsf FRUIT,PLUM bsf FRUIT,MANGO ; ; The define "bmsk" can be used to create the same result in the ; register FRUIT with two instructions; This allows the bit ; position equates to still be used with the BSF and BCF instructions ; in other parts of the program. ; movlw (bmsk APPLE) | (bmsk CHERRY) | (bmsk PLUM) | (bmsk MANGO) movwf FRUIT