News for hackers. Stuff that matters.
Re:Intel fires warning shots at Microsoft, says x86 emulatio... by kccqzy on Saturday June 10, 2017 @11:18PM (#14530431)
Fine. If you are really into getting the shortest instruction, try "xorl %eax,%eax" then "incl %eax" which is four bytes (31 c0 ff c0).
Re:Intel fires warning shots at Microsoft, says x86 emulatio... by gsg on Sunday June 11, 2017 @12:35AM (#14530655)
push $1/pop %eax (6a 01 58) is shorter, but perhaps not the best idea.
Re:Intel fires warning shots at Microsoft, says x86 emulatio... by nayuki on Sunday June 11, 2017 @12:16PM (#14532522)
Actually, there is no 32-bit pop instruction in x86-64 mode. Your code won't work.
Re:Intel fires warning shots at Microsoft, says x86 emulatio... by gsg on Sunday June 11, 2017 @01:24PM (#14532795)
You're right: it should be pushq $1/pop %rax (which is also three bytes, although there will be a prefix byte for registers r8 through r15).