PDA

View Full Version : small-c common51 in EPROM?


Robert Milby
07-24-01, 01:51 PM
Problem - Small-C creates a huge hex file for the most simple programs. Most of it is common51 or other standard functions. This takes forever to download to the NMIY-0031

Proposed Solution: Burn the standard functions into EPROM above the Monitor.

Question: Has anyone tried (or have comments about) the following:
1) copy the monitor into a larger EPROM with a Prom Burner
2) Compile common51.c into the upper address space of the EPROM - I am not sure how yet
3) Burn the common51.hex into the EPROM above the monitor
4) Modify common51.c so that it produces an .segment .rom2 command (to tell the assembler to put the code into the EPROM memory space) in all .asm files
5) Run the assembler with a -o- option to generate separate hex files . See level1.doc in the A51 directory.
6) Download only the main() code only. The standard functions are permently available in EPROM

Can it work?

Robert Milby
07-24-01, 05:31 PM
I have had some success:
I inserted the following assembler directives into common51.c

define free space on top of Monitor ver1.1

.EQU free_EPROM,h'1150

after the initialization code
.segment .EPROM
.EPROM
.org free_EPROM

The listing shows that the remainder of the common51 code goes from h'1150 to h'12E3

I will not be certain that this works until I actually try it, but I am optimistic.