This "high" keyword is excellent. Much nicer, I agree. However, I don't understand why you say "Saving W around setting PCLATH is pointless because you are about to trash the old W value with the table entry value." The value in W is the digit value that needs to be converted to a 7-segment pattern. For example... ... movf DIGIT0,W call Convert7Seg ... In the code sample you added, that value is thrown out. -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Olin Lathrop Sent: Wednesday, June 12, 2002 7:32 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: Odd problem... > org 0x0700 ; Start in really high memory > ;----------------------------------------------------- > ; Convert 4-digit data to 7-segment data > ;----------------------------------------------------- > > Convert7Seg: > movwf SAVE_ADDR ; Save offset > movlw 0x07 > movwf PCLATH > movf SAVE_ADDR,W ; Retrieve offset Saving W around setting PCLATH is pointless because you are about to trash the old W value with the table entry value. I also don't like the MOVLW 7 to get the constant to load into PCLATH. If you change the ORG value, you have to remember to change this value. Worse, you didn't even document this dependecy. A far better answer is to have the assembler load the right value for you automatically. I've added a label to the start of the table for that purpose: movlw high table1 ;set the high bits of the table entry adr movwf pclath > addwf PCL,F ; Jump to appropriate offset table1 ;start address of the table > retlw B'01111110' ; '0' > retlw B'00110000' ; '1' > . > . > . > nop ; Error - '15' > retlw B'00000001' ; Return dash ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics