diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-05-12 04:57:49 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-05-12 04:57:49 +0000 |
commit | c445af5a2b1fd76533a6ce709677e779f215721f (patch) | |
tree | 119a7b8e222693254bb42285d2f51025760c1d68 /sim/tic80/interp.c | |
parent | e05e76e8a470200543c927636f8ceae638236c5f (diff) | |
download | gdb-c445af5a2b1fd76533a6ce709677e779f215721f.zip gdb-c445af5a2b1fd76533a6ce709677e779f215721f.tar.gz gdb-c445af5a2b1fd76533a6ce709677e779f215721f.tar.bz2 |
c80 simulator fixes.
Diffstat (limited to 'sim/tic80/interp.c')
-rw-r--r-- | sim/tic80/interp.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sim/tic80/interp.c b/sim/tic80/interp.c index b8ba567..8fda287 100644 --- a/sim/tic80/interp.c +++ b/sim/tic80/interp.c @@ -129,3 +129,30 @@ engine_run_until_stop (SIM_DESC sd, engine_halt (sd, cpu, cia, sim_stopped, SIGINT); } } + + +void +engine_step (SIM_DESC sd) +{ + if (!setjmp (sd->path_to_halt)) + { + instruction_address cia; + sim_cpu *cpu = STATE_CPU (sd, 0); + sd->halt_ok = 1; + setjmp (sd->path_to_restart); + sd->restart_ok = 1; + cia = cpu->cia; + if (cia.ip == -1) + { + /* anulled instruction */ + cia.ip = cia.dp; + cia.dp = cia.dp + sizeof (instruction_word); + } + else + { + instruction_word insn = IMEM (cia.ip); + cia = idecode_issue (sd, insn, cia); + } + engine_halt (sd, cpu, cia, sim_stopped, SIGTRAP); + } +} |