callan300
June 19th, 2007, 18:32
Hello Everyone.
I am learning. Could someone help me with this code? I need to understand what the code is doing so that I can re-write the function in C#. I need help on learning how to figure this out. I am using a program called RecStud.exe.
Let me know if I need to provide more info?
Here is what I get from RecStud:
/* Procedure: 0x10001100 - 0x10001143
* Argument size: 24
* Local size: 0
* Save regs size: 0
*/
CALCRATED(A4, A8, Ac, A10, A14, A18)
/* unknown */ void A4;
/* unknown */ void A8;
/* unknown */ void Ac;
/* unknown */ void A10;
/* unknown */ void A14;
/* unknown */ void A18;
{
(fsave)A18;
asm("fcomp dword [0x100080e4]"
;
asm("fnstsw ax"
;
if(!(ah & 0x40)) {
if(A4 >= Ac && A4 > 0) {
return A8 - A14 + A10 - 1;
}
return A4 | -1;
}
return 10000;
}
I am learning. Could someone help me with this code? I need to understand what the code is doing so that I can re-write the function in C#. I need help on learning how to figure this out. I am using a program called RecStud.exe.
Let me know if I need to provide more info?
Here is what I get from RecStud:
/* Procedure: 0x10001100 - 0x10001143
* Argument size: 24
* Local size: 0
* Save regs size: 0
*/
CALCRATED(A4, A8, Ac, A10, A14, A18)
/* unknown */ void A4;
/* unknown */ void A8;
/* unknown */ void Ac;
/* unknown */ void A10;
/* unknown */ void A14;
/* unknown */ void A18;
{
(fsave)A18;
asm("fcomp dword [0x100080e4]"

asm("fnstsw ax"

if(!(ah & 0x40)) {
if(A4 >= Ac && A4 > 0) {
return A8 - A14 + A10 - 1;
}
return A4 | -1;
}
return 10000;
}