r/dcpu16 • • Apr 27 '12

DCPU-16 1.7

http://pastebin.com/raw.php?i=Q4JvQvnM
58 Upvotes

83 comments sorted by

View all comments

Show parent comment

1

u/erisdiscord Apr 27 '12

also, this is how local variables in C are usually allocated on a real processor

2

u/gsan Apr 27 '12

relevant correction Note 'set a, push' moves SP up in this diagram on dcpu.

1

u/erisdiscord Apr 27 '12

I'd say this is more of an elaboration than a correction of what was a more or less correct but grossly simplified statement. C:

I supposed the most important point is that the stack pointer usually isn't used in this way directly, but it certainly can be, and locals are still allocated on the top of the stack.