X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fopcode2c.pl;h=0b114386e19e96332ec89ce432a459eb3185dfe6;hb=ba7ff1a7a78b3aa7c2cad9bfce117256638938b1;hp=95b9455bbf83b474ec487354f74cb0af34046c1d;hpb=60f3340a9f321271f5ea96df2ccfc248f67bfd2f;p=emu8051.git diff --git a/src/opcode2c.pl b/src/opcode2c.pl index 95b9455..0b11438 100755 --- a/src/opcode2c.pl +++ b/src/opcode2c.pl @@ -215,8 +215,6 @@ for ($i=0 ; $i< 256; $i++) { print INST_IMP " ","*"x76,"/\n"; print INST_IMP "int\n"; print INST_IMP "cpu8051_OP_$a_opcodehex[$i](void)\n"; -# TEST hugo new... -# print INST_DEF "int OP_$a_opcodehex[$i]( );\n"; print INST_IMP "{\n"; if( $i == 0x85 ) { @@ -232,7 +230,8 @@ for ($i=0 ; $i< 256; $i++) { if ($instargs[$i*4] > 0) { $op_destination=$instargs[$i*4+1]; if ($op_destination == 0) { # addr11 - print INST_IMP " unsigned int addr11 = ( ( memory_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + memory_read8( PGM_MEM_ID, cpu8051.pc++ );\n"; + print INST_IMP " unsigned int addr11 = ( ( memory_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + memory_read8( PGM_MEM_ID, cpu8051.pc );\n"; + print INST_IMP " cpu8051.pc++;\n"; } if ($op_destination == 1) { # addr16 print INST_IMP "unsigned int addr16 = ( memory_read8( PGM_MEM_ID, cpu8051.pc++ ) << 8 );\n"; @@ -612,7 +611,7 @@ for ($i=0 ; $i< 256; $i++) { print INST_IMP "unsigned int reladdr = ((char) memory_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1);\n"; print INST_IMP "cpu8051_WriteD( _PSW_, ( cpu8051_ReadD( _PSW_ ) & 0x7F ) );\n"; print INST_IMP "if ( destination < source ) cpu8051_WriteD( _PSW_, ( cpu8051_ReadD( _PSW_ ) | 0x80 ) );\n"; - print INST_IMP "if ( destination != source ) cpu8051.pc = reladdr;\n"; + print INST_IMP "if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; \n"; } # PUSH