]> Untitled Git - emu8051.git/commitdiff
Fix error with JMP @A,DPTR instruction
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 4 Nov 2013 15:27:10 +0000 (10:27 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 6 Nov 2013 03:17:21 +0000 (22:17 -0500)
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

index 29c1c41ad1bce7574b399d19beb534fc33f8b6f0..a783126bafabffcf5e3687557ba410801cd5e98a 100755 (executable)
@@ -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