Skip to content

Commit

Permalink
v850: Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Feb 2, 2024
1 parent 87ff467 commit 21cddb9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions librz/analysis/arch/v850/v850_il.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ static const char *v850_registers[] = {
"lp", // LP
/*PC*/

/*
* \see Section 3.3-3.5 https://www.renesas.com/us/en/document/mas/rh850g3kh-users-manual-software
* \see SR_get() in v850_disas.h
* regID Symbol*/
/*0 */ "EIPC",
/*1 */ "EIPSW",
/*2 */ "FEPC",
Expand Down
5 changes: 4 additions & 1 deletion librz/analysis/p/analysis_v850.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static char *get_reg_profile(RzAnalysis *analysis) {

/*
* \see Section 3.3-3.5 https://www.renesas.com/us/en/document/mas/rh850g3kh-users-manual-software
* regID Symbol */
* regID Symbol */
/*0 */ "gpr EIPC .32 132 0\n"
/*1 */ "gpr EIPSW .32 136 0\n"
/*2 */ "gpr FEPC .32 140 0\n"
Expand Down Expand Up @@ -359,6 +359,9 @@ static char *get_reg_profile(RzAnalysis *analysis) {
return strdup(p);
}

/**
* All preludes are guessed by looking at the instruction at the beginning of the function
*/
static RzList /*<RzSearchKeyword *>*/ *analysis_preludes(RzAnalysis *analysis) {
#define KW(d, ds, m, ms) rz_list_append(l, rz_search_keyword_new((const ut8 *)d, ds, (const ut8 *)m, ms, NULL))
RzList *l = rz_list_newf((RzListFree)rz_search_keyword_free);
Expand Down
8 changes: 8 additions & 0 deletions librz/asm/arch/v850/v850_disas.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ static inline const char *GR_get(ut8 i) {
return GR[i];
}

/*
* \see Section 3.3-3.5 https://www.renesas.com/us/en/document/mas/rh850g3kh-users-manual-software
* */
static inline const char *SR_get(ut8 regID, ut8 selID) {
if (selID == 0) {
switch (regID) {
Expand Down Expand Up @@ -466,6 +469,11 @@ static inline ut16 get_disp22(const V850_Inst *i) {
return (V850_word(i, 2) & ~1) | ((V850_word(i, 1) & 0x3f) << 16);
}

/**
* Lists of registers
* \see xiii_sorted_list
* \see DISPOSE and PREPARE instruction in section 7.2.2 https://www.renesas.com/us/en/document/mas/rh850g3kh-users-manual-software
*/
static const ut8 V850_list12_map[] = {
/*[0] = */ 30,
/*[21] = */ 31,
Expand Down

0 comments on commit 21cddb9

Please sign in to comment.