gnupic: #pragma for memory maps
Subject:
Re: #pragma for memory maps
From:
"Kevin L. Pauba" ####@####.####
Date:
1 Jul 2002 12:42:31 -0000
Message-Id: <1025526604.32000.40.camel@dad>
Ricardo,
After sending out the questions I just couldn't resist and started
coding.
I have the following working (cut from my p16f873.h):
#pragma maxram 0x1ff
#pragma memmap 0x20 0x07f 0 RAM 0x100
#pragma memmap 0xa0 0x1ff 1 RAM 0x100
#pragma badram 0x8f-0x90 0x95-0x97 0x9a-0x9d
I'm going to change the inc2h.pl script to read the "__MAXRAM", and
"__BADRAM" directives from the .inc file to write the correct #pragma's.
If the syntax is acceptable, I'll send the diff's to Scott to perform a
code review (when I make the trivial change to allow the SFR memmap
entries).
On Thu, 2002-06-27 at 23:55, Scott Dattalo wrote:
>
> Ricardo Orozco was working on a program to convert .inc files into .h
> files. But, so was Kevin. Not deterred, Ricardo proceeded to adapt his
> program to create the PIC specific memory maps that SDCC needs to allocate
> registers. In the process, Ricardo suggested that instead of hardcoding
> this info in SDCC, that we create compiler pragmas that could be placed in
> the include files. Does anyone have opinions on this?
>
> A possible syntax would be:
>
> #pragma memmap START END [ALIAS_MASK] TYPE
>
> where
>
> memmap - the pragma
>
> START, END - define the range of memory
> ALIAS_MASK - bit mask defining how/if the register range is aliased
> TYPE - type of memory in the range.
>
> For example, a partial listing for a 16F877 would look like:
>
> #pragma memmap 0x20 0x6f RAM
> #pragma memmap 0x70 0x7f 0x180 RAM
> #pragma memmap 0x02 0x04 0x180 SFR
>
>
> The benefit is that as a user you could define a new memory map without
> having to modify the SDCC source. The detriment is that somebody has to
> write the code to implement this feature. Hmm.
>
> Scott
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>