
At times it is necessary or useful to be able to specify more than one command format. The most obvious use of multiple formats would be when the ROM words actually have more than one physical format. Some microcode sequencers use different physical formats for jumps, conditional jumps and ordinary microinstructions. Another less obvious use of multiple formats is when you wish to give the illusion of multiple command formats, even though there is only one physical format. To illustrate, consider the case of providing conditional and unconditional jumps. One way to implement unconditional jumps is to treat them as conditional jumps and use a condition that is always true. The same scheme could be used to implement ordinary micro-instructions as conditional jumps using a condition that is always false. For conditional jumps it would be convenient to have two required fields, condition, and jump address. On the other hand, it would be inconvenient to require explicit specification of conditions on unconditional jumps and ordinary instructions. Similarly on ordinary microinstructions no required operands would seem to be most appropriate.
cjump: equ 2
cont: equ 3
fcjump: format cjump
fcont: format cont
The operand field of the "format" statement is a list of one or more command names. The label of the statement is the name of the format. All of the opcodes in the operand field will be associated with the format named in the label.
condb: field position=0,width=3,default=1,format=fjump,type=constant
condc: field position=0,width=3,default=0,format=fcont,type=constant
Note that these three fields all occupy the same place in the rom word. When multiple formats are used, the rules for overlapping fields are modified somewhat. There may not be any overlapping fields in a single format. Furthermore, there must be a definition for each field in each format. The "type=constant" parameter may be used to prevent the user from assigning a value to a field in a particular format. The ROM preprocessor will issue an error message if a value is assigned to a constant field.
addrb: field position=3,width=8,cmdpos=(0,1),format=(fjump,fcjump)
Note that only two field descriptions are required. The format parameter can be used to assign a field to more than one format, as illustrated above. When the "cmdpos" parameter is used with a field assigned to more than one format, a single number can be used to specify that the field appears in the same command position in each format, or a list of numbers can be used (one per format) to specify that the field appears at different command positions in each format.
ctl_b: field position=12,format=(fcont,fjump,fcjump)
ctl_c: field position=13,format=(fcont,fjump,fcjump)
cont
cont
cjump xcond,endit,ctl_c
jump beg,ctl_a
endit: jump *,ctl_b
The first format defined in the text is the default format. All fields without "format" parameters, are assigned to the default format. The default format is used for "word" opcodes and for opcodes that are not explicitly mentioned in a "format" statement. The default format is used for creating dummy words to fill holes left by "org" statements.