From 1ba08e42405921556cb80d065ce3b8ed42b09cf1 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Mon, 4 Nov 2013 10:27:10 -0500 Subject: [PATCH] Fix error with JMP @A,DPTR instruction The resulting jump address is simply the sum of the values in the accumulator and the DPTR registers, not the indirect read of that sum. Error reported and fixed by Anthony (antliu at gmail.com). --- src/opcode2c.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opcode2c.pl b/src/opcode2c.pl index 29c1c41..a783126 100755 --- a/src/opcode2c.pl +++ b/src/opcode2c.pl @@ -290,7 +290,7 @@ for ($i=0 ; $i< 256; $i++) { print INST_IMP "unsigned char destination = ( cpu8051_ReadD( _PSW_ ) >> 7 );\n"; } if ($op_destination == 18) { # @A+DPTR - print INST_IMP "unsigned int destination = cpu8051_ReadI( cpu8051_ReadD( _ACC_ ) + cpu8051_ReadD( _DPTRLOW_ ) + ( cpu8051_ReadD( _DPTRHIGH_ ) << 8 ) );\n"; + print INST_IMP "unsigned int destination = cpu8051_ReadD( _ACC_ ) + cpu8051_ReadD( _DPTRLOW_ ) + ( cpu8051_ReadD( _DPTRHIGH_ ) << 8 );\n"; } # Mis en commentaire car donnait un warning (destination et source unused variables...) # if ($op_destination == 20) { # AB -- 2.20.1