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

Function sendZExtFromI32ToR64

src/e9tool/e9codegen.cpp:1477–1488  ·  view source on GitHub ↗

* Send a `mov $value,%r64' instruction. */

Source from the content-addressed store, hash-verified

1475 * Send a `mov $value,%r64' instruction.
1476 */
1477void sendZExtFromI32ToR64(FILE *out, const char *value, int regno)
1478{
1479 const uint8_t REX[] =
1480 {0x00, 0x00, 0x00, 0x00, 0x41, 0x41, 0x00,
1481 0x00, 0x41, 0x41, 0x00, 0x00, 0x41, 0x41, 0x41, 0x41, 0x00};
1482 const uint8_t OPCODE[] =
1483 {0xbf, 0xbe, 0xba, 0xb9, 0xb8, 0xb9, 0x00,
1484 0xb8, 0xba, 0xbb, 0xbb, 0xbd, 0xbc, 0xbd, 0xbe, 0xbf, 0xbc};
1485 if (REX[regno] != 0x00)
1486 fprintf(out, "%u,", REX[regno]);
1487 fprintf(out, "%u,%s,", OPCODE[regno], value);
1488}
1489
1490/*
1491 * Send a `mov $value,%r64' instruction.

Callers 1

sendLoadValueMetadataFunction · 0.85

Calls 1

fprintfFunction · 0.50

Tested by

no test coverage detected