Searching \ for '[PIC]: How to use MPASM generated "cod" files with' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=asm
Search entire site for: 'How to use MPASM generated "cod" files with'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: How to use MPASM generated "cod" files with'
2000\09\14@061209 by Wojtek Zabolotny

flavicon
picon face
Hi All,

Because of the bug in macro implementation in GPASM (discussed in the
"Global symbols in macros don't work in gpasm?" thread), I had to use MPASM
last time. However the debbugging facilities of MPLAB simulator are very
poor, and I really had to do the job in GPSIM (USART & SPI simulation).
MPASM (DOS version) runs smoothly under DOSEMU in Linux, so there is no
problem with using MPASM & GPSIM together, however one problem exists:
GPSIM does not accept the MPASM generated "cod" files. As I've found in the
GPSIM's documentation the reason is the inclusion of OS dependent filenames
in the cod file. I've checked it and this is what I found:

To make the MPASM generated cod files you need:
1. Change the processor name to one accepted by GPSIM
  (in my case I had to change "16F877" to "16f877")
2. Change all the filenames from the DOS versions into their UNIX
  equivalents.
  Eg. I have my sources in "~/dos/pic2" directory which is "F:\PIC2" under
  DOSEMU.
  If my source is "F:\PIC2\PICTEST1.ASM" and it uses the
  include file "F:\PIC2\P16F877.INC", then I change this strings
  to "pictest1.asm" and "p16f877.inc" (however I have to start the gpsim
  in the "~/dos/pic2" directory.

One more remark about the string format in "cod" files. I have stated that
the strings in "cod" files are written in following form:
length_of_string (1 byte)
string_itself (array of bytes)
zero_padding (array of zero bytes)
I've stated, that it is safe to change the strings, when changing the length
byte respectively, and padding the new string with zeros.
Up to now I did it just with Midnight Commander (F3 to view -> F2 to edit ->
repeatedly F2 to switch hex/text edit -> F6 to save), but I'm
considering to write a simple C program or Perl script to make it
automatically (making chnages "by hand" after each compilation is rather
boring & tiring).
--
                       HTH & Greetings
                     Wojciech M. Zabolotny
       http://www.ise.pw.edu.pl/~wzab  <--> spam_OUTwzabTakeThisOuTspamise.pw.edu.pl

http://www.freedos.org  Free DOS for free people!

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\14@082739 by Scott Dattalo

face
flavicon
face
On Thu, 14 Sep 2000, Wojtek Zabolotny wrote:

{Quote hidden}

What a coincidence! In the GPL spirit of things, Daniel Christian needed the
same feature (supporting MPLAB generated .cod files in gpsim), so he sent a
patch that supposedly does it for him. I haven't personally tested it since I
don't have any MPLAB formatted .cod files lying around on /dev/sda. But I've
checked his changes into CVS and could make a tar ball if you want.


Scott

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\14@094820 by wzab

flavicon
picon face
On Thu, Sep 14, 2000 at 07:29:11AM -0500, Scott Dattalo wrote:
>
> What a coincidence! In the GPL spirit of things, Daniel Christian needed the
> same feature (supporting MPLAB generated .cod files in gpsim), so he sent a
> patch that supposedly does it for him. I haven't personally tested it since I
> don't have any MPLAB formatted .cod files lying around on /dev/sda. But I've
> checked his changes into CVS and could make a tar ball if you want.
>
I'd be glad to receive the patches (or the new sources). BTW I'm very
interested how does he solve the problem of mapping DOS dirs <-> Unix dirs?
My idea was to give in the command line of the script something
like this:
./script -d "F:\PIC2" -u "~/dos/pic2" file.cod

--
                              Thanks & Greetings
                             Wojciech M. Zabolotny

       http://www.ise.pw.edu.pl/~wzab  <--> .....wzabKILLspamspam@spam@ise.pw.edu.pl

http://www.freedos.org  Free DOS for free people!

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\15@140939 by Peter L. Peres

picon face
>use cod files with gpsim

MPASM can generate object files in any format you want, including INHX16
and INHX32. Use a LIST F=... directive in your source to do that. I have
gpsim but I did not get around to check it out so I don't know what file
formats it will take. I have standardized all my pic tools to INHX16 since
1996 or so.

hope it helps,

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\09\15@142740 by Scott Dattalo
face
flavicon
face
On Fri, 15 Sep 2000, Peter L. Peres wrote:

> >use cod files with gpsim
>
> MPASM can generate object files in any format you want, including INHX16
> and INHX32. Use a LIST F=... directive in your source to do that. I have
> gpsim but I did not get around to check it out so I don't know what file
> formats it will take. I have standardized all my pic tools to INHX16 since
> 1996 or so.

But the symbolic information in .cod files makes debugging SO much easier.

Scott

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\09\15@172505 by Olin Lathrop

flavicon
face
> MPASM can generate object files in any format you want, including INHX16
> and INHX32. ...

No, MPASM uses some sort of private format for object files that are
definitely not HEX files.  HEX files were originally intended for prom
programmer use, so they only contain address and data information.  Object
files need to contain relocatable and other linker input information.  Try
looking at a .O file with notepad or something.  It's not even a text file.
MPASM only creates HEX files when producing absolute code.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinspamKILLspamcognivis.com, http://www.cognivis.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\09\16@085558 by Peter L. Peres

picon face
>But the symbolic information in .cod files makes debugging SO much easier.

In 1996 MPASM did not generate CODs so I had to parse the listing file for
my 16C54 debugger/simulator ;-) Also the Microchip simulator crashed my
system regularly for some reason so I could not use that. I still don't
know where the problem was/is.

Peter

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...