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

Function sendLeaFromPCRelToR64

src/e9tool/e9codegen.cpp:1539–1549  ·  view source on GitHub ↗

* Send a `lea offset(%rip),%r64' instruction. */

Source from the content-addressed store, hash-verified

1537 * Send a `lea offset(%rip),%r64' instruction.
1538 */
1539void sendLeaFromPCRelToR64(FILE *out, const char *offset, int regno)
1540{
1541 const uint8_t REX[] =
1542 {0x48, 0x48, 0x48, 0x48, 0x4c, 0x4c, 0x00,
1543 0x48, 0x4c, 0x4c, 0x48, 0x48, 0x4c, 0x4c, 0x4c, 0x4c, 0x48};
1544 const uint8_t MODRM[] =
1545 {0x3d, 0x35, 0x15, 0x0d, 0x05, 0x0d, 0x00,
1546 0x05, 0x15, 0x1d, 0x1d, 0x2d, 0x25, 0x2d, 0x35, 0x3d, 0x25};
1547 fprintf(out, "%u,%u,%u,%s,",
1548 REX[regno], 0x8d, MODRM[regno], offset);
1549}
1550
1551/*
1552 * Send a `lea offset(%rip),%r64' instruction.

Callers 6

sendLoadPointerMetadataFunction · 0.85
sendLoadRegToArgFunction · 0.85
sendLoadOperandMetadataFunction · 0.85
sendTranslateAddressFunction · 0.85
sendLoadArgumentMetadataFunction · 0.85
sendPushFunction · 0.85

Calls 1

fprintfFunction · 0.50

Tested by

no test coverage detected