next up previous
Next: Example: Sum of Squares Up: TAL Previous: Example: MAL/TAL Differences

Machine Code Format

TAL instructions consist of several fields in two basic formats. All instructions contain a 6 bit opcode field, which provides a maximum of 64 different instructions, and defines how the other 26 bits are interpreted.

The first basic format is used for instructions which contain immediate data. The fields are defined as:

tabular220

In addition to the op-code field, this format contains two 5 bit register fields and a 16 bit field for an immediate constant.

For example, the op-code for the addi instruction is 0010 00. The machine code for the instruction:

        addi    $13, $7, 50

is:

tabular239

Note that the order of the fields for tex2html_wrap_inline145 and tex2html_wrap_inline147 is reversed.

The second instruction format is used for instructions which contain only register operands. The opcode for all instructions in this format is 0000 00. The general format is:

tabular257

The 11 bit op-code extension which appears in bits 0-10 uniquely identifies the instruction using this format.

For example, the register addition instruction instruction:

        add     $13, $7, $8

is encoded as:

tabular278

Note that the register fields appear in a different order than the operands in the TAL instruction.



CS 301 Class Account
Mon Dec 1 23:34:28 AST 1997