Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Relocatable logic with macro

Status
Not open for further replies.

Night Rider

Member
i'm programming with relocatable logic with pic (mplab etc) and i call macro's from a header file .h which i created. when i call a macro with name locoloco it works fine, but when i call a macro with name mul8x8 5, 6 the mplab show me that i have an error at 32-34 lines of code. the error has 151 code. the subject is that i haven't any error at these lines. if i reposition the code at these lines the error is the same. i put the call of macro mul8x8 5, 6 in comments and it works fine all the code and with the other macros. what's the problem? i can't work with macros which has variables with the relocatable logic? help pls, thanks.
 
hi,
According to the MPLAB error codes, code 151

151 Operand contains unresolvable labels or is too complex

Its possible that the 'mult8x8' part is the trouble, can you change it something simpler. eg: M8by8 in order to test the problem?

Lets know
 
The name of the macro is most certainly not the problem.

My guess is that the macro does not work for two constant operands. Can we see the macro definition, the macro call, and can you tell us precisely which processor you are using.

I'm also not familiar with the term "relocatable logic". Can you elaborate on what this means. IIRC "symbols" can be relocated by the linker but constants cannot be relocated -- they are...well...constant.

Details MAN details!
 
"My guess is that the macro does not work for two constant operands". Your idea Papabravo makes me thinks to see somethink that i hadn't saw before. No, the true is that the macro works with two or three or four variables. The problem was that i must place a "local" directive in the macro to define a constant in the macro. that's why it didn't worked. Thanks!
 
Night Rider said:
"My guess is that the macro does not work for two constant operands". Your idea Papabravo makes me thinks to see somethink that i hadn't saw before. No, the true is that the macro works with two or three or four variables. The problem was that i must place a "local" directive in the macro to define a constant in the macro. that's why it didn't worked. Thanks!
It was a lucky shot, but I have been doing this for a bit less than half a century.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top