Sorry, I forgot the topic tag.
----- Original Message -----
From: Elopes <elopes_74
KILLspamhotmail.com>
To: pic microcontroller discussion list <.....PICLISTKILLspam
.....MITVMA.MIT.EDU>
Sent: Tuesday, May 01, 2001 1:25 PM
Subject: bit adjustment
> Hi PIClisters !
>
> I've been learning a lot with you reading your posts. by now I have a
> trouble that I can't solve by myself, please can
>
> I'm writing a code to a remote control system with 4 channels, where the
> variable "channel" represents the "bit" that must be changed on PORTB.
There
{Quote hidden}> is my code:
>
> ;channel assumes values from 0 to 3
> movf portb, w ; make a copy of portB
> movwf sendreg ; on sendreg register
> "
> "
> " do something
> "
> btfss sendreg, channel
> goto _set ; this should invert the bit
> ;"channel"
> bcf sendreg, channel ; on sendreg register ====> but it
> ;doesn't do that !!!
> goto $ + 2
> _set
> bsf sendreg, channel
> movf sendreg, w
> movwf portb
> return
>
> the instruction < bsf register, b > only accepts a literal on "b"???
> how can I set a bit on a register (sendreg) using another pointer
register
> (channel)???
> any suggestions?
> thanks in advance,
> Eduardo.
>
>
>
--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUT
TakeThisOuTmitvma.mit.edu