a urm emulator
2012–10–31
Well, my attempt one anyway
why did i bother?
The answer to which is that I got fed up writing out trace tables half-way through unit one and my suspicion is that there was going to be a lot more of this. So I had the thought, “why not write something in JavaScript?”. So here it is my attempt…
the emulator
You are allowed four commands:
- Z(x) //zero register x
- C(x,y) //copy the contents of register x into register y
- S(x) //add 1 to the contents of register x
- J(x,y,z) //if the contents of register x equal the contents of register y, then jump to line z of the programme.
From a suggestion, from Robin H, I’ve included a default URM that calculates the square of the first register. Then click the clear button to get started, remembering to look at the registers.