>myke predko wrote: > >Tjaart wrote: > >> Fix_up_PCLATH MACRO >> local Local_Label >> Local_Label >> movlw ((Local_Label>>8)&&0xFF) >> movwf PCLATH >> ENDM > >.... and Myke replied: > >> Actually, this can be simplified to: >> >> movlw $ >> 8 >> movwf PCLATH > >Tjaart and Myke: > >Actually... The following is best: > > movlw high ($ + 2) > movwf PCLATH > Andy, I forgot about the "high" operator in the MPASM - yes, that makes it even simpler. Out of curiosity, why are you adding 2 to the current address (This would make the value that you are getting PCLATH for is the instruction *after* "movwf PCLATH")? I guess it's for maximizing code space for a table (ie start two addresses before modifying PCL). Is there any other reason for doing this? myke Avoiding precedents does not mean nothing should ever be done. It only means that nothing should ever be done for the first time - Sir Humphrey Appleby K.C.B.