On Wed, May 30, 2001 at 09:08:10PM +0200, Joan Ilari wrote: > What about a computed goto ? I have never used 12 bit CPUs, > but with 14 bit ones, it works : > > ... > call table ;w contains the table index > ... ;when returning, W contains table(index) > > table addwf PCL,F > retlw '1' > retlw '2' > .... Joan, As Roman pointed out in his initial message, it's a 12 bit PIC. They have this rather bizarre rule that computed goto's and calls can only occur in the first 256 bytes of a page. So what Roman means by "run out of room" is that all the computable parts of the PIC are already filled with computed goto table code. So the challenge is how to simulate a computed goto table without actually using a computed goto. BAJ > > > -----Mensaje original----- > > De: pic microcontroller discussion list > > [mailto:PICLIST@MITVMA.MIT.EDU]En nombre de Roman Black > > Enviado el: miercoles, 30 de mayo de 2001 17:38 > > Para: PICLIST@MITVMA.MIT.EDU > > Asunto: Re: [PIC]: A table question. > > > > > > Hi, has anyone done a table-less data table?? > > > > I have run out of room on a 12-core PIC and > > need a small table. > > > > I have tried: > > > > movlw 23 (table data byte) > > decf count,f > > skpnz > > goto table_exit > > movlw 71 (next data byte) > > decf count,f > > skpnz > > goto table_exit > > > > But this is 4 bytes per table data byte. > > Does anyone have a more efficient system? > > > > I have thought about placing a table in > > a ram bank, then using FSR to address it as > > the 16C505 can address any ram with FSR without > > bank switching. I think this will get me > > 2 bytes rom = 1 table data byte. But it is messy. > > > > Any suggestions from the PIC masters? :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#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body