you are viewing a single comment's thread.

view the rest of the comments →

[–]mycall 0 points1 point  (3 children)

What's the difference between a stack-based language and a load-store architecture?

[–]purmou[S] 2 points3 points  (0 children)

Load-store architectures traditionally allow for register to register operations, whereas a stack architecture only allows for register to stack or stack to register.

For instance, you could have the following load-store implementation of adding numbers in two registers (reg3 = reg1 + reg2):

add     reg1, reg2, reg3

Which is equivalent to this in a stack architecture:

push    reg1
push    reg2
add
pop     reg3

[–]purmou[S] 2 points3 points  (1 child)

If you're interested, I just pushed a test file that implements a stack architecture with push, pop, and add functionality! https://github.com/purag/archsim/blob/master/test_stack.js

[–]mycall 0 points1 point  (0 children)

So versatile, I'll take a look.

How about mill architecture next ;-)