<< 2012-3 >>
Department of
Computer Science
 

Introduction

File Name Conventions

Object files produced by the linker are, by convention, appended with a suffix of .preout to distinguish them from other file types.

Object File Format

The linker produces executable object files which may be run on the simulator The executable object file is split into a number of sections as displayed in the diagram below :
object file format diagram

Instruction encoding

The instructions are encoded in binary form for the machine in the output of the linker. There are two instruction formats:
Instruction encoding diagram

Type 1 encoding

Instructions encoded in type 1 format are generally register-register, and load/store operations that do not require large constants. The fields in the encoding are as follows:
Filed nameBitsContents
Opcode0-5Instruction opcode
Reg16-11Instruction operand 1 (typically denotes register)
Reg212-17Instruction operand 2 (typically denotes register)
Reg318-23Instruction operand 3 (typically denotes register)
Partition24-31Instruction operand 3 (denotes register)

Instructions whose parameters are not register based (for example CREPAR) use a log2 encoding for constants in the Regi fields.

The instructions encoded in type 1 format are:

MOV, LOAD, STORE, LOADIDX, STOREIDX, ADD, SUB, MUL, DIV, MOD, LS, RS, RSU, AND, OR, XOR, NOT, LT, GT, EQ, CREPAR, DELPAR, INVPAR, SETIPAR, UPDPAR

Type 2 encoding

Branch instructions, instructions using large constants, and other miscellaneous instructions not requiring a partition parameter are encoded using the type 2 format. The fields in the encoding are as follows:
Filed nameBitsContents
Opcode0-5Instruction opcode
Reg6-11Instruction operand 1 (typically denotes register)
Reg212-31Instruction operand 2 (typically encodes 20 bit signed constant)

The instructions encoded in type 2 format are:

LOADC, JUMP, JUMPZ, JUMPNZ, JUMPR, HALT, NOP, TRAP

Executable header

The header of the executable object file contains the bootstrap for the user application. Here the initial state of the machine is created for entry point proper into the user application. The header also contains the initial partition creation code required by the applciation. A bootstrap header looks like
  CREPAR    0, i, 1
  SETIPAR   0
  CREPAR    1, c, 1
  CREPAR    2, t, 1
  CREPAR    3, p1size, p1stride
  CREPAR    ...
  CREPAR    n+2, pnsize, pnstride
  LOADC     31, nnn
  LOADC     30, 0
  STORE     30, 31, 2
  LOADC     31, nnn-2
  LOADC     31, nnn-1
  JUMP      main
  HALT
  
SymbolMeaning
iNumber of cache lines for instruction cache partition
cNumber of cache lines for scalar cache partition
tNumber of cache lines for stack cache partition
piUser partition i
sizeThe number of lines required for a user partition
strideThe stride required for a user partition
nThe number of user partitions
nnnApplication stack pointer start
mainRelative address of aplication entry point

We can pattern match against this header style to spot linker generated executable files -- for use with debuggers etc.

Instruction Code

The instruction code is a block of encoded instructions which represent the code for the user application, including user object files generated by the assembler and precompiled library object files. All relocations are resolved, being data (including the constant pool and user data), partition and branching.

Constant Pool

The amalgamated constant pool appears after the instruction segment in the executable object file. This is the collection of constant pools of each object file specified no the command line.
© 1995-2013 University of Bristol  |  Terms and Conditions  |  Use of Cookies
About this Page