View previous topic :: View next topic |
Author |
Message |
mbfrench
Joined: 30 Sep 2006 Posts: 2
|
Problem using #import for assembly code |
Posted: Sat Sep 30, 2006 4:00 pm |
|
|
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
|
|
Posted: Mon Oct 02, 2006 7:53 am |
|
|
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
|
|
Posted: Mon Oct 02, 2006 10:50 am |
|
|
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. |
|
|
|