#1 emulation of MOVC instructions faulty

open
nobody
None
5
2005-05-08
2005-05-08
No

Hi!

while toying around with emu51, I found out that the
emulation of the instructions MOVC A,@A+DPTR and MOVC
A,@A+PC in emu51 is faulty.
They read the external data memory instead of code
space which they are supposed to do.

"prog" was "ram" in both cases which is faulty.

You can easily fix that by patching the source code.

Beginning from line 804 in emu51.cpp it has to be:

case 0x93: // movc A,@DPTR+A
*Acc=prog[*Acc+*DPTR];
PC++;
break;
case 0x83: // movc A,@PC+A
*Acc=prog[*Acc+PC];
PC++;
break;

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks