Overlays and Segments

Source lines in GIN are divided into three classes:

  • Lines which give rise to stored words.
  • Lines which only affect the operation of the compiler: these consist of directives, labels and lines in macro definitions.
  • Lines which give rise to other source lines: these are macro call lines.

Every source line which gives rise to a stored word must be within an overlay (except for interludes). Every GIN program consists of one or more overlays. An overlay is a block of consecutive words in a program which are stored together and which will be brought into core as a unit distinct from any other overlays.

Almost any program which is not very large will consist of a single overlay. For example, the GIN compiler (which is written in GIN) consists of one overlay, and any such program is colloquially referred to as non-overlaid since no changing of overlays take place.

However, GIN allows programs to be set up as a collection of overlays; one of these (the first to be compiled) will be resident in core initially, and the rest will be stored on some kind of backing-store and brought in by the program as required.

For its own convenience, GIN also insists that a program be subdivided into segments. A segment is a section of code containing up to 1024 stored words. Each segment has its own name, and is included as a unit according to the user's instructions. Labels and other identifiers within the segment can be local to the segment and unavailable outside it.

GIN insists that each segment should be contained within, or else form the whole of, an overlay.

There are two classes of overlays, long overlays and chapters.

A long overlay commences with a #BASE directive and ends with a #OVERLAY directive. It will contain one or more segments, and will have a name (which should be unique, although GIN does not depend on this). The #BASE directive specifies the name of the overlay and the base address, which is the core address where its first word is expected to go when the overlay is in core. The #OVERLAY directive can specify the first instruction in the overlay to be obeyed, and whether the program is to halt before entering the overlay.

The first overlay of a program must be in the form of a long overlay.

Click here for a table of George overlays

A chapter consists of a segment which does not lie between #BASE and #OVERLAY. It has a base address of zero, and it is assumed to have no specific entry point (that is, the user arranges for entry to it).

The intended use of chapters is as relocatable code which may be obeyed irrespective of its position in the machine. Most of GEORGE is written as chapters. To use chapters successfully, all branches within a chapter should be relative, and references to data words in the chapter should be modified by a pointer to the first word of the chapter. (GEORGE holds such a pointer in FX1).

Click on a letter for a table of George chapters: A B C D E F G H I J K L M N O P Q R S T U V W X

A segment is simply all the code between #SEGMENT and #END. It has a name and an address on backing-store.

It is possible to correct a segment already compiled by means of the #MEND directive; this directive specifies the segment to be altered, and all that is to be done is to state which words in the segment need correction and what their contents should be. The end of a series of corrections is a #END directive.

  • Last modified: 17/01/2024 11:55
  • by 127.0.0.1