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

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

#include <stdint.h>
#include "temu-c/Support/Attributes.h"
Include dependency graph for Assembler.h:

Go to the source code of this file.

Functions

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

Detailed Description

This file contains the declarations of the assembler and disassembler.

Definition in file Assembler.h.

Function Documentation

TEMU_API 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.
TEMU_API 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.
TEMU_API char* temu_disassemble ( void *  Cpu,
uint32_t  Instr 
)

Disassemble an instruction.

Warning
The function returns a malloced string. You have ownership and is responsible for calling free() on it.
Returns
A pointer to a malloced instruction string or null incase of failure.
TEMU_API const char* temu_disassembleAuto ( void *  Cpu,
uint32_t  Instr 
)

Disassemble an instruction.

Warning
The function returns a thread local string. It is borrowed and not allowed to escape the current thread without a copy.
Returns
A pointer to a a thread local instruction string or null incase of failure.
TEMU_API 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 and are responsible for calling free() on it.
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.
TEMU_API const char* temu_disassembleMemoryAuto ( void *  Cpu,
uint64_t  Addr 
)