fxsdk/fxos/analysis.c
Lephe 25db504c22 fxos: bring disassembling to a new level
Almost-complete implementation of fxos, the disassembler in particular
is now able to detect syscalls and register addresses on the fly, plus
support for SH4-only instructions.
2019-05-03 11:19:36 +02:00

22 lines
576 B
C

#include <fxos.h>
#include <stdio.h>
/* analysis_short(): Print a one-line summary for an address */
void analysis_short(struct os const *os, uint32_t value)
{
/* Find out whether it is a syscall address */
int syscall = os_syscall_find(os, value);
if(syscall != -1)
{
printf(" %%%03x", syscall);
/* Also find out the syscall's name! */
struct sys_call const *call = sys_find(syscall);
if(call) printf(" %s", call->name);
}
/* Find out any peripheral register address */
struct reg_address const *reg = reg_find(value);
if(reg) printf(" %s", reg->name);
}