Scor­pio News

  

July–September 1988 – Volume 2. Issue 3.

Page 17 of 39

As it stands this system of reference will serve well for most applications, but it could be improved. Firstly, where re-entrant sections are used it may be desirable to have two or more routines in a common section. An example would be where they have considerable common code which is not used elsewhere, or where one would often be followed by the other. This could be achieved using a dual table system where the routine number would be used as a reference to a table of entry addresses and section numbers, and the section number found would reference a table of disk allocations.

An obvious second change that could be made concerns the length bytes. An accuracy of 128 bytes in the length of blocks is good enough for most cases, but it would obviously be possible to use 2 bytes to give the exact length. Of course it would then be necessary to buffer the sectors as they are loaded.

There remains one very difficult question if we are going to have re- entrant sections in the overlay. How, using a high level language compiler, do we arrange for the relevant code to occupy a suitable free block of memory? The situation is not as troublesome as it could be because we have removed the need to link into the main code by our overlay management system. Firstly we must allocate the memory block we are going to use. If the compiler produces relocatable object (.REL files) we will probably have issued /D: and /P: link switches to ensure the data area is constant, and we should be able to leave a suitable gap between code and data to take the extra bits. Then when we compile and link these we can arrange for them to be where we want. If the re-entrant sections need to access runtimes or any of the main code, it should be possible to load the host program into the linker for the required references. Such a process is naturally very involved and will take some time and

Page 17 of 39