A
Size: a a a
A
SZ
SZ
A
A
AM
SZ
A
A
SZ
A
EK
>>> WHAT IS THIS? <<<
In fact, this is a packer of x86 FPU instructions with ≈ 3-4x efficiency (not taking into account recompiler code and constants).
All you need is just define some symbolic constants, include this file in your fasm project, use a few macros and perform a call to recompiled function.
>>> FEATURES <<<
• Definition of FPU operations in easy to read format of Reverse Polish Notation (RPN).
• Flexibly customizable recompiler which creates native x86 function from bytecode (that is, fast for execution).
• Native code copier (so you can mix FPU instructions with native x86 code inside bytecode block).
• Declaration of up to 11-13 bytecode instructions associated with 2-byte FPU (...or not only FPU?...) instructions (this number is sufficient for most purposes).
• Definition of up to 17 2-byte integer and floating-point constants.
• Definition of up to 16 4-byte floating-point variables.
• Declaration of unlimited subfunctions with custom names inside bytecode block.
• Possibility to override some predefined bytecode instructions associated with native x86 instructions.
• The size of recompiler is ≈ 50..74 bytes (for 1..13 types of bytecode instructions, with no support of native code copier, variables and subfunctions) to ≈ 65..85 / 76..96 bytes (for 1..11 types of bytecode instructions, with max functionality) including writting of input stream offset to register. This size can vary depending on used options of macro 'fpb_recompile!'.
>>> NOTES <<<
Brief statistics of HerbaKaif intro:
- bytecode contains 244 nibbles (= 122 bytes = 169 opcodes; average length of 1 bytecode instruction ≈ 1.44 nibbles ≈ 0.72 bytes);
- size of recompiled function = 413 bytes (compression ratio ≈ 3.39x; average length of 1 unpacked native x86 instruction ≈ 2.44 bytes);
- size of recompiler = 74 bytes (including writting of input stream offset to register, although this is partly part of another code);
- compression ratio including bytecode recompiler = 413/(122+74) ≈ 2.11x.d
EK
mov eax,[ecx]
cdq
idiv ebx
mov eax,[ecx+4]
add [esi],eax
xor eax,eax
A
𝐦
𝐦
A
𝐦