Em 14/7/2011 15:13, Bob Ammerman escreveu: > BTW, it is possible to properly use the RETLW as a lookup table in=20 > PIC24/dsPIC assembly code. > > mov ,W0 > bra W0 > retlw valuefor0 > retlw valuefor1 > retlw valuefor2 > .etc. > > This is significantly slower than using PSV, but is very simple to use. > > -- Bob Ammerman > RAm Systems It is 3 times slower than PSV (1 CALL + 1 BRA + 1 RETLW =3D 6 cycles total, against 1 MOVE + 1 Stall =3D 2 cycles total) and uses twice as many FLASH words. Besides you are forced to use two different access methods, one for constant data in FLASH and another for data in RAM. Isaac --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .