T-EMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
Assembler.h File Reference

This file contains the declarations of the assembler and disassembler. More...

#include <stdint.h>
Include dependency graph for Assembler.h:

Go to the source code of this file.

Functions

uint32_t temu_assemble (void *Cpu, const char *AsmStr)
 
char * temu_disassemble (void *Cpu, uint32_t Instr)
 
void temu_assembleToMemory (void *Cpu, const char *AsmStr, uint64_t Addr)
 
char * temu_disassembleMemory (void *Cpu, uint64_t Addr)
 

Detailed Description

This file contains the declarations of the assembler and disassembler.

Definition in file Assembler.h.

Function Documentation

uint32_t temu_assemble ( void *  Cpu,
const char *  AsmStr 
)

Assemble an instruction

Parameters
Cpuprocessor for which to assemble.
AsmStrString with instruction in the CPUs assembler.
Returns
Instruction bitpattern.
void temu_assembleToMemory ( void *  Cpu,
const char *  AsmStr,
uint64_t  Addr 
)

Assemble an instruction to memory

Parameters
Cpuprocessor for which to assemble.
AsmStrString with instruction in the CPUs assembler.
AddrPhysical address of where to put the instruction.
char* temu_disassemble ( void *  Cpu,
uint32_t  Instr 
)

Disassemble an instruction.

Warning
The function returns a malloced string. You have ownership
Returns
A pointer to a malloced instruction string or null incase of failure.
char* temu_disassembleMemory ( void *  Cpu,
uint64_t  Addr 
)

Disassemble an instruction in memory

The function dissasmbles an instruction and retuns a string allocated on the heap. You are responsible for its release using free().

Warning
The function returns a malloced string. You have ownership
Parameters
CpuCPU whose memory space will be used for disasembling.
AddrPhysical address of instruction to dissassemble.
Returns
A pointer to a malloced instruction string or null incase of failure.