> >As I hinted in the subject of this message, I suspect that the while loop > >compiles incorrectly. The loop check compiles as follows: > >MOVLR 00h > >MOVFP 27,WREG ; get c > >BTFSC ALUSTA,2 ; zero? > >GOTO 0089h ; skip > >The code can be seen in context in the list file portion below. The > >problem is that the MOVFP instruction does not modify the flags, and the > >loop terminates only later once the zero (terminating) character has > >already been displayed!!! My guess is that the programmer who wrote the compiler read note 3 under "Appendix B: Compatibility" [page 13-165 in my copy of the 96/97 PIC16/17 Microcontroller Data Book]. That note reads, simply: 3. Replace: MOVF REG1, W with: MOVFP REG1, WREG Until seeing your post, I incorrectly thought it was MOVFP rather than MOVPF which affects the zero flag; it turns out to be the other way 'round. Perhaps Microchip can note that in the next copy of the data book? That same bug could easily have bitten me. [I've already been bitten by "incf" affecting the CARRY flag...]