in order to tell the heap how large it starts off. The problem is that with recent compilations (ie: returning to an earlier code version doesn't help) that line has begun to do nothing and I don't know why. I'll step to it, evaluate the r-expression. Then when I step once more and evaluate pFreeList^.mbBlock.lwMemoryLength I get 0.
Don't remember much Pascal but, if that's a pointer then are you sure it's valid? Does "lwHeapPages" contain 0 (either forgetting to set it or being corrupted by something along the way)?
Other than that, you may have to disassemble it and see if the compiler is doing it wrong.
The actual solution was that pFreeList was paged in to physical memory that didn't exist, thus causing neither my PC nor Bochs to say anything about the invalid access. Fixed now and exchanged for another pagefauling headache.