From 53dcd669e504fb892aaca0b3c7a99aea559aac7a Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Thu, 8 May 1997 18:36:00 +0000 Subject: [PATCH] Fix non-anulled calls so that return address is correct --- sim/tic80/ChangeLog | 4 ++++ sim/tic80/insns | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sim/tic80/ChangeLog b/sim/tic80/ChangeLog index 51e676ab12d..4a458e428fb 100644 --- a/sim/tic80/ChangeLog +++ b/sim/tic80/ChangeLog @@ -1,5 +1,9 @@ Thu May 8 11:57:47 1997 Michael Meissner + * 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. diff --git a/sim/tic80/insns b/sim/tic80/insns index 437b6c95b6f..7c16213a775 100644 --- a/sim/tic80/insns +++ b/sim/tic80/insns @@ -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, -- 2.30.2