diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-04-02 11:58:42 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-04-02 12:39:30 (GMT) |
commit | 1db4ef323b7a76093356ae76268132f3760e1631 (patch) | |
tree | fec36ee0ec1b6b2010b62ca4177edca0e31e2114 /plugins/arm/v7/operands/reglist.c | |
parent | 1bc80837dde03a32b5ab185067f7bd4c499a9850 (diff) |
Rewritten the whole instruction definition format.
Diffstat (limited to 'plugins/arm/v7/operands/reglist.c')
-rw-r--r-- | plugins/arm/v7/operands/reglist.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/plugins/arm/v7/operands/reglist.c b/plugins/arm/v7/operands/reglist.c index 00c3b98..1f56249 100644 --- a/plugins/arm/v7/operands/reglist.c +++ b/plugins/arm/v7/operands/reglist.c @@ -255,7 +255,7 @@ static void g_armv7_reglist_operand_print(const GArmV7RegListOperand *operand, G /****************************************************************************** * * -* Paramètres : - * +* Paramètres : selected = masque de bits pour les registres à intégrer. * * * * Description : Crée une liste vierge de registres ARM. * * * @@ -265,48 +265,24 @@ static void g_armv7_reglist_operand_print(const GArmV7RegListOperand *operand, G * * ******************************************************************************/ -GArchOperand *g_armv7_reglist_operand_new(void) -{ - GArchOperand *result; /* Structure à retourner */ - - result = g_object_new(G_TYPE_ARMV7_REGLIST_OPERAND, NULL); - - return G_ARCH_OPERAND(result); - -} - - -/****************************************************************************** -* * -* Paramètres : operand = liste de registres à compléter. * -* selected = masque de bits pour les registres à intégrer. * -* * -* Description : Remplit une liste de registres de registres ARM. * -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -bool g_armv7_reglist_load_registers(GArmV7RegListOperand *operand, uint32_t selected) +GArchOperand *g_armv7_reglist_operand_new(uint16_t selected) { + GArmV7RegListOperand *result; /* Structure à retourner */ uint8_t i; /* Boucle de parcours */ GArmV7Register *reg; /* Nouveau registre à intégrer */ - for (i = 18; i < 32; i++) - if (selected & (1 << i)) return false; + result = g_object_new(G_TYPE_ARMV7_REGLIST_OPERAND, NULL); - for (i = 0; i < 18; i++) + for (i = 0; i < 16; i++) { if ((selected & (1 << i)) == 0) continue; reg = g_armv7_register_new(i); - g_armv7_reglist_add_register(operand, reg); + g_armv7_reglist_add_register(result, reg); } - return true; + return G_ARCH_OPERAND(result); } |