Subj : Re: Initialize subroutine in startup assy code never returns if total RAM usage goes over 0x1f000 To : borland.public.cpp.borlandcpp From : Mike Hollenbeck Date : Wed Mar 23 2005 10:13 am Bob Gonder wrote: >Mike Hollenbeck wrote: > > >>I am compiling code to run on an embedded platform using a 80188 processor and 256K of RAM space. >>whenever the FARHEAP gets above 0x1F000 the system just resets. > >So when the heap is larger than half the total memory space, it >resets. >What memory model are you using? >How far up does the app start loading? 0x100? 64k? >How big is the stack? >How big is the app without the heap? >Is part of the ram reserved for system use? Bios or Video? > >> I can supply the Makefile, BCPP45.ASM .RM and .LOC files if needed. > >And why are you using a heap with asm? > > Thanks for your response Bob. The Memory Model is Large The Ram starts at 0x2400 and is 256K large The Stack is 45K The app doesn't use the heap and is run from ROM in it's own seperate 256K memory area starting at 0xC0000, malloc is never called. I haven't removed the DMM code as yet, I may try that next, but this error occures when the FARHEAP approches 0x1FFFF, but since it is the last section of Memory and it isn't used, I believe the error is possibly in another module. Assy code is only used for the startup routines. They were provided by Borland. The reset occures durring the setup phase, not durring the run p hase, the code never reaches main(). The lower 2400 bytes are used for system I/O - Control Also, did I mention that the code compiles and links with no errors, and only a few warnings about unused variables. As an aside, the same platform is used in another product compiled with an earlier version of Borland C++ using almost all of the 256K of Ram space and it compiles and runs with no problems. I have matched the Makefile, and memory control .RM files with that version to no avail. I also checked the Assy startup code, and in the area that it is failing, the code is identical. I am thinking of changing this code to compile using that version, but I was told that there are scope differences that need to be addressed, and I am not sure without documentation how long that process will take. I was hoping that there was a compiler option that I was missing, but again the Makefile options and memory control files are as close a match as I can make them. Thanks again for your help. Mike .