diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-07-31 05:53:06 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-07-31 05:53:06 (GMT) |
commit | a5d8e3fc30cda2e13d30f099e93ab1b182fdc0bd (patch) | |
tree | cf183906b2301cd3c726af820292fd0f2458bfa1 /src/arch/immediate.c | |
parent | dc436357ff29158dddd836d368d152d42d5b086b (diff) |
Improved the way code is decoded by avoiding to propagate the base address everywhere.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@385 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/immediate.c')
-rw-r--r-- | src/arch/immediate.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/arch/immediate.c b/src/arch/immediate.c index d9e36f2..46abe62 100644 --- a/src/arch/immediate.c +++ b/src/arch/immediate.c @@ -148,7 +148,7 @@ static void g_imm_operand_init(GImmOperand *operand) * Paramètres : size = taille de l'opérande souhaitée. * * data = flux de données à analyser. * * pos = position courante dans ce flux. [OUT] * -* len = taille totale des données à analyser. * +* end = limite des données à analyser. * * low = position éventuelle des 4 bits visés. [OUT] * * endian = ordre des bits dans la source. * * * @@ -160,7 +160,7 @@ static void g_imm_operand_init(GImmOperand *operand) * * ******************************************************************************/ -GArchOperand *_g_imm_operand_new_from_data(MemoryDataSize size, const bin_t *data, off_t *pos, off_t len, bool *low, SourceEndian endian) +GArchOperand *_g_imm_operand_new_from_data(MemoryDataSize size, const bin_t *data, off_t *pos, off_t end, bool *low, SourceEndian endian) { GImmOperand *result; /* Opérande à retourner */ @@ -171,52 +171,52 @@ GArchOperand *_g_imm_operand_new_from_data(MemoryDataSize size, const bin_t *dat switch (size) { case MDS_4_BITS_UNSIGNED: - if (!read_u4(&result->unsigned_imm.val8, data, pos, len, low, endian)) + if (!read_u4(&result->unsigned_imm.val8, data, pos, end, low, endian)) goto gionfd_error; break; case MDS_8_BITS_UNSIGNED: - if (!read_u8(&result->unsigned_imm.val8, data, pos, len, endian)) + if (!read_u8(&result->unsigned_imm.val8, data, pos, end, endian)) goto gionfd_error; break; case MDS_16_BITS_UNSIGNED: - if (!read_u16(&result->unsigned_imm.val16, data, pos, len, endian)) + if (!read_u16(&result->unsigned_imm.val16, data, pos, end, endian)) goto gionfd_error; break; case MDS_32_BITS_UNSIGNED: - if (!read_u32(&result->unsigned_imm.val32, data, pos, len, endian)) + if (!read_u32(&result->unsigned_imm.val32, data, pos, end, endian)) goto gionfd_error; break; case MDS_64_BITS_UNSIGNED: - if (!read_u64(&result->unsigned_imm.val64, data, pos, len, endian)) + if (!read_u64(&result->unsigned_imm.val64, data, pos, end, endian)) goto gionfd_error; break; case MDS_4_BITS_SIGNED: - if (!read_s4(&result->signed_imm.val8, data, pos, len, low, endian)) + if (!read_s4(&result->signed_imm.val8, data, pos, end, low, endian)) goto gionfd_error; break; case MDS_8_BITS_SIGNED: - if (!read_s8(&result->signed_imm.val8, data, pos, len, endian)) + if (!read_s8(&result->signed_imm.val8, data, pos, end, endian)) goto gionfd_error; break; case MDS_16_BITS_SIGNED: - if (!read_s16(&result->signed_imm.val16, data, pos, len, endian)) + if (!read_s16(&result->signed_imm.val16, data, pos, end, endian)) goto gionfd_error; break; case MDS_32_BITS_SIGNED: - if (!read_s32(&result->signed_imm.val32, data, pos, len, endian)) + if (!read_s32(&result->signed_imm.val32, data, pos, end, endian)) goto gionfd_error; break; case MDS_64_BITS_SIGNED: - if (!read_s64(&result->signed_imm.val64, data, pos, len, endian)) + if (!read_s64(&result->signed_imm.val64, data, pos, end, endian)) goto gionfd_error; break; |