Results 1 to 2 of 2
A stack machine in computer architecture terms is where the operands to instructions are on the stack in memory. No registers for accumulation or anything like that.
But how would ...
- 10-03-2010 #1Just Joined!
- Join Date
- Jul 2009
- Posts
- 7
computer architecture, has anyone heard of the stack machine?
A stack machine in computer architecture terms is where the operands to instructions are on the stack in memory. No registers for accumulation or anything like that.
But how would this affect algorithms (in a theoretical assembly language of a stack machine)? Since you can't just plug this into register A, this into register B and chug like x86 or MIPS types. You have to use the stack for your algorithms. How would all this work on general kinds of programming (other than the trivial "postfix arithmetic expressions" lecture professors come up with every time they want to explain a stack)?
Also how would memory be affected? Would I be able to have dramatically much less memory and still be fine? I'm thinking about the use of MRAM, of which the largest readily available chip in 2011 will be of 2 MB size (16 Mbit). Granted the size of instructions would be much less (I've worked some stuff out: you could use 8 bits for encoded instructions and 16 bits if they're unencoded). I've heard Forth programmers debate on if 64 KB is more than enough (which could make for a 16 bit address bus?). In any case I was thinking of 8 bit instructions, 16 bit operands, and 24 (maybe 32 if needed) bit addresses. 24 bit addresses 16 MB of memory, which is well beyond the capabilities of small MRAM chips at the moment.
Also the whole MRAM thing brings up new programming issues. If your program messes up, it could destroy other things too, right? Since everything is on this memory (universal memory). How do we program and get around those potential issues? Keep in mind this is very forward thinking because just about all programming today assumes the hard drive is pretty much a lockbox, and if your program messes up in RAM (aka memory leaks), you can flush the RAM and/or restart your program. You can't much do that in a universal memory system? Or would you just copy the program and make it redundant?
- 10-04-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,956
Some examples of stack machines in software:
1. UCSD p-machine
2. Java VM
3. Forth (language and VM)
4. Postscript
In hardware:
1. HP-3000
2. Burroughs mainframes
3. Tandem T/16
4. Atmel MARC4 microcontroller
There were also some chips designed as Forth machines that executed Forth code directly in hardware. Honestly, these are typically very efficient systems and languages. I think a number of HP RPN calculators also used stack-based hardware for efficiency sake.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
