One more example... this time to calculate the maximum common divisor.

        One more question... does jsr working? I can't use it...

        And, finally... can anybody explain the argument to return?

        Thanks.. Cheers
-- 
 | Alberto Manuel Brandão Simões |
 | [EMAIL PROTECTED] |
 | http://numexp.sourceforge.net |
# (C)2001 Alberto Simões
#
# max common divisor (mdc - maximo divisor comum)
#
# Values are placed on I1 and I2. Result is on any of them
#
# NOTE: I don't really know if this is the best algorith,
#       the idea is to be, only an example.

        set I1, 7
        set I2, 20
        
LOOP:   eq I1, I2, FINISH
        gt I1, I2, OTHER
        sub I2, I2, I1
        branch LOOP
        
OTHER:  sub I1, I1, I2
        branch LOOP
        
FINISH: print I1
        end

Reply via email to