Test build: SillyCalc, a RPN calculator based on a stack and a single register

So... I just came up an idea of a processor structure which reads RPN bytecodes to calculate. The only internal storage of the processor is a stack and a register. Beside that, there can be external storage which is address-based.

Then, for the most important part of the structure, the computing unit, I just coded a prototype of a prototype (as it has very limited function and is just workable rather than really useful), which I can type in RPN expressions to let it calculate something.

Well, the result? Pretty good actually. Although the coding process is a little weird, as I have to copy and paste a lot of stuffs.

So... RPN master race? Well at least it's easiest way to for a computer to read an expression, and no brackets required (think of Lisp)

Look at the way it runs... Isn't it beautiful?

3 7 add 2 5 add 6 3 opp add mul mul disp =>210

And here's the code. Just casually coded this pretty, so didn't add any comments. But considering to the length of this file, it should be fine without a comment.


Leave a Reply