# euclid.eas - highest common factor # SCCSID("@(#)/export/home/staff/mike/src/language/eta/easpit/SCCS/s.euclid.eas 1.1") # # ### NOT FINISHED # This is a function of two arguments, so if the caller adheres to the # standard calling convention, the stack at the point of our first # instruction will be: a b addr. # Prologue: roll addr under arguments >EUCLID: N2 H N2 H # (... addr) a b # Body of loop >EUCLIDloop: N0 H # a b b A N0 N1 S S T # (skip if not done) # a b N1 NEUCLIDdone: N0 T # (... addr) a N1 N2 H # ... a 1 addr T