First,*** DOCUMENT YOUR CODE ***! If you force yourself to explain the purpose of every instruction, you will find a lot of problems on your own. Second, it tells anyone trying to help you what you *thought* you were doing. Third, it shows that you've put at least a little effort into your code, and not just throwing it over the wall asking everyone else to do your homework for you. Nevertheless, since you are a beginner I will continue this one time. > OUTER decfsz COUNT1,1 ^ Don't do this. Use the W and F symbols supplied for that purpose. I assume you meant F here, but I didn't waste time looking it up. Personally, I only use W and put nothing there for F since that's the default. > call INNER > goto OUTER Note that this is an infinite loop. Too bad there is no way to tell if that's what you intended. > INNER movlw FFh This is a subroutine entry point, which needs a description even more than other lines of code. Also, I'm surprised that "FFh" was understood by the assembler as a constant. I know it accepts h'FF' and 0xFF, but I've never seen the trailing "h" syntax before and it's not listed in my (perhaps old) MPASM manual. If you never assembled this or used something other than MPASM, then you're being rather rude by not pointing it out. I would have hit delete right up front and gone on to somebody actually worth helping if you had mentioned you weren't using MPASM. > movwf COUNT2 > LOOP decfsz COUNT2,1 > goto INNER This is probably wrong. Jumping back to INNER reloads COUNT2 with FFh each time, so the DECFSZ will never skip since it is always decrementing from FFh to FEh. If the last instruction did jump back to LOOP, then execution would just fall off the end of the subroutine since there is no RETURN there. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu