Lines Matching refs:data
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
335 static void get_modrm(byte data, int* mod, int* regop, int* rm) {
336 *mod = (data >> 6) & 3;
337 *regop = (data & 0x38) >> 3;
338 *rm = data & 7;
342 static void get_sib(byte data, int* scale, int* index, int* base) {
343 *scale = (data >> 6) & 3;
344 *index = (data >> 3) & 7;
345 *base = data & 7;
354 int PrintOperands(const char* mnem, OperandOrder op_order, byte* data);
355 int PrintImmediateOp(byte* data);
356 int F7Instruction(byte* data);
357 int D1D3C1Instruction(byte* data);
358 int JumpShort(byte* data);
359 int JumpConditional(byte* data, const char* comment);
360 int JumpConditionalShort(byte* data, const char* comment);
361 int SetCC(byte* data);
362 int CMov(byte* data);
363 int FPUInstruction(byte* data);
485 // Returns number of bytes used including the current *data.
489 byte* data) {
490 byte modrm = *data;
497 advance = PrintRightOperand(data);
502 advance = PrintRightOperand(data);
514 // Returns number of bytes used by machine instruction, including *data byte.
516 int DisassemblerIA32::PrintImmediateOp(byte* data) {
517 bool sign_extension_bit = (*data & 0x02) != 0;
518 byte modrm = *(data+1);
533 int count = PrintRightOperand(data+1);
535 AppendToBuffer(",0x%x", *(data + 1 + count));
538 AppendToBuffer(",0x%x", *reinterpret_cast<int32_t*>(data + 1 + count));
544 // Returns number of bytes used, including *data.
545 int DisassemblerIA32::F7Instruction(byte* data) {
546 ASSERT_EQ(0xF7, *data);
547 data+1);
562 int32_t imm = *reinterpret_cast<int32_t*>(data+2);
567 int count = PrintRightOperand(data+1);
568 int32_t imm = *reinterpret_cast<int32_t*>(data+1+count);
577 int DisassemblerIA32::D1D3C1Instruction(byte* data) {
578 byte op = *data;
580 byte modrm = *(data+1);
600 imm8 = *(data+2);
619 // Returns number of bytes used, including *data.
620 int DisassemblerIA32::JumpShort(byte* data) {
621 ASSERT_EQ(0xEB, *data);
622 byte b = *(data+1);
623 byte* dest = data + static_cast<int8_t>(b) + 2;
629 // Returns number of bytes used, including *data.
630 int DisassemblerIA32::JumpConditional(byte* data, const char* comment) {
631 ASSERT_EQ(0x0F, *data);
632 byte cond = *(data+1) & 0x0F;
633 byte* dest = data + *reinterpret_cast<int32_t*>(data+2) + 6;
643 // Returns number of bytes used, including *data.
644 int DisassemblerIA32::JumpConditionalShort(byte* data, const char* comment) {
645 byte cond = *data & 0x0F;
646 byte b = *(data+1);
647 byte* dest = data + static_cast<int8_t>(b) + 2;
657 // Returns number of bytes used, including *data.
658 int DisassemblerIA32::SetCC(byte* data) {
659 ASSERT_EQ(0x0F, *data);
660 byte cond = *(data+1) & 0x0F;
663 PrintRightByteOperand(data+2);
668 // Returns number of bytes used, including *data.
669 int DisassemblerIA32::CMov(byte* data) {
670 ASSERT_EQ(0x0F, *data);
671 byte cond = *(data + 1) & 0x0F;
673 int op_size = PrintOperands(mnem, REG_OPER_OP_ORDER, data + 2);
678 // Returns number of bytes used, including *data.
679 int DisassemblerIA32::FPUInstruction(byte* data) {
680 byte escape_opcode = *data;
682 byte modrm_byte = *(data+1);
687 return MemoryFPUInstruction(escape_opcode, modrm_byte, data+1);
881 byte* data = instr;
885 if (*data == 0x3E /*ds*/) {
887 data++;
888 } else if (*data == 0x2E /*cs*/) {
890 data++;
894 const InstructionDesc& idesc = instruction_table_->Get(*data);
898 data++;
902 data++;
903 data += PrintOperands(idesc.mnem, idesc.op_order_, data);
907 data += JumpConditionalShort(data, branch_hint);
911 AppendToBuffer("%s %s", idesc.mnem, NameOfCPURegister(*data & 0x07));
912 data++;
916 byte* addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data+1));
918 NameOfCPURegister(*data & 0x07),
920 data += 5;
925 byte* addr = data + *reinterpret_cast<int32_t*>(data+1) + 5;
927 data += 5;
932 byte* addr = reinterpret_cast<byte*>(*reinterpret_cast<int32_t*>(data+1));
934 data += 5;
939 AppendToBuffer("%s al, 0x%x", idesc.mnem, data[1]);
940 data += 2;
953 switch (*data) {
955 AppendToBuffer("ret 0x%x", *reinterpret_cast<uint16_t*>(data+1));
956 data += 3;
962 get_modrm(*(data+1), &mod, ®op, &rm);
964 *data == 0x6B ? *(data+2) : *reinterpret_cast<int32_t*>(data+2);
969 data += 2 + (*data == 0x6B ? 1 : 4);
974 { data++;
976 get_modrm(*data, &mod, ®op, &rm);
979 data += PrintRightByteOperand(data);
980 int32_t imm = *data;
982 data++;
991 data += PrintImmediateOp(data);
995 { byte f0byte = data[1];
999 get_modrm(*data, &mod, ®op, &rm);
1002 data += PrintRightOperand(data);
1003 } else if (f0byte == 0x1F && data[2] == 0) {
1005 data += 3;
1006 } else if (f0byte == 0x1F && data[2] == 0x40 && data[3] == 0) {
1008 data += 4;
1009 } else if (f0byte == 0x1F && data[2] == 0x44 && data[3] == 0 &&
1010 data[4] == 0) {
1012 data += 5;
1013 } else if (f0byte == 0x1F && data[2] == 0x80 && data[3] == 0 &&
1014 data[4] == 0 && data[5] == 0 && data[6] == 0) {
1016 data += 7;
1017 } else if (f0byte == 0x1F && data[2] == 0x84 && data[3] == 0 &&
1018 data[4] == 0 && data[5] == 0 && data[6] == 0 &&
1019 data[7] == 0) {
1021 data += 8;
1024 data += 2;
1026 data += 2;
1028 get_modrm(*data, &mod, ®op, &rm);
1032 data++;
1034 data += 2;
1036 get_modrm(*data, &mod, ®op, &rm);
1040 data++;
1042 data += JumpConditional(data, branch_hint);
1045 data += 2;
1046 data += PrintOperands(f0mnem, REG_OPER_OP_ORDER, data);
1048 data += SetCC(data);
1050 data += CMov(data);
1052 data += 2;
1057 get_modrm(*data, &mod, ®op, &rm);
1058 data += PrintRightOperand(data);
1072 { data++;
1074 get_modrm(*data, &mod, ®op, &rm);
1077 data += PrintRightOperand(data);
1083 { data++;
1085 get_modrm(*data, &mod, ®op, &rm);
1096 data += PrintRightOperand(data);
1102 { bool is_byte = *data == 0xC6;
1103 data++;
1106 data += PrintRightByteOperand(data);
1107 int32_t imm = *data;
1109 data++;
1112 data += PrintRightOperand(data);
1113 int32_t imm = *reinterpret_cast<int32_t*>(data);
1115 data += 4;
1121 { data++;
1123 get_modrm(*data, &mod, ®op, &rm);
1131 data += PrintRightByteOperand(data);
1132 int32_t imm = *data;
1134 data++;
1140 { bool is_byte = *data == 0x88;
1142 data++;
1143 get_modrm(*data, &mod, ®op, &rm);
1146 data += PrintRightByteOperand(data);
1150 data += PrintRightOperand(data);
1157 while (*data == 0x66) data++;
1158 if (*data == 0xf && data[1] == 0x1f) {
1160 } else if (*data == 0x90) {
1162 } else if (*data == 0x8B) {
1163 data++;
1164 data += PrintOperands("mov_w", REG_OPER_OP_ORDER, data);
1165 } else if (*data == 0x89) {
1166 data++;
1168 get_modrm(*data, &mod, ®op, &rm);
1170 data += PrintRightOperand(data);
1172 } else if (*data == 0x0F) {
1173 data++;
1174 if (*data == 0x38) {
1175 data++;
1176 if (*data == 0x17) {
1177 data++;
1179 get_modrm(*data, &mod, ®op, &rm);
1183 data++;
1184 } else if (*data == 0x2A) {
1186 data++;
1188 get_modrm(*data, &mod, ®op, &rm);
1190 data += PrintRightOperand(data);
1194 } else if (*data == 0x3A) {
1195 data++;
1196 if (*data == 0x0B) {
1197 data++;
1199 get_modrm(*data, &mod, ®op, &rm);
1200 int8_t imm8 = static_cast<int8_t>(data[1]);
1205 data += 2;
1206 } else if (*data == 0x16) {
1207 data++;
1209 get_modrm(*data, &mod, ®op, &rm);
1210 int8_t imm8 = static_cast<int8_t>(data[1]);
1215 data += 2;
1216 } else if (*data == 0x17) {
1217 data++;
1219 get_modrm(*data, &mod, ®op, &rm);
1220 int8_t imm8 = static_cast<int8_t>(data[1]);
1225 data += 2;
1226 } else if (*data == 0x22) {
1227 data++;
1229 get_modrm(*data, &mod, ®op, &rm);
1230 int8_t imm8 = static_cast<int8_t>(data[1]);
1235 data += 2;
1239 } else if (*data == 0x2E || *data == 0x2F) {
1240 const char* mnem = (*data == 0x2E) ? "ucomisd" : "comisd";
1241 data++;
1243 get_modrm(*data, &mod, ®op, &rm);
1248 data++;
1251 data += PrintRightOperand(data);
1253 } else if (*data == 0x50) {
1254 data++;
1256 get_modrm(*data, &mod, ®op, &rm);
1260 data++;
1261 } else if (*data == 0x54) {
1262 data++;
1264 get_modrm(*data, &mod, ®op, &rm);
1268 data++;
1269 } else if (*data == 0x57) {
1270 data++;
1272 get_modrm(*data, &mod, ®op, &rm);
1276 data++;
1277 } else if (*data == 0x6E) {
1278 data++;
1280 get_modrm(*data, &mod, ®op, &rm);
1282 data += PrintRightOperand(data);
1283 } else if (*data == 0x6F) {
1284 data++;
1286 get_modrm(*data, &mod, ®op, &rm);
1288 data += PrintRightXMMOperand(data);
1289 } else if (*data == 0x70) {
1290 data++;
1292 get_modrm(*data, &mod, ®op, &rm);
1293 int8_t imm8 = static_cast<int8_t>(data[1]);
1298 data += 2;
1299 } else if (*data == 0x90) {
1300 data++;
1302 } else if (*data == 0xF3) {
1303 data++;
1305 get_modrm(*data, &mod, ®op, &rm);
1309 data++;
1310 } else if (*data == 0x73) {
1311 data++;
1313 get_modrm(*data, &mod, ®op, &rm);
1314 int8_t imm8 = static_cast<int8_t>(data[1]);
1320 data += 2;
1321 } else if (*data == 0xD3) {
1322 data++;
1324 get_modrm(*data, &mod, ®op, &rm);
1328 data++;
1329 } else if (*data == 0x7F) {
1331 data++;
1333 get_modrm(*data, &mod, ®op, &rm);
1334 data += PrintRightXMMOperand(data);
1336 } else if (*data == 0x7E) {
1337 data++;
1339 get_modrm(*data, &mod, ®op, &rm);
1341 data += PrintRightOperand(data);
1343 } else if (*data == 0xDB) {
1344 data++;
1346 get_modrm(*data, &mod, ®op, &rm);
1350 data++;
1351 } else if (*data == 0xE7) {
1352 data++;
1354 get_modrm(*data, &mod, ®op, &rm);
1357 data += PrintRightOperand(data);
1362 } else if (*data == 0xEF) {
1363 data++;
1365 get_modrm(*data, &mod, ®op, &rm);
1369 data++;
1370 } else if (*data == 0xEB) {
1371 data++;
1373 get_modrm(*data, &mod, ®op, &rm);
1377 data++;
1387 { data++;
1389 get_modrm(*data, &mod, ®op, &rm);
1392 data += PrintRightOperand(data);
1400 AppendToBuffer("push 0x%x", *reinterpret_cast<int32_t*>(data+1));
1401 data += 5;
1405 AppendToBuffer("push 0x%x", *reinterpret_cast<int8_t*>(data + 1));
1406 data += 2;
1410 AppendToBuffer("test al,0x%x", *reinterpret_cast<uint8_t*>(data+1));
1411 data += 2;
1415 AppendToBuffer("test eax,0x%x", *reinterpret_cast<int32_t*>(data+1));
1416 data += 5;
1422 data += D1D3C1Instruction(data);
1432 data += FPUInstruction(data);
1436 data += JumpShort(data);
1440 if (*(data+1) == 0x0F) {
1441 byte b2 = *(data+2);
1444 data += 3;
1446 get_modrm(*data, &mod, ®op, &rm);
1447 data += PrintRightXMMOperand(data);
1450 data += 3;
1452 get_modrm(*data, &mod, ®op, &rm);
1454 data += PrintRightXMMOperand(data);
1456 data += 3;
1458 get_modrm(*data, &mod, ®op, &rm);
1460 data += PrintRightXMMOperand(data);
1472 data += 3;
1474 get_modrm(*data, &mod, ®op, &rm);
1477 data += PrintRightOperand(data);
1480 data += PrintRightXMMOperand(data);
1494 pseudo_op[data[1]],
1497 data += 2;
1500 data += PrintRightXMMOperand(data);
1509 if (*(data+1) == 0x0F) {
1510 byte b2 = *(data+2);
1513 data += 3;
1515 get_modrm(*data, &mod, ®op, &rm);
1516 data += PrintRightXMMOperand(data);
1519 data += 3;
1521 get_modrm(*data, &mod, ®op, &rm);
1523 data += PrintRightXMMOperand(data);
1525 data += 3;
1527 get_modrm(*data, &mod, ®op, &rm);
1529 data += PrintRightXMMOperand(data);
1531 data += 3;
1533 get_modrm(*data, &mod, ®op, &rm);
1535 data += PrintRightXMMOperand(data);
1537 data += 3;
1539 get_modrm(*data, &mod, ®op, &rm);
1541 data += PrintRightXMMOperand(data);
1544 data += 3;
1546 get_modrm(*data, &mod, ®op, &rm);
1547 data += PrintRightXMMOperand(data);
1552 } else if (*(data+1) == 0xA5) {
1553 data += 2;
1555 } else if (*(data+1) == 0xAB) {
1556 data += 2;
1564 data += F7Instruction(data);
1576 int instr_len = data - instr;
1578 printf("%02x", *data);
1584 for (byte* bp = instr; bp < data; bp++) {