Project

General

Profile

Actions

Getting Started with x86 » History » Revision 40

« Previous | Revision 40/87 (diff) | Next »
Alexander Kamkin, 04/06/2017 04:58 PM


Getting Started with x86

Prerequisite

MicroTESK should be installed.

Demo Specifications

Specifications of the x86 (8086) instruction set architecture (ISA) can be found in $MICROTESK_HOME/arch/demo/x86/model/x86.nml.

Each instruction is described in nML by means of the following constructs (mov r16/r16 is taken as an example):

  1. the signature
    op mov_r1616 (dst: GPR16, src: GPR16)
  2. the assembly format
    syntax = format("mov %s, %s", dst.syntax, src.syntax)
  3. the binary encoding
    image = format("1000101111%s%s", dst.image, src.image)
  4. the semantics
      action = {
        dst = src;
        ...
      }
    

To compile the ISA model, run the following command:

$MICROTESK_HOME/bin/compile.sh x86.nml

Demo Templates

Test templates for the x86 ISA can be found in $MICROTESK_HOME/arch/demo/x86/templates.

The directory contains a number of demo templates including the following ones:

block.rb demonstrates how to use block constructs
block_random.rb demonstrates how to create randomized instruction sequences using block constructs
euclid.rb demonstrates test program simulation to predict the resulting microprocessor state
random.rb demonstrates how to randomize tests by using biased values, intervals, arrays, and distributions
random_immediate.rb demonstrates how to randomize immediate values
random_registers.rb demonstrates how to randomize registers (dependencies)

To run template processing use the following command:

$MICROTESK_HOME/bin/generate.sh x86 block.rb --code-file-prefix block --code-file-extension -v

When the processing is finished, files with the resulting assembly code can be found in $MICROTESK_HOME

For more information, see MicroTESK wiki: http://forge.ispras.ru/projects/microtesk/wiki/Template_Description_Language

Updated by Alexander Kamkin about 7 years ago · 40 revisions