Nikolai Golovchenko wrote: > > Tony, > If you need to cycle FSR from 0x40 to 0xFF and again, may be this will > work: > incf FSR, f ;increment FSR > skpnz ;check for overflow from 255 to 0 > bsf FSR, 6 ;if overflow fix FSR to 0x40 > > FSR should be preloaded with a number in 0x40-0xFF range. Thanks for the tip. I was trying to do it with the least instruction count and be 'isosynchronous'. I learnt that here ;-) What I am trying to do is output an 8 bit value to PortB as quick as possible. The data is coming from RAM at address 0x40 to 0x7F. To avoid the problems I had with quick succession BSF BCF instructions I had to do the following... WaveData7 bsf FSR,6 movf INDF,W incf FSR movwf PORTB bcf FSR,7 goto WaveData7 I guess the internal bus can't keep up with multiple read/write/modify instructions on the same register. This is a short as I can get it which results in a repetition rate of about 2.2KHz at 4MHz. I just got the ROMzap software to do sine, rectified, triangle and arbitrary waves from PORTB. They look quite good on the CRO with a simple R2R, but filtering is obviously needed. The arbitrary waves are good. Just draw them on the PC screen and out of PORTB they come. I was hoping to have this done sooner, but some friends arrived here to do some choir singing with the Melbourne Philharmonic Orchestra so we took time off to show them around. Strange thing was, they live in Chandler Arizona right near the Microchip HQ, but they didn't have a clue what a PIC was. -- Best regards Tony http://www.picnpoke.com mailto:sales@picnpoke.com