mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-26 22:50:48 +00:00
Add the gb.pseudo plugin ##arch
This commit is contained in:
parent
3921857875
commit
71a7e9bb48
1
dist/plugins-cfg/plugins.def.cfg
vendored
1
dist/plugins-cfg/plugins.def.cfg
vendored
@ -292,6 +292,7 @@ parse.bpf_pseudo
|
||||
parse.chip8_pseudo
|
||||
parse.dalvik_pseudo
|
||||
parse.evm_pseudo
|
||||
parse.gb_pseudo
|
||||
parse.m68k_pseudo
|
||||
parse.mips_pseudo
|
||||
parse.ppc_pseudo
|
||||
|
2
libr/arch/p/gb/pseudo.c
Normal file
2
libr/arch/p/gb/pseudo.c
Normal file
@ -0,0 +1,2 @@
|
||||
#define Z80_IS_GB 1
|
||||
#include "../z80/pseudo.c"
|
@ -1,4 +1,4 @@
|
||||
/* radare - LGPL - Copyright 2015-2022 - jvoisin */
|
||||
/* radare - LGPL - Copyright 2015-2024 - jvoisin */
|
||||
|
||||
#include <r_lib.h>
|
||||
#include <r_flag.h>
|
||||
@ -78,11 +78,19 @@ static int parse(RParse *p, const char *data, char *str) {
|
||||
return true;
|
||||
}
|
||||
|
||||
RParsePlugin r_parse_plugin_z80_pseudo = {
|
||||
.name = "z80.pseudo",
|
||||
.desc = "z80 pseudo syntax",
|
||||
#if Z80_IS_GB
|
||||
RParsePlugin r_parse_plugin_gb_pseudo = {
|
||||
.name = "gb.pseudo",
|
||||
.desc = "GameBoy pseudo syntax",
|
||||
.parse = parse, // parse actually converts the string into asm.pseudo
|
||||
};
|
||||
#else
|
||||
RParsePlugin r_parse_plugin_z80_pseudo = {
|
||||
.name = "z80.pseudo",
|
||||
.desc = "Z80 pseudo syntax",
|
||||
.parse = parse, // parse actually converts the string into asm.pseudo
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef R2_PLUGIN_INCORE
|
||||
R_API RLibStruct radare_plugin = {
|
||||
|
@ -10,6 +10,7 @@ r_asm_sources = [
|
||||
'../arch/p/null/pseudo.c',
|
||||
'../arch/p/tricore/pseudo.c',
|
||||
'../arch/p/z80/pseudo.c',
|
||||
'../arch/p/gb/pseudo.c',
|
||||
'../arch/p/wasm/pseudo.c',
|
||||
'../arch/p/v850/pseudo.c',
|
||||
'../arch/p/tms320/pseudo.c',
|
||||
|
18
libr/asm/p/gb_pseudo.mk
Normal file
18
libr/asm/p/gb_pseudo.mk
Normal file
@ -0,0 +1,18 @@
|
||||
OBJ_GB_PSEUDO+=$(LIBR)/arch/p/gb/pseudo.o
|
||||
|
||||
TARGET_GB_PSEUDO=parse_gb_pseudo.${EXT_SO}
|
||||
STATIC_OBJ+=${OBJ_GB_PSEUDO}
|
||||
ifeq ($(CC),cccl)
|
||||
LIBDEPS=-L../../util -llibr_util
|
||||
LIBDEPS+=-L../../flag -llibr_flag
|
||||
else
|
||||
LIBDEPS=-L../../util -lr_util
|
||||
LIBDEPS+=-L../../flag -lr_flag
|
||||
endif
|
||||
|
||||
ifeq ($(WITHPIC),1)
|
||||
ALL_TARGETS+=${TARGET_GB_PSEUDO}
|
||||
${TARGET_GB_PSEUDO}: ${OBJ_GB_PSEUDO}
|
||||
${CC} $(call libname,parse_gb_pseudo) ${LIBDEPS} $(LDFLAGS) \
|
||||
$(LDFLAGS_SHARED) ${CFLAGS} -o ${TARGET_GB_PSEUDO} ${OBJ_GB_PSEUDO}
|
||||
endif
|
@ -97,6 +97,7 @@ extern RParsePlugin r_parse_plugin_bpf_pseudo;
|
||||
extern RParsePlugin r_parse_plugin_stm8_pseudo;
|
||||
extern RParsePlugin r_parse_plugin_evm_pseudo;
|
||||
extern RParsePlugin r_parse_plugin_null_pseudo;
|
||||
extern RParsePlugin r_parse_plugin_gb_pseudo;
|
||||
extern RParsePlugin r_parse_plugin_tricore_pseudo;
|
||||
#endif
|
||||
|
||||
|
@ -409,6 +409,7 @@ EXPECT=<<EOF
|
||||
{
|
||||
"opcode": "adc 0xed",
|
||||
"disasm": "adc 0xed",
|
||||
"pseudo": "0xed = 0xed + ",
|
||||
"description": "add with carry register pair",
|
||||
"srcs": [
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ bpf.pseudo
|
||||
chip8.pseudo
|
||||
dalvik.pseudo
|
||||
evm.pseudo
|
||||
gb.pseudo
|
||||
m68k.pseudo
|
||||
mips.pseudo
|
||||
null.pseudo
|
||||
|
Loading…
Reference in New Issue
Block a user