OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 mnem = "fstp_s"; | 853 mnem = "fstp_s"; |
854 break; | 854 break; |
855 default: | 855 default: |
856 UnimplementedInstruction(); | 856 UnimplementedInstruction(); |
857 } | 857 } |
858 AppendToBuffer("%s ", mnem); | 858 AppendToBuffer("%s ", mnem); |
859 int count = PrintRightOperand(data + 1); | 859 int count = PrintRightOperand(data + 1); |
860 return count + 1; | 860 return count + 1; |
861 } | 861 } |
862 } else if (b1 == 0xDD) { | 862 } else if (b1 == 0xDD) { |
863 if ((b2 & 0xF8) == 0xC0) { | 863 int mod, regop, rm; |
864 AppendToBuffer("ffree st%d", b2 & 0x7); | 864 get_modrm(*(data + 1), &mod, ®op, &rm); |
| 865 if (mod == 3) { |
| 866 switch (regop) { |
| 867 case 0: |
| 868 AppendToBuffer("ffree st%d", rm & 7); |
| 869 break; |
| 870 case 2: |
| 871 AppendToBuffer("fstp st%d", rm & 7); |
| 872 break; |
| 873 default: |
| 874 UnimplementedInstruction(); |
| 875 break; |
| 876 } |
865 return 2; | 877 return 2; |
866 } else { | 878 } else { |
867 int mod, regop, rm; | |
868 get_modrm(*(data + 1), &mod, ®op, &rm); | |
869 const char* mnem = "?"; | 879 const char* mnem = "?"; |
870 switch (regop) { | 880 switch (regop) { |
871 case 0: | 881 case 0: |
872 mnem = "fld_d"; | 882 mnem = "fld_d"; |
873 break; | 883 break; |
874 case 3: | 884 case 3: |
875 mnem = "fstp_d"; | 885 mnem = "fstp_d"; |
876 break; | 886 break; |
877 default: | 887 default: |
878 UnimplementedInstruction(); | 888 UnimplementedInstruction(); |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 fprintf(f, "%02x", *bp); | 1592 fprintf(f, "%02x", *bp); |
1583 } | 1593 } |
1584 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { | 1594 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { |
1585 fprintf(f, " "); | 1595 fprintf(f, " "); |
1586 } | 1596 } |
1587 fprintf(f, " %s\n", buffer.start()); | 1597 fprintf(f, " %s\n", buffer.start()); |
1588 } | 1598 } |
1589 } | 1599 } |
1590 | 1600 |
1591 } // namespace disasm | 1601 } // namespace disasm |
OLD | NEW |