gnupic: Re: How to use MPASM generated "cod" files with GPSIM


Previous by date: 14 Sep 2000 19:11:17 -0000 Re: How to use MPASM generated "cod" files with GPSIM, Wojtek Zabolotny
Next by date: 14 Sep 2000 19:11:17 -0000 Re: SOLUTION: How to use MPASM generated "cod" files with GPSIM, Wojtek Zabolotny
Previous in thread: 14 Sep 2000 19:11:17 -0000 Re: How to use MPASM generated "cod" files with GPSIM, Wojtek Zabolotny
Next in thread:

Subject: Re: [PIC]: How to use MPASM generated "cod" files with GPSIM
From: Dan Christian ####@####.####
Date: 14 Sep 2000 19:11:17 -0000
Message-Id: <20000914121307.C2148@wankel.ceng.com>

On Thu, Sep 14, 2000 at 04:10:58PM +0200, Wojtek Zabolotny wrote:
> 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

What I did was to add a smart search path to the fopen routine.  To
get it, start gpsim like this:
    gpsim -L $HOME/pic:$HOME/pic/more

The COD parse will first strip off and discard the F:\.  There is a
possible loss of information, but you would have to have different
files with the same name to be tripped up by this.  This also makes
the file names displayed in the source browser nicer.

Then the open routine will search the path for the right files.  If
the open routine can't find the file, it will strip off a directory
layer and try again.  Note that all this gets run with the original
capitalization, then with all caps, and with all lower case.  You do
need all this, since MPLAB will tend to force some things to upper
case.

So if the search path is: /tmp/mysource:/dos/mplab/includes and you
are looking for c:\mplab\includes\P16F877.INC, it will end up trying
these pathes:
      /tmp/mysource/maplab/includes/P16F877.INC
      /dos/mplab/includes/maplab/includes/P16F877.INC
      /tmp/mysource/includes/P16F877.INC
      /dos/mplab/includes/includes/P16F877.INC
      /tmp/mysource/P16F877.INC
      /dos/mplab/includes/P16F877.INC
      /TMP/MYSOURCE/MAPLAB/INCLUDES/P16F877.INC
      /DOS/MPLAB/INCLUDES/MAPLAB/INCLUDES/P16F877.INC
      /TMP/MYSOURCE/INCLUDES/P16F877.INC
      /DOS/MPLAB/INCLUDES/INCLUDES/P16F877.INC
      /TMP/MYSOURCE/P16F877.INC
      /DOS/MPLAB/INCLUDES/P16F877.INC
      /tmp/mysource/maplab/includes/p16f877.inc
      /dos/mplab/includes/maplab/includes/p16f877.inc
      /tmp/mysource/includes/p16f877.inc
      /dos/mplab/includes/includes/p16f877.inc
      /tmp/mysource/p16f877.inc
      /dos/mplab/includes/p16f877.inc
      
This sounds like a lot of work, but 1) Linux is really good about
caching the look ups, and 2) this is an ugly example.

I usually have a path with my directory and the mplab directory in it
and everything is found perfectly.

If you are using a linker, then some files will be included many
times.  The redundant copies will get filtered out, and only one will
actually be loaded.

If you turn up the verbose level, you can see it trying all the file
pathes.

TODO:  There should also be a "set " command to set the search path.

Let me know of any problems.

-Dan

-- 

Previous by date: 14 Sep 2000 19:11:17 -0000 Re: How to use MPASM generated "cod" files with GPSIM, Wojtek Zabolotny
Next by date: 14 Sep 2000 19:11:17 -0000 Re: SOLUTION: How to use MPASM generated "cod" files with GPSIM, Wojtek Zabolotny
Previous in thread: 14 Sep 2000 19:11:17 -0000 Re: How to use MPASM generated "cod" files with GPSIM, Wojtek Zabolotny
Next in thread:


Powered by ezmlm-browse 0.20.