stack machine vs register-based machine

Programming, for all ages and all languages.
Post Reply
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

stack machine vs register-based machine

Post by binutils »

which one you alike?
or is there something others?

--
PS: http://www.youtube.com/watch?v=Komseiqp1DQ :)
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

register-based machines because they are easier to JIT compile.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

IMHO, its really a matter of personal preference.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Post by DeletedAccount »

Just FYI ... The .Net framework essentially uses a stack based machine ...atleast the IL code it generates assumes more or less a stack machine
I think Java VM does the same (sorry i have no clue on this .. :( ) ....


@ mods : I planning to write a tutorial on programming using IL ... Is this info
helpful for osdevelopers ...??? (May be ) .... It is certainly useful for compiler developers 8)
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Hi,

Register based machines really flourished with the IBM system/360, eons ago. As far as I can recall from my lectures, the main problem with stack machines at the time was the increased number of instructions required to do the same task as a register machine tended to choke the frontside bus a little, causing performance degradation.

Nowadays, the FSB is less of a performance bottleneck, and certain groups (including Chris Bailey, head of the Amadeus group based at York university, UK) have been looking into the possibility of reinventing stack machines for a new age. They believe the the bottlenecks have now moved elsewhere, and stack machines may again be the better beast.

As mentioned, the .NET runtime uses a stack based virtual machine, as does the Java runtime. In fact, one of the aims of the above project is to construct a native Java processor (or similar).

Until then, however, register based machines are still the de-facto standard. I would be interested to see what Brendan has to say on this (he seems extremely knowledgeable on matters such as this).

Cheers,

James
Post Reply