Fix non-anulled calls so that return address is correct
This commit is contained in:
parent
30a05dbd8d
commit
53dcd669e5
2 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
|||
Thu May 8 11:57:47 1997 Michael Meissner <meissner@cygnus.com>
|
||||
|
||||
* insns (jsr,bsr): For non-allulled calls, set r31 so that the
|
||||
return address does not reexecute the instruction in the delay
|
||||
slot.
|
||||
|
||||
* misc.c (tic80_trace_*): Change format slightly to accomidate
|
||||
real large decimal values.
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ instruction_address::function::do_bsr:instruction_address nia, signed32 *rLink,
|
|||
nia.ip = -1;
|
||||
}
|
||||
else
|
||||
*rLink = cia.dp + sizeof (instruction_word);
|
||||
*rLink = nia.ip + sizeof (instruction_word);
|
||||
nia.dp = cia.ip + 4 * offset;
|
||||
TRACE_UCOND_BR (MY_INDEX, nia.dp);
|
||||
return nia;
|
||||
|
@ -614,7 +614,7 @@ instruction_address::function::do_jsr:instruction_address nia, signed32 *rLink,
|
|||
nia.ip = -1;
|
||||
}
|
||||
else
|
||||
*rLink = cia.dp + sizeof (instruction_word);
|
||||
*rLink = nia.ip + sizeof (instruction_word);
|
||||
nia.dp = offset + base;
|
||||
if (nia.dp & 0x3)
|
||||
engine_error (SD, CPU, cia,
|
||||
|
|
Loading…
Reference in a new issue