Fields

A field corresponds to a certain number of bits of a machine instruction. The first field of an instruction stores the opcode of the instruction. The remaining fields include the operands of the instruction. There can also be 0-bit fields, which just correspond to punctuation in the assembly language format of the instruction.

Parameters:

Examples:


Figure 23. The dialog for editing the fields of machine instructions.

Consider the fields shown in Figure 23 above. Assume that the "reg" field has a set of three values associated with it: A=2, B=3, and C=4. Also, assume that the punctuation characters '[' and ']' are individual character tokens (see the discussion of tokens for information on setting the token usage of punctuation characters). Now consider two 16-bit machine instructions with names "foo" and "bar" with opcodes 0 and 1 and with the following respective formats:

    op reg reg un7
    op delta[reg]
These instructions can be called in assembly language as shown in these examples:
    foo B C
    bar -2[A]
and will be assembled into the following bits (with spaces inserted to indicate the separate fields):
    00000 011 100 0000101
    00001 11111110 010

Note that the delta value of -2 is converted to binary using 8-bit 2's complement notation.

If the two punctuation characters '[' and ']' are not individual tokens and instead form parts of symbols, then you need to separate them with whitespace from neighboring characters in instruction calls to avoid ambiguity or incorrect parsing. For example, you would need to write

    foo B C
    bar -2 [ A ]

Notes: