difference between stack / register based architecture? 
Author Message
 difference between stack / register based architecture?

Hi,

        can anyone tell me the difference between a stack based architecture
and a register based architecture?

TIA

Dan

--
---------------------------------------------------------------------------
| be nice to my lynx - don't use frame/javascript unless truly necessary. |
|                                                               Dan       |
---------------------------------------------------------------------------



Fri, 22 Feb 2002 03:00:00 GMT  
 difference between stack / register based architecture?
stack based:

every calculation is done on the stack. You'll push a few values on it, then
do calculations with it:

push    3                            Stack = 3
push    5                            Stack = 3 5
push    6                            Stack = 3 5 6
mul                                    Stack = 3 30           (done 5*6)
add                                    Stack = 33              (done 30+3)

Register based:

mov    ax,    5
mov    bx,    6
mul    bx
add    ax,    3

As you can see, the stack can be filled with every number you are going to
use, while the reg based must be given numbers after every calculation



Quote:

>Hi,

> can anyone tell me the difference between a stack based architecture
>and a register based architecture?

>TIA

>Dan

>--
>---------------------------------------------------------------------------
>| be nice to my lynx - don't use frame/javascript unless truly necessary. |
>| Dan   |
>---------------------------------------------------------------------------



Fri, 22 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need Help W/ Intel Architecture REGISTERS

2. MANIFESTO: A Forth/OS should be based on an ExoKernel architecture

3. Article on Python-based Web architecture

4. Scheme and Subsumption Architecture based robotics control

5. Scheme and Subsumption Architecture based robotics control

6. Register versus Stack

7. Stack vs. Register Machine Performance

8. loading value from FPU stack directly into register

9. Maximizing register usage: problems with stack?

10. Virtual register stack for x87

11. Difference between heap and stack?

12. Error: Clock skew plus hold time of destination register exceeds register-to-register delay

 

 
Powered by phpBB® Forum Software