Gavin, I've used that same routine on the 16F877 and (slightly modified) on the 18F452 with no problem. About the only thing that can go wrong at the point where it failed for you (I think) is a typo, which there didn't seem to be in what you wrote, or a mistake in the parameters you are passing to the macro. You should pass it the name of a GPR register where the pointer is stored, a GPR name where the buffer begins, and a constant indicating how big the buffer is. I vaguely recall having that same error at that point myself at one time by passing it (the macro)something other than it expected. I don't remember exactly what the mistake was now. Hope that is of some help. Jon M. (Mike) Jones (541) 926-2856 pmjones3@attbi.com ----- Original Message ----- From: "Gavin Jacobs" To: Sent: Monday, March 10, 2003 7:07 PM Subject: [PIC]: Unresolvable labels or is too complex > I am trying to program a 16F628 USART. I copied some code by Tony K|bek, which contained a Macro by Eric Smith. The MPASM compiler > complains when it hits the the calculation of "ALIGNED" as follows: > "Error[151] C:\PIC PROJECTS\HELLO WORLD\USART.ASM 14 : Operand contains unresolvable labels or is too complex" > > Any idea what's wrong? > > > The macro definition is: > > ;+++++ > ; INC_BUFFER advance buffer pointers wrap if necessary > ; > ; If buffer size is power of two, and buffer is aligned > ; on an multiple of twice it size, this macro generates > ; two instructions, Otherwise it generates six instructions. > ; Originator: Eric Smith, eric@brouhaha.com for non-comercial use. > > INC_BUFFER MACRO Pointer, Base, Size > LOCAL POWER_OF2, ALIGNED,BIT,VALUE > > POWER_OF2 SET !(Size&(Size-1)) ; calculate if power of 2 > ALIGNED SET POWER_OF2&&((Base&(Size-1))==0) ; calculate if aligned > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body