Jump to content
Sign in to follow this  
qu1j0t3

Object File Compatibility

Recommended Posts

Hi,

 

I have a project which already has several files of MPASM code. I would like to be able to link BoostC code with these, which leads me to ask:

1) will the linker work with MPLAB .O files? (My testing with SourceBoost seems to fail)

2) are the calling conventions documented? (assembly from C)

 

Thanks.

Share this post


Link to post
Share on other sites

qu1j0t3,

 

1) will the linker work with MPLAB .O files? (My testing with SourceBoost seems to fail)

 

The answer is no. BoostC compiler and linker have the own .obj file format.

 

 

2) are the calling conventions documented? (assembly from C)

Even if the calling convention was documented, there would still be the problem of how to turn the ASM code into a BootsC/Boost Linker compatible file.

 

My recommendation would be to turn the ASM code into C code.

You can still use the asm code, and just put a C function wrapper around it:

 

char MyAdd10( char arg1 )

{

char res;

 

asm

{

// add 10 to value passed

movf _arg1, W

addlw 10

movwf _res

}

 

return res;

}

 

Note: In order to used "W" in ASM code you must include <system.h>

 

 

Hope this helps.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...