X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fs51.src%2Fmov.cc;h=512da92b093e0c93c6a6c9c2c561a5c07ada829e;hb=7837c232c608353fb948c183d8e92775f427e5a9;hp=a8ae690b003eb55abbeb075b92a0a1ed01085f47;hpb=909ff6198903c0feff992f63a29283c131bbc364;p=fw%2Fsdcc diff --git a/sim/ucsim/s51.src/mov.cc b/sim/ucsim/s51.src/mov.cc index a8ae690b..512da92b 100644 --- a/sim/ucsim/s51.src/mov.cc +++ b/sim/ucsim/s51.src/mov.cc @@ -418,10 +418,23 @@ int t_uc51::inst_mov_a_addr(uchar code) { class cl_cell *cell; - - cell= get_direct(fetch()); - acc->write(cell->read()); - return(resGO); + int address = fetch(); + + /* If this is ACC, it is an invalid instruction */ + if (address == ACC) + { + sim->app->get_commander()-> + debug ("Invalid Instruction : E5 E0 MOV A,ACC at %06x\n", PC); + + return(resHALT); + } + else + { + cell= get_direct(address); + acc->write(cell->read()); + return(resGO); + } + }