I have the following Assembler Code in a x86 Program and I need to modify it as it is buggy:
fld ds:(flt_203B8 - 29C48h)[ebx]
fdivr dword ptr [esi+44h]
fmul ds:(flt_203BC - 29C48h)[ebx]
fisttp [ebp+var_334]
mov eax, [ebp+var_334]
cmp eax, 0Fh
jg short greater
test eax, eax
mov edx, 0
cmovs eax, edx
jmp short valueWithinLimits
greater:
mov eax, 0Fh
valueWithinLimits:
....
In Pseudocode this is
v29 = (signed int)(*(float *)(v3 + 68) / 40.0 * 15.0);
if ( v29 > 15 )
{
v29 = 15;
}
else if ( v29 < 0 )
{
v29 = 0;
}
I need to insert the following line as second line:
v29 = 15 - v29;
Is there any way I can do that without needing any more space? I assume no but maybe someone has a smart Idea here what can be done in this case.