Builder: How you control the result, in brief
Builder gives you quite fine control over the way in which your final combined (or merged) file is constituted. There is some extra work involved, but for the larger projects the extra work is relatively minor and the benefits are considerable.
Builder requires some extra stuff inside each *.SPT source file, plus one *.b1d “build file”. (that’s a numeral one between the b and the d, to avoid conflicts with any file extension used by others).
Within the *.SPT source files you “tag” sections of code as belonging to named segments. When Builder encounters a segment tag it will direct everything below that to the named segment, until it encounters another tag. Simple tags (there are couple of slightly more complicated ones) are of the form:
;<SEGMENTNAME> ;Anything after the > will be directed to the output segment named.
The first semicolon makes this a comment line as far as the SPLat/PC simulator or translator are concerned. The word appearing between < and > is used by Builder. The < and > themselves delineate the segment name.
The leading semicolon is part of the tag. You must have ;< . A < on its own will not work.
Here is a very brief example of a source file containing 3 simple segments:
;<MEQUSEG>;Any mEQU statements go here
Counter mEQU 12 ;A counter in permanent memory
;<CODESEG>;The actual program code goes here
Count: PermRecall
IncM Counter
PermStore
Return
;<NV0SEG>;------ NVEM0 tables --------
SineTable: NV0fNUM 1.0
NV0fNUM 1.02
... etc ..
The above program contains 3 segments, MEQUSEG, CODESEG and NV0SEG. The names must consist of letters and/or numerals. There is no significance to them all ending in ‘SEG’. Builder does not care about upper/lower case. The names must be a single word.
The matching build file will contain 3 things:
- A list of the allowed segment names (you can define your own)
- A separator, which is
#---. This just tells Builder it has come to the end of the segment names - A list of the *.SPT files that are to be merged.
The build file is what controls the order in which files are read and the order in which segments are emitted. A build file for our current simple example might look like this:
MEQUSEG CODESEG NV0SEG #--- ;Separator Source1.SPT Source2.SPT Source3.SPT
The build file may contain comments using normal SPLat conventions.
In the next few screens we will present a few additional capabilities of Builder.