C std. and ROMing of C code
Larry Pajakowski
larry at extel.UUCP
Tue Oct 16 11:57:05 AEST 1984
Has the C standards group considered the problems encountered when
placing C code into ROM? Has anybody looked into the portability
problems associated with developing program on a UN*X machine and then
moving it into an EPROM environment?
We have some sizable code ( >250k ) running on an 8088 written in C and
all in EPROM. One of the biggest problems we had with the ROM version
compared with our UN*X test bed were initialized variables (mostly
message strings).
C traditionally has placed initialized data into the data space. That
is fine if you have a disk to refresh the memory and wanted to changed
an initialized variable. Our compiler from Lantech assumed a fairly
traditional split I & D environment. Our code could grow to the limit
of the 8088 (1-meg) while the data space was limited to 64k and the
stack space occupied the same space as the data space.
Since initialized data was assumed to be in the data space where
pointers wroked we were forced to copy initialized data from a special
area in EPROM to RAM thus simulating the effect of a disk. This has 2
disadvantages. First it forced us to place all initialized date
(messages etc.) in 1 or 2 modules and second it took away about 12k of
our fairly precious 64k or RAM.
Several other ideas were contemplated like using a 32 bit pointer to
eliminate the 16 bit limitation. This was tried but
the resultant 30% increase of code
size (makes the 8088 work kinda hard) and 30% decrease in speed were
unacceptable (all that EPROM costs money).
Has this been hashed out by the standards committee?
Anybody have any better ideas about moving code from a UN*X environment
to EPROM?
--
Larry Pajakowski
Extel Corp, Northbrook, IL
ihnp4!tellab1|extel|larry
More information about the Comp.lang.c
mailing list