microprobe.utils.asm

microprobe.utils.asm module

This module implements the required features to interpret assembly statements and translate them into Microprobe internal representation of instruction, operands, labels and addreses.

The main elements of this module are the following:

  • MicroprobeAsmInstructionDefinition objects to represent assembly statements (i.e. instruction definitions)

  • interpret_asm() function validates the assembly statements and translates them into internal Microprobe represenation of instructions and operands.

Functions

instruction_to_asm_definition(instr)

interpret_asm(code, target, labels[, log, ...])

Return the list of MicroprobeInstructionDefinition objects that results from interpreting the code (list of assembly statements).

Classes

MicroprobeAsmInstructionDefinition(assembly, ...)

Classes diagram

Inheritance diagram of MicroprobeAsmInstructionDefinition



Functions

instruction_to_asm_definition(instr)[source]
interpret_asm(code, target, labels, log=True, show_progress=False, parallel=True, queue=None)[source]

Return the list of MicroprobeInstructionDefinition objects that results from interpreting the code (list of assembly statements). The target object is used to validate the existence of the instruction and operands in the target and the labels are needed to validate the correctness of the symbolic labels used in the assembly statements.

Parameters:
Returns:

A list of instructions, operands, labels, etc. resulting from interpreting the assembly

Return type:

list of MicroprobeInstructionDefinition

Raises:

microprobe.exceptions.MicroprobeAsmError – if something is wrong during the interpretation