A yeah, another neat attribute of this technique: If 'count' is not a valid value on entry the result will be zero! Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: "Bob Ammerman" To: Sent: Thursday, May 31, 2001 8:33 AM Subject: Re: [PIC]: A table question. > Roman, > > It is untested, but I am certain it will work. > > Thanks for the compliment. > > Oh yeah, another feature: its isochronous. > > Bob Ammerman > RAm Systems > (contract development of high performance, high function, low-level > software) > > ----- Original Message ----- > From: "Roman Black" > To: > Sent: Thursday, May 31, 2001 5:47 AM > Subject: Re: [PIC]: A table question. > > > > Bob, does this actually work?? If so, this is VERY > > clever and deserves a place in Piclist history. > > My system used 4:1 for a table and was rough, and I > > was hoping someone could get a 3:1 system. I never > > expected someone to make a straight 2:1 system!! > > > > It's even fairly neat to read, as you would like > > in a table of values. > > > > Very impressive. :o) > > -Roman > > > > > > > > Bob Ammerman wrote: > > > > > > I knew it, I knew it... > > > > > > There _is_ a two instruction per entry technique! > > > > > > movlw value1^value2^value3 > > > decfsz count,F > > > xorlw value1 > > > decfsz count,F > > > xorlw value2 > > > decfsz count,F > > > xorlw value3 > > > etc. > > > > > > Notice what happens: > > > > > > If count == 1 on entry then all the xor's except value1 occur, > > > leaving 'value1' in W. > > > > > > If count == 2 on entry then all the xor's except value2 occur, > > > leaving 'value2' in W. > > > > > > If count == 3 on entry then all the xor's except value3 occur, > > > leaving 'value3' in W. > > > > > > Bob Ammerman > > > RAm Systems > > > (contract development of high performance, high function, low-level > > > software) > > > > > > ----- Original Message ----- > > > From: "Roman Black" > > > To: > > > Sent: Wednesday, May 30, 2001 1:13 PM > > > Subject: Re: [PIC]: A table question. > > > > > > > Bob Ammerman wrote: > > > > > > > > > > And why can't you use a normal ADDWF PCL,F table? > > > > > > > > > > > > Wow! Everyone on the piclist is deaf tonight! ;o) > > > > > > > > It is a 12-core PIC, you can only put calls and > > > > computed gotos on the bottom 256byte blocks. Those > > > > are all full of other tables. I need a sane way > > > > of adding a small table in another area (a high > > > > block where tables are not possible). I can do it > > > > with the 4:1 system I showed but that is very > > > > unpolished. Surely someone has done this before? > > > >:o) > > > > -Roman > > > > > > > > -- > > > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > > > > > > > > > > > -- > > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > -- > > http://www.piclist.com hint: To leave the PICList > > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu