can nayone please convert this c function into ASM for me. i just need
this function in ASM code very important
int binomial (int n, int r)
{
if (r < 0 || r > n || n < 1 )
return 0;
if (n==1)
return 1;
else
return binomial (n - 1, r) + binomial (n - 1); |
Request for Question Clarification by
andyt-ga
on
24 Apr 2005 09:51 PDT
Hi mott85, is it ok if I use a program to generate the asm? I could
do it for PowerPC or Solaris Assembly.
|
Clarification of Question by
mott85-ga
on
24 Apr 2005 10:23 PDT
for solaris please also would you know how to call that asm from a min
function in c if you could do both i can even up the price.
|
Request for Question Clarification by
andyt-ga
on
24 Apr 2005 17:35 PDT
I'm not sure what you mean about calling from a min function. Could
you post the code in c that you want converted to asm?
|
Clarification of Question by
mott85-ga
on
25 Apr 2005 09:22 PDT
My apologies i had a typo this is the c function i need converted.
Howver i need to be able to call this asm function from the main
function in c (inlining) so i really need 2 things
1. this function converted to ASM
int binomial (int n, int r)
{
if (r < 0 || r > n || n < 1 )
return 0;
if (n==1)
return 1;
else
return binomial (n - 1, r) + binomial (n - 1);
2. Call this newly converted function from main function in a c program
Thanks
|
Request for Question Clarification by
andyt-ga
on
25 Apr 2005 10:04 PDT
I tried running your program, and got a compile error (because the
binomial function call on the last line has 1, not 2 args).
Should your last line really be:
return binomial (n - 1, r) + binomial (n - 1, r);
?
|
Clarification of Question by
mott85-ga
on
25 Apr 2005 22:11 PDT
Yes that would be correct.
|
Clarification of Question by
mott85-ga
on
26 Apr 2005 22:18 PDT
Probably partailly my fualt for being unclear butr i the time has
passed for helkp on this issue Thanks for trying.
|