TEMU  4.4
The Terma Emulator
Assembler.h File Reference
#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)
 
const TEMU_API 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)
 
const TEMU_API char * temu_disassembleMemoryAuto (void *Cpu, uint64_t Addr)
 

Detailed Description

This file contains the declarations of the assembler and disassembler.

Function Documentation

◆ temu_assemble()

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_assembleToMemory()

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_disassemble()

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_disassembleAuto()

const TEMU_API 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_disassembleMemory()

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_disassembleMemoryAuto()

const TEMU_API char* temu_disassembleMemoryAuto ( void *  Cpu,
uint64_t  Addr 
)