How to get opcodes of PHP?

Check out the Vulcan Logic Disassembler PECL extension – see author’s home page for more info. The Vulcan Logic Disassembler hooks into the Zend Engine and dumps all the opcodes (execution units) of a script. It was written as as a beginning of an encoder, but I never got the time for that. It can … Read more

x86 32 bit opcodes that differ in x86-x64 or entirely removed

Almost all instructions that are available in both modes have the same opcodes in both modes. Removed instructions: Binary-coded-decimal stuff like AAM (ASCII-adjust after multiplication) for fixing up binary-coded-decimal after doing normal binary add/sub/mul/div on a register holding two base-10 digits in each 4-bit half. They ran slowly anyway, and weren’t used. Storing numbers as … Read more

execute binary machine code from C

The code must be in a page with execute permission. By default, stack and read-write static data (like non-const globals) are in pages mapped without exec permission, for security reasons. The simplest way is to compile with gcc -z execstack, which links your program such that stack and global variables (static storage) get mapped in … Read more

Avoiding getfield opcode

My guess is that the point is to copy the values into local variables once, to avoid having to fetch the field value repeatedly from the heap for each iteration of the loop in the next few lines. Of course, that begs the question as to why the same comment hasn’t been applied on the … Read more