diff options
Diffstat (limited to 'csim/sim.c')
-rw-r--r-- | csim/sim.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -121,8 +121,8 @@ void machine_step(t_machine *m) { } break; case C_ROM: - if (p->eqs[i].Rom.rom != NULL) { - a = m->var_values[p->eqs[i].Rom.read_addr]; + a = m->var_values[p->eqs[i].Rom.read_addr]; + if (p->eqs[i].Rom.rom != NULL && a < p->eqs[i].Rom.rom->words_defined) { v = p->eqs[i].Rom.rom->data[a]; } else { v = 0; |