Dwayne, Thanks for clearing that up ! I've gone another way to stop getting the message, and added a ErrorLevel -302 line to the start of my code. However, I see the advantage in using the XOR message as this will give a message in those situations where one is needed. Still can't see why the code doesn't work though...;-) Andy Dwayne Reid wrote: > At 05:11 PM 5/28/03 +0100, Andy Pryer wrote: > >> Steve, >> >> Code looks fine to me, except one point - Why do you have an XOR on the >> registers ? e.g. on TRISIO ? Just looking at some of my code and >> MicroChip code which initialises these registers, neither of which use >> an XOR. I thought this was the function of changing to Bank1 using the >> STATUS,RP0 flag ? > > > The reason the original poster is XORing the MSB is to suppress the warning > message that will otherwise be emitted by the assembler. > > The assembler does not keep track of the bank select or ram page bits. So > anytime it sees a RAM or ROM address that goes past a boundary, it outputs > a warning message to prompt you to make sure have taken care of it. > > The problem with that is that there can be MANY such messages - how do you > tell which messages can be ignored? > > The solution is to manually flip or mask the bit that causes the > problem. The advantage of using an XOR is that if by mistake, you put in > the name of a register that is in RAM page 0, you are warned to check it. > > I do this using macros, rather than manually typing in the 'XOR 0x80' for > every register that needs it. > > dwayne > > -- > Dwayne Reid > Trinity Electronics Systems Ltd Edmonton, AB, CANADA > (780) 489-3199 voice (780) 487-6397 fax > > Celebrating 19 years of Engineering Innovation (1984 - 2003) > .-. .-. .-. .-. .-. .-. .-. .-. .-. .- > `-' `-' `-' `-' `-' `-' `-' `-' `-' > Do NOT send unsolicited commercial email to this email address. > This message neither grants consent to receive unsolicited > commercial email nor is intended to solicit commercial email. > > -- > 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 -- Andy Pryer Email: andy.pryer@cubecomputing.com Web: http://www.cubecomputing.com Tel/Fax: 01582 703872 ------------------------------------------------------------------ PGP Fingerprint FF1A 67E9 8E52 8689 68DF C86A FCE9 002B 61B8 5C73 -- 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