CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problem using #import for assembly code

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mbfrench



Joined: 30 Sep 2006
Posts: 2

View user's profile Send private message

Problem using #import for assembly code
PostPosted: Sat Sep 30, 2006 4:00 pm     Reply with quote

I have about a 500 line assembly program written in MPLAB that I would like to call from C. Based on the info on the CCS site I got the impression that would be possible with version 4.0 but I haven't had any luck importing anything other than Hex files. I'd like to let the linker do it's job if it can. It may be I just don't have enough information to set it up right.

When I try to import object or COFF files, I get the following error:

Linker Error: COFF file 'D:\Documents\Pic Projects\project\ImportTest.cof' is corrupt; recompile module.

I am compiling from MPLAB IDE 7.4 with the CCS plugin.
I am using CCS 4.002 demo version for a 16F877 processor.
The source, object, and other files are all in the same directory.

Any help would be appreciated.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Mon Oct 02, 2006 7:53 am     Reply with quote

I think at this time I wouldn't try the #import.
V4.x doesn't have that working yet.

Can you do it with a #asm??
mbfrench



Joined: 30 Sep 2006
Posts: 2

View user's profile Send private message

PostPosted: Mon Oct 02, 2006 10:50 am     Reply with quote

Thanks for the feedback. I was hoping to avoid inlining it because the code was already debugged and working in MPLAB. It is the tack I took though and have worked through most of the details. The following were some of the inconveniences I ran into - If you know of ways around them, it would be appreciated for next time:

All the #defines provided in MPLAP (STATUS, Z, C, etc) had to be re-established.

All the semi-colons had to be replaced with // for comments.

No obvious way to reference program labels for variables for computed jumps. As a bad example:

movlw TblStart
addf Index
movwf PC

TblStart:
retlw 1
retlw 2
. . .

None of them a big deal, but I apparently added a bug or to in the process.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group