In volume 3, number 2 of the Nascom Newsletter, I described
the addition of two more commands and two more pseudo ops to the
COMPASS assembler (version 1.3). This article describes the
addition of a further command.
As there were only two ‘spare’ command letters, the BADCMD
facility of COMPASS is used. This was thoughtfully provided by
Level 9 as a jump at £0F00 for the addition of extra commands,
and the address of this sump is changed to the address of the
The new routine, the ‘Z’ command, provides a means of
listing label addresses without having to reassemble the
program. Once a program has been assembled, pressing ‘Z’
followed by a Newline will list the labels and their addresses
immediately, the number being displayed at a time being
controlled by the ‘H’ command. The command will work before
assembly but rubbish will be displayed.
The program as shown below has its origin at COMPASS+£1A53,
as it is assumed that the previous additions have been
incorporated. If they have not, then the origin is at
COMPASS+£197E and line 10 will have to be altered accordingly.
The COMPASS Assembler is unusual in that the labels are not
restricted in length, and so the storage of their addresses is
also unusual. The usual way is to split the symbol area into 8
byte blocks, six bytes being for the label and two for its
address. In this instance, the symbol area is split up into four
byte blocks, with two bytes for the address and the other two
bytes as the address of the label in the source area. As an
example, the label ‘RIN’ of this program appeared in the symbol
01 60 08 00
the first two bytes being the label address and the second, the
abject address. A label address of 00 00 indicates the end of
the list and, as the program outputs the object address first,
it is erased in lines 36 and 37.
The following listing shows how simple it is to display the
labels once the storage is understood. Lines 56 and 57 put the
command address in the jump table, so a cold start is necessary
for the program to work.