[RL78] :Fix offset for mem_get_si in sim
Commit Message
Hi,
The following patch fixes the handling of the offset that is generated
for the mem_get_si.
The mem_get_si reads the 0th,1st and 2nd byte correctly and fails on the 3rd byte,
where it is again reading the 2nd byte.
This patch should fix this problem.
Regards,
Amrita Honap
=========================End Of Patch================================
Apologies for any company disclaimer that may get added to this e-mail.
Comments
On 19 Feb 2015 10:52, Amrita Honap wrote:
> The following patch fixes the handling of the offset that is generated
> for the mem_get_si.
> The mem_get_si reads the 0th,1st and 2nd byte correctly and fails on the 3rd byte,
> where it is again reading the 2nd byte.
seems logical to me, but probably want DJ to approve it
-mike
> - | mem_get_byte (address + 2) * 16777216;
> + | mem_get_byte (address + 3) * 16777216;
This is OK, thanks!
=======================Start of Patch================================
Changelog
2015-02-19 Amrita Honap <Amrita.Honap@kpit.com>
* rl78/mem.c (mem_get_si) : Fix offset for mem_get_si
@@ -435,7 +435,7 @@ mem_get_si (int address)
v = mem_get_byte (address)
| mem_get_byte (address + 1) * 256
| mem_get_byte (address + 2) * 65536
- | mem_get_byte (address + 2) * 16777216;
+ | mem_get_byte (address + 3) * 16777216;
CHECK_ALIGNMENT (address, v, 3);
tprintf ("(\033[35m[%05X]->%04X)\033[0m", address, v);
return v;