MCPcopy Create free account
hub / github.com/GJDuck/e9patch / sendLoadNextMetadata

Function sendLoadNextMetadata

src/e9tool/e9metadata.cpp:1243–1348  ·  view source on GitHub ↗

* Emits instructions to load the address of the next instruction to be * executed by the CPU. */

Source from the content-addressed store, hash-verified

1241 * executed by the CPU.
1242 */
1243static void sendLoadNextMetadata(FILE *out, const char *name,
1244 const InstrInfo *I, CallInfo &info, bool _static, int regno)
1245{
1246 const char *regname = getRegName(getReg(regno))+1;
1247 uint8_t opcode = 0x06;
1248 switch (I->mnemonic)
1249 {
1250 case MNEMONIC_RET:
1251 case MNEMONIC_CALL:
1252 case MNEMONIC_JMP:
1253 sendLoadTargetMetadata(out, I, info, _static, regno);
1254 return;
1255 case MNEMONIC_JO:
1256 opcode = 0x70;
1257 break;
1258 case MNEMONIC_JNO:
1259 opcode = 0x71;
1260 break;
1261 case MNEMONIC_JB:
1262 opcode = 0x72;
1263 break;
1264 case MNEMONIC_JAE:
1265 opcode = 0x73;
1266 break;
1267 case MNEMONIC_JE:
1268 opcode = 0x74;
1269 break;
1270 case MNEMONIC_JNE:
1271 opcode = 0x75;
1272 break;
1273 case MNEMONIC_JBE:
1274 opcode = 0x76;
1275 break;
1276 case MNEMONIC_JA:
1277 opcode = 0x77;
1278 break;
1279 case MNEMONIC_JS:
1280 opcode = 0x78;
1281 break;
1282 case MNEMONIC_JNS:
1283 opcode = 0x79;
1284 break;
1285 case MNEMONIC_JP:
1286 opcode = 0x7a;
1287 break;
1288 case MNEMONIC_JNP:
1289 opcode = 0x7b;
1290 break;
1291 case MNEMONIC_JL:
1292 opcode = 0x7c;
1293 break;
1294 case MNEMONIC_JGE:
1295 opcode = 0x7d;
1296 break;
1297 case MNEMONIC_JLE:
1298 opcode = 0x7e;
1299 break;
1300 case MNEMONIC_JG:

Callers 1

sendLoadArgumentMetadataFunction · 0.85

Calls 6

getRegFunction · 0.85
sendLoadTargetMetadataFunction · 0.85
sendTemporaryRestoreRegFunction · 0.85
sendLoadPointerMetadataFunction · 0.85
sendUndoTemporaryMovRegFunction · 0.85
fprintfFunction · 0.50

Tested by

no test coverage detected