#pragma once #include #include #include // REX prefix: 0b0100WRXB std::vector REX(const std::string& s); // Manual, page 530 // Reg + Reg/Memory // disp: optional, only necessary in some cases, e.g. indexed memory access // returns: Encoded ModRM byte, followed by SIB and disp bytes, if appropriate std::vector ModRM(const std::string& reg, const std::string& rm, int32_t disp = 0); // Just the number of reg, e.g. for encoding inside primary opcode uint8_t RegNo(const std::string& reg); std::vector OpSizePrefix();