IBM1130: Fix address computation overflow
In sim_instr(), the effective address is computed; for the case of TAG (index register addressing), the contents of the specified index register is added to the effective address, but the result is not masked to 16 bits as per the hardware functionality. Adding a a 16 bit mask operation fixes the issue.
This commit is contained in:
parent
f1fb14d350
commit
aea2634940
1 changed files with 1 additions and 1 deletions
|
@ -653,7 +653,7 @@ t_stat sim_instr (void)
|
||||||
|
|
||||||
eaddr = word2; /* assume standard addressing & compute effective address */
|
eaddr = word2; /* assume standard addressing & compute effective address */
|
||||||
if (TAG) /* if indexed */
|
if (TAG) /* if indexed */
|
||||||
eaddr += ReadIndex(TAG); /* add index register value */
|
eaddr = (eaddr + ReadIndex(TAG)) & 0xFFFF; /* add index register value */
|
||||||
if (INDIR) /* if indirect addressing */
|
if (INDIR) /* if indirect addressing */
|
||||||
eaddr = ReadW(eaddr); /* pick up referenced address */
|
eaddr = ReadW(eaddr); /* pick up referenced address */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue