gnupic: #pragma for memory maps
Subject:
#pragma for memory maps
From:
Scott Dattalo ####@####.####
Date:
28 Jun 2002 05:07:42 -0000
Message-Id: <Pine.LNX.4.44.0206272139180.23933-100000@ruckus.brouhaha.com>
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