I'm trying to use the asm function in C to insert redundant xor instructions:
int main (int argc, char** argv) {
asm(".rept 100 ; xor %eax, %eax; .endr");
return 0;
}
which actually works but I want to know if there is a way to encode specific xor encodings. The assembler defaults to using opcode 0x31, but I want to encode xor opcodes 0x81 and 0x35. (As seen here: https://www.felixcloutier.com/x86/xor)
I have tried replacing xor directly with the opcode:
asm(".rept 100 ; \x35 %eax, %eax; .endr");
But the assembler throws an invalid character error. Any help would be appreciated.