From: Hugo Villeneuve Date: Mon, 4 Nov 2013 15:16:04 +0000 (-0500) Subject: Fix error with RETI instruction X-Git-Tag: v2.0.0~98 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=c4f4ebc5ab29f3be5989e94768d8bb709667e3f1;p=emu8051.git Fix error with RETI instruction The stack pointer was not updated correctly. Error reported and fixed by Anthony (antliu at gmail.com). --- diff --git a/src/opcode2c.pl b/src/opcode2c.pl index 0b11438..29c1c41 100755 --- a/src/opcode2c.pl +++ b/src/opcode2c.pl @@ -483,6 +483,7 @@ for ($i=0 ; $i< 256; $i++) { print INST_IMP "unsigned char SP = cpu8051_ReadD( _SP_ );\n"; print INST_IMP "cpu8051.pc = ( cpu8051_ReadI( SP-- ) << 8 );\n"; print INST_IMP "cpu8051.pc += cpu8051_ReadI( SP-- );\n"; + print INST_IMP "cpu8051_WriteD( _SP_, SP );\n"; } # RLC