Lines Matching full:data

312   static void get_modrm(byte data, int* mod, int* regop, int* rm) {  in get_modrm()  argument
313 *mod = (data >> 6) & 3; in get_modrm()
314 *regop = (data & 0x38) >> 3; in get_modrm()
315 *rm = data & 7; in get_modrm()
319 static void get_sib(byte data, int* scale, int* index, int* base) { in get_sib() argument
320 *scale = (data >> 6) & 3; in get_sib()
321 *index = (data >> 3) & 7; in get_sib()
322 *base = data & 7; in get_sib()
331 int PrintOperands(const char* mnem, OperandOrder op_order, byte* data);
332 int PrintImmediateOp(byte* data);
333 int F7Instruction(byte* data);
334 int D1D3C1Instruction(byte* data);
335 int JumpShort(byte* data);
336 int JumpConditional(byte* data, const char* comment);
337 int JumpConditionalShort(byte* data, const char* comment);
338 int SetCC(byte* data);
339 int CMov(byte* data);
340 int FPUInstruction(byte* data);
470 // Returns number of bytes used including the current *data.
474 byte* data) { in PrintOperands() argument
475 byte modrm = *data; in PrintOperands()
482 advance = PrintRightOperand(data); in PrintOperands()
487 advance = PrintRightOperand(data); in PrintOperands()
499 // Returns number of bytes used by machine instruction, including *data byte.
501 int DisassemblerIA32::PrintImmediateOp(byte* data) { in PrintImmediateOp() argument
502 bool sign_extension_bit = (*data & 0x02) != 0; in PrintImmediateOp()
503 byte modrm = *(data+1); in PrintImmediateOp()
518 int count = PrintRightOperand(data+1); in PrintImmediateOp()
520 AppendToBuffer(",0x%x", *(data + 1 + count)); in PrintImmediateOp()
523 AppendToBuffer(",0x%x", *reinterpret_cast<int32_t*>(data + 1 + count)); in PrintImmediateOp()
529 // Returns number of bytes used, including *data.
530 int DisassemblerIA32::F7Instruction(byte* data) { in F7Instruction() argument
531 DCHECK_EQ(0xF7, *data); in F7Instruction()
532 byte modrm = *++data; in F7Instruction()
562 int count = PrintRightOperand(data); in F7Instruction()
564 AppendToBuffer(",0x%x", *reinterpret_cast<int32_t*>(data + count)); in F7Instruction()
571 int DisassemblerIA32::D1D3C1Instruction(byte* data) { in D1D3C1Instruction() argument
572 byte op = *data; in D1D3C1Instruction()
574 byte modrm = *++data; in D1D3C1Instruction()
605 int count = PrintRightOperand(data); in D1D3C1Instruction()
609 imm8 = *(data + 1); in D1D3C1Instruction()
623 // Returns number of bytes used, including *data.
624 int DisassemblerIA32::JumpShort(byte* data) { in JumpShort() argument
625 DCHECK_EQ(0xEB, *data); in JumpShort()
626 byte b = *(data+1); in JumpShort()
627 byte* dest = data + static_cast<int8_t>(b) + 2; in JumpShort()
633 // Returns number of bytes used, including *data.
634 int DisassemblerIA32::JumpConditional(byte* data, const char* comment) { in JumpConditional() argument
635 DCHECK_EQ(0x0F, *data); in JumpConditional()
636 byte cond = *(data+1) & 0x0F; in JumpConditional()
637 byte* dest = data + *reinterpret_cast<int32_t*>(data+2) + 6; in JumpConditional()
647 // Returns number of bytes used, including *data.
648 int DisassemblerIA32::JumpConditionalShort(byte* data, const char* comment) { in JumpConditionalShort() argument
649 byte cond = *data & 0x0F; in JumpConditionalShort()
650 byte b = *(data+1); in JumpConditionalShort()
651 byte* dest = data + static_cast<int8_t>(b) + 2; in JumpConditionalShort()
661 // Returns number of bytes used, including *data.
662 int DisassemblerIA32::SetCC(byte* data) { in SetCC() argument
663 DCHECK_EQ(0x0F, *data); in SetCC()
664 byte cond = *(data+1) & 0x0F; in SetCC()
667 PrintRightByteOperand(data+2); in SetCC()
672 // Returns number of bytes used, including *data.
673 int DisassemblerIA32::CMov(byte* data) { in CMov() argument
674 DCHECK_EQ(0x0F, *data); in CMov()
675 byte cond = *(data + 1) & 0x0F; in CMov()
677 int op_size = PrintOperands(mnem, REG_OPER_OP_ORDER, data + 2); in CMov()
682 // Returns number of bytes used, including *data.
683 int DisassemblerIA32::FPUInstruction(byte* data) { in FPUInstruction() argument
684 byte escape_opcode = *data; in FPUInstruction()
686 byte modrm_byte = *(data+1); in FPUInstruction()
691 return MemoryFPUInstruction(escape_opcode, modrm_byte, data+1); in FPUInstruction()
896 byte* data = instr; in InstructionDecode() local
900 if (*data == 0x3E /*ds*/) { in InstructionDecode()
902 data++; in InstructionDecode()
903 } else if (*data == 0x2E /*cs*/) { in InstructionDecode()
905 data++; in InstructionDecode()
909 const InstructionDesc& idesc = instruction_table_->Get(*data); in InstructionDecode()
913 data++; in InstructionDecode()
917 data++; in InstructionDecode()
918 data += PrintOperands(idesc.mnem, idesc.op_order_, data); in InstructionDecode()
922 data += JumpConditionalShort(data, branch_hint); in InstructionDecode()
926 AppendToBuffer("%s %s", idesc.mnem, NameOfCPURegister(*data & 0x07)); in InstructionDecode()
927 data++; in InstructionDecode()
931 byte* addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data+1)); in InstructionDecode()
933 NameOfCPURegister(*data & 0x07), in InstructionDecode()
935 data += 5; in InstructionDecode()
940 byte* addr = data + *reinterpret_cast<int32_t*>(data+1) + 5; in InstructionDecode()
942 data += 5; in InstructionDecode()
947 byte* addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data+1)); in InstructionDecode()
949 data += 5; in InstructionDecode()
954 AppendToBuffer("%s al,0x%x", idesc.mnem, data[1]); in InstructionDecode()
955 data += 2; in InstructionDecode()
968 switch (*data) { in InstructionDecode()
970 AppendToBuffer("ret 0x%x", *reinterpret_cast<uint16_t*>(data+1)); in InstructionDecode()
971 data += 3; in InstructionDecode()
975 data++; in InstructionDecode()
976 data += PrintOperands("imul", REG_OPER_OP_ORDER, data); in InstructionDecode()
977 AppendToBuffer(",%d", *data); in InstructionDecode()
978 data++; in InstructionDecode()
982 data++; in InstructionDecode()
983 data += PrintOperands("imul", REG_OPER_OP_ORDER, data); in InstructionDecode()
984 AppendToBuffer(",%d", *reinterpret_cast<int32_t*>(data)); in InstructionDecode()
985 data += 4; in InstructionDecode()
990 { data++; in InstructionDecode()
992 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
995 data += PrintRightByteOperand(data); in InstructionDecode()
996 int32_t imm = *data; in InstructionDecode()
998 data++; in InstructionDecode()
1007 data += PrintImmediateOp(data); in InstructionDecode()
1011 { byte f0byte = data[1]; in InstructionDecode()
1014 data += 2; in InstructionDecode()
1016 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1019 data += PrintRightOperand(data); in InstructionDecode()
1020 } else if (f0byte == 0x1F && data[2] == 0) { in InstructionDecode()
1022 data += 3; in InstructionDecode()
1023 } else if (f0byte == 0x1F && data[2] == 0x40 && data[3] == 0) { in InstructionDecode()
1025 data += 4; in InstructionDecode()
1026 } else if (f0byte == 0x1F && data[2] == 0x44 && data[3] == 0 && in InstructionDecode()
1027 data[4] == 0) { in InstructionDecode()
1029 data += 5; in InstructionDecode()
1030 } else if (f0byte == 0x1F && data[2] == 0x80 && data[3] == 0 && in InstructionDecode()
1031 data[4] == 0 && data[5] == 0 && data[6] == 0) { in InstructionDecode()
1033 data += 7; in InstructionDecode()
1034 } else if (f0byte == 0x1F && data[2] == 0x84 && data[3] == 0 && in InstructionDecode()
1035 data[4] == 0 && data[5] == 0 && data[6] == 0 && in InstructionDecode()
1036 data[7] == 0) { in InstructionDecode()
1038 data += 8; in InstructionDecode()
1041 data += 2; in InstructionDecode()
1043 data += 2; in InstructionDecode()
1045 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1049 data++; in InstructionDecode()
1067 data += 2; in InstructionDecode()
1069 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1073 data += PrintRightXMMOperand(data); in InstructionDecode()
1075 data += 2; in InstructionDecode()
1077 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1081 data++; in InstructionDecode()
1084 data += 2; in InstructionDecode()
1086 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1087 int8_t imm8 = static_cast<int8_t>(data[1]); in InstructionDecode()
1092 data += 2; in InstructionDecode()
1094 data += JumpConditional(data, branch_hint); in InstructionDecode()
1097 data += 2; in InstructionDecode()
1098 data += PrintOperands(f0mnem, REG_OPER_OP_ORDER, data); in InstructionDecode()
1100 data += SetCC(data); in InstructionDecode()
1102 data += CMov(data); in InstructionDecode()
1105 data += 2; in InstructionDecode()
1108 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1109 data += PrintRightOperand(data); in InstructionDecode()
1116 data += 2; in InstructionDecode()
1118 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1120 data += PrintRightOperand(data); in InstructionDecode()
1128 { data++; in InstructionDecode()
1130 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1133 data += PrintRightOperand(data); in InstructionDecode()
1139 { data++; in InstructionDecode()
1141 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1152 data += PrintRightOperand(data); in InstructionDecode()
1158 { bool is_byte = *data == 0xC6; in InstructionDecode()
1159 data++; in InstructionDecode()
1162 data += PrintRightByteOperand(data); in InstructionDecode()
1163 int32_t imm = *data; in InstructionDecode()
1165 data++; in InstructionDecode()
1168 data += PrintRightOperand(data); in InstructionDecode()
1169 int32_t imm = *reinterpret_cast<int32_t*>(data); in InstructionDecode()
1171 data += 4; in InstructionDecode()
1177 { data++; in InstructionDecode()
1179 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1187 data += PrintRightByteOperand(data); in InstructionDecode()
1188 int32_t imm = *data; in InstructionDecode()
1190 data++; in InstructionDecode()
1196 { bool is_byte = *data == 0x88; in InstructionDecode()
1198 data++; in InstructionDecode()
1199 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1202 data += PrintRightByteOperand(data); in InstructionDecode()
1206 data += PrintRightOperand(data); in InstructionDecode()
1213 while (*data == 0x66) data++; in InstructionDecode()
1214 if (*data == 0xf && data[1] == 0x1f) { in InstructionDecode()
1216 } else if (*data == 0x90) { in InstructionDecode()
1218 } else if (*data == 0x8B) { in InstructionDecode()
1219 data++; in InstructionDecode()
1220 data += PrintOperands("mov_w", REG_OPER_OP_ORDER, data); in InstructionDecode()
1221 } else if (*data == 0x89) { in InstructionDecode()
1222 data++; in InstructionDecode()
1224 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1226 data += PrintRightOperand(data); in InstructionDecode()
1228 } else if (*data == 0xC7) { in InstructionDecode()
1229 data++; in InstructionDecode()
1231 data += PrintRightOperand(data); in InstructionDecode()
1232 int imm = *reinterpret_cast<int16_t*>(data); in InstructionDecode()
1234 data += 2; in InstructionDecode()
1235 } else if (*data == 0x0F) { in InstructionDecode()
1236 data++; in InstructionDecode()
1237 if (*data == 0x38) { in InstructionDecode()
1238 data++; in InstructionDecode()
1239 if (*data == 0x17) { in InstructionDecode()
1240 data++; in InstructionDecode()
1242 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1246 data++; in InstructionDecode()
1247 } else if (*data == 0x2A) { in InstructionDecode()
1249 data++; in InstructionDecode()
1251 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1253 data += PrintRightOperand(data); in InstructionDecode()
1257 } else if (*data == 0x3A) { in InstructionDecode()
1258 data++; in InstructionDecode()
1259 if (*data == 0x0B) { in InstructionDecode()
1260 data++; in InstructionDecode()
1262 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1263 int8_t imm8 = static_cast<int8_t>(data[1]); in InstructionDecode()
1268 data += 2; in InstructionDecode()
1269 } else if (*data == 0x16) { in InstructionDecode()
1270 data++; in InstructionDecode()
1272 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1273 int8_t imm8 = static_cast<int8_t>(data[1]); in InstructionDecode()
1278 data += 2; in InstructionDecode()
1279 } else if (*data == 0x17) { in InstructionDecode()
1280 data++; in InstructionDecode()
1282 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1283 int8_t imm8 = static_cast<int8_t>(data[1]); in InstructionDecode()
1288 data += 2; in InstructionDecode()
1289 } else if (*data == 0x22) { in InstructionDecode()
1290 data++; in InstructionDecode()
1292 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1293 int8_t imm8 = static_cast<int8_t>(data[1]); in InstructionDecode()
1298 data += 2; in InstructionDecode()
1302 } else if (*data == 0x2E || *data == 0x2F) { in InstructionDecode()
1303 const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd"; in InstructionDecode()
1304 data++; in InstructionDecode()
1306 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1311 data++; in InstructionDecode()
1314 data += PrintRightOperand(data); in InstructionDecode()
1316 } else if (*data == 0x50) { in InstructionDecode()
1317 data++; in InstructionDecode()
1319 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1323 data++; in InstructionDecode()
1324 } else if (*data == 0x54) { in InstructionDecode()
1325 data++; in InstructionDecode()
1327 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1331 data++; in InstructionDecode()
1332 } else if (*data == 0x56) { in InstructionDecode()
1333 data++; in InstructionDecode()
1335 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1339 data++; in InstructionDecode()
1340 } else if (*data == 0x57) { in InstructionDecode()
1341 data++; in InstructionDecode()
1343 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1347 data++; in InstructionDecode()
1348 } else if (*data == 0x6E) { in InstructionDecode()
1349 data++; in InstructionDecode()
1351 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1353 data += PrintRightOperand(data); in InstructionDecode()
1354 } else if (*data == 0x6F) { in InstructionDecode()
1355 data++; in InstructionDecode()
1357 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1359 data += PrintRightXMMOperand(data); in InstructionDecode()
1360 } else if (*data == 0x70) { in InstructionDecode()
1361 data++; in InstructionDecode()
1363 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1364 int8_t imm8 = static_cast<int8_t>(data[1]); in InstructionDecode()
1369 data += 2; in InstructionDecode()
1370 } else if (*data == 0x76) { in InstructionDecode()
1371 data++; in InstructionDecode()
1373 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1377 data++; in InstructionDecode()
1378 } else if (*data == 0x90) { in InstructionDecode()
1379 data++; in InstructionDecode()
1381 } else if (*data == 0xF3) { in InstructionDecode()
1382 data++; in InstructionDecode()
1384 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1388 data++; in InstructionDecode()
1389 } else if (*data == 0x73) { in InstructionDecode()
1390 data++; in InstructionDecode()
1392 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1393 int8_t imm8 = static_cast<int8_t>(data[1]); in InstructionDecode()
1399 data += 2; in InstructionDecode()
1400 } else if (*data == 0xD3) { in InstructionDecode()
1401 data++; in InstructionDecode()
1403 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1407 data++; in InstructionDecode()
1408 } else if (*data == 0x7F) { in InstructionDecode()
1410 data++; in InstructionDecode()
1412 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1413 data += PrintRightXMMOperand(data); in InstructionDecode()
1415 } else if (*data == 0x7E) { in InstructionDecode()
1416 data++; in InstructionDecode()
1418 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1420 data += PrintRightOperand(data); in InstructionDecode()
1422 } else if (*data == 0xDB) { in InstructionDecode()
1423 data++; in InstructionDecode()
1425 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1429 data++; in InstructionDecode()
1430 } else if (*data == 0xE7) { in InstructionDecode()
1431 data++; in InstructionDecode()
1433 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1436 data += PrintRightOperand(data); in InstructionDecode()
1441 } else if (*data == 0xEF) { in InstructionDecode()
1442 data++; in InstructionDecode()
1444 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1448 data++; in InstructionDecode()
1449 } else if (*data == 0xEB) { in InstructionDecode()
1450 data++; in InstructionDecode()
1452 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1456 data++; in InstructionDecode()
1466 { data++; in InstructionDecode()
1468 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1471 data += PrintRightOperand(data); in InstructionDecode()
1479 AppendToBuffer("push 0x%x", *reinterpret_cast<int32_t*>(data+1)); in InstructionDecode()
1480 data += 5; in InstructionDecode()
1484 AppendToBuffer("push 0x%x", *reinterpret_cast<int8_t*>(data + 1)); in InstructionDecode()
1485 data += 2; in InstructionDecode()
1489 AppendToBuffer("test al,0x%x", *reinterpret_cast<uint8_t*>(data+1)); in InstructionDecode()
1490 data += 2; in InstructionDecode()
1494 AppendToBuffer("test eax,0x%x", *reinterpret_cast<int32_t*>(data+1)); in InstructionDecode()
1495 data += 5; in InstructionDecode()
1501 data += D1D3C1Instruction(data); in InstructionDecode()
1512 data += FPUInstruction(data); in InstructionDecode()
1516 data += JumpShort(data); in InstructionDecode()
1520 if (*(data+1) == 0x0F) { in InstructionDecode()
1521 byte b2 = *(data+2); in InstructionDecode()
1524 data += 3; in InstructionDecode()
1526 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1527 data += PrintRightXMMOperand(data); in InstructionDecode()
1530 data += 3; in InstructionDecode()
1532 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1534 data += PrintRightXMMOperand(data); in InstructionDecode()
1536 data += 3; in InstructionDecode()
1538 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1540 data += PrintRightXMMOperand(data); in InstructionDecode()
1553 data += 3; in InstructionDecode()
1555 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1558 data += PrintRightOperand(data); in InstructionDecode()
1561 data += PrintRightXMMOperand(data); in InstructionDecode()
1575 pseudo_op[data[1]], in InstructionDecode()
1578 data += 2; in InstructionDecode()
1581 data += PrintRightXMMOperand(data); in InstructionDecode()
1590 if (*(data+1) == 0x0F) { in InstructionDecode()
1591 byte b2 = *(data+2); in InstructionDecode()
1594 data += 3; in InstructionDecode()
1596 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1597 data += PrintRightXMMOperand(data); in InstructionDecode()
1600 data += 3; in InstructionDecode()
1602 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1604 data += PrintRightXMMOperand(data); in InstructionDecode()
1606 data += 3; in InstructionDecode()
1608 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1610 data += PrintRightXMMOperand(data); in InstructionDecode()
1612 data += 3; in InstructionDecode()
1614 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1616 data += PrintRightXMMOperand(data); in InstructionDecode()
1618 data += 3; in InstructionDecode()
1620 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1622 data += PrintRightXMMOperand(data); in InstructionDecode()
1625 data += 3; in InstructionDecode()
1627 get_modrm(*data, &mod, &regop, &rm); in InstructionDecode()
1628 data += PrintRightXMMOperand(data); in InstructionDecode()
1633 } else if (*(data+1) == 0xA5) { in InstructionDecode()
1634 data += 2; in InstructionDecode()
1636 } else if (*(data+1) == 0xAB) { in InstructionDecode()
1637 data += 2; in InstructionDecode()
1645 data += F7Instruction(data); in InstructionDecode()
1657 int instr_len = data - instr; in InstructionDecode()
1659 printf("%02x", *data); in InstructionDecode()
1665 for (byte* bp = instr; bp < data; bp++) { in InstructionDecode()