Background: Euclid's GCD algorithm is given here as a recursive function:
GCD(x,y) = if x = yNote that you will have a far easier time coding this on the Minimal Ultimate RISC if you first convert it to iterative form and then optimize it a fair amount before even imagining using assembly or machine language.then x
else GCD( min(X,Y), max(X,Y)-min(X,Y) )