gnupic: .COD file problems with MPLAB
Subject:
.COD file problems with MPLAB
From:
"Aaron Colwell" ####@####.####
Date:
12 Sep 2004 23:32:25 +0100
Message-Id: <BAY24-F13IEoPXCFbN400049fba@hotmail.com>
I've been having trouble using MPLAB with the .cod files generated by
GPLINK. After looking at
the code for a little bit, I figured out that making the following change
allows MPLAB to properly
read the .cod files.
Index: cod.c
===================================================================
RCS file: /cvsroot/gputils/gputils/gplink/cod.c,v
retrieving revision 1.7
diff -r1.7 cod.c
282c282
< gp_putl16(&lb.block[offset + COD_LS_SLOC], state.lst.was_org);
---
> gp_putl16(&lb.block[offset + COD_LS_SLOC], state.lst.was_org <<
>state.byte_addr);
I don't know if this is what the "right fix" should be, but it seems to make
things work for me. I'm
using gplink via sdcc. Here is the command-line that sdcc is using.
C:\msys\1.0\local\bin\gplink.exe -I"C:\msys\1.0\local\bin\..\share\sdcc\lib"
-I"C:\msys\1.0\local\bin\..\share\sdcc\lib\pic16" -m -o prog prog.o
pic18f242.lib
The problem I'm seeing in MPLAB is that the addresses are half of what they
are supposed to be, so
stepping through the code in the simulator does not work right. It shows the
wrong lines for the
current instruction.
Aaron
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/