Author Topic: Factorial  (Read 2337 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Factorial
« on: August 29, 2011, 02:57:59 AM »
Deleted
« Last Edit: April 11, 2015, 10:04:22 AM by Peter »

Charles Pegge

  • Guest
Re: Factorial
« Reply #1 on: August 29, 2011, 09:47:59 AM »
Thanks Peter.

I wonder if anyone would like to do some code for division. :)

Charles

jcfuller

  • Guest
Re: Factorial
« Reply #2 on: August 29, 2011, 10:12:55 AM »
You might find some useful information here.
http://www.ray.masmcode.com/

James

Charles Pegge

  • Guest
Re: Factorial
« Reply #3 on: August 29, 2011, 12:40:04 PM »

dec ecx affects the sign flag for jl exit

This is a conditional loop (defined between the brackets).

(
 dec ecx
 jl exit       < here
 sub byte [edi],48
 inc edi
 repeat
)


The Finish procedure is not required here. It is used in thinBasic to explicitly invoke the terminate macro. It is only needed when the compiled code is required to be persistent, like a DLL, so that thinBasic can call its procedures. Finish() is like FreeLibrary().

If terminate does not appear in the code then the compiler will automatically add it at the end.


Charles