Re: Contest #2... Example Programs
- Posted by mattlewis (admin) Dec 13, 2010
- 2704 views
I've posted source code for calculating the GCD of 47250 and 39690 (other numbers are possible, of course). You'll have to assemble the code. Get it here (zip file) or check out the mercurial repo at http://scm.openeuphoria.org/hg/contest (branch: matt-assembler).
To assemble:
$ eui assem.ex euclid.cpa division.cpa stack.cpa less-than.cpa > gcd.cpu
Then you can run the gcd.cpu file with your interpreter. It prints the two numbers and then their GCD. Assembled, it comes out to just under 600 instructions, and should run for 388,834 steps.
Matt