mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2024-12-29 13:03:37 +01:00
25db504c22
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.
22 lines
576 B
C
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);
|
|
}
|